Hello! i want some help...
I designed a 8-leds stackable module for a project.
Each module has 8 leds (3mm ,25mA) , a 74HC595 shift register and ULN2803.
The purpose of this module is stack'em (daisy chained) and make each led addressable.
I want to stack 38 of those ( 304 leds ) but the problem is that i don't know how to even
the current along the array. The lighted LEDS tend to dim when other LEDS turns ON.
When more leds are ON, all the lighted leds are dimmed and i don't know how to handle this
i did a little sketch test where i use a potentiometer for turn on the leds while i spin it.
With this test i can see clearly this dim effect. I did a little video to show this:
The dim effect can be seen at about sec 14 of the video.
Here is another video showing one module:
I didn't used any resistor...should do i? wich one?
attached is a schematic of the module (is messy, sorry)
And i know is not a software problem because all it does is just turn ON/OFF the leds but heres the code:
int dataPin = 8; //wire A
int latchPin = 9; //wire B
int clockPin = 10; //Wire C
int pads = 6; // number of modules
byte ledsbit[500]; // leds array
byte ledsbyte[50]; // bytes for each shifter
int valoract = 0; // actual pot value
int valorant = 0; // previous pot value
dif = 0; // difference in pot
void setup()
{
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void refresh_Leds() // updates leds
{
for (int modulo = 0; modulo < pads; modulo++)
{
ledsbyte[modulo] = 0;
for (int l=modulo*8; l<(modulo*8)+8;l++)
{
ledsbyte[modulo] = ledsbyte[modulo] << 1;
if (ledsbit[l] == 1) ledsbyte[modulo] |=1;
}
}
digitalWrite(latchPin, LOW);
for (int i=(pads-1); i>-1 ; i--) shiftOut(dataPin, clockPin, LSBFIRST,ledsbyte[i]);
digitalWrite(latchPin, HIGH);
}
void Leds_pot() // updates the leds on/onn
{
int ledsON = map(valoract, 1020,0, 0, pads*8);
for (int ii = 0; ii < pads*8; ii++) ledsbit[ii] = 0;
for (int ii = 0; ii < ledsON; ii++) ledsbit[ii] = 1;
refresh_Leds();
}
void loop()
{
valoract = analogRead(15);
dif = valoract-valorant;
if (valoract - valorant > 2 || valoract-valorant < -2)
{
Leds_pot();
valorant = valoract;
}
}
Then you have no control over how much current the LEDs are taking.
wich one?
That depends entirely on the LED you are using. Look up the forward voltage, subtract it from the 3V3 you have and then subtract another 1V for the saturation of the darlingtons. Then workout what resistor you need. This lack of control is probably causing the problem with dimming you are seeing. What current capability has your supply?
304 LEDs at 25mA a pop is 7.6A is your power supply up to that?
but the problem is that i don't know how to even the current along the array.
Proper layout and wiring. You will also need to buffer the clock and latch pins as you can't drive 38 of them from one pin.
Also you have no decoupling capacitors. You need a 0.1uF ceramic on each shift chip plus a 100uF ever three or four modules.
Hey there, looking at your schematic (Its working for me btw) I see you have no resistors installed, in fact I am surprised that your LEDs or transistor array are not fried yet! As you are using a 3.3v supply this will be working to your advantage, but each darlington will still have to be dropping 1.3v! Install a 220 ohm resistor in series with each led (do not use one common resistor unless you only have one LED on at a time) and that should sort out the dimming problem, however the LEDs will be overall less bright.
Hello!
I edited the pictures and youtube videos to public.
I am using a pc power supply. It handles 20A with 3.3V...
There are independent wires for power (5V for the logic and 3.3V for the leds)
I merged the GND from the power supply and the arduino.
Do you think adding 220 resistors between ULN2803 and the leds will fix the dim issue?
Will i have power problems with the logic when i stack the 38 modules? i am testing with up to
12 modules now and the last couple is being weird ( when many lights are ON all the last 2 modules
are ON very weak even when the must be off).
Try adding connecting power & Gnd to both ends of your daisy chain.stack and not just 1 end.
What do you have for connectors?
That might be a limitation as well. You need 160mA per board, after 10 boards you could be exceeding the current capacity of 1A rated connectors. Put a meter on 3.3 & 5V, see if it's being degraded/drooping as the you add on more.
Copper traces on the circuit board is very narrow for 7.6 A. With only 3.3 volts affects a small voltage drop very much. Draw their own lines for GND and 3.3 volts to each card.
GND should also be connected between each card.