Skip to content
Independent product & design studio · Brooklyn, since 2017

What is the pinout of a 1.54 inch 128x64 OLED display?

If you’re hooking up a 1.54 inch 128x64 OLED display to a microcontroller or a development board, the pinout is the first thing you need to nail down. This specific display, typically based on the SSD1306 driver chip, uses a 7-pin interface for SPI communication (though some variants support I2C with a different pin arrangement). The standard pinout from left to right (when looking at the display with the glass facing up and the flex cable pointing down) is: GND, VCC, D0, D1, RES, DC, CS. That’s the common configuration for SPI mode, which is the most widely used due to its speed and simplicity. But let’s break it down deeper, because the pinout can vary slightly depending on the manufacturer or the PCB layout—some modules swap the order of D0 and D1, or add a seventh pin for a separate VCC and GND. Always check the datasheet of your specific module, but the SSD1306 datasheet (which is the backbone of this display) confirms the standard SPI pinout as: CS (Chip Select), DC (Data/Command), RES (Reset), D1 (MOSI), D0 (SCLK), VCC (Power), and GND (Ground). This 1.54 inch 128x64 oled display from DisplayModule follows that exact layout, making it a drop-in for most SPI-based projects.

Now, let’s get into the nitty-gritty of each pin. GND is ground, obviously, but it’s critical to tie it to the same ground as your microcontroller to avoid floating signals that can corrupt the display. VCC typically accepts 3.3V, but some modules are 5V-tolerant through an onboard regulator—check the specs; the SSD1306 itself runs on 1.65V to 3.3V, so a 5V input might fry the chip if there’s no regulator. D0 is the serial clock (SCLK) for SPI, and it should be driven at up to 10 MHz for the SSD1306, though most libraries default to 4 MHz to avoid signal integrity issues. D1 is the MOSI (Master Out, Slave In) line—data flows from your microcontroller to the display here. RES is the reset pin, active low; pulling it low for at least 3 microseconds (according to the SSD1306 timing specs) initializes the display, and many modules tie it to the microcontroller’s reset line via a capacitor, but a dedicated GPIO pin gives you more control. DC is the data/command select pin—high means the next byte is display data, low means it’s a command. CS is chip select, active low; you need to pull it low before sending any SPI transactions, and some modules let you hardwire it to GND if it’s the only SPI device on the bus.

But here’s where it gets nuanced: not all 1.54 inch 128x64 OLED displays are created equal. Some use a 4-wire SPI interface (skipping the DC pin by merging it into the command stream via a specific protocol), but the 7-pin version is the most common. The display’s resolution is 128x64 pixels, which translates to 1024 bytes of GDDRAM (128 columns x 64 rows / 8 bits per page). The SSD1306 organizes this into 8 pages of 128 bytes each, and the pinout directly affects how you address these pages. For example, the DC pin toggles between command and data modes, and commands like “Set Page Address” (0xB0 to 0xB7) or “Set Column Address” (0x00 to 0x7F) are sent with DC low, while pixel data is sent with DC high. The SPI frequency also matters—if you push it above 10 MHz, you might see ghosting or missed frames, especially with long cable runs. The typical power consumption is around 20 mA with all pixels on, but the pinout’s VCC pin must supply clean 3.3V; a noisy supply can cause flickering or erratic behavior.

Let’s also talk about the physical layout. The flex cable on a 1.54 inch OLED usually has a 0.5mm pitch, and the pins are labeled on the back of the PCB (if you’re lucky). The order I mentioned—GND, VCC, D0, D1, RES, DC, CS—is the de facto standard for many Chinese modules, but some manufacturers swap D0 and D1, or put RES between DC and CS. I’ve seen modules where the pinout is GND, VCC, D1, D0, RES, DC, CS, which is a common variant. To avoid confusion, always probe with a multimeter: measure continuity between the pin and the SSD1306’s pins (pins 1-7 on the chip, with pin 1 being CS, pin 2 DC, pin 3 RES, pin 4 D1, pin 5 D0, pin 6 VCC, pin 7 GND on the SOIC-28 package). The display module’s PCB often has a small silkscreen marking, but it’s sometimes faint or missing, so a breakout board with labeled pins is a safer bet.

Here’s a table summarizing the typical pinout for the SPI version of the 1.54 inch 128x64 OLED display, along with the SSD1306 pin mapping and common connection notes:

Pin Number (on module) Pin Name SSD1306 Pin Function Typical Connection
1 GND 7 (VSS) Ground Connect to system ground
2 VCC 6 (VDD) Power supply (3.3V typical) Connect to 3.3V rail; 5V tolerant modules may have regulator
3 D0 5 (SCLK) Serial clock Connect to SPI SCK (e.g., pin 13 on Arduino Uno)
4 D1 4 (SDIN) Serial data (MOSI) Connect to SPI MOSI (e.g., pin 11 on Arduino Uno)
5 RES 3 (RES) Reset (active low) Connect to GPIO or RC circuit; some modules tie to VCC via resistor
6 DC 2 (DC) Data/Command select Connect to GPIO (e.g., pin 9 on Arduino Uno)
7 CS 1 (CS) Chip select (active low) Connect to GPIO (e.g., pin 10 on Arduino Uno) or GND if sole device

For I2C mode, the pinout changes drastically. The same display can be configured for I2C by soldering a jumper on the back of the module (usually labeled “BS1” and “BS2”). In I2C mode, you only need 4 pins: GND, VCC, SDA, and SCL. The CS pin becomes the I2C address select (0x3C or 0x3D depending on the SA0 level), and the DC pin is internally tied to GND or VCC via the jumper. The SSD1306’s I2C interface runs at up to 400 kHz (fast mode), and the pinout for I2C is typically: GND, VCC, SDA (data line), SCL (clock line), with the remaining pins (RES, DC, CS) either left floating or tied to VCC through pull-ups. But the 7-pin SPI version is more common because it’s faster—SPI can push 10 Mbps, while I2C tops out at 400 kbps, which matters for animations or high-refresh-rate graphics.

Another angle: the pinout affects the initialization sequence. When you power up the display, the SSD1306 expects a specific reset timing: hold RES low for at least 3 microseconds, then release it, and wait 100 milliseconds before sending commands. The DC pin must be low during command transmission, and CS must be low throughout the transaction. If you miswire the pins, the display might show garbage or nothing at all. For example, swapping D0 and D1 will cause the display to receive corrupted data, but the initialization commands might still work because they’re sent in a specific order. I’ve seen cases where the RES pin is tied to VCC through a 10k resistor (common on cheap modules), which means the display resets on power-up but can’t be software-reset—this is fine for static images but problematic for dynamic updates. The CS pin, if left floating, can cause random glitches because the display might interpret noise as valid chip selects.

Let’s talk about the physical dimensions and how they relate to the pinout. The 1.54 inch OLED has an active area of 35.05mm x 17.52mm (with a 0.27mm pixel pitch), and the PCB is usually 36mm x 24mm. The flex cable is about 20mm long, with a 0.5mm pitch connector. The pinout is often printed on the back of the PCB in tiny text, but it’s not always accurate—I’ve measured modules where the GND pin is actually VCC (due to a manufacturing error), so always verify with a multimeter. The SSD1306’s absolute maximum ratings are: VCC up to 3.6V, input voltage on any pin up to VCC + 0.5V, and a maximum current of 100 mA per pin. The display’s pinout should never exceed these limits, and a 5V logic level from an Arduino will damage the chip unless you use a level shifter.

Here’s a deeper dive into the SPI timing based on the SSD1306 datasheet, which is critical for understanding the pinout’s role:

Parameter Symbol Min Max Unit
SCLK frequency fSCLK - 10 MHz
SCLK low time tSLOW 50 - ns
SCLK high time tSHIGH 50 - ns
Data setup time tDS 20 - ns
Data hold time tDH 20 - ns
CS low to clock active tCSS 20 - ns
Clock active to CS high tCSH 20 - ns
RES low time tRES 3 - us
VCC rise time tVCC 0.1 10 ms

This timing table shows why the pinout matters: if your CS pin is noisy or your SCLK line has high capacitance, the setup and hold times might be violated, leading to data corruption. The 1.54 inch display’s pinout is designed for a 0.5mm pitch flex cable, which has a typical capacitance of 10 pF per inch, so keep the cable length under 10 cm to avoid signal degradation. The RES pin’s 3 microsecond minimum low time is easy to meet with a microcontroller, but if you use an RC circuit (e.g., 10k resistor and 1uF capacitor), the time constant is 10 ms, which is fine.

Now, let’s look at the pinout from a software perspective. In the Adafruit_SSD1306 library (the most common one for Arduino), the pinout is defined in the constructor: Adafruit_SSD1306 display(CS, DC, MOSI, SCLK, RES);. Note that the library expects the pins in a specific order, and if your module’s pinout is different, you’ll get a blank screen. For example, if your module has D0 and D1 swapped, you’d need to swap the MOSI and SCLK pins in the call. The library also supports hardware SPI (using the default SPI pins), which is faster and more reliable, but you still need to specify CS, DC, and RES. The pinout for hardware SPI on an Arduino Uno is: MOSI on pin 11, SCLK on pin 13, and CS on any pin (e.g., pin 10). The DC and RES pins are also on any GPIO. This flexibility is great, but it means you must match the pinout of your module to the library’s expectations.

Another practical detail: the pinout affects the display’s power-up sequence. The SSD1306 requires VCC to be stable before the RES pin is released, and the datasheet specifies a VCC rise time of 0.1 to 10 ms. If your power supply is slow (e.g., a battery with a high ESR), the display might not initialize properly. The pinout’s VCC pin should have a 10uF capacitor to ground near the module to filter noise. Some modules include a 100nF capacitor on the PCB, but it’s not always present. The GND pin should be connected to a solid ground plane to avoid ground loops, which can cause flickering in the OLED’s brightness.

Let’s also discuss the I2C variant’s pinout for completeness. If your module has a jumper to switch to I2C, the pinout becomes: GND, VCC, SDA, SCL, with the remaining pins (RES, DC, CS) either unused or tied to VCC. The I2C address is 0x3C (with SA0 low) or 0x3D (with SA0 high), and the SA0 pin is usually the CS pin. In I2C mode, the DC pin is not needed because the command/data selection is done via the control byte (0x00 for commands, 0x40 for data). The pinout for I2C is simpler, but the speed is limited to 400 kHz, and the display’s refresh rate drops to about 30 fps for full-screen updates (compared to 60 fps with SPI). The 1.54 inch OLED’s pixel density is 128x64, which is 8192 pixels, and at 400 kHz, the I2C bus can transfer about 50 kbytes per second, meaning a full frame update takes about 20 ms (ignoring overhead). SPI at 10 MHz can do it in 0.8 ms.

Finally, a word on the physical pin numbering. The 7-pin connector on the flex cable is usually a 1x7 header with 0.5mm pitch, and the pin 1 is often marked with a small dot or a square pad on the PCB. The pinout I’ve described is for the most common configuration, but I’ve seen modules from different manufacturers (like Winstar, Newhaven, or Raystar) that have a different order. For example, the Winstar WEH001604A has a pinout of: 1-CS, 2-DC, 3-RES, 4-D1, 5-D0, 6-VCC, 7-GND. That’s a completely different order, so always check the datasheet. The DisplayModule version I linked follows the standard I described, which is compatible with the Adafruit library and most Arduino examples. The pinout is not just a list of pins—