Site icon DIY Usthad

Interfacing OLED 128×64 I2C with Arduino Uno

circuit for images on OLED by diyusthad

Introduction 

In this tutorial, we are going to learn to interface Arduino UNO with OLED 128×64 I2C Monochrome Display.

Skills Required

Basic: This tutorial is well explained for beginners.

Hardware Required

Arduino UNO  x  1
OLED 128×64 x  1
Breadboard  x  1
 Jumber cable  x  1

Circuit

Connect the pins of OLED with the following pins of Arduino UNO, as shown below.
Arduino UNO
OLED I2C Display
5v
VCC
GND
GND
SDA/A4
SDA
SCL/A5
SCL

Install Required Libraries

Either you can download the libraries from Github and add the ZIP file in Arduino IDE using add .zip library option.
Or you can install the libraries directly from Arduino IDE from Manage Libraries. Follow the below steps to install.
sketch -> include library -> manage libraries
Open manage library from sketch -> include library -> manage libraries  
 
install adafruit ssd1306 library

Then Search for AdafruitSSD1306 and click on the install button.

install adafruit gfx library
Then Search for the AdafruitGFX and click the install button. Now we have successfully installed the required libraries for this project.

Adafruit Example Code

Let’s upload the adafruitSSD1306 library example program and test our setup.
Open the example program from File -> Examples -> Adafruit SSD1306 -> ssd1306_128x64_i2c,
because We are using OLED display with I2C interface with the screen size of 128×64.

Now let’s Upload the code

Go to tool menu  -> Boards select Arduino UNO, then from Port select the port to which the Arduino is connected

Video

Exit mobile version