Configuring resistance in an electric circuit to scale voltage or limit current relies primarily on the series voltage divider topology. Unlike a simple series current-limiting resistor, a two-resistor divider creates a predictable, load-independent reference voltage at a specific node. In this guide, we will design a light-sensing voltage divider for an ESP32 microcontroller, analyze its failure modes, and map out exactly how to breadboard and test it.
Designing a Voltage Divider: The Core Resistance Topology
When you need to step down a voltage or create a variable analog signal from a resistive sensor, the standard topology is the two-resistor series voltage divider. Let us define the nodes for our reference design:
- Node A (VCC): The 3.3V supply rail.
- Node B (Vout): The midpoint junction between the two resistors, feeding the microcontroller ADC.
- Node C (GND): The 0V system ground.
In this configuration, R1 connects between Node A and Node B. R2 connects between Node B and Node C. The output voltage at Node B is determined by the ratio of R2 to the total series resistance: Vout = VCC * (R2 / (R1 + R2)).
Why This Topology Over a Rheostat?
A common beginner mistake is using a single variable resistor (a rheostat) in series with the load to drop voltage. The problem with a rheostat is that its voltage drop depends entirely on the current drawn by the load. If the load's impedance changes, the voltage sags unpredictably. A stiff voltage divider, however, provides a low-impedance Thevenin equivalent source. By drawing a small, constant quiescent current through R1 and R2, the divider maintains a stable voltage ratio at Node B regardless of minor fluctuations in the downstream load, provided the load impedance is significantly higher than the divider's Thevenin resistance.
Real-World Design Walkthrough: LDR Sensor for ESP32
Let us build a practical light-sensing circuit. We will use a GL5528 Light Dependent Resistor (LDR) as R2, and a fixed metal film resistor as R1. The GL5528 has a nominal resistance of 10kΩ at 10 lux, drops to roughly 1kΩ in bright room light, and rises to over 100kΩ in the dark.
To keep our Thevenin source impedance well under the ESP32's 10kΩ ADC limit across most lighting conditions, we will select a 10kΩ 1/4W 1% metal film resistor (e.g., Yageo MFR-25 series) for R1. We will connect Node B to GPIO 34 (ADC1_CH6), which is an input-only pin with no internal pull-up/pull-down conflicts.
Breadboard and Test Procedure
Follow these numbered steps to build and verify the circuit on a standard 830-point solderless breadboard:
- De-energize the board: Ensure the ESP32 is unplugged from USB power before inserting components.
- Insert R1: Place the 10kΩ fixed resistor with one leg in the 3.3V rail (Node A) and the other leg in row 10 (Node B).
- Insert R2 (LDR): Place the GL5528 LDR with one leg in row 10 (Node B) and the other leg in the GND rail (Node C). Polarity does not matter for standard LDRs.
- Route the Signal: Use a 22 AWG solid core jumper wire to connect row 10 (Node B) to GPIO 34 on the ESP32.
- DMM Continuity Check: Set your multimeter to continuity mode. Probe Node B and GND. You should read the resistance of the LDR (cover it with your hand; it should read >50kΩ). Probe Node A and Node B; you should read exactly 10kΩ.
- Power and Verify: Plug in the ESP32. Set your DMM to DC Volts. Probe Node B (row 10) relative to GND. In normal room light, you should read approximately 1.65V (half of 3.3V, since both resistors are roughly 10kΩ).
- Dynamic Test: Cover the LDR completely with your finger. The resistance of R2 will spike, and your DMM should show Vout rising toward 3.0V - 3.3V. Shine a flashlight on it; Vout should drop below 0.5V.
Behavior Matrix and Extreme Failure Modes
Understanding what happens when components drift or fail is what separates a hobbyist from a reliable designer. Below is the behavior matrix detailing how the circuit responds to changes in the resistive elements, followed by an analysis of extreme short and open faults.
| Element Changed | Effect on Total Series Resistance | Effect on Vout (Node B) | Effect on Quiescent Current |
|---|---|---|---|
| R1 (Fixed) Increases | Increases | Decreases (closer to GND) | Decreases |
| R1 (Fixed) Decreases | Decreases | Increases (closer to VCC) | Increases |
| R2 (LDR) Increases (Dark) | Increases | Increases (closer to VCC) | Decreases |
| R2 (LDR) Decreases (Light) | Decreases | Decreases (closer to GND) | Increases |
What Breaks at the Extremes?
When designing for production or harsh environments, you must calculate the fault states. Here is what happens when a component catastrophically fails:
- R1 Shorts (0Ω): Node B is tied directly to 3.3V. Vout = 3.3V. The current is now limited only by R2. If the LDR is in bright light (1kΩ), current spikes to 3.3mA. This is well within the 1/4W rating of the LDR and the 3.3V rail capacity, but the ADC will permanently read maximum (4095 on a 12-bit scale).
- R1 Opens (Infinite Ω): The path to VCC is broken. Node B is pulled down to 0V entirely through the LDR. The ADC reads 0. No excessive current flows.
- R2 (LDR) Shorts (0Ω): Node B is tied directly to GND. Vout = 0V. The current is limited by R1 to exactly 0.33mA (3.3V / 10,000Ω). Power dissipation in R1 is ~1mW. The circuit is perfectly safe, but the ADC reads 0.
- R2 (LDR) Opens (Infinite Ω): The path to GND is broken. Node B floats up to 3.3V through R1. Because the ESP32 ADC input impedance is extremely high (>1MΩ), Node B will sit at 3.3V, and the ADC will read maximum. Again, no overcurrent hazard exists.
For a deeper theoretical foundation on how these ratios scale, the SparkFun Voltage Divider Tutorial provides excellent visual breakdowns of the underlying Kirchhoff's Voltage Law (KVL) proofs.
Frequently Asked Questions: Resistance in an Electric Circuit
How do you calculate total resistance in an electric circuit with mixed topologies?
For mixed series-parallel circuits, you must reduce the network step-by-step from the inside out. First, identify resistors that are strictly in parallel (sharing the exact same two nodes) and combine them using the reciprocal formula: R_parallel = 1 / (1/R1 + 1/R2). Treat that combined equivalent resistance as a single new resistor. Next, add any resistors in series with that new equivalent block using simple addition (R_series = R1 + R2). Repeat this reduction process until the entire network is collapsed into a single equivalent resistance value between the main supply nodes. If the circuit contains bridge configurations that cannot be reduced this way, you must apply a Delta-Wye (Δ-Y) transform or use mesh/nodal analysis.
Why does resistance in an electric circuit change when temperature increases?
Resistance changes with temperature due to the Temperature Coefficient of Resistance (TCR). In standard conductors like copper wire, an increase in temperature causes the metal lattice to vibrate more intensely, increasing the collision rate for free electrons and thereby increasing resistance (a positive TCR, or PTC). However, in semiconductors, thermistors (NTC), and carbon-based components like the LDR used in our walkthrough, heat provides enough thermal energy to free additional charge carriers, which actually decreases the resistance. When designing precision analog circuits, you must select resistors with a low TCR (e.g., ±25 ppm/°C metal film) to prevent thermal drift from skewing your voltage divider ratio.
What happens to the power dissipation when you double the resistance in an electric circuit?
The answer depends entirely on whether the circuit is driven by a constant voltage source or a constant current source. If the circuit is connected to a constant voltage source (like a 3.3V regulator or a battery), doubling the resistance will halve the power dissipation, governed by the formula P = V² / R. Conversely, if the circuit is driven by a constant current source (like an LED driver or a bias current mirror), doubling the resistance will double the power dissipation, governed by the formula P = I² * R. Always identify your source type before swapping resistor values to manage thermal loads.






