New ModelIf your display has a single row header across the top, it is the newer version. For wiring instructions, skip down to "Wiring Up the Newer Version"
Older ModelIf your display has a row of header pins down each side, it is the older model. See "Wiring the OLDER design" below.
The older breakout does not have a 5V level shifter on board, so its a little more complex to wire up!
The OLED module supports 3 methods of communication: 4 wire SPI, 8-bit parallel in 8080 and 6800 format. Since the display is small and we like to save pins, we'll be using the SPI protocol. Our tutorial, wiring and example code is all for SPI so if you need 8-bit, check the datasheets for details on how to wire up for 8-bit parallel.
Plug in the OLED and the '245 chip. The Chip has the notch closest to the OLED. Click on the image to see a large photo if you need help orienting
Starting from the top pin of the OLED (closest to the Adafruit flower) Connect the following OLED pins:
- Common ground - black wire
- 3.3V (red wires from the Arduino)
- SD CS Pin- don't connect (microSD card, we'll get to this later)
- OLED CS Pin - purple wire - 74LVC245 pin #17
- OLED Reset Pin - blue wire - 74LVC245 pin #16
- OLED D/C Pin - yellow wire - 74LVC245 pin #15
- OLED SCLK Pin - orange wire - 74LVC245 pin #14
- OLED DATA Pin - brown - 74LVC245 pin #13
- SD Detect Pin- not used, don't connect. Later on, if you wish, you can use this pin to detect if a card is inserted, it will be shorted to ground when a card is in the holder
Next we'll connect the remaining 74LVC245 pins to the Arduino
- Pin #1 goes to 3.3V (red wire)
- Purple wire - goes to Digital #10
- Blue wire - goes to Digital #9
- Yellow wire - goes to Digital #8
- Orange wire - goes to Digital #13
- Brown wires - goes to Digital #11
- Connect to common ground
Then connect pin #20 of the 74LVC245 to 3.3V and pin #19 to Ground.
Digital #12 isn't used yet (we'll connect this to the SD card later
The updated 5v ready version of this display includes on-board level-shifting. So the 74LVC245 chip is not required and the wiring is much simpler! For the level shifter we use the CD74HC4050 which has a typical propagation delay of ~10ns
The full pin names are marked on the back of the board, but there are abbreviations on the front to help identify pins when it is plugged into the breadboard. The chart below lists the full pin name, the abbreviated name (in parentheses) and the Arduino pin name to connect it to. Wire colors are as shown in the photo.
- GND (G) - Gnd (Black Wire)
- VCC (+) - 5v (Red Wire)
- SDCS (SC) - skip
- OCS (OC) - Digital #10 (Orange Wire)
- RST (R) - Digital #9 (Green Wire)
- D/C (DC) - Digital #8 (Brown Wire)
- SCK (CK) - Digital #13 (White Wire)
- MOSI (SI) - Digital #11 (Blue Wire)
- MISO (SO) - skip
- CD (CD) - skip
Now we can run the test software on the Arduino. We'll need to download the library first and install it
Three libraries need to be installed using the Arduino Library Manager…this is the preferred and modern way. From the Arduino “Sketch” menu, select “Include Library” then “Manage Libraries…”
Type “gfx” in the search field to quickly find the first library — Adafruit_GFX:
Repeat the search and install steps, looking for the Adafruit_ZeroDMA and Adafruit_SSD1331 libraries.
After you restart, you should be able to select File→Examples→Adafruit_SSD1331→test - this is the example sketch that just tests the display by drawing text and shapes. Upload the sketch and you should see the following:
For a detailed tutorial on the Adafruit GFX library, including all the functions available please visit the GFX tutorial page