I have my raspberry pi set up to do two main things:
- control 16 LEDs via 16 transistors each connected to an out pin. The LEDs are collectively fed the 5V from the GPIO.
- power a chip also on the 5V line
The chip itself is not important (its a DAC) beyond the fact that it is very sensitive to the 5V going in that must remain perfectly constant.
My problem is that when the LEDs are off I measure 4.99V on the GPIO 5V line, and 4.97V when they are on. The fact that it isn’t exactly 5V is annoying but not nearly as important for my purpose as the slight shift in value between the two states. And I suspect there is a similar dip in voltage when the CPU/GPU are busy compared to when they are (mostly) idle, although I have not measured this precisely.
So my question is what can I do to keep the 5V line as constant as possible?
Someone mentioned to me the idea of taking a 12V power supply and converting it into two 5V supplies, one for the pi and one for the LEDs, but I was unable to find this explained online (might just be that I couldn’t formulate it right, I’m no expert in electronics).
In case it matters, I am currently using a 5V 3A power supply for the pi.
The voltage will fluctuate slightly on the 5v pin due to the protection circuitry built-in to the Raspberry Pi. Mainly the polyfuse, which has a resistance of about 0.2 ohms. When the load increases (LEDs, CPU usage, hard drive spinning), the voltage will drop slightly on the GPIO 5v pin. If that voltage drop is undesirable, you can:
- Run the chip on a dedicated power supply/regulator to isolate it from voltage fluctuations.
- Or if the chip must be powered by the Pi’s 5v pin, you could power the whole Pi directly through the 5v pin, effectively bypassing all protection. This is risky and has less tolerance for mistakes, but the risk can be minimized if you use a good-quality power supply with regulation and protection.
How to keep (1) 5V DC power supply for Rpi and (2) 5V DC power supply for external circuits, eg, LEDs, relays etc as steady as possible, say, less than 0.02V fluctuation (ie, “slight dip” in Rpi 40 pin connector 5V power, when switching on LEDs)?
Use two separate 5V regulated power supplies, one for Rpi, another for external circuit such as LED, relays etc.
There are many ways to avoid the “slight dip” when switching on/off LEDs (or motors and servos) at the same time. One way is to use PCA9685 PMW controller to switch on/off LEDs etc with slightly different, human eyes unnoticeable, start times (say, 0.1% of period of 50Hz). This is also to prevent the EMI when switch off (not on) many serovs/motors at the same time.
(1) Use a 200VAC to 12VDC 3A~5A switching regulated power supply to get a stable 12VDC power supply.
(2) Use Two DC12V to DC5V 3A step down switching regulated power supplies, one for Rpi, another for external circuits such as LED, motor, servo, or relays.