spezifisches

GT-ACQI-22WO digital alarm clock hack

hack clock esp32

Nowadays when opening a cheap clock you will probably be greeted by the dreaded epoxy blob with a lot of traces going from it to the display or LEDs. Thankfully the designers of the Globaltronics GT-ACQI-22WO used a discrete display controller and no epoxy at all, so we have an easy starting point for our soon to be ESP32-enhanced clock! (As soon as I saw this, I went back to the store and bought the other one they had left in the clearance sale.)

A black clock display with white 7-segment LEDs showing 19:35 and 27°C summer temperatures next to a breadboard.
Clock display attached to ESP32 board, RTC and temperature/humidity sensor

Display

The display board named DIY-1941LED pretty much contains the whole clock: The main PCB has white LEDs on its front-facing side which are separated by plastic dividers. They shine through a mask to form the displayed symbols and segments.

All display segments light up at the same time showing PM, alarm, snooze, etc. symbols
Here I shone a flashlight through the mask

The back side of the main PCB has an unidentified sanded off microcontroller, a display controller (AIP1640), a passive buzzer, a coin cell holder to keep the RTC running, and connections from the power supply (flex cable socket) and to the button PCB (white/red cables).

A PCB with white solder resist on a blue mat
Display PCB (from left to right): Buzzer, CR2032 cell holder, display controller, 32 kHz crystal, unidentified microcontroller, display/power supply connector

All the LEDs (except one) are connected to the display controller, which is a Wuxi I-core Elec AiP1640 (English/Chinese datasheet). It can control up to 16 grids with 8 LEDs each (7 segments + 1 decimal dot) - on this board only the first 11 grids are used.

It has an SPI interface and luckily I read somewhere that it's compatible with the TM1640 which is pretty common and supported in some libraries. This was almost plug & play. By going through all the segments and dots in sequence (controlled by an ESP32) I got this mapping between grid/segments and the display:

A composite image showing the display's front with a lot of white 0603 LEDs and a sheet of paper showing which grids on the display controller they are connected to
Display PCB front. Labels corresponding to TM1640 datasheet. Within a 'grid' the segments are in the usual order for 7-segment displays except for the segments marked above. (Bolt LED not shown on paper.)

I mentioned one LED before that isn't connected to the display controller. This is the status indicator of the wireless charging IC, which is a bolt symbol that is located below the "zZ" snooze indicator. The bolt LED is connected between Ground and the middle pin (labelled "LED") of the 5 pin flex cable that goes to the power supply board. Its 1 kΩ series resistor sits on the power board and I think it's supplied by the charging IC's internal (around) 5 V regulator.

One notable mention is the transistor which drives the passive buzzer, located below the microcontroller. This means we can just hook it up directly to our ESP32.

Another less notable mention for me is the input for a thermistor because I will not be using it. Anyway the thermistor's 2 pins are connected with the 5 pin flex cable, go through a voltage divider and to the microcontroller.

Buttons

The button PCB with the label DIY-1941K contains 6 push buttons which are arranged into a small scan matrix. I traced the connections of the PCB from photos and this is what I came up with:

An elongated green PCB with 6 buttons on it
Button PCB with crudely hand-drawn markings. Lines with same color are connected.

Which leads to the following schematic:

See caption
Button scan matrix schematic

Power Supply

The power supply board has labels DIY-1941C/LZX16-1001 V1.1 and does multiple jobs:

  1. A thermistor is located at the back of the clock which is connected by two wires to the supply board.
  2. On the back it has connections for a USB-C power input and a USB-A (5V/2A) power output.
  3. It controls the Qi wireless charging coil near the top of the clock.
  4. It connects to the display's main board with a 5 pin flex cable.
A green PCB with some big capacitors and an IC in the middle
Power Supply PCB while still connected to its big coil inside the case.

The easiest part are the 2 pins of the thermistor which are simply routed through to 2 pins of the display connector. These pins are labelled RT+/-.

The USB-C's VBUS line goes to the wireless charging IC and to a switching regulator. I think there is some USB Power Delivery thing going on here where the input voltage isn't always 5V. The D+/D- data lines are connected to the IC but I didn't look into that further.

The switching regulator puts out 5 V which go to the USB-A socket and to the display connector.

Similar image to the previous one but with labels
Labelled power supply board. The bottom edge is located at the back of the clock.

Most of the rest of the PCB is dedicated to the wireless charging feature around an Injoinic IP6806 (datasheet). It looks pretty similar to the Typical Application Schematic in section 6 of the datasheet. Except for the 3 possible LED outputs of which only LED1 is used which goes to the display connector as we already saw above.

Side note: The IP6806 has a thermal shutdown feature (datasheet, p. 8) using an NTC. But they put the NTC next to the display connector on the PCB in a seemingly useless position. I would have assumed that it should be measuring the parts with the most power losses like probably the H bridge in the charging IC or the charging coil.

Hardware Modifications

The goal of my modifications is to control the display from a custom ESP32 board so I can get features like NTP time synchronization and better display modes (e.g. night mode, events from and temperature/humidity reporting to HomeAssistant).

Also I want to remove wireless charging because I don't need it and in fact think it's quite annoying that the bolt symbol LED keeps blinking if I put something on top of the clock because of the foreign object detection.

Display Board Mods

Some orange cables are now connected to various parts of the display board
Modified display PCB with attached cables going to my ESP board (click to make larger)
Showing the whole display assembly with two attached bundles of custom cables.
Display assembly with crimped connectors.

Power Supply Board Mods

The power supply has also been graced by orange cables.
Power supply modifications.

Here a close-up of the mods:

Some markings showing which parts on the PCB need to be changed.
Power supply modifications, close-up.

ESP32 Board

Here is the schematic of my perfboard:

See caption
ESP32 perfboard schematic

The board looks like this:

See caption
Power supply (left), ESP board (right), and display unit (above). You can see the thin twisted orange cable between supply and ESP board for USB.

It consists of a bunch of standard components:

You can find KiCAD schematics in my repository.

A U-shaped plastic bracket next to a perfboard, connected by a small black screw
ESP perfboard attached to plastic frame.

I screwed the perfboard to the plastic frame holding the power supply board using a self-tapping M2 screw. This is already pretty stable but for good measure I put in some foam to rest the right side of the board on.

A look inside the opened clock case in plastic with wood optic
The power supply board and ESP board are now installed inside the case.

The black plastic frame looks a bit twisted on the picture but it's actually held in place really solidly through the round pin which creates a bridge to the display unit when put together.

A look inside the opened case with a small blue board attached to the back
AHT21 temperature/humidity sensor board is sitting in the back of the case. I taped the wires of the stock thermistors to the side.

For the temperature/humidity sensor I made a small cutout at the back so it touches outside air. That board is also attached using a self-tapping M2 screw in an existing hole.

Backside of clock showing USB-C and USB-A sockets and screw holes.
Backside of the clock. Note the small square cutout with the AHT21 sensor.

Software

I used ESPHome for this project to simplify integration into HomeAssistant. realthk noted in an issue that he implemented TM1640 support based on ESPHome's TM1637 code and it works pretty well with the AiP1640 on this clock.

Some special handling for all the symbols and pseudo-segments on the display needed to be added. The rest is pretty much writing an ESPHome configuration.

Source code of my project can be found at: https://github.com/spezifisch/esp32-acqi-clock. To build and flash it you can use ESPHome's build instructions.

The first things I added was playing the mario theme using the RTTTL module of ESPHome and add a very low light night mode for the clock without blinking dots:

First version of distraction-free night mode. The display controller actually has 4 brightness levels. A higher brightness is shown here.

And of course a mode to show humidity which we can now measure, too:

Mode showing humidity (in %RH) instead of day and month.

The software is still work in progress but basic clock display works and I can use it on my night stand. My next steps will be modding the other clock and I think it should be possible to use the ESP32's hardware SPI instead of the bit-banging implementation in the current TM1640 module.