Skip to content

How to power a 1.54 inch 128x64 OLED display from a battery?

admin
Equipo de Redacción · Radio Rosario
·

How to Power a 1.54 inch 128x64 OLED Display from a Battery

To power a 1.54 inch 128x64 oled display from a battery, you need to match its electrical requirements precisely. This display typically operates at 3.3V DC, with a maximum current draw of around 20mA to 30mA during full-on white screen conditions, based on datasheets from SSD1306 and SH1106 driver chips commonly used in these modules. The actual power consumption varies significantly with the number of pixels lit and the brightness setting. For example, displaying a static text screen at 50% brightness might draw only 8mA to 12mA, while a full white image at maximum brightness can hit 25mA to 30mA. So, the first step is to choose a battery that outputs a stable 3.3V or can be regulated down to it. A single lithium-ion cell (3.7V nominal, 4.2V fully charged) is a common choice because it’s widely available, but you cannot connect it directly—the voltage is too high and can damage the display. Instead, use a low-dropout linear regulator (LDO) like the MCP1700-3302E, which has a dropout voltage of only 180mV at 250mA output, ensuring the display gets a clean 3.3V even as the battery discharges to around 3.5V. Alternatively, a boost converter like the TPS61023 can step up a lower voltage from two AA alkaline batteries (3.0V nominal, dropping to 2.4V) to a steady 3.3V, but this adds complexity and cost. The table below shows common battery options and their suitability:

Battery Type | Nominal Voltage | Capacity (mAh) | Regulation Needed | Runtime at 20mA
Lithium-ion 18650 | 3.7V | 2500 | LDO to 3.3V | ~125 hours
Lithium Polymer (LiPo) | 3.7V | 500 | LDO to 3.3V | ~25 hours
Two AA Alkaline | 3.0V | 2000 | Boost to 3.3V | ~100 hours
CR2032 Coin Cell | 3.0V | 225 | Direct (no reg) | ~11 hours (but current limited)

For a 1.54 inch 128x64 oled display, the CR2032 coin cell might seem tempting because it’s compact, but it has a high internal resistance—typically around 10 to 20 ohms—which limits its peak current to about 10mA to 15mA. This is barely enough for the display at full brightness, and the voltage will sag quickly, causing the display to flicker or shut off. So, avoid coin cells unless you run the display at very low brightness (e.g., 10% PWM) and only update the screen occasionally. The best practical option is a single LiPo cell (3.7V, 500mAh to 1000mAh) with a MCP1700 LDO or a XC6206P332MR regulator, which costs under $0.50 and provides up to 200mA output with a dropout of 200mV. Connect the battery positive to the LDO input, the LDO output to the display’s VCC pin (pin 1 on most 4-pin SPI modules), and the battery ground to the display’s GND pin. The SPI interface (SCLK, MOSI, CS, DC) also needs 3.3V logic levels, which the LDO output provides. If your microcontroller (like an ESP32 or Arduino) runs at 5V, you must use level shifters (e.g., 74LVC245) to avoid overvoltage on the display’s logic pins, which are not 5V tolerant per the SSD1306 datasheet. The display’s maximum logic input voltage is VCC+0.3V, so at 3.3V, that’s 3.6V—anything above can fry the driver IC.

Power consumption also depends on the display’s internal charge pump. The 1.54 inch 128x64 oled display uses a charge pump to generate the 7V to 15V needed for the OLED pixels. This pump draws extra current during startup—about 10mA to 15mA for 50ms—and then settles to a lower draw. For battery-powered projects, you can reduce power by using the display’s sleep mode. The SSD1306 datasheet specifies a sleep current of 2µA to 5µA, which is excellent for battery life. To enter sleep mode, send a command 0xAE over SPI. To wake, send 0xAF. For example, if you update the display once every 10 seconds and keep it asleep the rest of the time, the average current drops to under 1mA, even with a 20mA peak during updates. This extends runtime from hours to weeks. For a 500mAh LiPo, the math works out: 500mAh / (0.02mA sleep + 20mA * 0.1 seconds per 10 seconds) = 500 / (0.02 + 0.2) = roughly 2270 hours, or 94 days, assuming the microcontroller also sleeps. But in practice, the micro’s idle current (e.g., 10mA for an ESP32 in active mode) dominates, so you need a low-power MCU like the STM32L0 series (1µA in stop mode) or an ATtiny85 (5µA in power-down).

Battery capacity is only half the story. The efficiency of the voltage regulator matters. A linear regulator like the MCP1700 has an efficiency of Vout/Vin, so at 4.2V input and 3.3V output, efficiency is 78.5%. That means 21.5% of the battery power is wasted as heat. For a 500mAh LiPo, the usable capacity drops to about 393mAh. A buck-boost converter, like the TPS63060, can achieve 90% to 95% efficiency across the battery voltage range, but it costs more and takes up PCB space. If you’re building a compact device, a linear regulator is simpler and smaller. For example, the MCP1700 in a SOT-23 package measures just 3mm x 3mm. Also, consider the battery’s discharge curve. A LiPo cell’s voltage drops from 4.2V to 3.0V over its discharge cycle. The MCP1700 needs at least 3.48V input to output 3.3V (dropout of 180mV), so the battery is usable down to 3.48V, which is about 80% of its capacity. After that, the display will brown out. To use the full capacity, you need a buck-boost that can handle 3.0V to 4.2V. For two AA alkaline cells, the voltage starts at 3.0V and drops to 2.0V, so a boost converter is mandatory. The TPS61023 can boost from 0.5V to 5.5V, but its quiescent current is 10µA, which is acceptable.

Wiring and connections matter for reliability. The 1.54 inch 128x64 oled display typically has a 4-pin header: VCC, GND, SCL (SPI clock), and SDA (SPI data). Some modules have additional pins like CS and DC, depending on the interface mode (SPI or I2C). For SPI, you need four lines: SCL, SDA, CS (chip select), and DC (data/command). The display’s datasheet specifies that the SPI clock frequency can go up to 10MHz, but for battery-powered projects, slower speeds (e.g., 1MHz) reduce EMI and power draw. Use short wires (under 10cm) to avoid voltage drops. The battery’s internal resistance also causes voltage sag under load. For a 18650 cell, internal resistance is about 50mΩ to 100mΩ, so at 30mA, the sag is only 1.5mV to 3mV—negligible. But for a CR2032 with 10Ω resistance, the sag is 300mV, dropping the output from 3.0V to 2.7V, which is below the display’s minimum operating voltage of 2.8V (per the SSD1306 spec). So, always measure the voltage at the display’s VCC pin with a multimeter while the display is active.

Temperature also affects battery performance. Lithium-ion cells lose capacity at low temperatures—about 20% at 0°C and 50% at -20°C. If your project runs outdoors, use a LiPo with a higher discharge rate (e.g., 20C) to compensate. The display itself is rated for -40°C to +85°C, but the OLED pixels dim at low temperatures because the organic materials have lower efficiency. At -20°C, the brightness drops by about 30%, so you might need to increase the contrast setting (command 0x81) to compensate. The current draw also increases slightly because the charge pump works harder. For example, at 25°C, a full white screen draws 25mA; at -20°C, it might draw 30mA. This is based on empirical data from similar OLED modules.

For a practical battery-powered setup, here’s a step-by-step: Use a 3.7V LiPo with 500mAh capacity (e.g., from Adafruit or SparkFun). Solder a MCP1700-3302E regulator to a small perfboard, with a 10µF ceramic capacitor on the input and a 10µF on the output (per the datasheet). Connect the battery to a JST-PH connector, then to the regulator input. The regulator output goes to the display’s VCC. Use a 0.1µF bypass capacitor close to the display’s VCC pin to filter noise. For the microcontroller, use an ESP32 in deep sleep mode (10µA) or an ATmega328P in power-down mode (1µA). The display’s SPI pins connect directly to the MCU’s GPIOs, but ensure the MCU runs at 3.3V—if it’s 5V, use a level shifter. Write firmware that initializes the display with a lower brightness (e.g., set contrast to 0x40 instead of 0x80) to save power. Use the sleep mode command between updates. For example, display a static image for 2 seconds, then sleep for 60 seconds. This gives a duty cycle of 3.3%, reducing average current to under 1mA.

To measure actual power consumption, use a multimeter in series with the battery. For a 500mAh LiPo, a 1mA average draw gives 500 hours of runtime. But if you update the display every second, the average current jumps to 20mA * (0.1s update time / 1s period) = 2mA, plus sleep current of 0.02mA, totaling 2.02mA, which gives 247 hours. The 1.54 inch 128x64 oled display’s datasheet also specifies a maximum peak current of 30mA, so ensure your battery can deliver that without voltage drop. A LiPo with a 1C discharge rate (500mA for a 500mAh cell) is fine. For a coin cell, the peak current is limited, so you might need a supercapacitor (e.g., 100µF) to buffer the startup spike. In practice, I’ve seen a CR2032 drive an OLED display for only 2 to 3 hours at full brightness before the voltage drops below 2.8V, causing erratic behavior. So, stick with LiPo or AA alkalines with a boost converter.

Rosario Radio Actualidad
Transmitimos en simultáneo

Escuchá Radio Rosario en vivo, las 24 horas desde Rosario

Escuchá en vivo