ESP8266 IoT Development Board Weather Station Using DHT11 Sensor & OLED Display

by RonFrtek in Circuits > Arduino

337 Views, 2 Favorites, 0 Comments

ESP8266 IoT Development Board Weather Station Using DHT11 Sensor & OLED Display

ESP8266 IoT Development Board Weather Station Using DHT11 Sensor & OLED Display

In this tutorial you will learn how to make a simple weather station using a ESP8266 IoT Development Board with DHT11 Sensor & OLED Display. We are going to make all this using a Visuino program.

You will also learn how to set the I2C pins for any board in Visuino, this is very useful when you have a board with different I2C pins as the supported ones.


What You Will Need

a454daa7-193f-44e4-b869-b7b6c7db1614.jpg
VisuinoAdvrtisemenESPNowESP32C3-1.jpg
  • ESP8266 IoT Development Board Link
  • DHT11 Temperature & Humidity sensor (usually comes with the ESP8266 IoT Development Board)
  • OLED Display (usually comes with the ESP8266 IoT Development Board)
  • Visuino program: Download Visuino

Brought by PCBWay

2022-08-26_13-41-18.jpg
FHUQHJ6LF9Y8DUL.png

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

NEW! Now you can get Aluminum PCB & FLEX PCB in their Special Offer!

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

ESP8266-IoT-Development-Board-DHT11-humidity-sensor-0-96-oled-Display-SDK-Programming-ESP-12F-Wifi-.jpg
  • Connect DHT11 sensor pin [VCC] to the Development Board pin [VCC] see attached picture
  • Connect Oled Display pin [VCC] to the Development Board pin [VCC] see attached picture

Start Visuino, and Select the Generic ESP8266 Board Type

select-board-uno.jpg
2023-03-27_13-12-59.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Generic ESP8266" as shown on Picture 2

In Visuino Set I2C Pins

2023-03-27_13-18-22.jpg

Select the Generic ESP8266 Board and in the Properties window expand "I2C Channels" > "I2C" and set "SCL" to 14 and "SDA" to 2

Note: Your ESP8266 IoT Development Board might have a different SCL & SDA pins so check your board specification

In Visuino Add Components

DHT11.jpg
OLED.jpg
  • Add "OLED I2C" component
  • Add "DHT11" component


Note: in case you have any other DHT sensor, Select "HumidityThermometer1" component and in the properties window elect the type of your DHT sensor either DHT11 or DHT22,etc


In Visuino Set Components

FQ40EY6L0XV2TJG.jpg
F00E65TL0XV2TJF.jpg
F5WFQ7EL0XV2TJE.jpg
FSJNTAAL0XV2TJD.jpg
FA6EPCOL0XV2TJC.jpg

Double click on the "DisplayOLED1" component and in the "Elements" window

  • drag "Draw Text" to the left side & in the properties window set size to 2, "Text" to TEMP
  • drag another "Draw Text" to the left side & in the properties window set size to 2, "Text" to HUM & "Y" to 40
  • drag "Text Field" to the left side & in the properties window set size to 2, and "X" to 60
  • drag another "Text Field" to the left side & in the properties window set size to 2, and "X" to 60 and "Y" to 40
  • Close the "Elements" window


In Visuino Connect Components

2023-03-27_13-31-06.jpg
weather-dev-board.png
  • Connect "HumidityThermometer1" pin [Temperature] to "DisplayOLED1" > "TextField1" pin [In]
  • Connect "HumidityThermometer1" pin [Humidity] to "DisplayOLED1" > "TextField2" pin [In]
  • Connect "HumidityThermometer1" pin [Sensor] to "Generic ESP8266 Board" GPIO pin [5]
  • Connect "DisplayOLED1" pin I2C [Out] to "Generic ESP8266 Board" I2C pin [In]


Generate, Compile, and Upload the Arduino Code

2023-03-27_13-35-07.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the ESP8266 IoT Development Board, the Display will start to show the current Temperature and Humidity.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu