Hi everyone!
I'm experimenting with some tlc5940 ICs and some leds for a project i'm making.
After some trying, i found the perfect setup for me but also some problems.
This is my current configuration:
A - 1500µF 10V ELNA capacitor to minimize ripple
B1 and B2 - Resistors to limit current, two in series for each chip since i don't have exact values
C - Arduino NANO connected to USB @ Ubuntu Studio
D1 and D2 - TLC5940 daisy chained
E - 5v From arduino, this is not used right now, the power for leds and chips is from a separate 10A @ 5V power supply.
F - 5v From 10A @ 5V power supply, used to power leds and chips
Green Line - Ground, common for arduino and chips/leds
These are the voltages i get from each supply (E is Arduino, F is power supply)
This is the code i have on the Arduino (C):
#include "Tlc5940.h" // Include TLC5940 library
#include "tlc_fades.h" // Include animation library
int incomingByte; // Var for serial data
int led = 0; // Var for led
void setup() {
Tlc.init(); // Init TLC library
Serial.begin(9600); // Open serial port, 9600bps
}
void loop() {
incomingByte = Serial.read(); // Read the serial port and give its value to incomingByte
if(incomingByte > 0) { // If i receive something from serial
led = random(0,32); // Get a random led
tlc_addFade(led, 0, 4096, millis(), millis()+80); // Add to the queue a fade from 0 to 4095 brightness from now to now+80ms
tlc_addFade(led, 4096, 0, millis()+81, millis()+600); // Add to the queue a fade from now+81ms to now+600ms from 4095 to 0 brightness
}
tlc_updateFades(); // Update and display the fades.
}
Basically when i input something i get a fading led.
Now here's the problem. After a fade the led gets barely lit, as if i set the pwm to "1", you can't really see it, but some times it is very lit and you can notice it.
How can i resolve?
If i do a Tlc.Set(led, 0) after the fade the led stays off and the problem disappears, so i guess the problem is software, or maybe not working TLCs/Arduino?
Another thing i was thinking about, the data to the TLCs is sent via the pin 13. Could it be the led connected to that pin that messes up things?
Thank you and sorry for the poor English, i'm Italian