Go Down

Topic: TM1640 based, 16 digit display (dealextreme) (Read 22595 times) previous topic - next topic


Cool, thanks.
Now I just need to remember what that part was good for!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Author of TM1638 library has expanded to support the TM1640.


I'll test tomorrow and let you guys know.
Electrical Engineering Student


I ordered mine from DX while ago, but only this part was missing from the package? Damn!

Good to know about the TM1638 library, that it supports TM1640 too. Their combination as a display might work, even that they are completely different colors. Yellow was the one I was missing so far...

The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"


The module I received was red as well.

Anyways, it's working great with the updated TM1638 library.

Here's it running off of an ATtiny85 :)
Electrical Engineering Student


Could someone please, explain me how a single IC with 24 pins, can address 16 7-segments displays?
You need to individually address 128 LEDs, how do you do it with just 24 pins?

Do each display have another IC or what?

I do not know much about electronics, but I think I know enough to understand this...

I have been lately using the WS2801 driver to make something like an ambilight system for my PC screen using processing, an Arduino, SPI, WS2801, and RGB leds, I have 25 independant RGB LEDs to achieve a nice ambilight clone, but this... how does it work!?!?! I did read the TM1640 sheet, but I still do not get it.

PLEASE!!! some one explain me!!

Thanks in advance!!


Well, the Tm164 is actually 28 pins.
All the A segments are connected on parallel, all the Bs, all the Cs, Ds, Es, Fs, all the Decimal Points. So that's 8 pins.
Then each group of segments  gets a common cathode (or anode?). 16 more.
Power, Ground, and the two I2C lines.  4 more.
28 pins.
Each digit is turned on one at a time for ~500uS, so every 8 mS all 16 digits get turned on one time.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


:smiley-fat: Ouch!! How could I be so stupid!!  :~

You are right it is more than possible.

I did not mean it was impossible because of the 24 vs 28 pins, just because I was thinking that each display would need another IC to multiplex or something like that but I see they don't, I guess that using common cathode displays, all GRID1-GRID16 pins but one of the TM164 keep high for 500usec, then another, then another...

Thanks for explaining!!

If this TM1640 had PWM, it would be just perfect  :P I could drive with just one 28 pin IC like 43 RGB LEDs... really cheap solution for ambilight like projects (I am still looking for something cheaper than what I did so everyone can have an easy and cheap one)



Made an instructable for this:


Electrical Engineering Student


Great work!
Since I have a couple attiny45, I'd like to know what is the size of the test sketch? Would it fit the smaller (4kb) memory?
On dealextreme the dimensions of the display aren't listed. Have you measured it?

Thank you in advance.


Jun 30, 2012, 11:09 pm Last Edit: Jun 30, 2012, 11:21 pm by Boyan Reason: 1
The author of TM1638/TM1640 library has done great work and it is super easy to drive the board. I got mine in March and they are working beutiully!


A good example of excellent work in the open source world. Otherwise driving the board is not terribly difficult but the library makes it baseically a usable building block for someething bigger. Not having to figure out the Chinglish PDF and commands is great help! Thanks Ricardo.


Hi there, I'm new with the Arduino. I want to display via this TH1640, but when I compile the example, the compiler says:
C:\Program Files\arduino-0018\libraries\TM1638\/TM16XX.h:58: error: 'String' has not been declared

What do I do wrong? Same happens with other Versions of the same lib.

Can please somebody help me? I haven't programmed for a longer time so I'm not sure what happens here.

Anyone know about the TM1640 chip? I've ordered one, and i'm going to try and figure it out.

Here is all the reference info I could find:

Schematic: http://ljy99731.13.dns222.net/download/LM1640_sch.pdf
Datasheet: http://ljy99731.13.dns222.net/download/tm1640.pdf

Is it similar to the TM1638, for which an arduino library has already been built?

I've contacted the author of the arduino TM1638 library, and he's also got one of these units on order, to try and figure out.



Is it me or on the pin out in the PDF for the 1640, where are the GND's exactly, unlike the TM1638 with GND either side ?



@flacketts it is NOT you, a latter batch of the PCBs is totally mislabeled, the silk screen is absolutely wrong, I stumbled upon this just like you and the first thing I did is compare it with earlier boards-  sure enough, wrong silk screen

Good thing I always used the connectors and never actually wired it because if I did based on the silk screen I would have fried the board for sure



@Mathias_Laufer you must use an older version of the IDE, the current one is totally messed up and this library no longer works, not to mention many other libraries so I have a VM with older Arduino IDE, otherwise all my previous code would no longer compile

Go Up