-
Notifications
You must be signed in to change notification settings - Fork 13
SSD1306 based OLED connected to Arduino
A few weeks ago I bought two of these cheap "I2C OLED 0.96 inch displays" on eBay. Since it took me a while to get them up and running, i want to share my findings with you. I will give three example sketches, each using a different library (Adafruit, u8g and smart components).
![OLED connected to Arduino](https://github.com/pacodelgado/arduino/raw/master/images/ssd1306.jpg)
![Back side of OLED](https://github.com/pacodelgado/arduino/raw/master/images/ssd13006_back.jpg)
Although it was sold as an I2C display, it turned out that it operates as an SPI device by default. If you look at the back side, you can see that it is in 4-wire SPI mode. I2C operation will be researched in another post later.
- Display technology: OLED
- Size: 0.96"
- Resolution: 128x64
- Protocol: SPI
- Power supply range: 3V-5V
- Chipset: SSD1306, Datasheet
The display has the following pins: GND, VCC, D0, D1, RES, DC, CS. Since pin names are often named differently, i will give an overview of commonly used names for refernce:
Pin | Alternate Names | Description |
---|---|---|
VCC | Power supply | |
GND | Ground | |
D0 | SCL,CLK,SCK | Clock |
D1 | SDA,MOSI | Data |
RES | RST,RESET | Rest |
DC | A0 | Data/Command |
CS | Chip Select |
Wiring used in the Sketch:
Display | Arduino Pin |
---|---|
D0 | 12 |
D1 | 11 |
CS | 8 |
DC | 9 |
RES | 10 |
- Sketch: https://github.com/pacodelgado/arduino/tree/master/ssd1306_sample_adafruit
- Libraries: https://github.com/adafruit/Adafruit_SSD1306 and https://github.com/adafruit/Adafruit-GFX-Library
The sketch uses the same wiring as in the Adafruit example.
Wiring for sketch:
Display | Arduino Pin |
---|---|
D0 | 10 |
D1 | 9 |
CS | GND |
DC | 11 |
RES | 13 |
- Visit homepage
- The sketch can be found on this side: Smart Componets OLED sketch