Introduction: Remote Wi-Fi DHT11 Temperature and Humidity I2C 2 X 16 LCD Display With Two ESP8266 and Visuino
ESP8266 modules are great low cost stand alone controllers with built in Wi-Fi, and I already made a simple Blink instructable with ESP8266 NodeMCU module.
The advantage of the ESP8266 over Arduino and other controllers is the builtin Wi-Fi. In this Instructable I will show you how with the help of Visuino you can use two ESP8266 modules to make a remote LCD Display for Temperature and Humidity DHT11 sensor.
In the Instructable, I will use 2 NodeMCU modules. One version 0.9, and the other 1.0. The NodeMCU are the easiest way to program and experiment with ESP8266 controllers. This Instructable however can easily be done with other modules, and the Sensor module can even use ESP-01 module as it needs only one GPIO pin to connect to the DHT11 sensor.
Step 1: Components
- 2 NodeMCU ESP8266 boards (I used both NodeMCU 0.9, and NodeMCU 1.0 versions, but any other combination, or even stand alone ESP-12 will work)
- One DHT11 Sensor module I got from this cheap 37 sensors set
- One I2C 16x2 LCD Display (Back side of the LCD with the I2C adapter showed on Picture 2)
- 7 Female-Female jumper wires
Step 2: Connect the DHT11 to the First NodeMCU ESP8266 Module
- Connect Power(Red wire), Ground(Black wire), and Data(Gray wire) to the DHT11 Module (Picture 1 shows 2 different types of DHT11 sensor modules. As you can see the pins may differ, so connect carefully!)
- Connect the other end of the Ground wire(Black wire) to the Ground pin of the ESP8266 module (Picture 2)
- Connect the other end of the Power wire(Red wire) to the 3.3V Power pin of the ESP8266 module (Picture 2)
- Connect the other end of the Data wire(Gray wire) to the Digital pin 2 of the ESP8266 module (Picture 3)
- Picture 4 shows where are the Ground, 3.3V Power, and Digital 2 pins of the NodeMCU 0.9
Step 3: Connect the I2C LCD Display to the Second NodeMCU ESP8266 Module
- Connect Ground(Black wire), Power(Red wire), SDA(Green wire), and SCL(Yellow wire) to the LCD Module (Picture 1)
- Connect the other end of the SCL wire(Yellow wire) to SCL/Digital pin 1 of the ESP8266 NodeMCU board (Picture 2)
- Connect the other end of the SDA wire(Green wire) to SDA/Digital pin 2 of the ESP8266 NodeMCU board (Picture 2)
- Connect the other end of the Ground wire(Black wire) to the Ground pin of the ESP8266 NodeMCUboard (Picture 3)
- Connect the other end of the Power wire(Red wire) to the 5V(Called "Vin" in version 1.0) Power pin of the ESP8266 NodeMCUboard (Picture 3)
- Picture 4 shows where are the Ground, 5V(Vin) Power, Digital 1, and Digital 2 pins of the NodeMCU 1.0
Step 4: Start Visuino, and Select the ESP8266 Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6.
Make sure that you install 1.6.7 or 1.6.5, otherwise this Instructable will not work!
If you have not done follow the steps in this Instructable to setup the Arduino IDE to program ESP 8266!
The Visuino: https://www.visuino.com also needs to be installed.
Step 5: In Visuino: Setup the Module As Access Point
- In the Object Inspector, expand the "Modules" property, then the "WiFi" sub property, then the "AccessPoint" sub property (Picture 1)
- Set the value of the "SSID" sub property of the "AccessPoint", to “Thermometer” (Picture 1)
To make sure the Access Point will be on the 200.200.200.X subnet, we need to assign a fixed address.
- In the Object Inspector, expand the "Config" sub property of the "AccessPoint" property (Picture 2)
- Set the value of the “Enabled” sub property of the Config to “True” (Picture 2)
- Set the value of the “IP” sub property to "200.200.200.100" (Picture 3)
Step 6: In Visuino: Add an UDP Socket for the Communication
Next we need to add an UDP socket for the communication.
- In the Object Inspector, click on the "..." button next to the value of the "Sockets" sub property of the "WiFi" property (Picture 1)
- In the Sockets editor select “UDP Socket” on the right, and then click on the "+" button on the left (Picture 2)
- In the Object Inspector, set the value “RemoteIPAddress” property to “200.200.200.200” (Picture 3) – this is the fixed IP address that we will assign to the other module later on
- In the Object Inspector set the value of the “RemotePort” to “8888” (Picture 4)
Step 7: In Visuino: Add and Connect DHT11 Component
- Type "dht" in the Filter box of the Component Toolbox then select the "Humidity and Thermometer DHT11/21/22/AM2301" component (Picture 1), and drop it in the design area
- Connect the "Sensor" pin of the HumidityThermometer1 component to the "Digital" input pin of the "Digital[ 2 ]" channel of the "NodeMCU ESP-12" component (Picture 4)
Step 8: In Visuino: Add Make Structure Component, and Add Analog Channels to It
We need to send a packet of 2 analog values. To do this we will make a structure with 2 analog values and will send it over the UDP socket.
- Type "stru" in the Filter box of the Component Toolbox then select the "Make Structure" component (Picture 1), and drop it in the design area
- Click on the "Tools" button (Picture 2) to open the "Elements" editor (Picture 3)
- In the "Elements" editor select the “Analog” element on the right, and then click 2 times on the "+" button on the left (Picture 3) to add 2 Analog elements (Picture 4)
- Close the "Elements" editor.
Step 9: In Visuino: Connect the Make Structure Component
- Connect the “Temperature” pin of the HumidityThermometer1 component to the “In” pin of the “Elements.Analog1” element of the MakeStructure1 component (Picture 1)
- Connect the “Humidity” pin of the HumidityThermometer1 component to the “In” pin of the “Elements.Analog2” element of the MakeStructure1 component (Picture 2)
- Connect the “Out” pin of the MakeStructure1 component to the “In” pin of the "Modules.WiFi.Sockets.UDPSocket1” of the “NodeMCU ESP-12” component (Picture 3)
Step 10: In Visuino: Add and Connect Clock Generator Component
The project can be used as it is, but if you run it it will overwhelm the network with UDP packets, as it will keep sending thermometer readings very fast one after another. It is better to read the thermometer only once a second. The Thermometer component has a “Clock” pin, that can be used to control when the thermometer will perform a reading and send the value to the socket. We will use a Clock Generator component to control the Thermometer.
- Type "clo" in the Filter box of the Component Toolbox then select the "Clock Generator" component (Picture 1), and drop it in the design area
- Connect the "Out" pin of the ClockGenerator1 component to the "Clock" input pin of the HumidityThermometer1 component (Picture 2)
Step 11: Generate, Compile, and Upload the ESP8266 Code for the Thermometer
- In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
- Connect the first NodeMCU module (The one with the DHT11) with USB cable to the computer
- Select the board type and serial port as I have shown you in this Instructable
- Make sure you have installed the latest staging version of the ESP support! The stable release does not have some of the latest features, and you will have errors when you try to compile!
- In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Step 12: in Visuino: Select the ESP8266 Board Type, and Configure It to Connect to the Access Point
Now lets program the Display module.
- Start new project.
- Click on the "Tools" button on the Arduino component, and when the dialog appears, select "NodeMCU ESP-12" as you did in Step 4 for the Thermometer module
Next we need to configure the module to connect to the Access Point of the Thermometer module, and use a fixed IP Address of 200.200.200.200
- In the Object Inspector, expand the “Modules” property, then the “WiFi” sub property, then the “AccessPoints” sub property, and click on the "..." button next to its value (Picture 1)
- In the "AccessPoins" editor, select “WiFi Access Point”, and then click on the "+" button on the left, to add the access point (Picture 2)
- In the Object Inspector, set the value of the "SSID" property to “Thermometer” (Picture 3)
- In the Object Inspector, expand the “Config” property, and set the value of the “Enabled” sub property to “True” (Picture 4)
- In the Object Inspector, set the value of the “IP” sub property to “200.200.200.200” (Picture 5)
Step 13: In Visuino: Add an UDP Socket for the Communication
Next we need to add an UDP socket for the communication.
- In the Object Inspector, click on the "..." button next to the value of the "Sockets" sub property of the WiFi (Picture 1)
- In the Sockets editor select “UDP Socket” on the right, and then click on the "+" button on the left (Picture 2)
- In the Object Inspector, set the value “RemoteIPAddress” property to “200.200.200.200” (Picture 3)
- In the Object Inspector set the value of the “Port” to “8888” (Picture 4)
- Close the "Sockets" dialog
Step 14: In Visuino: Add and Connect LCD Component, and Add Elements to Display the Temperature
- Type "lcd" in the Filter box of the Component Toolbox then select the "Liquid Crystal Display (LCD) - I2C" component (Picture 1), and drop it in the design area
- Click on the "Tools" button (Picture 2) to open the "Elements" editor (Picture 3)
We will add a Text field with the description of the value, and Analog field to display the value for the Temperature and Humidity values.
First we will add Description and value fields for the Temperature:
- Add Text field for the Temperature description text by select the "Text Field" in the right window of the "Elements" editor, and clicking on the "+" button (Picture 3)
- In the Object Inspector set the "InitialValue" property of the element to "Temp:" (Picture 4) - This will specify the text to be displayed
- Add Analog field for the Temperature value by selecting the "Analog Field" in the right window of the "Elements" editor, and clicking on the "+" button (Picture 5)
- In the Object Inspector set the "Column" property of the element to "10"(Picture 6) - This will specify the staring column of the field
Step 15: in Visuino: Add, and Setup Text and Analog Value Elements to Display the Humidity
Next we will repeat the same steps for the Humidity:
- Add Text field for the Humidity description text selecting the "Text Field" in the right window of the "Elements" editor, and clicking on the "+" button (Picture 1)
- In the Object Inspector set the "InitialValue" property of the element to "Humidity:" (Picture 2)
- In the Object Inspector set the "Row" property of the element to "1" (Picture 3) - This will specify that the field will be shown in the second row of the Display
- Add Analog field for the Humidity value by selecting the "Analog Field" in the right window of the "Elements" editor, and clicking on the "+" button (Picture 4)
- In the Object Inspector set the "Column" property of the element to "10"(Picture 5)
- In the Object Inspector set the "Row" property of the element to "1" (Picture 6)
Step 16: In Visuino: Add Split Structure Component, and Add Analog Channels to It
The Thermometer module sends the temperature and humidity in binary floating point form as a structure. We need to decode it properly. For this we need a “Split Structure” component with 2 “Analog” elements in it.
- Type "split" in the Filter box of the Component Toolbox then select the "Split Structure" component (Picture 1), and drop it in the design area
- Click on the "Tools" button of the SplitStructure1 component (Picture 2) to open the Elements editor (Picture 3)
- In the "Elements" editor select the “Analog” element, and then click 2 times on the "+" button (Picture 3) to add 2 Analog elements (Picture 4)
- Close the "Elements" editor
Step 17: In Visuino: Connect the Components
- Connect the "Out" pin of the "Elements.Analog1" of the SplitStructure1 component to the "In" pin of the "Elements.AnalogField1" element of the LiquidCrystalDisplay1 component (Picture 1)
- Connect the "Out" pin of the "Elements.Analog2" of the SplitStructure1 component to the "In" pin of the "Elements.AnalogField2" element of the LiquidCrystalDisplay1 component (Picture 2)
- Connect the "Out" pin of the LiquidCrystalDisplay1 component to the to the "In" pin of the I2C channel of the “NodeMCU ESP-12” component (Picture 3)
- Connect the “Out” pin of the “Modules.WiFi.Sockets.UDPSocket1” (Picture 4) of the “NodeMCU ESP-12” component, to the “In” pin of the SplitStructure1 component (Picture 5)
Step 18: Generate, Compile, and Upload the ESP8266 Code for the Display
- In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
- Connect the second NodeMCU module (The one with the Display) with USB cable to the computer
- Select the board type and serial port as I have shown you in this Inctructable
- In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
Step 19: And Play...
Congratulations! You have completed the project.
Picture 1 shows the connected and powered up project. As you can see on the picture the Display will show the temperature and the Humidity.
On Picture 2 you can see the complete Visuino diagram for the Temperature and Humidity measuring module.
On Picture 3 you can see the complete Visuino diagram for the I2C LCD Display module.
Also attached are the Visuino projects, that I created for this Instructable. You can download and open them in Visuino: https://www.visuino.com

Participated in the
Arduino All The Things! Contest
47 Comments
1 year ago
Здравей !!!
Искам да попитам дали всичко това не може да се постигне само с един модул NodeMCU ???
Благодаря ти предварително !!!
3 years ago
Hallo!
Does anyone work for you? Because I went through everything in the description but I don't want it to work. Someone tuna to help why it doesn't work? Thank you in advance for your help.
Question 5 years ago
I've completed the wifi temp project. The lcd shows no data, until I power up the esp8266 connected to the dht11. Then the LCD screen shows temp and humidity values of zero. Any idea what I've done wrong?
6 years ago
Great tutorial! You can use easily DHT11 or DHT22 sensor with only two (2) wires. Here is a useful link:
https://www.facebook.com/spectrasrl/photos/p.635952796529390/635952796529390
Here is one tech video with DS18S20 and DHT11 sensors designing an industrial temperature monitoring system, Raspberry Pi based:
https://youtu.be/Knis6KReK1A
Reply 6 years ago
Cool :-) Thank you! It requires power injector and splitter circuitry that I don't have at the moment, and most people don't have either, but is a very cool approach for remotely powering the sensors :-)
I tried to make Instructable with ready, easily accessible off the shelf components.
7 years ago
I am still learning Visuino and still impressed with it.. I am still a little confused on adding programming or sending data. Could you do this with 2 nanos and two NRFL2401's for an example?
Reply 7 years ago
Thank you!
The NRFL2401 is not yet supported, but I am working to add support for it. Will post tutorials too. For now the connection between Nanos can be done with Wi-Fi, although I prefer to directly program NodeMCUs instead ;-)
Reply 7 years ago
Thanks. I have a ton of NRF that I got cheap. It will take a while for esp8266 to arrive
7 years ago
Anyone just got the code as I do not want to use Visuino
7 years ago
Hello,
Im trying to verify and to write to the NODEMCU 0.9 but im getting the following error:
In file included from C:\Users\Pedro Maia\Documents\Visuino\Generated\Generated.ino:17:0:
C:\Users\Pedro Maia\Documents\Arduino\libraries\Mitov/Mitov_FormattedSerial.h:18:8: error: 'SerialConfig' does not name a type
const SerialConfig CSerialInits[] =
^
In file included from C:\Users\Pedro Maia\Documents\Visuino\Generated\Generated.ino:17:0:
C:\Users\Pedro Maia\Documents\Arduino\libraries\Mitov/Mitov_FormattedSerial.h: In member function 'virtual void Mitov::SerialPort<T_SERIAL_TYPE, T_SERIAL>::StartPort()':
C:\Users\Pedro Maia\Documents\Arduino\libraries\Mitov/Mitov_FormattedSerial.h:123:40: error: 'CSerialInits' was not declared in this scope
T_SERIAL->begin( inherited::Speed, CSerialInits[ AIndex ], SERIAL_FULL );
^
C:\Users\Pedro Maia\Documents\Arduino\libraries\Mitov/Mitov_FormattedSerial.h:126:40: error: 'CSerialInits' was not declared in this scope
T_SERIAL->begin( inherited::Speed, CSerialInits[ AIndex ], SERIAL_RX_ONLY );
^
C:\Users\Pedro Maia\Documents\Arduino\libraries\Mitov/Mitov_FormattedSerial.h:129:40: error: 'CSerialInits' was not declared in this scope
T_SERIAL->begin( inherited::Speed, CSerialInits[ AIndex ], SERIAL_TX_ONLY );
What should i do?
INFORMATION:
Windows 10 64 Bits
Arduino 1.6.7 (Package version: 2.1.0 RC2)
Visuino 7.7.0.74
Reply 7 years ago
Hello PedroM104,
Update to the "Stable" 2.1.0.
The Stable 2.1.0 is not compatible with the 2.1.0 RC2 and this is the reason for the error. Visuino was updated to be compatible with the Stable "2.1.0" version.
To update:
1. Uninstall 2.1.0 RC2
2. Delete manually the "C:\Users\[USER_NAME]\AppData\Local\Arduino15\packages\esp8266" !
3. Change the preferences to point to the "stable" release as described here : https://www.instructables.com/id/Setting-Up-the-Arduino-IDE-to-Program-ESP8266/
4. Install the stable 2.1.0
Make sure you do step 2! Otherwise you will have errors, and will not be able to compile any ESP 8266 projects!
Reply 7 years ago
It worked, i managed to pass a few errors after this, i changed to COM5 and recompiled everything and its working ! YES ! My first Projected completed ! Thanks a lot !!!
Reply 7 years ago
Great! :-) You can post a picture of it ;-) . There is the "I made it" button on the top. It will be cool :-)
Reply 7 years ago
I will :) Thanks for the help.
You got any advice to make this a more portable device?
Currently im using two Smartphone Chargers connected to the devices.
Tomorrow i will take a further look, to tweak, make a few changes to learn more about this :)
Reply 7 years ago
I will :) Thanks for the help.
You got any advice to make this a more portable device?
Currently im using two Smartphone Chargers connected to the devices.
Tomorrow i will take a further look, to tweak, make a few changes to learn more about this :)
Reply 7 years ago
I will :) Thanks for the help.
You got any advice to make this a more portable device?
Currently im using two Smartphone Chargers connected to the devices.
Tomorrow i will take a further look, to tweak, make a few changes to learn more about this :)
Reply 7 years ago
I will :) Thanks for the help.
You got any advice to make this a more portable device?
Currently im using two Smartphone Chargers connected to the devices.
Tomorrow i will take a further look, to tweak, make a few changes to learn more about this :)
Reply 7 years ago
I will :) Thanks for the help.
You got any advice to make this a more portable device?
Currently im using two Smartphone Chargers connected to the devices.
Tomorrow i will take a further look, to tweak, make a few changes to learn more about this :)
7 years ago
Not sure :-( .
The Compilation went fine right ?
You can try a different USB port.
7 years ago
If I read this corectly then it only reads Celcius and only goes to 0 degree or 32 F is there a F sensor?