Pocket sized ESP32 display board with 300µW Always On Display
While the battery can power the handheld for only a few hours, I wanted to include a standby mode that utilizes the low power display. This way the device would be usable as a clock and calendar. There are a few things necessary to keep the display active and the battery life long. Although the memory display does not need constant refreshing over SPI, a >1Hz clock signal must be supplied to its EXTCOMM pin. Otherwise the screen shows burn-in. This means that part of the ESP32 needs to remain active during standby mode.
At 70-200mA, the ESP32 can be power-hungry with its dual cores and WiFi modem. But not everyone knows that it has some nice power saving features. In sleep mode the ESP32's main cores are powered down, reducing the current to only 10µA. During this, the internal Real Time Clock controller is still active. The RTC itself can't do much, but it can wake the ESP32's third core, the ULP coprocessor. This Ultra Low Power processor can do basic tasks like checking sensors or reading and writing pin states while only needing ~150µA. Exactly what it need for the 1Hz signal. The ULP can be woken up periodically by the RTC using:
ulp_set_wakeup_period(0, 1000 * 1000);
For the 1Hz signal the ULP coprocessor has to be programmed in assembler. Luckily Espressif has an example for a blinking LED that does exactly what I wanted:
The ESP32 can activated by different wakeup sources. For this project GPIO interrupts are needed as the device should wake up with the press of a button. The two external wakeups are ext0 and ext1. While ext0 can only be assigned to one pin, ext1 can be assigned to a map of different pins. There are a few things to consider when using the ULP core: Only the pins that can be accessed by the RTC can be used (RTC GPIO). Also I found that the internal pullup/pulldown setting are not reliable. I used hardware pulldowns for my design.
// This wakes the ESP32 with buttons on GPIO32 & GPIO33 esp_sleep_enable_ext1_wakeup(BUTTON_PIN_BITMASK,ESP_EXT1_WAKEUP_ANY_HIGH);
I want to update the time every full minute. This can't be done without waking the ESP32 for a short time:
esp_sleep_enable_timer_wakeup((60-now.tm_sec) * 1000000);
With the standby mode configured, the ES32 should only draw a few µA with short spikes when the ULP or the main cores are woken up. But there are other components on the board that need to be powered as well. The display itself draws another 10µA but also needs a 5V supply. As the LiPo battery is only at 3.7V a DC-DC converter is needed. After some searching around I found the MCP1640 from Microchip. It's a boost regulator with a quiescent current of just 19µA. The IC is small and only needs a couple of external parts. The 3.3V power supply for the ESP32 was a bigger problem. It turns out that it is hard to find a regulator with a high output current but small quiescent current, that can also be hand soldered. I ended up with the AP2112K, which can supply 600mA with a quiescent current of 55µA.
Once I had the actual PCB, testing the real power consumption was also tricky. The shunt resistance for the µA-range on most multimeters is too high to power up the ESP32. And constantly switching between ranges or swapping wires was to tedious. A user on stackexchange came up with a clever solution (https://electronics.stackexchange.com/questions/340330/measure-wide-range-of-current-800-%c2%b5a-1-5-a/340353#340353):
A diode in parallel to the multimeter will limit the voltage drop when the current is high. In sleep mode the diode barely lets current though. This way I was able to measure the power consumption in sleep mode conveniently with my 20$ multimeter.
With the ESP32 in sleep mode the current is at around 97µA. 59µA are caused by the 3.3V power...Read more »
Earlier this year Panic, the software studio behind the Untitled Goose Game, introduced their Playdate console. It's a retro handheld device with a monochrome display and a crank as an input device: https://play.date/. I really liked the simplicity of it and decided to make something similar. It was also a chance to improve on my 2016 Chronio Smartwatch concept which features a similar display but only an ATmega328.
The display board is using the same 2.7" Sharp memory display as the Playdate. These displays only consume a few µAs and because of their in-pixel-memory they don't need constant refreshing. They are also readably under direct sunlight with no need for backlighting.
As its brains the board is using an ESP32. The dual core chip has enough processing power to drive the display while also featuring WiFi and Bluetooth. And it has a ULP co-processor for low power applications. I decided to include a small 5-way joystick and two buttons to enable simple games. As I wanted the device to work as a bare PCB without 3D-printed parts, a mechanical crank was out of the question.
The size of the needed PCB is defined by the display and buttons. With the display on the front, the ESP32 and all other components fit nicely on the back of the device. A milled slot enables the display flex cable to go through the PCB and into its connector.
I was able to reuse some of the parts and circuits from my ESP32 robot but it was challenging to keep the power consumption to a minimum. More on that in a separate project log.