Wednesday, April 28, 2021

Two DHT11's to Arduino with OLED Display

 

In this chapter we will first introduce the 96 x 64 Full Color OLED display.  Once again I was able to get the pins to line up so that a header extender can be used to connect the Arduino to the OLED display.  The pin alignment requires that the OLED overlap the Arduino, but the use of a header makes it much easier to add the display.  One pin needs to be bent on the five pin header to skip the Arduino D12 pin.  Then I used short jumper wires for the OLED power and ground as seen in the diagram below. 


 OLED Displays look like a LCD screen, but each pixel is actually an Organic LED.  Because the pixels are LED’s you do not need a backlight like LCD displays use. The use of LED’s also makes the screen much brighter and the colors are stronger than with a LCD screen.

You will need to add the SSD1331 library using the library manager or download it and copy the unzipped file to your Arduino/Library folder.

Next you will need two DHT11’s for this project.  The DHT 11 comes in a three pin or four pin case and can also be purchased mounted on a small circuit board.  The left pin is power the next is the signal and the right most pin is ground.  I soldered jumper wires on my DHT11’s to make easier to connect them up to the Arduino.  The signal wire from one DHT11 goes to the Arduino D2 and the other DHT11 signal wire goes to D3

Next you will need to install the DHT Sensor Library.  You can find the DHT11 support software in the Arduino Library manager.  Then you can download my code from github or type it in from the code below.  If everything is working you should see the Indoor and Outdoor temperatures in Fahrenheit and humidity percent being displayed on the OLED display.

 

I also developed a graphing version.  The video is at: https://youtu.be/Uq36psuKP-g


No comments: