MicroPython on Cheap $3 ESP8266 WeMos D1 Mini for 2x Temperature Logging, Wifi and Mobile Stats

by loggingforest in Circuits > Microcontrollers

15722 Views, 30 Favorites, 0 Comments

MicroPython on Cheap $3 ESP8266 WeMos D1 Mini for 2x Temperature Logging, Wifi and Mobile Stats

2temps-rec-1024x809.jpg
wemosd1connection.jpg

With tiny cheap ESP8266 chip / device you can log temperature data outside, in room, greenhouse, lab, cooling room or any other places completely free. This example we will use to log cooling room temperature, inside and outside.

Device will be connected to internet via Wifi

You will be able to check latest readings on your mobile phone, desktop or any other device with browser

Supplies

You need hardware parts to make logging device
You can purchase needed devices here (minimal required):

Also nice to have:

Add Your Device to LoggingPlatform

add_device.jpg

Here you can add your device to get api keys needed later: https://loggingforest.com/index.php/page/pricing


Hardware Connection

wemosd1connection.jpg
Pasted-into-MicroPython-on-cheap-ESP8266-WeMos-D1-mini-for-Temperature-and-Humidity-logging-Wifi-and-Mobile-stats.png

Connect 2x DS18B20 Out to WeMos D1 in

DS18B20 using onewire and can be connected to same pin, but ti simplify connection without soldering, we will connect separately.

Diagram example on image 1

Have in mind that DIgital inputs/outputs on WeMos D1 mini is not same as
in code, here is example transition, this is why in code we using pins 4 and 5, but on boards is written as D1, D2 as on imag 2

Upload Software Needed to Device (Windows Guide)

upi_com.jpg
burn_firmware.jpg
wemosd1mini-mainpy-1024x627.jpg
download_run.jpg

Connect device to USB on your Windows PC
Download and install Python here: https://www.python.org/downloads/

Download and run uPyCraft IDE tool to flash your NodeMCU here: uPyCraft.exe

Image 1: Select COM port (this is usualy larger number if you don’t have other devices connected)

Image 2:

Burn microPython downloaded firmware to device
If you have pyBoard or device with preloaded firmware you can skip this step

Download MicroPython firmware for NodeMCU here: https://micropython.org/resources/firmware/esp8266-20190125-v1.10.bin

Image 3:

Upload LoggingForest basic code example to device
Download example code here: main.py

Use menu->Save page as or CTRL+S to download from this page main.py

Now open file in uPiCraft tool and change parameters received on loggingforest.com website

Image 4:

Download and Run

Check Your Data on Desktop or Mobile

2temps-1024x700.jpg
preview.jpg
2temps-rec-1024x809.jpg

After that your device will start sending data to loggingforest and you can see it there
Image 1: In loggingforest device edit just define parameters name and values

Image 2:

Click on preview

Image 3:

And you will see nice data, temperature inside cooling room and outside temperature