Resources · Interactive tool

Voltage Divider Designer

The turbidity sensor speaks in 0–4.5V, but an ESP32 pin dies above 3.3V. Two resistors solve it — and which two resistors is a better question than it looks. Drag the sliders and watch the divider point climb and fall on the voltage ladder; the tap always sits at the R2 ⁄ (R1 + R2) fraction of the input.

Then try the presets. All three pairs make the same voltage. Only one of them is a good circuit.

TURBIDITY OUT 4.50V R1 10.0 kΩ DIV R2 20.0 kΩ GND VOLTS 0 5 VIN 3.3V MAX VOUT 3.00V ESP32-S3 GPIO2 · ADC PIN SAFE
STEP 1

Sensor output — VIN

4.50V

The turbidity sensor outputs 0 – 4.5V. Slide to simulate murkier water.

Resistors

R1 10.0 kΩ
R2 20.0 kΩ

Live math

3.00 V at the divider point

Try these

Same ratio → same voltage. So why does the unit insist on 10k + 20k? Watch the current line and the ADC noise.

Simulated ADC · GPIO2

-- sampling --
Challenges
  • Prove that only the ratio sets the voltage — find three different pairs that all give 3.00V.
  • Find a pair that's electrically safe but would drain the battery. What's it costing in mA?
  • Find a pair that's safe and efficient but useless — watch the ADC jitter grow.
  • Set VIN to 3.0V and remove the divider's safety margin (make VOUT ≈ VIN). Why is "safe right now" not the same as safe?
Why 10k + 20k

The ⅔ ratio caps a 5V worst case at 3.33V — safe by design, not by luck. The 30kΩ total draws about 0.15mA, small enough to ignore. And looking back from GPIO2, the divider "feels" like a ~6.7kΩ source — low enough that the ADC's little sips of current stay steady and the numbers don't jitter. Safe, frugal, and quiet: that's the whole design argument, and it's Lesson 8 of the unit. Gate 4 in the circuit sandbox verifies exactly this before GPIO2 is ever connected.