Arduino I2C OLED Display - Temperature and Humidity Display (SSD1306)
The process for using the library associate with the OLED display is somewhat convoluted, so I have simplified the steps and included them below:
Download the I2C library at the recommended link: HERE
Unzip the contents to a local folder
Navigate as follows: 'IIC_OLED -> 0.96Inch'
Copy 'Adafruit_SSD1306' and 'Adafruit_GFX'
Paste both folders in your 'Arduino -> libraries' folder
Navigate from the original folder again as follows: 'IIC_OLED -> 0.96Inch -> examples'
Copy 'ssd1306_128x64_i2c' and paste into your Arduino sketches folder
Now open the Arduino IDE and go to your 'Sketchbook' tab and you should see the 'ssd1306_128x64_i2c' - this means you are ready to test the example script! After uploading the sketch, your display should produce a series of objects and animations that look like similar to the video below:
Parts list for this tutorial:
The following Arduino code utilizes the library provided by DIYMall from the Amazon link above. The library uses a specific SSD1306 library (for the 128x64 pixel display) and an Adafruit display library. I will also be using the DHT22 library which can be easily downloaded from the Arduino IDE library manager.
The OLED display is wired to the Arduino through its I2c ports on analog pins A4/A5. The DHT22 uses digital pin 2 to communicate using the library described above.
If the code and wiring is done correctly, the output should look something like the photo shown here. The temperature default display is in Centigrade, and the relative humidity display is given as a percentage.
This tutorial has demonstrated how to wire and display temperature and humidity onto an inexpensive, easy-to-use, organic LED display that is compatible with the Arduino platform. This type of display is great for small projects where the user may be interested in displaying results in real-time or having a small display for an embedded project. These OLED displays are great because they consume less power and are brighter than traditional LCDs. This tiny display is ready and capable of being inserted into a 3-D printed case and used as a miniature screen for any engineer's project.
See More in Arduino and Electronics: