How to Build a Custom Power Supply for Embedded Systems
In this article
Building a custom power supply for an embedded system means designing a small, dedicated circuit that turns a raw input (USB, battery, wall adapter, or industrial bus) into the clean, regulated voltages your microcontroller and peripherals need. The single most common mistake is skipping the input protection and decoupling that a real embedded load demands. The shortest working path is: define your rails and current budget, pick a regulator topology for each rail, add protection and filtering, lay out the board with short return paths, then test each rail under load before connecting the target. This guide walks through that sequence with practical component choices and the checks that catch problems before they damage your board.
What You'll Need
- A schematic capture and PCB layout tool (KiCad, EasyEDA, or similar).
- Regulator ICs for each rail: a linear regulator (e.g., AMS1117 or LM317) for low-noise analog rails, and a buck converter module or IC for higher-current or wide-input rails.
- Input protection parts: a fuse or resettable polyfuse, a reverse-polarity diode or ideal-diode controller, and a TVS diode for transient suppression.
- Passives: input and output capacitors sized per the regulator datasheet, inductors for switching regulators, and feedback resistors.
- Decoupling capacitors (100 nF and 10 µF) for each IC power pin on the target board.
- Test equipment: a multimeter, an oscilloscope (ideally with a 10x probe), and an adjustable electronic load or power resistors.
- A breadboard or prototype PCB for the first build, plus a known-good bench supply to power it during testing.
Step-by-Step
- Define every rail and its current budget. List each voltage your system needs (for example 5 V input, 3.3 V for the MCU, 1.8 V for a sensor, and a separate analog rail). For each, add up the typical and peak current from the datasheets, then add 30–50% headroom. This budget decides whether a linear regulator is acceptable or whether you need a switching converter.
- Choose the topology per rail. Use a linear regulator when the voltage drop is small and noise matters (analog sensors, ADCs). Use a buck converter when the input is much higher than the output or the current is above roughly 300–500 mA, because a linear regulator will dissipate the difference as heat. For a battery-powered design, check the regulator's quiescent current.
- Add input protection first. Place a fuse or polyfuse in series with the input, a reverse-polarity diode (or ideal-diode controller for low loss), and a TVS diode across the input to clamp transients. These parts protect everything downstream and are cheap insurance.
- Design the input filter. Add a bulk electrolytic or ceramic capacitor (typically 10–100 µF) at the input, plus a smaller 100 nF ceramic close to the regulator. For switching regulators, follow the datasheet's recommended input capacitor value and placement exactly; too little input capacitance causes instability and voltage spikes.
- Set the output voltage correctly. For adjustable regulators, calculate the feedback resistor divider from the datasheet formula and use 1% resistors. For fixed regulators, verify the part number's voltage before soldering. Double-check the pinout against the datasheet; regulator pinouts are not standardized across families.
- Add output capacitance and decoupling. Place the datasheet-recommended output capacitor at the regulator, then distribute 100 nF ceramics at each IC power pin on the target board. Keep the regulator's output capacitor close to its output pin and its ground return short.
- Lay out the board for short return paths. Keep the input capacitor, regulator, and output capacitor in a tight loop. Route the ground return directly under the regulator and use a ground plane. Keep switching nodes small and away from sensitive analog traces. For linear regulators, provide a copper pour or heatsink pad if dissipation is above roughly 0.5 W.
- Test each rail in isolation before connecting the load. Power the board from a current-limited bench supply set to the expected input voltage. Measure each output with a multimeter. Then load each rail with a power resistor or electronic load at 50% and 100% of the budget and re-measure. Check ripple with an oscilloscope using a short ground lead.
- Check thermal performance under load. Run the supply at full load for several minutes and measure the regulator's case temperature. For linear regulators, calculate dissipation as (Vin − Vout) × Iout and compare with the package's thermal resistance. If it is too hot, add copper area, a heatsink, or switch to a buck converter.
- Connect the target and verify again. With the rails confirmed, connect the embedded system and re-check voltages at the target's power pins. Look for droop during boot or radio transmission, which indicates insufficient bulk capacitance or a regulator that cannot supply peak current.
Common Mistakes
- Omitting input protection, so a reversed adapter or a transient destroys the regulator and the MCU.
- Using a linear regulator for a large voltage drop at high current, which overheats the part and can shut down the system intermittently.
- Placing the output capacitor too far from the regulator, which causes oscillation in some linear and switching regulators.
- Ignoring the datasheet's minimum output capacitance or ESR requirements, especially for low-dropout regulators that need a specific capacitor type.
- Forgetting decoupling at the target ICs and relying only on the regulator's output capacitor.
- Testing with a high-current supply and no current limit, which turns a wiring mistake into a burned board.
Tips
- Keep a spare prototype board and test one rail at a time; debugging a multi-rail board is much harder.
- Use a current-limited bench supply for first power-up and set the limit just above the expected current.
- Measure ripple with the oscilloscope probe's ground spring, not the long ground clip, to avoid picking up loop noise.
- Label each rail on the schematic and silkscreen so you do not mix 3.3 V and 5 V later.
- For battery designs, check the regulator's dropout voltage and quiescent current at the lowest battery voltage.
Troubleshooting
- Output voltage is zero: check the fuse, reverse-polarity diode orientation, and regulator pinout. Verify the enable pin is pulled to the correct level.
- Output voltage is wrong: recheck the feedback resistor values and the regulator's reference voltage. Confirm you are measuring at the output capacitor, not before it.
- Regulator gets very hot: calculate dissipation and compare with the package rating. Reduce the input voltage, add copper area, or switch to a buck converter.
- System resets during operation: look for voltage droop at the target during peak current. Add bulk capacitance and verify the regulator's peak current rating.
- Excessive ripple or oscillation: check output capacitor value and ESR against the datasheet, shorten the capacitor's return path, and verify the input capacitor is close to the regulator.
Frequently Asked Questions
Can I use a linear regulator for a 12 V to 3.3 V conversion?
Only for very low current. The regulator dissipates (12 − 3.3) × Iout as heat, so at 500 mA that is about 4.35 W, which most small packages cannot handle. Use a buck converter instead.
Do I need a separate analog rail?
Only if your sensors or ADCs are sensitive to switching noise. A linear regulator fed from the main rail, plus ferrite beads and decoupling, is usually enough for hobby-level analog.
How much input capacitance should I add?
Follow the regulator datasheet's recommended value and place it close to the input pin. As a starting point, 10–100 µF bulk plus 100 nF ceramic works for many designs, but switching regulators often specify tighter values.
Why does my regulator oscillate?
Most often the output capacitor is the wrong value or ESR, or it is too far from the regulator. Some low-dropout regulators require a specific capacitor type; check the datasheet's stability section.
Can I power the embedded system directly from USB?
Yes, if the total current stays within the USB port's limit and you add the required decoupling. For higher current or higher voltage, use a dedicated adapter with input protection.