TM1637 LED chip investigation

30 November 2025
Around the time of making the Arduino-based timer a numeric LED display had been found that was smaller than the off-the-shelf LED module used by the timer's display module, the plan being to use it for a future project. Since then was able to source TM1637 driver chips that that the LED module uses, which appears to be made by Titan Microelectronics but could also be a generic part. The idea was the same Arduino library could be used as-is with a custom circuit using the smaller LED display, which turned out to be the XLITX CL3641AH, although this in itself was not done in the end as they were not compatible. The driver chip itself was interesting to experiment with although it has some quirks which call into question its suitability.

Test circuit

TM1637 pin-out

There are multiple versions of the data-sheet floating about with varying amounts of bad English and suspect some of them are not even official, so this chip needed a certain amount of trial-and-error to work out how it actually operated, but the pin-out itself was clear enough and is reproduced below with clarifications. As well as output for LED displays it also can handle input from up to sixteen buttons but this latter functionality was not investigated.

Key sense Serial Vcc LED chip select (anode)
K2 K1 CLK DIO Grid 1 Grid 2 Grid 3 Grid 4 Grid 5
20 19 18 17 16 15 14 13 12 11
1 2 3 4 5 6 7 8 9 10
Ground Seg 1 Seg 2 Seg 3 Seg 4 Seg 5 Seg 6 Seg 7 Seg 8 Grid 6
LED segments (open-drain)

The grid pins are confusingly described as (after correcting for misspelling) P-Type Open-Drain in the data-sheet which were pins that either supplied Vcc or were high impedance, the latter being done because the segment pins also double as key scanning pins. One consequence of this is requiring LED displays that are common anode where it is the segment pins rather than the chip select that are pulled to ground during the display cycle. The driver chip uses pulse code modulation so contrary to expectations current-limiting resistors are not required in series with the LED segment connections. As for the serial clock and data pins they require pull-up resisitors.

The serial protocol

Problems had been noted when the third-party TM1637 library was used at the same time as the Arduino Wire I2C library although at the time not much thought was made of it, but later investigation revealed the serial protocol to be a non-standard implementation of I2C where the address byte has been replaced with a command byte. As an aside suspicions of library conflict have since been dispelled. Trying to control it with my own USB-I2C master by avoiding any commands that have the LSB set showed that messages were partially being understood but could not get any controllable output. The Microchip PIC12F1822 which my I2C master is based on may be able to control the driver chip with its MSSA I2C operations but this is almost certainly more trouble than it is worth, not least because the chip would not be able to talk to any other devices over standard I2C. The Arduino TM1637 library uses toggling between input and output modes to emulate open-drain switching between a pin sinking current and being high-impedance but the effort of implementing something similar for other microcontrollers would not be vastly different to implementing firmware to drive LED displays directly.

Cancelled plans

Following the completion of the Arduino timer enclosure there had been plans to build a thermocouple temperature reading device as a follow-on enclosure project which was intended to use the XLITX CL3641AH LED display and there there had at least been consideration of using the TM1637 to drive it. Components for a redesigned thermocouple control PCB had been ordered in but otherwise no concrete action had been taken, with even whether to base it around Arduino or an ARM microcontroller still being an open question. One way or another parts for installing within the enclosure had not been finalised let alone being ready which held up doing anything to the enclosures themselves, and this would soon be be overtaken by the decision to stop doing enclosure projects within the apartment. I suspected that dust from cutting the enclosures was causing irritation and with this forcing the issue took the decision to stop doing such projects within the apartment, as it also made a mess that was a pain to clean up afterwards.

Remarks

Problems mixing the Wire and TM1637 Arduino libraries are almost certainly a simple error on my part and it ought to be possible to get them working, as the TM1637 library does not use anything that looks like it might conflict, but looking deeply into this was never within the scope of this mini-project. Now that I have a stock of these LED display control chips I might use them for a future project based around Arduino but fundamentally not being able to drive them using existing I2C master firmware was a disappointment and as a result do not recommend them as a component with other microcontrollers.