OLED Display Module with Arduino

Written By: Marcus Schappi

Dash icon
Difficulty
Easy
Steps icon
Steps
7
In this guide, we will use a 0.96'' OLED display screen with the Arduino. We will be using an SSD1306 OLED library and the Arduino IDE to program the Arduino. 

 After completing this guide, you are one step closer to using the OLED display in your own Arduino projects.

Step 1 The 0.96'' OLED Display Module

Let's take a closer look at the 0.96'' OLED module. It has four pins: 

 GND: In electronics, we define a point in a circuit to be a kind of zero volts or 0V reference point, on which to base all other voltage measurements. This point is called common ground or GND. 

 3.3V : While 'VCC' stands for Voltage Common Collector, we'll connect the VCC pin to 3.3V on the micro:bit 

 Serial Clock (SCL) 

 Serial Data (SDA) Voltage is the difference in electric potential between two points. As it is difficult to talk about voltage without a reference point, we need another point to compare it to. To connect the SCL and SDA pins to the Arduino, they must be connected to Pins A4 (SDA) and A5 (SCL). This is because pins A4 and A5 on the Arduino are what we call the SDA and SCL pins. These pins are required for the I2C protocol. I2C stands for inter-integrated circuit protocol, and it allows for some devices such as the OLED display to communicate with other devices like the Arduino.

Step 2 Connect VCC to 5V

Connect a red jumper wire from VCC pin on the OLED module to 5V on the Arduino.

Step 3 Connect GND to GND

Connect a black jumper wire from GND on the module to GND on the Arduino.

Step 4 Connect SCL to A5

Next, connect a jumper wire from SCL on the module to A5 on the Arduino.

Step 5 Connect SDA to A4

Then, connect a jumper wire from SDA on the module to A4 on the Arduino.

Step 6 Install SSD1306 Library

In the Arduino IDE, navigate to Tools > Manage Libraries Type 'adafruit ssdd 1306' in the search field. Find the library that says Adafruit SSD1306. Click on Install button next to it. You may be prompted to also install some dependencies, go ahead and install them all.

Step 7 Upload the code

Make sure 'Arduino Uno' is chosen in Boards, and the right COM Port is selected. Navigate to File > Examples > Adafruit SSD1306 > ssd1306_128x32_i2c Upload the following code to the Arduino and watch the display change! Not sure which COM port to choose? If you are using Windows, open up the System window. Once the System window is up, open Device Manager. Look under Ports (COM & LPT). You should see an open port named "Arduino UNO (COMxx)". If there is no COM & LPT section, look under "Other Devices" for "Unknown Device".