I'm seeing very inconsistent brightness/current/color from a simple TLC5940 circuit. I'm struggling to figure it out, and I hope you can help. Here are the details:
I have a relatively straight forward setup: An Arduino UNO connected to a single TLC5940.
Problem: The IREF I'm using should see around 17mA per channel, at full brightness. When I power the circuit using the USB connector, everything works pretty much correctly, I see between 15-17mA per channel according to my multimeter -- and all the LEDs look roughly the same brightness. If I use an external power supply for the TLC and LEDs, wired up separately (not via the Arduino, Arduino powered from USB, positive not shared), but with shared ground, I see very inconsistent output currents. Some channels output correctly, others at anything between 0 and 17mA. This is very inconsistent, e.g. if I turn the circuit off, remove the TLC from the board and re-seat it in the same spot, I'll can get radically different results, with different channels performing better/worse.
To me, and based on some research, this sounded like a decoupling issue:
I've tried many different variations of .1uF (ceramic), 1uF, 10uF, 47uF, 200uF and 470uF capacitors across the main power line on the breadboard.
I have tried single/multiple .1uF ceramic caps across the TLC VCC/GND line right next to the chip.
I've tried adding a small resistor before the TLC and a cap to further isolation the supply.
Other things I've tried:
Two different switched power supplies (1 x 5V 10A measured at 5.35V, 1 x 5V 2A measured at 5.27V).
Two different Arduino Unos.
Many different TLCs (Note: they don't burn out).
Building an Arduino-a-like on a breadboard, powering it and the TLC and the LEDs from the same power supply (not attached to USB/PC at all).
Leaving the multimeter out of the loop and just judging brightness with my eyes.
I always get similar inconsistent results. Running off an external supply is important to me, since the end demand of my project will well exceed the allowed USB current.
I've attached a photo of the Uno + "power-board", and the Breadboard arduino + "power-board".
I've spent quite a while trying to figure this out -- if you've any ideas whatsoever, I'd love to hear them.
From your posting, its a little unclear exactly where you put the decoupling. Try 100uF+ both between the LED + rail and GND, AND a 100uF and a 1-5 uF ceramic between the Vin to the chip and GND.
Try wiggling your wires to make sure is not just a bad connection. Especially try wiggling the GND wire that feeds back to your external supply.
Try not turning on any channels that are not populated with LEDs as this pulls a lot of current from the arduinio/USB.
Keep in mind that when using an external power supply, (without the arduino), you are going to come across some problems such as this. You need to get a voltage regulator. I would recommend checking the voltage coming out of whatever supply you are using using your multimeter.
I have a "3.7v" LiPo battery, it outputs 4v. If you do not regulate your power, the brightness is going to be higher since you are expecting a lower voltage. The arduino has a voltage regulator which is why ti works fine when using the usb.
(Sorry for my confusing writing, I just got back from work, if you are still confused, get a 5v Voltage Regulator)
AndrewStone: (1) My attempts so far have had one central pair of power lines, (VCC/GND) (might help to look at the images attached to the original post). The decoupling has been across these lines, near to the power entry point -- but also at the TLC VCC/GND right next to the chip. That is -- the power rail for LED and TLC is shared. I tried breaking these up into separate lines, and added separate decoupling for each -- but get the same inconsistent results. I am fairly certain it's not a bad connection, as I've rebuilt this countless times with different boards/wires. Only one channel is being turned on at a time, so it's not overload.
funkyguy4000: I was of the impression that all switch-mode power supplies were effectively already regulated. I am exclusively using switched-mode supplies. The two supplies I tried had 5.27V and 5.35V outputs, which is well within the TLC requirements. Given that the voltage drop across the LEDs should be consistent, I can't imagine it's the absolute voltage that is causing any variation in brightness (different current levels could cause this).
Grumpy_Mike: Done -- I trimmed all the caps down to the minimum -- unfortunately I get the same results.
Really appreciate the comments. Any more thoughts?
What exactly is the measured power coming from your switched regulator?
I was hoping to see those bigger caps right next to the chip and the LEDs because you are after all working on a breadboard... but it probably won't matter unless you have a marginal connection.
Try connecting the TLC's VCC to the Arduino's 5v power source but keep the LEDs on your regulated supply. Did the problem get fixed?
I wonder if you are accidentally programming the dot correction... is pin 27 grounded? Are the LEDs consistently inconsistent :-)? That is, is LED N always the same current or does it change? When does it change (constantly (i.e. LED is flickering), each time its lit, after power off/on, use a different chip, etc).
Power it all from the same power supply including the arduino, scrap the usb. I have no idea why this will work but had a similar problem that i spent far to much time trying to solve and i have read the same problem a couple of times now on here. Not the best advice i know but try it any way.
If I power the TLC and the Arduino off USB, and the LEDs off the external, it works fine. Put another way: If I power any of the chips off the external, it doesn't work.
Yes, the inconsistent LEDs are reasonably consistent (even through power-cycles) -- until I remove and re-seat the TLC, then the dim LEDs change. i.e. It's not DOT correction.
The switch-mode power supply is outputting 5.27V as measured by my multimeter.
This evening I tried swapping out my switch-mode 5V 10A power supply for a simple 7805 regulator + 9V transformer/wall-wart, leaving the rest of the circuit (i.e. decoupling arrangement) in place. It worked fine, repeatedly, regardless of re-seating the TLC -- i.e. it behaved as well as the USB connection.
Trouble is, I want to use that switch-mode power supply due to it's high-current output at the correct voltage -- I'll need 6-8A in the final circuit (quite a few LEDs), and I'd rather not cover the circuit with regulators and heatsinks to get the required current output.
So: What's the difference between a cheapo-wallwart + 7805 regulator (came in at 4.99V), and a switch mode PSU without a separate regulator (comes in at 5.27V). I believed, perhaps incorrectly, that switch-mode supplies were sufficiently regulated/cleaned already. Are there additional noise-reduction techniques I can use, if the switching is cause too much noise? I've already tried a whole range of different capacitor combinations -- any inspiration here?
umm well i was wrong then, do you have decoupling on the power. Ive got the standard decoupling on the chips (very close short legs) i also have some hi freq decoupling on the power supply lines them selfs(dif value to the chip de coupling). Other than that ALL connecting wires should be a short as possible including the power lines (the are little aerials). It took me a while to get my set up working i have 12 chips and 1 mega controlling them. the orientation and wire lengths were all my problems were and decoupling. i had about 2 weeks of messing to get it all working. it was like walking around in the dark to be honest. I think i know what i'm doing now but trying to explane it is impossible as i'm not a real engineer. i would say i made my own pcb's i'm not sure i would have had a chance on bread board at all.
I've since reproduced the problem using just the USB powered Arduino (no external supply at all). With an IREF that should yield 17mA (and does with most outputs), I get 13mA on one output. Occasionally, down to 8mA. The bad output has been seen on pin 1, 8, 9 or 10 -- so moves around somewhat.
Under a 'scope, the voltage varies between vMax 5.35 to vMin 5.22 for the external PSU, and 5.14V and 4.83V for the USB version (the signal is much noisier with the TLC on, naturally).
Decoupling between VCC/GND on the chip (.1uF) and on the rails (100uF, 47uF, 10uF) in place (dramatic difference with and without it, on the scope, naturally).
I figured it out. AndrewStone was the closest, thanks Andrew!
The problem was dot-correction. Specifically: EEPROM programmed dot-correction, so even though pin-27 was grounded, the EEPROM stored dot-correction data meant the current was inconsistent (similar proposed problem here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1276436937).
Once I enabled register-controlled dot-correction, a simple call to Tlc.setAllDC(63) resulted in ~perfectly balanced currents. If brightness varies somewhat later, I can always use dot-correction for its intended purpose.
I purchased the chips on ebay, so buyers please keep this in mind if you see similar problems! (Keywords: TLC5940, Inconsistent color, inconsistent current, inconsistent colour, uneven current)
Thanks to all those that replied, appreciate your time.