1. What is a Voltage Divider?
A voltage divider is a simple linear circuit that outputs a fraction of its input voltage. It is one of the most fundamental building blocks in electronics, constructed using just two resistors connected in series. The voltage drops across the resistors in direct proportion to their resistance values.
Voltage dividers are widely used to read analog sensors, create reference voltages, or shift logic levels between microcontrollers operating at different voltages (e.g., interfacing a 5V sensor with a 3.3V Arduino).
2. The Math Behind the Divider
To understand why this formula works, we apply Ohm's Law ($V = I * R$). In a series circuit, the current ($I$) is identical through both resistors. The total resistance is $R_total = R1 + R2$. Therefore, the current flowing through the loop is $I = V_in / (R1 + R2)$.
Applying Ohm's Law to find the voltage across the ground resistor ($R2$) gives us $V_out = I * R2$. Substituting the current formula into this equation yields the standard voltage divider formula.
// Resistor Voltage Divider Calculator in TypeScript
function calculateVout(vIn: number, r1: number, r2: number): number {
return vIn * (r2 / (r1 + r2));
}
// Example: Stepping down 5V to 3.33V using R1=10k and R2=20k
const vOut = calculateVout(5, 10000, 20000);
console.log(`Vout: ${vOut.toFixed(2)}V`); // Outputs 3.33V3. The High-Current Pitfall
The biggest mistake beginners make is using a voltage divider as a power supply (e.g., trying to step down a 12V battery to 5V to power a motor). Any load connected to the output node ($V_out$) acts as a third resistor in parallel with $R2$. This changes the equivalent resistance of the bottom half of the divider, dragging the output voltage down.
Additionally, voltage dividers waste energy as heat. For power delivery, you should always use a linear voltage regulator or a switching buck converter instead of series resistors.