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
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
- Arduino UNO (or any other Arduino)
- OLED Display
- DHT11 temperature/humidity sensor
- Jumper wires
- Visuino program: Download Visuino
The Circuit
- Connect DHT11 sensor pin (VCC or +) to Arduino pin (5V)
- Connect DHT11 sensor pin (GND or -) to Arduino pin (GND)
- Connect DHT11 sensor pin (S) to Arduino digital pin (7)
- Connect OLED Display pin (VCC) to Arduino pin (5V)
- Connect OLED Display pin (GND) to Arduino pin (GND)
- Connect OLED Display pin (SCL) to Arduino pin (SCL)
- Connect OLED Display pin (SDA) to Arduino pin (SDA)
Start Visuino, and Select the Arduino UNO Board Type
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
- Add "SSD1306/SH1106 OLED Display (I2C)" component
- Add 2X "Analog To Text" component
- Add "Humidity and Thermometer DHT11/21/22/AM2301" component
In Visuino Set Components
- 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
- Connect "DisplayOLED1" component pin [Out] to Arduino I2C pin [In]
- Connect "HumidityThermometer1" component pin [Sensor] to Arduino digital pin [7]
- Connect "HumidityThermometer1" component pin [Temperature] to AnalogToText1 pin [In]
- Connect "HumidityThermometer1" component pin [Humidity] to AnalogToText2 pin [In]
- Connect "AnalogToText1" pin [Out] to "DisplayOLED1" > TextField1 component pin [In]
- Connect "AnalogToText2" pin [Out] to "DisplayOLED1" > TextField2 component pin [In]
Generate, Compile, and Upload the Arduino Code
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