Introduction: Simple DIY Weather Station With DHT11 and OLED Display

About: Arduino fan!

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.

Step 1: What You Will Need

  1. Arduino UNO (or any other Arduino)
  2. OLED Display
  3. DHT11 temperature/humidity sensor
  4. Jumper wires
  5. Visuino program: Download Visuino

Step 2: The Circuit

  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)

Step 3: 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

Step 4: In Visuino Add Components

  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

Step 5: 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

Step 6: In Visuino Connect Components

  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]

Step 7: 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)

Step 8: 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