Don’t you hate that "Undervoltage" out of the blue? I've had one too many USB hard disk lockdowns on my Pi today, so I decided to solder-hack a new power supply with an efficient adjustable step-down converter and enough oomph to not be bothered by sudden spikes in demand. Instead of 5 volts, this one’s ready to accept anything from 6 to 30 volts on the input. With only a short cable to the micro USB in, an extra buffer capacitor and two additional USB power-only sockets, now I can run my USB-boot SSD without piping its current through the Pi’s USB ports). I set the voltage level to 5.1 volts and the Pi hasn’t had a hiccup since.
The circuitry is quite simple, and the parts were sub-10 € in total:
- Switching power supply for 220 V AC to 12V 2.5 A DC, 2.95 €
- Adjustable buck converter XL4015 max. 30V/5A, 1.30 €
- 12V connector 5.5 / 2.1 mm, 0.35 €
- MicroUSB charge cable (to cut apart), 1 €
- USB socket "dual layer female A", solderable, 0.15 €
- piece of perfboard 2x8cm, 0.20 € in bulk or 2 € solo ...
- some wire and shrink wrap, < 1 €
Using two leftover 1/10" 90° pins, I soldered the negative pads of the regulator perpendicular to the perfboard, then added the 12V connector on one end and the USB socket on the other. The buffer capacitor sits on the other side of the perfboard, mainly because it didn’t fit anywhere else. I soldered the output of the regulator to the red (+) and black (-) wires (or, for this cable, (-) to the unisolated ground bundle) of the microUSB plug, and to the power lines of the USB socket.
DO NOT connect the raspberry and the USB SSD until you've adjusted the output level to 5 volts. Most of these modules come with a "random" output, which may be as high as the raw input voltage, and will fry your Pi. Use the potentiometer to adjust the output to 5.1 volts - this may require a lot of turns counter-clockwise (YMMV) because there's a tiny worm screw gear inside. (If it starts clicking against the end stop and the output still hasn’t decreased, you’ve been turning it the wrong way.)
Once that’s sorted out, you can plug in your Raspberry Pi and extra storage and it won’t go down easily (the regulator has built-in short-circuit, over-temp and over-current protection). Even though the supply I used offers "only" 2.5 amps, the nice thing is that it's incoming at 12 volts (12 V x 2.5 A = 30 watts), and buck regulators do not burn off the extra voltage as heat like linear regulators do, but rather they "trickle" short bursts of electrons through the coil, then smooth that out into a regulated lower-voltage steady stream. So you can pull 4 amps at 5 volts (20 Watts) at the output with no problem (if the wires are up to it).
No more timelapses filling up the SD card, either Now I just need to make an enclosure so I can mount it to my printer …