System Design

Power Supply and Decoupling Design for Microcontroller Circuits

How to power a microcontroller reliably: choosing an LDO or buck regulator, sizing and placing decoupling capacitors, analog supply filtering, layout and testing.

On this page
  1. What a microcontroller needs from its power supply
  2. Choosing the regulator
  3. Why decoupling capacitors are needed
  4. How to decouple a microcontroller
  5. Choosing the capacitors
  6. Placement and layout
  7. Handling noisy loads: motors, relays and radios
  8. Protection and supervision
  9. Verifying the design
  10. Common mistakes
  11. Checklist

What a microcontroller needs from its power supply

A microcontroller’s power supply has two jobs. It must provide a steady voltage within the range the datasheet specifies, and it must deliver sudden bursts of current without that voltage dipping or ringing.

The second job is harder than it sounds. Digital logic draws current in short spikes every time it switches, at the edges of every clock cycle and every time an output pin changes state. A radio transmission or a motor starting can draw much larger bursts. If the supply can’t respond quickly, the voltage at the chip’s pins sags, which can cause erratic behaviour, corrupted ADC readings, communication errors or resets that are very hard to track down.

A reliable design covers three areas:

  1. Regulation: converting the input source to the right voltage.
  2. Decoupling: small local energy stores at each chip that supply fast current spikes.
  3. Layout: short, low-inductance connections and a solid ground so the first two can work.

Before you start, find your MCU vendor’s hardware design guide. Most manufacturers publish an application note (often titled something like “getting started with hardware development”) with recommended decoupling values and layout for each family. Treat that as your primary reference; the guidance below is general.

Choosing the regulator

Linear regulators (LDOs)

A linear regulator drops the excess voltage across a pass transistor. Low-dropout (LDO) regulators can work with only a small difference between input and output.

Advantages: simple, cheap, few external parts and low output noise.

Disadvantages: they waste the dropped voltage as heat. The power dissipated is roughly:

Power lost = (input voltage − output voltage) × load current

Key specifications to check:

  • Dropout voltage: the minimum input-to-output difference at your load current. For a 3.3 V output from a single lithium cell, for example, dropout matters a lot as the cell discharges.
  • Maximum output current and thermal performance of the package.
  • Quiescent current: the regulator’s own consumption, critical for battery devices. Our article on low-power embedded design covers this.
  • Input voltage rating, including any transients on the input.
  • Capacitor requirements for stability (see below).

Switching regulators

A switching regulator, such as a buck (step-down) converter, uses an inductor and fast switching to convert voltage efficiently, often at high efficiency across a wide range of loads.

Advantages: much less heat when the input is well above the output, or when currents are larger.

Disadvantages: more components, more careful layout, and switching noise that can affect sensitive analog circuits or radios. Some have poor efficiency at very light loads unless they include a low-power mode.

A common compromise is a buck converter to step down from a high input voltage, followed by an LDO for noise-sensitive circuitry.

Worked example: regulator heat

Suppose a board draws 100 mA at 3.3 V.

  • From a 5 V USB supply through an LDO: (5 − 3.3) × 0.1 = 0.17 W. That’s fine for most small packages.
  • From a 12 V supply through an LDO: (12 − 3.3) × 0.1 = 0.87 W. That is likely to make a small SOT-23 package very hot, possibly beyond its limits. A larger package with copper area for heat sinking, or a buck converter, would be more appropriate.

Check the package’s thermal resistance in the datasheet to estimate temperature rise, and remember that real designs may run in a warm enclosure.

Why decoupling capacitors are needed

The regulator might be several centimetres away from the microcontroller. The PCB traces between them have inductance, which resists sudden changes in current. When the MCU suddenly needs a burst of current, the regulator simply can’t deliver it fast enough through that inductance.

A decoupling capacitor placed right next to the chip’s supply pin acts as a tiny local reservoir. It supplies the fast current spike, then recharges from the main supply between spikes. It also gives high-frequency noise generated by the chip a short path to ground, so less of it spreads through the rest of the board.

The terms decoupling capacitor and bypass capacitor are often used interchangeably. Some engineers use “bypass” for the small capacitor at each pin and “decoupling” for larger capacitors that isolate sections of the board, but usage varies.

How to decouple a microcontroller

One small capacitor per supply pin

The standard starting point is a 100 nF (0.1 µF) ceramic capacitor on every power pin, as close as possible to that pin, with a short connection to ground. If a microcontroller has four VDD pins, it needs four capacitors, even if the pins are close together, because each pin feeds a different part of the chip’s internal power grid.

Some datasheets recommend different values, or an additional smaller capacitor (in the nanofarad or picofarad range) for very high-frequency noise. Follow the datasheet where it gives specific guidance.

Bulk capacitance

Small capacitors handle fast spikes but store little energy. Larger “bulk” capacitors, typically a few microfarads up to tens of microfarads, handle slower changes in load and support the supply during bigger bursts:

  • Place one near the MCU, serving the group of supply pins.
  • Place capacitors at the regulator’s input and output as its datasheet specifies.
  • Add bulk capacitance near any high-current load, such as a radio module, motor driver or LED driver, and at the board’s power input.

Analog supply pins (VDDA / AVCC)

The analog supply pin powers the ADC and other analog circuitry. Noise here shows up directly as noise in your measurements. Common practice is:

  • A local capacitor close to the analog supply pin, often a small ceramic in parallel with a larger one, as the datasheet suggests.
  • A filter between the digital and analog supplies, such as a ferrite bead or a small resistor, so digital switching noise doesn’t reach the analog pin.
  • A decoupling capacitor on the voltage reference pin (VREF+ or AREF) if the chip has one.

Core regulator capacitors (VCAP)

Some microcontrollers have an internal regulator for their core logic and require an external capacitor on a dedicated pin, often labelled VCAP or VCORE. These pins usually have strict requirements for capacitance and sometimes for ESR. Getting this wrong can make the chip fail to start or behave unreliably, so follow the datasheet exactly.

Choosing the capacitors

Dielectric types and DC bias derating

Multilayer ceramic capacitors (MLCCs) are the usual choice for decoupling. They come in different dielectric classes:

  • C0G (NP0): very stable, but only practical in small values. Good for small high-frequency capacitors and crystal load capacitors.
  • X7R and X5R: the common choice for 100 nF to several microfarad decoupling. Their capacitance varies somewhat with temperature.
  • Y5V and Z5U: much less stable, losing a large share of their capacitance with temperature and voltage. Generally best avoided for decoupling.

An important effect is DC bias derating: Class 2 ceramics such as X5R and X7R lose a significant part of their capacitance when a DC voltage is applied. A small-package 10 µF capacitor rated for 6.3 V might provide much less than 10 µF when operating at 5 V. Manufacturers publish curves or online tools showing the effective capacitance at a given voltage. Choosing a higher voltage rating or a larger package reduces the effect.

Package size and inductance

Every capacitor has some equivalent series inductance (ESL), which limits how well it works at high frequencies. Smaller packages such as 0402 and 0603 generally have lower inductance than larger ones, and the way the capacitor connects to the board, through traces and vias, often matters even more than the capacitor itself. This is also why a large electrolytic capacitor on its own can’t replace small ceramics at each pin.

Regulator stability and capacitor ESR

LDO regulators need output capacitors to remain stable. Some older designs need capacitors with a minimum equivalent series resistance (ESR), and can oscillate with very low-ESR ceramic capacitors. Many modern LDOs are designed to be stable with ceramics. Always check the regulator’s datasheet for the required capacitance and ESR range, and remember that DC bias derating can reduce the effective capacitance below the required minimum.

Placement and layout

Good decoupling depends as much on layout as on component values:

  • Place each small decoupling capacitor as close as possible to its supply pin, on the same side of the board if you can.
  • Minimise the loop area formed by the supply pin, the capacitor and the ground return. The current flows around this loop, and a smaller loop means lower inductance.
  • Connect to ground with a short path, ideally a via straight into a solid ground plane right next to the capacitor’s pad.
  • Use a continuous ground plane. On a two-layer board, keep one layer as unbroken as possible. On four-layer boards, a common arrangement places a ground plane on the layer directly below the components.
  • Avoid splitting the ground plane under signals unless you have a specific reason; return currents need an unbroken path under their signal traces.
  • Route power with wide traces or copper pours to keep resistance and inductance low.
  • Keep switching regulator “hot loops” tight. In a buck converter, the loop formed by the input capacitor, the switch and the diode or second switch carries fast-changing current. Place the input capacitor right next to the regulator and follow the layout example in its datasheet.

Handling noisy loads: motors, relays and radios

High-current and inductive loads are common causes of microcontroller resets and glitches:

  • Separate supply paths. Feed motors, relays and solenoids from their own supply branch, ideally connecting to the MCU’s supply only at a single point near the power input.
  • Flyback diodes. Put a diode across every relay coil and solenoid to absorb the voltage spike when it switches off.
  • Bulk capacitance at the load, to supply its inrush current locally.
  • Radio modules draw bursts of current when they transmit. Follow the module’s recommended decoupling and keep its supply path short and wide.

If you’re moving from a breadboard prototype, where motors and the MCU often share a supply, our guide from Arduino prototype to custom PCB explains how to separate them on a real board.

Protection and supervision

  • Reverse-polarity protection: a series diode is simple but drops voltage; a P-channel MOSFET arrangement drops less.
  • Overcurrent protection: a fuse or resettable polyfuse at the input.
  • Transient and ESD protection: TVS diodes on power inputs and on connectors that users touch or that run off the board.
  • Brown-out detection: most microcontrollers have a brown-out detector that holds the chip in reset when the supply drops too low. Enable it and set its threshold appropriately, so the MCU doesn’t run unreliably, or corrupt flash writes, during a voltage dip.
  • Supervisors: for critical designs, an external voltage supervisor can provide a more precise or more reliable reset.

Verifying the design

After assembly, check the supply rather than assuming it’s fine:

  • Measure each rail with a multimeter under typical load.
  • Look at the supply with an oscilloscope at the MCU’s pins, using a short ground connection (such as a probe-tip ground spring) rather than the long ground clip, which picks up noise and gives misleading readings.
  • Watch the rail during load changes: a radio transmitting, a motor starting, or the MCU waking from sleep. Check the dips and ringing stay within the MCU’s specified operating range with margin.
  • Check regulator temperature under maximum load.
  • Test brown-out behaviour by slowly lowering and raising the input voltage with a bench supply, and confirm the system resets cleanly.
  • Check ADC noise with a stable input to judge analog supply quality.

These checks are part of hardware-software integration; our article on what embedded testing means puts them in context.

Common mistakes

  • Sharing one decoupling capacitor between several supply pins.
  • Placing capacitors far from the pins, or connecting them to ground through long, thin traces.
  • Ignoring DC bias derating, so the effective capacitance is far below the label.
  • Forgetting the analog supply or the VCAP pin.
  • Using an LDO with a large voltage drop at significant current, leading to overheating.
  • Running motors and relays from the MCU’s supply without separation or flyback diodes.
  • Breaking up the ground plane with long traces running across it.
  • Measuring with a long scope ground lead and either missing real noise or chasing noise the probe created.

Checklist

  1. Read the MCU vendor’s hardware design guide and the regulator datasheet.
  2. Choose an LDO or switching regulator based on voltage drop, current, heat, noise and quiescent current.
  3. Fit a 100 nF ceramic capacitor on every supply pin, plus bulk capacitance near the MCU.
  4. Filter and decouple the analog supply and reference pins.
  5. Fit the exact VCAP capacitor if the MCU requires one.
  6. Choose X5R/X7R or C0G dielectrics and check effective capacitance under DC bias.
  7. Place capacitors close to the pins, with short ground vias into a solid ground plane.
  8. Separate noisy, high-current loads and add flyback diodes.
  9. Add input protection and enable brown-out detection.
  10. Verify the rails with an oscilloscope under real load changes.

Power design is part of the hardware design stage of the embedded system design flow, and the MCU you choose, covered in how to choose a microcontroller, sets many of its requirements.

The complete guide to system design

Introduction to Embedded System Design: The Design Flow
Read the guide

Keep exploring

Guides from other topics

All topics →