OLED
Interfacing SSD1306 0.96" OLED with Raspberry Pi
What is the SSD1306 0.96" OLED?
SSD1306 0.96" OLED practical reference
The SSD1306 drives a 0.96-inch monochrome OLED panel at 128x64 pixels over I2C (an SPI variant also exists, but the 4-pin I2C module is what most people reach for first). Unlike character LCDs, every pixel is individually addressable, so you can draw shapes, plot graphs, show custom fonts and icons, and scroll bitmap animations — not just fixed-width text.
Because OLED pixels are individually lit rather than backlit through a filter, contrast is excellent and there's no potentiometer to fiddle with like on character LCDs. The tradeoff is a bit more setup: you need both Adafruit's GFX library (the generic drawing engine) and the SSD1306-specific driver on top of it, and the API is graphics-oriented (draw calls + a buffer you flush to the screen) rather than the simple print() calls a character LCD uses.
Key specifications
- Display: 128 × 64 pixels, monochrome OLED
- Operating voltage: 3.3V – 5V (most breakout modules have an onboard regulator)
- Interface: I2C (this module); SPI variants also exist on other boards
- I2C address: 0x3C default on most modules, 0x3D on some — scan to confirm
- Viewing technology: Self-emissive OLED — high contrast, no backlight, wide viewing angle
- Driver + graphics library: Requires Adafruit GFX (drawing engine) plus the Adafruit SSD1306 driver on top of it
Pinout and connection notes
Pin order varies more between SSD1306 modules than most parts — some print GND/VCC/SCL/SDA left to right, others VCC/GND/SCL/SDA. Always check the silkscreen labels on your specific board rather than assuming pin position. Unlike the character-LCD backpacks, most SSD1306 breakouts genuinely work fine at 3.3V, making them an easier fit for ESP32/Pi/STM32 without the 5V-rail workarounds those LCDs need.
- GND: Ground
- VCC: Power, 3.3V–5V DC depending on the module's onboard regulator
- SCL: I2C clock line
- SDA: I2C data line
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up SSD1306 0.96" OLED with Raspberry Pi
Library
Adafruit CircuitPython SSD1306 by Adafruit
sudo raspi-config # Interface Options -> I2C -> Enable, then reboot pip3 install adafruit-circuitpython-ssd1306 pillow
Wiring
| Component pin | Raspberry Pi pin | Note |
|---|---|---|
| VCC | Pin 1 (3.3V) | Most SSD1306 modules run fine directly off 3.3V. |
| GND | Pin 6 (GND) | |
| SDA | GPIO2 (Pin 3) | Pi's dedicated hardware I2C data pin. |
| SCL | GPIO3 (Pin 5) | Pi's dedicated hardware I2C clock pin. |
Swipe sideways to see every column →
- Unlike the Arduino/ESP32 libraries, CircuitPython's SSD1306 driver works through PIL (Pillow) — you draw onto a regular image object, then push the whole image to the display with display.image() + display.show().
- Same 0x3C-vs-0x3D address caveat as the other boards; pass addr=0x3D if yours doesn't initialize.
- Enable I2C in raspi-config first, then confirm the display shows up with
i2cdetect -y 1before troubleshooting your code.
Related Components
Related Guides & Projects
Raspberry Pi Pico W and Pico 2 W: Install MicroPython with Thonny or UF2
Hold BOOTSEL, drag the correct UF2 file, open the REPL and blink the onboard LED. Includes the Pico vs Pico W vs Pico 2 W firmware differences and what to do when the drive does not appear.
Raspberry Pi Pico W Web Server in MicroPython: Control an LED and Read a Sensor
Connect the Pico W to WiFi, serve a responsive control page, switch an LED and display the onboard temperature or an external sensor, with timeouts and reconnect handling.
Raspberry Pi Pico Oscilloscope with MicroPython
Convert a Raspberry Pi Pico into a basic 500 kSPS oscilloscope using its 12-bit ADC and MicroPython. Displays waveforms on an SSD1306 OLED or streams samples over USB serial to a Python plotter on your PC.
Self-Hosted Nextcloud NAS on Raspberry Pi 4
Build a private, durable Nextcloud NAS on a Raspberry Pi 4 -- SSD boot instead of a failure-prone SD card, Docker Compose with Redis caching, Tailscale for remote access with zero ports forwarded, and an automated backup strategy that actually runs.