Go Down

Topic: How to connect multiple tm1637 based 7 segment display in one arduino (Read 14841 times) previous topic - next topic

housito

MULTIPLE TM1637 DISPLAYS USING THE SAME CLK PIN

I know this is an old topic but it has been read many times so I thought I would add something.

I have wired up two TM1637 displays to a Nano and used the same CLK pin for both displays. Both displays work.

I called them display0 and display1

TM1637Display display0(2, 3);
TM1637Display display1(2, 4);

I will have to wait for the arrival of more TM1637 displays before I can find out how many more are possible from the same CLK pin.

Regards

Fox27
Hi, i'm starting with arduino and will like to build a race tracker with timer like this: https://www.dfgtec.com/pdt-software
This particular example use the adafruit display in the sketch. i only have m1637 displays and can't make it work, was trying the first approach (display(1,2) display(3,4), etc... can you help a trying to figure out how to solve it? or do you recommend i buy the adafruit display (little expensive xD)

tigger

@housito
Others have reported problems using different versions of the library.
There is at least one published tutorial that advises removing the capacitors on the clock line. I am quite certain that this is an unnecessary modification.
I have only just started to explore the modules as a quick way of getting an event counter going.
I use the Robotdyn 4-digit TM1637 and the library that uses #include <TM1637Display.h>.
The examples all worked well straightaway using a Nano.

What I would interested to know is if anyone has thoughts on using two modules to increase the count range to 9999,9999. I guess it's use two instances of TM1637 and a simple carry over of 1000's to 10,000's?

Paul__B

There is at least one published tutorial that advises removing the capacitors on the clock line.
I think you need to explain what capacitors would ever be doing on the clock line in the first place?

Please cite a web reference.

tigger

Not for me to explain what someone else has written. You can always place your comments on the article.
It seemed a strange thing to do to a reasonably well designed product. No need for your comments like that
https://www.instructables.com/id/TM1637-7-Segment-Display-Making-It-Work/

bodmer

@tigger et al. You should not need to remove the capacitors, they should be 100pF and are there for EMC reasons (so the boards work in an electrically noisy/RF environment with long wires to the display).

It is possible the board was populated with the wrong parts, i.e the reel being loaded into the assembly machine was 100nF instead of 100pF, or the bill of materials had a typo error. In that case they will need to be removed.

Fitting the wrong part does happen, I had some cheap ESP8266 boards a while ago from China that had 4R7 fitted in series with an LED instead of 4K7, clearly the assembly machine operator needed to get some new glasses!  In that case the LED and resistor was powered from the 5V supply, the LED got so hot it glowed red for thermal reasons (!) and melted the solder.

Edit: I have just found the RobotDyn schematic... and they have used 10nF, this is 100x too big so if you have a RobotDyn board or one with the same error you WILL need to remove them.

Paul__B

It seemed a strange thing to do to a reasonably well designed product. No need for your comments like that
OK, well thank you for introducing me to a fascinating topic; I have (just) now done due research on the matter.

The TM1637 datasheet recommends 10k pull-ups toVcc and 100 pF - that is picofarad capacitors to ground for RF suppression.  Precisely how they determined those capacitors to be advisable will be lost in the annals of time, but the value is reasonable.

On to "Robotdyn".  We must assume they are the originators of the more expensive version of the modules as these - the ones with pinout on both ends and a "pilot"(!) LED on the rear - all bear essentially identical markings except for the "Robotdyn" logo.  And they have published a schematic which clearly illustrates the work of some complete moron!

OK, that may sound rude, but is I think a reasonable summary.  My guess is that they did not have 100 pF capacitors in inventory and did not feel the need to do so essentially for this one design, so substituted the "nearest" value to hand - 10 nF.  Actually, as they also produce actual UNO clones (as well as non-"UNO"s), they do have inventory of 22 pF which would have been a quite appropriate substitute.

In the event, the modules have been produced with a completely unworkable capacitor value - happens to be the same as one of the correct supply bypass capacitors so yes, easier to inventory and produce.  And that 10 nF value has been copied into the "no name" clones which I confirmed by measuring the value of one removed (the second one - I not surprisingly lost the first when testing) by my Ardutester as "9888 pF".

There is at least one published tutorial that advises removing the capacitors on the clock line. I am quite certain that this is an unnecessary modification.
Well, given that the capacitors are indeed 10 nF, I am quite certain that removing them is in fact, an essential repair to a faulty product.  Presumably the smaller $1 Catalex/ tabao modules (with no "pilot" and only one end pinout) are likewise impaired.

I removed the capacitors easily with (my head magnifiers and) the soldering iron tip pressed against the side of the capacitor, then tapping the iron against the table to eject it.  (That was not where I lost the capacitor, rather as I pressed it against the SMD test pads on the Ardutester.  :smiley-eek: )

What I would interested to know is if anyone has thoughts on using two modules to increase the count range to 9999,9999. I guess it's use two instances of TM1637 and a simple carry over of 1000's to 10,000's?
The problem here is not so much of wiring the two displays with the clock pin commoned and separate DIO pins, but mounting the displays adjacent.

Much more sensible to just use a MAX7219 display.


Now noted bodmer's addendum.  :smiley-lol:

tigger

@bodmer and Paul_B
Thanks for the extra detective work on the capacitor values.
I don't recall the writer of the item recommending complete removal replacing them with the correct 100pF capacitors.
It's not great when the manufacturer (Robotdyn) publishes the schematic at odds with the original chip manufacturer. The power bypass capacitors don't look right either - TMI show 100uF plus 0.1uF, Robotdyn show 105 and 104.
Having said that, the boards I have here do look genuine Robotdyn TM and do look nicely made...
A crude in circuit check with a Fluke 83 in capacitance mode gives a value of 370pF, so not a 100x wrong, and they do work.
When buying this stuff, you are always taking a chance, but you have to weigh up the pros and cons of getting a ready made module or doing a board yourself and buying in the components from a reputable distributor. If a module is wrong, however, not only do you waste a lot of time and money and then end up buying twice.

Wackena

FYI - From an ESP8266 board,  I use a CD4051 8 channel multiplexer for DIO output to 3 TM1637 4 digit 7 segment LED displays. Also using only 1 CLK output pin in series to each display. I was not successful when trying to have 4 displays. Appears ESP8266 board does  not have enough power.

fixduino

thanks for this . i have same case, lets try.

Thanks bodmer..  Very hsppy dat u replied..  I tried your siggestion as well.. The program i used is given below

#include <TimerOne.h>
#include "TM1637.h"
TM1637 tm1637(1,2);
TM1637 tm1637a(3,4);
TM1637 tm1637b(5,6);
TM1637 tm1637c(7,8);
TM1637 tm1637d(9,10);
TM1637 tm1637e(11,12);

void setup()
{
  tm1637.init();
  tm1637.set(BRIGHT_TYPICAL);
  tm1637a.init();
  tm1637a.set(BRIGHT_TYPICAL);
  tm1637b.init();
  tm1637b.set(BRIGHT_TYPICAL);
  tm1637c.init();
  tm1637c.set(BRIGHT_TYPICAL);
  tm1637d.init();
  tm1637d.set(BRIGHT_TYPICAL);
  tm1637e.init();
  tm1637e.set(BRIGHT_TYPICAL);
}

void loop()
{
  int a=7,b=53;
  int a1,a2,a3,a4;
  a1=a/10;
  a2=a%10;
  a3=b/10;
  a4=b%10;
 
  tm1637.display(0,a1);
  tm1637.display(1,a2);
  tm1637.display(2,a3);
  tm1637.display(3,a4);
  tm1637a.display(0,a1);
  tm1637a.display(1,a2);
  tm1637a.display(2,a3);
  tm1637a.display(3,a4);
  tm1637b.display(0,a1);
  tm1637b.display(1,a2);
  tm1637b.display(2,a3);
  tm1637b.display(3,a4);
  tm1637c.display(0,a1);
  tm1637c.display(1,a2);
  tm1637c.display(2,a3);
  tm1637c.display(3,a4);
  tm1637d.display(0,a1);
  tm1637d.display(1,a2);
  tm1637d.display(2,a3);
  tm1637d.display(3,a4);
  tm1637e.display(0,a1);
  tm1637e.display(1,a2);
  tm1637e.display(2,a3);
  tm1637e.display(3,a4);     
}

No error was shown while compiling and uploadind.  But only the first two displays are displaying the value..  Rest of the displays are off..  In between the third display displayed jst two digits. I cant understand what is the problem..  Please healp me out..


ASHIK A S

Paul__B

A crude in circuit check with a Fluke 83 in capacitance mode gives a value of 370pF, so not a 100x wrong, and they do work.
Well, if it actually works with those components, then that may be OK, but I would be somewhat suspicious about in-circuit testing of capacitors in digital circuits (which will of course, show the characteristics of connected digital lines, but is quite likely to be affected by the protection diodes, and possibly reducing the measured value for all I know).

What is the case, is that I removed the capacitors from my older board(s) and measured them out of circuit as 10 nF.  (I do however need to check whether I removed them from the boards I have purchased most recently.  :smiley-eek: )



I was not successful when trying to have 4 displays. Appears  ESP8266 board does  not have enough power.
Or you may have been using boards with the wrong capacitors still fitted.  The point is it may work with them, or it may not.  With the wrong capacitors it is an "edge" case - you are working against a serious design problem, in which case you must expect it to be unreliable and an otherwise minor change such as paralleling more devices could easily be the breaking point.

Go Up