I hope this is the right place to ask! I’m working on a Raspberry Pi project and was hoping for some guidance or confirmation about my setup.
I’m driving 40 ultra-bright LEDs using 5 shift registers (74HC595). The LEDs are powered directly from the Pi’s 5V pin, and since they’re super bright, I’ve added 470-ohm resistors. The LEDs are rated for 20mA each, but I’ve limited the current with the resistors.
The setup is managed with a Python program that switches the LEDs on and off, with a maximum of 7 LEDs lit at the same time. The distance between the LEDs and the Pi is no more than 4 meters.
My main questions are:
Does this pose any risk to the Raspberry Pi itself?
I’m avoiding using an external power supply because I think it’s unnecessary for this setup. Am I correct?
One thing I noticed during testing is that if there’s a power failure, the Pi resets its pins, and all LEDs turn on until the script starts running again. I believe this isn’t a big issue since the current draw in this case should still be under 200mA. Do you agree, or is there something I might have missed?
The 74HC595 should be powered from 3.3volt when controlled with a 3.3volt processor.
The LEDs should have a common rail to 5volt (not ground).
Are you doing this?
Note the the 74HC595 has a total drive limit of 70mA. White LEDs have a Vf of about 3.3volt at their max rated current, but that drops to ~2.7volt at a fraction of that current.
Leo..
Thanks so much for the reply! I didn’t know this—super helpful. It seems like it works fine with 5V too, though maybe it’s a bit less stable?
I’m still a little unsure about setting up the common 5V rail when using the 74HC595 to drive everything. Doesn’t the IC take in current and then distribute it through its pins? Should I set it up like in the image I’m sharing?
For now I have basically I copied what I am seeing here
Yes it is less stable. You may find it works OK with one IC and not another or you may find that after put everything together with 40 LEDs, operation is erratic, intermittent and unpredictable.
If you are making a PCB, the TLC5916 would be a better choice. It will work with 3.3V I/O and does not require individual resistors for each LED and you can easily adjust the LED brightness.
Eh I wish I knew it earlier. I am trying now with my prototype with 3.3V. Everything looks good and there is I suppose much less current flowing so I might decrease the resistors value. I guess things should be ok with this setup. If someone could have a brief look at my schematic here it would be great. It's is going to be a permanent artistic installation so I try to make it robust! Thanks for all the support
Your LEDs have a maximum forward voltage (Vf) of 3.6V, the 595 can only output 3.3V at most (it will be less). That is 0.3V less than the LED V(f), so some of your LEDs may not turn on. You will need to hand pick the LEDs that work with your selected resistor values.
Well, the circuit seems to operate well in prototype with 40 LEDS and the 79CH595 at 5V. I am never having more than 7 LEDS on at the same time. Of course now I am tempted to redesign and TLC5916 seems a great option.
TLC5916 should work also at 5V I guess and then I could still power everything from Pi itself.
One of the things that still I cannot explain is why the lights are turned on when I exit the python script. Actually, I noticed they blink when I approach the wires with my hands. Shouldn't the pins reset to a closed state?
Hm seems a bit hard to find it in a local store! Another option is to use ULN2803 along with 74HC595 or maybe a TPIC6B595. I will keep searching for the TLC5916