Labs / Analog · Beginner · 20 min
Voltage divider
Use Vout = Vin x R2 / (R1 + R2) to scale a signal.
Engineering instrumentation: This lab includes an instrument-style virtual test setup and parameter-driven waveform. For physical measurements, use the Practical Bench.
Parts
- Resistors 10k x3
- Breadboard
- Multimeter
- ESP32
Steps
- Connect R1 and R2 in series between Vin and GND.
- Measure the middle point.
- Change R2 and note Vout.
- Use it to scale 5 V to 3.3 V for the ESP32.
Safety: check polarity and power off before changing the circuit.
ESP32 code (Arduino IDE)
const int PIN=34;\nvoid setup(){ Serial.begin(115200); }\nvoid loop(){ int raw=analogRead(PIN); float v=raw*3.3/4095;\n Serial.println(v); delay(200); }Viva questions
Vout with equal resistors?
Half of Vin.
Why not power a motor from a divider?
The output voltage drops when current is drawn. A divider is for signals only.
Divide 5 V to 3.3 V?
R1 = 5.1k and R2 = 10k gives about 3.3 V.