Simple DIY Weather Station With DHT11 and OLED Display

by RonFrtek in Circuits > Arduino

5626 Views, 13 Favorites, 0 Comments

Simple DIY Weather Station With DHT11 and OLED Display

Visuino Tutorial - Simple DIY Weather Station with DHT11 and OLED Display

In this tutorial we will learn how to create a simple weather station using Arduino, DHT11 sensor, OLED Display and Visuino to Display the Temperature and Humidity.

Watch a demonstration video.

What You Will Need

FZEK4WBK3XGYAP0.LARGE.jpg
images.jpg
41015728-1.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
VisuinoAdvrtisementM5Stack6.jpg
  1. Arduino UNO (or any other Arduino)
  2. OLED Display
  3. DHT11 temperature/humidity sensor
  4. Jumper wires
  5. Visuino program: Download Visuino

The Circuit

2019-12-16_0-17-30.jpg

  1. Connect DHT11 sensor pin (VCC or +) to Arduino pin (5V)
  2. Connect DHT11 sensor pin (GND or -) to Arduino pin (GND)
  3. Connect DHT11 sensor pin (S) to Arduino digital pin (7)
  4. Connect OLED Display pin (VCC) to Arduino pin (5V)
  5. Connect OLED Display pin (GND) to Arduino pin (GND)
  6. Connect OLED Display pin (SCL) to Arduino pin (SCL)
  7. Connect OLED Display pin (SDA) to Arduino pin (SDA)

Start Visuino, and Select the Arduino UNO Board Type

FGEDJB4JJOK456K.LARGE.jpg
F8LR4HQK1UXJLG7.LARGE.jpg

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://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 higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. 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 "Arduino UNO" as shown on Picture 2

In Visuino Add Components

2019-12-15_16-15-52.jpg
2019-12-15_16-16-05.jpg

  1. Add "SSD1306/SH1106 OLED Display (I2C)" component
  2. Add 2X "Analog To Text" component
  3. Add "Humidity and Thermometer DHT11/21/22/AM2301" component

In Visuino Set Components

2019-12-15_16-16-33.jpg
2019-12-15_16-16-49.jpg
2019-12-15_16-18-09.jpg
2019-12-15_16-17-40.jpg
2019-12-15_16-17-28.jpg
2019-12-15_16-17-53.jpg
2019-12-15_16-17-08.jpg
cloud.png
drop-icon.png
  • Select "AnalogToText1" component and in the properties window set "Precision" to 0 (Picture1)
  • Select "AnalogToText2" component and in the properties window set "Precision" to 0 (Picture1)
  • Select "DisplayOLED1" component and double click on it. (Picture2)
  • In the element window drag 2X "Draw Bitmap" to the left (Picture2)
  • In the element window drag 2X "Text Field" to the left (Picture2)
  • In the Elements window Select "Draw Bitmap1" on the left and in the properties window set "Y" to 30 and select "Bitmap" and click on the 3 dots.
  • In the "Transparency Bitmap Editor" click on the button "Load" and Load the "Cloud" bitmap from the file.

    Note: the "Cloud" Bitmap is available here to download or you can browse for more here,
  • Close the "Transparency Bitmap Editor"
  • In the Elements window Select "Draw Bitmap2" on the left and in the properties window set "X" to 75 and select "Bitmap" and click on the 3 dots.
  • In the "Transparency Bitmap Editor" click on the button "Load" and Load the "Drop" bitmap from the file.

    Note: the "Drop" Bitmap is available here to download or you can browse for more here,
  • Close the "Transparency Bitmap Editor"
  • In the Elements window select "TextField1" and in the properties window set "size" to 4, "X" to 5, "Y" to 5
  • In the Elements window select "TextField2" and in the properties window set "size" to 2, "X" to 105, "Y" to 5

In Visuino Connect Components

2019-12-16_0-54-23.jpg
OLED-DHT11.png

  1. Connect "DisplayOLED1" component pin [Out] to Arduino I2C pin [In]
  2. Connect "HumidityThermometer1" component pin [Sensor] to Arduino digital pin [7]
  3. Connect "HumidityThermometer1" component pin [Temperature] to AnalogToText1 pin [In]
  4. Connect "HumidityThermometer1" component pin [Humidity] to AnalogToText2 pin [In]
  5. Connect "AnalogToText1" pin [Out] to "DisplayOLED1" > TextField1 component pin [In]
  6. Connect "AnalogToText2" pin [Out] to "DisplayOLED1" > TextField2 component pin [In]

Generate, Compile, and Upload the Arduino Code

F0P14MMK1UXJMQ8.LARGE.jpg
FCG1WWZK1UXJMQ7.LARGE.jpg

In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE

In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Play

If you power the Arduino UNO module, the room temperature and humidity level should be displayed on the OLED display.

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