Maker Portal

View Original

Arduino I2C OLED Display - Temperature and Humidity Display (SSD1306)

See this content in the original post

DIYMall's 0.96" OLED Arduino Display


See this content in the original post

The process for using the library associate with the OLED display is somewhat convoluted, so I have simplified the steps and included them below:

  1. Download the I2C library at the recommended link: HERE

  2. Unzip the contents to a local folder

  3. Navigate as follows: 'IIC_OLED -> 0.96Inch'

  4. Copy 'Adafruit_SSD1306' and 'Adafruit_GFX'

  5. Paste both folders in your 'Arduino -> libraries' folder

  6. Navigate from the original folder again as follows: 'IIC_OLED -> 0.96Inch -> examples'

  7. 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:

See this content in the original post

See this content in the original post

Parts list for this tutorial:

  1. Arduino Uno - $13.00 [Our Store]

  2. OLED Display (Arduino-Compatible) - $10.00 [Our Store]

  3. DHT22 Temperature Sensor - $9.00 [Our Store]

  4. 10k resistor - $7.99 (750 pcs) [Amazon]

  5. jumper wires - $7.29 (100 pcs) [Amazon, Our Store]

  6. Mini Breadboard - $3.00 [Our Store]

See this content in the original post

See this content in the original post

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.

 

See this content in the original post

See this content in the original post

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:

See this gallery in the original post