Skip to content

Displaying both humidity and temperature from a DHT_22 sensor on two 1.5 OLED Displays using I2C to communicate to an Arduino/AVR board

Notifications You must be signed in to change notification settings

Digital1O1/DHT_22-Temperature-Humidty-OLED-Display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DHT_22 With Dual 1.3 OLED Displays

DSC_0430-min

=== Overall goal of this project ===

  • Display the temperature and humidity readings to both OLED displays
  • Provide additional documentation so that others can use two OLED displays at the same time in their own projects

Please keep in mind

In this repository Visual Studio code and the Platform IO extension was used.

If you do NOT want to go through the hassel of setting both VS Code and Platform IO up

  • Click on the 'SRC' folder to find the source code for this project
  • Comment out the '#include <Arduino.h>' header
  • Then copy and paste the code to your favorite text editor (To include the Arduino IDE)

=== Items used ===

  1. Two 1.3 OLED displays
  2. A single DHT_22 sensor
  3. A handful of jumper wires
  4. An Arduino UNO

=== Information about the OLED Displays ===

  1. Both OLED displays have the SH1106 driver instead of the more common SH1306 driver that's found on smaller OLED displays
  2. Both communicate with the UNO via I2C to make things easier as far as the wiring goes.
  3. They can also be found on Amazon via link

IMPORTANT NOTE

To ensure that both OLED displays are

  1. Connected correctly
  2. Have different HEX addresses

The following .ino/Arduino sketch can be uploaded to the UNO or whatever Arduino board you're using.

Make sure the baud rate (9600) in the serial monitor matches the one being used in the sketch to avoid getting "garbage" values in the serial monitor


=== Establishing different HEX addresses with OLED displays ===

IMG_6132

On the back of both displays is a 'section' called ADD_SELECT which dictates if the display has either has 0x3C or 0x3D for their HEX address when using the I2C Scanner

The next step involves taking a soldering station and de-soldering the SMD resistor that's on the 0x78 side and just solder the 'middle point' to the 0x7A side as shown in the pictures below.

================== Before ==================

InkedIMG_6134_LI

================== After ==================

InkedIMG_6133_LI

I'm not entirely if the HEX addresses would change if you were to take a pliers and just physically rip out the SMD resistor, but I'm assuming not.

Once again, to ensure the displays have different HEX addresses, the I2C Scanner can be used.


=== Wiring Diagram ===

Since using a hardware diagram generator like Fritzing is frowned upon, I generated the diagram below with Autodesk EAGLE.

WHICH IS FREE BTW

Here's a visual representation of how I wired everything up.

image

If the diagram was confusing to follow, here's an in-depth explantion of what I did.

  1. VDD --> 5 Volts
  2. All GNDs --> Single ground point on UNO
  3. SCL --> A5
  4. SDA --> A4
  5. Singal out on DHT_22 --> Digital I/0 Pin 8

=== IMPORTANT STUFF ===

  • To prevent any text from overlapping, or the OLED displays from flickering, the sendBuffer() adn clearBuffer() function calls must be 'paired' with one another or you're gonna have a bad time yo.
  • If you're using either an UNO or Nano board, using two OLED displays WILL eat up most of the on board memory. With this code alone I was using ~96% of the memory
  • The U8g2lib.h library (From my understanding...) only deals with Character arrays.
    • The dtostrf() function MUST be used to display the data.

That's it for now!

Revisions to this repo will be made later this week if nessessary.

About

Displaying both humidity and temperature from a DHT_22 sensor on two 1.5 OLED Displays using I2C to communicate to an Arduino/AVR board

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages