To measure a 400V DC bus (like an EV battery or solar string) with a 3.3V microcontroller ADC, use a high voltage voltage divider consisting of a 3.3MΩ upper leg (split into three 1.1MΩ series resistors for creepage clearance) and a 24kΩ lower leg, clamped with a 3.3V Zener diode. This topology costs under $0.50, requires no isolated power supply, and provides DC precision that Hall-effect sensors cannot match.
While the math behind a basic resistive divider is simple, scaling it to high voltage introduces parasitic capacitance, ADC sampling errors, and lethal failure modes. This guide walks through the exact component selection, failure analysis, and safe validation steps to get your design from the breadboard to the PCB.
The High Voltage Voltage Divider Topology & Node Map
A high voltage divider is fundamentally two impedances in series, but at 400V+, physical layout becomes as critical as the schematic. We define four critical nodes in this topology:
- Node $V_{IN}$: The high-voltage source (e.g., 400V DC bus).
- Node $V_{DIV}$: The physical junction between the upper resistor string and the lower shunt resistor.
- Node $V_{OUT}$: The microcontroller ADC input pin, protected by a clamping diode.
- Node $GND$: The common ground shared by the high-voltage source and the microcontroller.
The governing equation remains $V_{OUT} = V_{IN} \times \frac{R2}{R1 + R2}$. However, in high-voltage applications, $R1$ is rarely a single physical component. It is a string of series resistors designed to distribute the voltage gradient, preventing internal arcing and satisfying IEC 61010-1 creepage and clearance requirements.
Why Resistive Dividers Beat the Alternatives for DC Buses
Before committing to a resistor network, you must rule out isolated alternatives. Here is how the resistive high voltage voltage divider compares to standard isolated sensing topologies for DC measurement.
| Topology | Example Part | Cost (Approx) | Bandwidth | Isolation | Best Use Case |
|---|---|---|---|---|---|
| Resistive Divider | Vishay VR25 / BZX384 | $0.30 | DC to MHz | None (Galvanic tie) | Cost-sensitive DC bus monitoring, battery packs |
| Hall Effect (Voltage) | LEM LV 25-P | $28.00 | DC to 100kHz | Yes (Galvanic) | Traction inverters, high-noise environments |
| Isolated Amplifier | TI AMC1301 | $4.50 | DC to 200kHz | Yes (Galvanic) | Grid-tied solar, motor phase sensing |
The Verdict: Choose the resistive divider when your system shares a common ground, you are measuring DC or low-frequency AC, and BOM cost is a primary constraint. If the high-voltage side can float to lethal potentials relative to the user or the MCU ground, you must use an isolated amplifier like the AMC1301.
Design Walkthrough: Scaling 400V DC for an ESP32 ADC
Let’s design a divider to measure a 400V nominal DC bus (which can peak at 450V during transients) using an ESP32 ADC (3.3V full-scale, ~10pF internal sampling capacitor).
1. Selecting R2 (The Shunt)
The ESP32 ADC requires a low source impedance to charge its internal 10pF sampling capacitor within the ~1µs acquisition window. If R2 is too large, the reading will be non-linear and artificially low. We target an R2 value around 20kΩ to 30kΩ.
Pick: 24kΩ (Standard E24 value, 1%, 1/4W).
2. Calculating R1 (The Upper Leg)
Using the peak voltage (450V) to ensure we never clip the ADC:
$R1 = R2 \times (\frac{V_{IN(max)}}{V_{OUT(max)}} - 1)$
$R1 = 24k \times (\frac{450}{3.3} - 1) = 3.24M\Omega$
Pick: 3.3MΩ total. To handle the voltage stress and increase physical creepage distance, we split this into three 1.1MΩ resistors in series. Standard 1/4W metal film resistors are rated for ~250V continuous; three in series safely handles 750V.
3. Adding the Protection Clamp
Add a 3.3V Zener diode (e.g., BZX384-C3V3) in parallel with R2. This ensures that if the high voltage bus spikes to 1kV, the ADC pin never sees more than ~3.5V (accounting for Zener dynamic impedance).
Failure Modes: What Breaks at the Extremes?
High voltage circuits fail catastrophically. You must understand exactly what happens when a component fails open or short. This behavior table assumes a 400V $V_{IN}$ and the 3.3MΩ / 24kΩ design above.
| Component Failure | Node $V_{OUT}$ Behavior | System Consequence |
|---|---|---|
| R1 String Opens | Pulled to 0V by R2 | MCU reads 0V. Failsafe. System detects loss of bus voltage. |
| R1 String Shorts | Spikes to 400V | Zener diode clamps it to ~3.5V, drawing massive current. Zener vaporizes (fails open), then MCU ADC is destroyed. |
| R2 Opens | Rises to 400V | Lethal hazard at test points. MCU ADC is instantly destroyed. This is the most dangerous failure mode. |
| R2 Shorts | Drops to 0V | MCU reads 0V. R1 string dissipates $P = \frac{400^2}{3.3M} = 48mW$. No thermal damage. |
| Zener Shorts | Drops to 0V | MCU reads 0V. R2 and R1 form a divider to ground, dissipating normal quiescent power. |
Step-by-Step Breadboard Validation (The Safe Way)
Never breadboard 400V. Standard solderless breadboards are rated for ~50V max. At 400V, the internal spring clips will arc, melt the plastic, and create a lethal shock hazard. To validate your high voltage voltage divider ratio and ADC code, use a low-voltage proxy test.
- Wire the Proxy Circuit: On your breadboard, build the exact divider topology but scale the voltages. Use a 12V bench power supply as $V_{IN}$. Keep R1 as 3.3MΩ and R2 as 24kΩ.
- Verify the Ratio with a DMM: Measure $V_{IN}$ (should be ~12.00V). Measure $V_{DIV}$. It should read $12 \times \frac{24}{3324} = 0.086V$. If it reads significantly higher, your breadboard has leakage paths or your DMM input impedance (usually 10MΩ) is loading the node. (Note: At 400V, the 10MΩ DMM load is negligible, but at 12V with 3.3MΩ resistors, it matters).
- Connect the Microcontroller: Wire $V_{DIV}$ to the ESP32 ADC pin. Read the raw ADC counts via serial monitor.
- Inject a Transient: Momentarily bump the bench supply to 15V to simulate a bus spike. Verify in your serial monitor that your software clamps the reading and doesn't throw an integer overflow error when scaling the math back to the 400V equivalent.
- Transition to Perfboard/PCB: Once the math and code are verified, solder the actual HV components to a PCB with proper 2mm+ clearance slots routed between the high-voltage and low-voltage copper pours.
Decision Tree: Picking Your High-Voltage Divider Components
Use this decision matrix to select your exact component values based on your target bus voltage and microcontroller logic level. Do not guess; follow the path to the concrete BOM pick.
| Target Bus Voltage | MCU Logic | R1 Configuration (Upper) | R2 Value (Lower) | Clamp Diode |
|---|---|---|---|---|
| 12V - 24V DC (Automotive) | 3.3V | Single 100kΩ (1/4W) | 33kΩ | 3.3V Zener |
| 120V AC RMS (Mains) | 3.3V | 2x 1MΩ Series (for AC creepage) | 15kΩ | 3.3V Zener + Series Schottky |
| 400V DC (Solar/EV) | 3.3V | 3x 1.1MΩ Series (Metal Film) | 24kΩ | 3.3V Zener (BZX384) |
| 800V DC (Fast Charger) | 5.0V | 5x 1.5MΩ Series (HV Thick Film) | 39kΩ | 5.1V Zener |
Default Recommendation: For the vast majority of modern DIY and commercial DC bus monitoring (400V nominal), the 3x 1.1MΩ / 24kΩ configuration paired with a BZX384-C3V3 Zener diode is the gold standard. It balances ADC charging time, power dissipation (under 65mW total), and physical safety margins perfectly. Buy Vishay VR25 or Dale RN55 series resistors for long-term stability; avoid cheap carbon composition resistors, which drift significantly under continuous high-voltage stress.






