- 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
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)
- Two 1.3 OLED displays
- A single DHT_22 sensor
- A handful of jumper wires
- An Arduino UNO
- Both OLED displays have the SH1106 driver instead of the more common SH1306 driver that's found on smaller OLED displays
- Both communicate with the UNO via I2C to make things easier as far as the wiring goes.
- They can also be found on Amazon via link
To ensure that both OLED displays are
- Connected correctly
- 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
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.
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.
Since using a hardware diagram generator like Fritzing is frowned upon, I generated the diagram below with Autodesk EAGLE.
Here's a visual representation of how I wired everything up.
If the diagram was confusing to follow, here's an in-depth explantion of what I did.
- VDD --> 5 Volts
- All GNDs --> Single ground point on UNO
- SCL --> A5
- SDA --> A4
- Singal out on DHT_22 --> Digital I/0 Pin 8
- 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.
Revisions to this repo will be made later this week if nessessary.