Math Bridge: LED current and an LDR divider

← Back to Getting Started With Hardware Prototyping
Math BridgePrototypingStruggle-friendly runway

Why do an LED resistor and a light sensor use the same law?

Use voltage, current, and resistance once to protect an LED, then again to turn an LDR into an ADC reading.

Voltage Vera, the prototyping guideVoltage Vera guides
The one targetTurn two simple resistor circuits into expected bench readings.
The chapter caseA 3.3 V LED path and a 10 kΩ LDR divider.
What it buys youNumbers to check before declaring that the input works.

A field team faces an unresolved physical question: Why do an LED resistor and a light sensor use the same law? They must answer it before changing led resistor on the real device. Predict the direction first.

See the relationship before changing it

The figure reads from left to right. The blue card is led resistor. The middle card applies this page's relationship. The green card is selected divider voltage. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This added model holds every other chapter fixture fixed, so the numeric fixture does not switch without explanation.

LED resistor changes selected divider voltage An input card leads through the page relationship to the selected divider voltage result. SET INPUT ONE CONTROL APPLY RULE predict calculate check units READ RESULT
Walk the arrows. The fixed resistor and LDR share one rail. Their resistance ratio, not resistance alone, decides the voltage share.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline for led resistor is 8.

  2. 2

    Name the relationship. R LED =(3.3-2.0)/0.010=130 ohm V bright =3.3x10/(10+8)=1.83 V code bright =4095x1.83/3.3≈2,275 V dark =3.3x10/(10+1000)=0.0327 V code dark ≈41

  3. 3

    Substitute the chapter fixture. Set led resistor to 8. The page ledger gives selected divider voltage as 1.83 V.

  4. 4

    Read the result. Keep V beside the value. Use it only inside the technical boundary on this page.

Predict, then change led resistor

Try Predict the direction of selected divider voltage. Move one control, calculate, then check your prediction.

8
Chapter baseline
Selected divider voltage

Observe The fixed resistor and LDR share one rail. Their resistance ratio, not resistance alone, decides the voltage share. Reset the control to 8 and compare selected divider voltage.

Explain Only led resistor moves here. The other chapter fixtures remain fixed.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only led resistor moves. Field effects named in the page's technical boundary stay fixed.

1. Start with what the resistor controls

An LED has a forward voltage, but it does not hold its own current to a safe value. A series resistor spends the remaining rail voltage and sets the current. An LDR changes resistance with light. Paired with a fixed resistor, it turns that change into a voltage ratio that an ADC can read.

Voltage Vera: The LED path asks for current. The LDR path asks for voltage. Both start from the same relationship among V, I, and R.

2. Name every algebra move

1

Find voltage across the LED resistorSubtract the LED forward voltage from the rail.

2

Choose resistanceUse R=(VS−Vf)/I.

3

Add divider resistanceFind Rfixed+Rsensor.

4

Take the fixed-resistor shareVout=VSRfixed/(Rfixed+Rsensor).

5

Scale voltage to ADC codecode=4,095×Vout/Vref.

3. Reproduce the chapter case

RLED=(3.3−2.0)/0.010=130 Ω
Vbright=3.3×10/(10+8)=1.83 V
codebright=4095×1.83/3.3≈2,275
Vdark=3.3×10/(10+1000)=0.0327 V
codedark≈41

The divider is not a linear light meter. As sensor resistance grows far beyond 10 kΩ, equal resistance changes produce smaller voltage and code changes. The raw code must be recorded with the lighting condition.

4. Try the LDR resistance

TryMove the LDR resistance while the rail, fixed resistor, LED, and ADC stay fixed.

LED resistor
Selected divider voltage
Selected ADC code
1 MΩ dark voltage
1 MΩ dark code
Divider current

ObserveRaising LDR resistance lowers the output voltage and ADC code, but the same resistance step produces less code movement toward the dark end.

ExplainThe fixed resistor and LDR share one rail. Their resistance ratio, not resistance alone, decides the voltage share.

Technical boundaries.

This is a static ideal divider and nominal LED calculation, not a complete sensor or protection design.

LED
Forward voltage changes with part, current, and temperature; choose a standard resistor and verify current
LDR
Resistance versus lux is part-specific, curved, slow, and temperature-dependent
ADC
Input impedance, settling, noise, reference error, and calibration affect the code

Measure voltage and raw code at named light conditions before choosing thresholds.

5. Use the numbers at the bench

Before connecting the LED, calculate the resistor and check the chosen standard value. Before trusting the LDR, measure rail voltage, divider voltage, and raw ADC code in at least bright, normal, and dark conditions. A statement such as “sensor works” loses the curve that threshold design needs.

6. Record the evidence state

Store the rail, LED part and forward voltage, resistor value, measured current, LDR part, fixed resistor, wiring order, ADC reference and mode, raw codes, light conditions, temperature, board, and firmware version.

7. Check yourself

Why is the LED resistor 130 Ω in the teaching case?
Answer: It must drop 3.3−2.0=1.3 V at 0.010 A, so R=1.3/0.010=130 Ω.
Why is the bright divider output 1.83 V?
Answer: The 10 kΩ fixed resistor receives 10/(10+8) of 3.3 V.
Does ADC code 2,275 mean a known light level?
Answer: No. It is the voltage ratio for the assumed resistance; a real lux value needs the LDR curve and calibration.
Honesty boundary.

The arithmetic reproduces the chapter's 3.3 V rail and catalog-typical LED and LDR values.

130 Ω
A calculated value before standard-value selection and measurement
2,275
An ideal 12-bit code from an assumed 8 kΩ LDR
41
An ideal code at an assumed 1 MΩ, not a universal darkness threshold

Correct, not complete: this ledger does not map raw code to lux or prove electrical safety without measurement.