Display and HMI

box-keychain: ESP32 E-Paper Keychain

A keychain-sized e-paper display that changes image every 30 minutes and lasts over 20 days on standby

Display and HMI e-paperkeychainlow-powerdisplay ESP32

Official path: https://oshwhub.com/guozhaowen/box-keychain

01 Overview

The box-keychain is a compact e-paper keychain based on the ESP32 family, small enough to attach to your keys. It exploits the low power and static display properties of e-paper to achieve long standby times.

The device refreshes the screen every 30 minutes to show a preset image, suitable as a personal accessory or a subtle notification device. Users can also manually cycle images via a button for interactivity.

Deep sleep current is very low, giving a measured standby time of more than 20 days, so it can be carried daily without frequent charging.

This project is positioned as a DIY or small-batch build, not a commercial product, and does not involve certifications or mass-production optimization.

Unlike typical LCD or OLED screens, e-paper retains its content even when power is removed, so the display does not need to be powered during standby, further reducing power consumption.

The design emphasizes simplicity and reliability; both hardware and software are easy to modify, allowing users to customize image sets and refresh strategies.

02 Hardware

  • MCU: ESP32 family (exact module per schematic, typically ESP32-PICO or ESP32-C3), responsible for controlling the e-paper, handling button input, and entering low-power modes.
  • Display: E-paper panel (typical 1.54" or 2.13", SPI interface, driver IC like SSD1681 or UC8253), static display, content retained without power.
  • Power: 3.7V Li-ion cell (typical 200-400 mAh), regulated to 3.3V via LDO or DC-DC for the ESP32 and panel. Specific regulator IC per schematic.
  • Charging: Micro-USB or Type-C port with a TP4054 or similar charge management IC; charge current set by external resistor.
  • Button: At least one tactile button to wake the device or cycle images, configurable as GPIO interrupt wake.
  • Battery monitoring: Resistor divider network scales battery voltage to ESP32 ADC for low-battery detection.
  • Temperature sensing (optional): NTC thermistor connected to ADC for low-temperature compensation (e-paper refresh may be unreliable in cold conditions).
  • Layout notes: Keep antenna area clear of metal or battery; secure the e-paper flex cable to prevent bending damage.

03 Software flow

1. Flash firmware: Compile and flash using ESP-IDF or Arduino framework, packaging image resources into a Flash partition.

2. Initialize: On boot, initialize SPI peripheral, e-paper driver, and GPIOs; read battery voltage.

3. First display: Read the first preset image from Flash and refresh it to the e-paper.

4. Main loop: Before deep sleep, set RTC timer to wake approximately every 30 minutes.

5. Wake handling: On wake, check if triggered by button; if so, cycle to next image and refresh immediately; otherwise, refresh current image on schedule.

6. Low battery policy: If battery voltage is below threshold, show low-battery icon and extend refresh interval (e.g., 60 minutes) to prolong standby.

7. Error handling: If e-paper refresh fails (e.g., communication error), log error and attempt re-initialization; if persistent, enter deep sleep until next wake.

8. Update images: Update the Flash partition containing images via serial or OTA, without modifying driver code.

04 Core points

Deep sleep current varies across ESP32 variants; verify actual standby current for the chosen module to meet expectations.

E-paper refresh draws significant current (especially full refresh); ensure the power supply can handle transient peaks to avoid voltage drops causing resets.

E-paper driver IC initialization sequences and timings differ by model; do not copy code across variants without consulting the respective datasheet.

Image data must be preprocessed according to the e-paper's pixel format and scan direction, or the display may appear inverted or misaligned.

Low temperatures can slow or fail e-paper refresh; consider adding temperature sensing and compensation logic.

Battery voltage detection requires calibrating the ADC reference and accounting for divider resistor tolerances to avoid false low-battery alerts.

中文

显示与人机

box-keychain:ESP32 墨水屏钥匙扣

一个可挂在钥匙上的墨水屏,每30分钟更换一张图片,可待机20天以上

显示与人机 e-paperkeychainlow-powerdisplay ESP32

官方路径: https://oshwhub.com/guozhaowen/box-keychain

01 项目概述

box-keychain 是一款基于 ESP32 系列芯片的墨水屏钥匙扣,外形小巧,可挂在钥匙链上随身携带。它利用墨水屏的低功耗和静态显示特性,实现超长待机。

设备每 30 分钟自动刷新一次屏幕,显示一张预置图片,适合作为个性挂饰或信息提醒。用户也可以通过按键手动切换图片,增加互动性。

深度睡眠模式下待机电流极低,实测可待机 20 天以上,无需频繁充电,适合日常携带。

本项目定位为个人 DIY 或小批量制作,非商业产品,不涉及认证或量产优化。

与普通 LCD 或 OLED 屏幕不同,墨水屏在断电后仍能保持显示内容,因此待机时无需维持屏幕供电,进一步降低功耗。

整体设计注重简单可靠,硬件和软件均易于修改,方便用户自定义图片集和刷新策略。

02 项目硬件描述

  • 主控: ESP32 系列(具体型号见原理图,通常为 ESP32-PICO 或 ESP32-C3 模组),负责控制墨水屏、处理按键输入和进入低功耗模式。
  • 显示: 墨水屏(典型 1.54 英寸或 2.13 英寸,SPI 接口,驱动 IC 如 SSD1681 或 UC8253),静态显示,断电不丢失内容。
  • 供电: 3.7V 锂电池(典型 200-400mAh),经 LDO 或 DC-DC 降至 3.3V 给 ESP32 和屏幕供电。具体稳压芯片见原理图。
  • 充电: Micro-USB 或 Type-C 接口,配 TP4054 或类似充电管理芯片,充电电流由外部电阻设定。
  • 按键: 至少一个轻触按键,用于唤醒设备或切换图片,可配置为 GPIO 中断唤醒。
  • 电池监测: 电阻分压网络将电池电压分压后接入 ESP32 ADC,用于低电量检测。
  • 温度检测(可选): NTC 热敏电阻连接 ADC,用于低温补偿(墨水屏在低温下刷新可能异常)。
  • 布局注意: 天线区域需净空,避免被金属外壳或电池遮挡;墨水屏排线需固定,防止弯折损坏。

03 项目软件流程描述

1. 烧录固件:使用 ESP-IDF 或 Arduino 框架编译并烧录,将图片资源打包进 Flash 分区。

2. 初始化:上电后初始化 SPI 外设、墨水屏驱动和 GPIO,读取电池电压。

3. 首次显示:将第一张预置图片从 Flash 读取并刷新到墨水屏。

4. 主循环:进入深度睡眠前设置 RTC 定时器,约 30 分钟唤醒一次。

5. 唤醒处理:唤醒后检查是否因按键触发,若是则切换图片并立即刷新;否则按定时刷新当前图片。

6. 低电量策略:若电池电压低于阈值,显示低电量图标,并延长刷新间隔(如 60 分钟),以延长待机。

7. 错误处理:若墨水屏刷新失败(如通信错误),记录错误并尝试重新初始化,必要时进入深度睡眠等待下次唤醒。

8. 更新图片:通过串口或 OTA 更新 Flash 分区中的图片集,无需修改驱动代码。

04 项目核心点

ESP32 系列芯片的深度睡眠电流因型号而异,选择时需确认实际待机电流,避免超出预期。

墨水屏刷新时电流较大(尤其是全屏刷新),需确保电源能提供瞬时峰值电流,避免电压跌落导致复位。

墨水屏驱动 IC 的初始化序列和时序因型号而异,不可直接跨型号复制代码,需参考对应数据手册。

图片数据需按墨水屏的像素格式和扫描方向预处理,否则显示可能颠倒或错位。

低温环境下墨水屏刷新可能变慢或失败,必要时加入温度检测和补偿逻辑。

电池电压检测需校准 ADC 参考电压,并考虑分压电阻的误差,避免误判低电量。