Tag Archives: I2C

Using the SSD1306 OLED With an Arduino

In this Video Tutorial we show you how to incorporate the SSD1306 OLED into your Arduino project. This is a versatile, low power display that makes it easy for you to incorporate a nice display into your Arduino projects. For this project, we connect the OLED via I2C. The schematic for our project is presented below:

SSD1306 OLED
SSD1306 OLED

Our physical build looked like this:

I2C SSD1306 OLED

The video above shows in depth description of the code development, but for your convenience, we include the code below.

 

Scan Arduino to Find I2C Addresses

I2C SSD1306 OLED

A challenge in many Arduino projects is that it can be difficult to get I2C components working properly. Many times the libraries and demonstration code indicate a certain I2C address for the component, but the Arduino is unable to find the component at that Address. This can be a challenge, because often times we might not have the exact same version of the component that is assumed in the libraries and code. A perfect example of this are the SSD1306 OLED displays. Many of the components look identical, but they can have different I2C addresses. In order to overcome this challenge, the following code allows you to scan your I2C Bus, and list the address of all the components found. Simply attach the component as instructed in the component documentation. Then run the following code. It will list the address of the I2C components it finds. Then you can edit the sample code to use the proper address. Enjoy!

 

Library for I2C Connection of the LCD1602 to the Raspberry PI


This lesson shows how to connect an LCD1602 to a Raspberry Pi using only 4 wires by I2C. You will need to copy the code below, and create a program called LCD1602.py, and save it in the same folder your main python programs are in.