Go Down

Topic: Why doesn't my TM1637 work anymore when I use 9v? (Read 821 times) previous topic - next topic

Tafkaap

As a first Arduino project, I'm building an alarm clock with 3 TM1637 4x7 displays, 2 in the main box (with the Arduino Nano) and 1 in a little box for the bedroom. In between is a 10 m HDMI cable with the connectors replaced with Sub-D15 ones. The only other lines in that cable are meant for 2 push buttons, 1 RGB led and 2 relay switched 9v lines.

My problem is this: the whole thing works great, on USB power. Yet when I connect the 9v adapter, it works for a couple of seconds and then crashes -- always while updating the TM1637 at the far end of the cable.

So far I tried and found this:
- Drawing power from USB works, power from 9v means the Android crashes after a while.
- Slowing the communication with the TM1637 means it takes a longer while to crash. (Plus slowing down the system so badly it's not usable anymore.)
- With no delay it crashes within writing the first 4 bytes, and with 10 ms between bits it takes minutes. But it still crashes.
- The 3 TM1637's each have an own clock, but they share the data line.
- It doesn't matter whether the USB is still connected or not.
- I've tried, but not found any short circuits.
- The 9v relay lines are not switched on -- that happens elsewhere in the sketch.
- The connection is serial, in a way, but with handshaking for each sent bit.


I could understand it if the cable was just too long, but what's the difference between USB and 9v power? The signals should be exactly the same, after all. And as far as I can measure with my multimeter, they are.

Forgive me for not including a circuit scheme or anything like that -- I'll include them if the answer isn't easy but they'll take a lot of work to draw. (I've included the software I wrote, plus the library for the TM1637's. I don't think it'll help much, but who knows.)

Paul_KD7HB

Nice work on the boxes. They look great.

I suspect your problem is the 9 volt adapter and the 9 volt battery do not supply enough power. Check the current rating of the adapter. I hope you have the adapter power and the 9 volt battery going into the external power connector on the arduino. Are you powering the external devices off the Ardiuno internal 5 volt pins?

Perhaps a block diagram showing the pieces and the power and ground connections would help.

Paul

Tafkaap

Nice work on the boxes. They look great.
Thanks. I think they look terrible, but I'm learning and I hope version 2.0 will look ok. :)

I suspect your problem is the 9 volt adapter and the 9 volt battery do not supply enough power. Check the current rating of the adapter. I hope you have the adapter power and the 9 volt battery going into the external power connector on the arduino. Are you powering the external devices off the Ardiuno internal 5 volt pins?
The adapter can provide up to 1 ampere, which is more than the USB can offer and way more than my little system uses... The actual alarm buzzers aren't not connnected yet, btw. The heaviest load the Nano has to carry is (I think) for the transistor that switches the remote led on/off. It should be no problem, but I'll try running the program without switching it on. Who knows.

Perhaps a block diagram showing the pieces and the power and ground connections would help.
Working on it now...

Tafkaap

The heaviest load the Nano has to carry is (I think) for the transistor that switches the remote led on/off. It should be no problem, but I'll try running the program without switching it on. Who knows.
Nope. It doesn't matter. (I hate transistors -- give me 0 and 1, none of this analog nonsense...)

Tafkaap

Five hours of work (and finding out how to do it) later, here's the electronic scheme. Now let's hope I didn't make some mistakes -- it's the first time in 25 years or so I drew one and back then computers were a bit less sophisticated.

MarkT

You are simply overloading the on-board regulator of the Nano I think.  Under USB power its
not used, but from 9V on Vin it will be dropping 4V and carrying all the current for your relays and
displays.

Use a 5V regulator or DC-DC converter to power the displays local and remote and I think
it will be OK

I do have some questions about the circuit though:

Do your relays have built-in diodes?  I hope they are very low current reed-relays with
in-built diodes, as those are the only relays it is safe to power direct from an Arduino pin.

Do you realise that sending a high speed logic signal 11m through a cable is generally a bad
idea and will lead to various issues?  What speed are you clocking the displays?  I'd suggest
keeping that speed low, and adding 100 ohm resistors in series with the clock and data lines
at each end of the cable to help tame signal reflections
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Southpark

#6
Apr 07, 2017, 01:19 pm Last Edit: Apr 07, 2017, 01:27 pm by Southpark
My problem is this: the whole thing works great, on USB power. Yet when I connect the 9v adapter, it works for a couple of seconds and then crashes -- always while updating the TM1637 at the far end of the cable.
You probably need to first explain what you mean in the topic about - "won't work anymore when...."

Are you saying that it used to work with the 9V? And now it does not work with 9V anymore?

Try putting a big electrolytic capacitor (eg. 1000 microFarad) on the end of your long cable, to try stabilise the supply voltage. And add the general decoupling capacitors to supply pins of your integrated circuits.

Tafkaap

Thanks for your help! I tried several of your suggestions, attached an external 5v power supply and changed the circuit to make that work, and in the end it turned out that not the data but the power connection was giving trouble. After connecting an elco of 470 µF to the Vcc and Gnd lines at the end of the cable, it all works. (I suppose 470 µF is a lot, but I had it available and it does its job.)

BTW the relays are actually an optocoupled set of two, but I took the first good-looking relay pictures I found in the layout program. (Sorry.)

After a week of struggling and misunderstanding, I can finally get back to programming the thing. Which I find much more fun. :-)

Go Up