class: center, middle, inverse, title-slide .title[ # The Voltage Divider, Potentiometer & Photoresistor ] .subtitle[ ## Programmable Electronics — Unit 1 ] .date[ ### Class 6 ] --- # Learning Targets .lt-box[ - Derive and apply the voltage divider equation. - Explain how a potentiometer acts as an adjustable voltage divider — and, wired differently, as an adjustable resistor. - Explain how a photoresistor's resistance changes with light, and use it in a voltage divider to sense brightness. - Build a potentiometer-controlled LED dimmer and a photoresistor-driven light sensor. ] .eu-label[Essential Understanding:] Two resistors in series don't just add up — the point *between* them sits at a predictable voltage. That single idea is how almost every sensor in this course turns a physical quantity into something a circuit can read. --- # Agenda .agenda-box[ 1. The voltage divider: two resistors, one useful midpoint 2. Deriving the equation 3. The potentiometer: a divider you can turn — and a resistor you can turn 4. Quick exercises 5. Choosing resistor values for the dimmer 6. **Build 1 (15 min):** potentiometer LED dimmer 7. The photoresistor: resistance that changes with light 8. Photoresistor + voltage divider = a light sensor 9. Quick exercise 10. Choosing the fixed resistor for the photoresistor divider 11. **Build 2 (20 min):** photoresistor night-light preview 12. Homework ] --- # Two resistors, one useful midpoint .pull-left.w45[ <img src="assets/schematics/voltage-divider.svg" alt="Voltage divider: R1 and R2 in series, Vout tapped between them" style="max-height:340px;display:block;margin:0 auto;"/> ] .pull-right.w50[ - Two resistors in series, from a supply voltage down to ground. - The point *between* them sits at a voltage somewhere between `\(V_{in}\)` and 0 — exactly where depends on the ratio of the two resistors. - That midpoint, `\(V_{out}\)`, is what you tap with a wire (or a multimeter probe) to use elsewhere in your circuit. ] --- # Deriving the equation Same current flows through both resistors — it's a series circuit, just like Class 4. `$$I = \frac{V_{in}}{R_1 + R_2}$$` `\(V_{out}\)` is just the voltage across `\(R_2\)` alone — apply Ohm's law to `\(R_2\)` using that same current: `$$V_{out} = I \times R_2 = \frac{V_{in}}{R_1 + R_2} \times R_2$$` `$$V_{out} = V_{in} \times \frac{R_2}{R_1 + R_2}$$` --- # Quick exercise `\(V_{in} = 6\,\text{V}\)`, `\(R_1 = 1\,\text{k}\Omega\)`, `\(R_2 = 2\,\text{k}\Omega\)`. 1. Calculate `\(V_{out}\)`. 2. If you swapped `\(R_1\)` and `\(R_2\)`, would `\(V_{out}\)` go up or down? Predict before you calculate — then check. Show your work in your notebook. --- # The potentiometer .pull-left.w40[ <img src="assets/schematics/potentiometer-divider.svg" alt="Potentiometer wired across Vin and ground, wiper tapped as Vout" style="max-height:320px;display:block;margin:0 auto;"/> ] .pull-right.w55[ - A potentiometer ("pot") is a single resistor with a **third terminal** — a wiper that slides along it. - The two ends are `\(R_1 + R_2\)` combined, fixed. The wiper's position sets how much is on each side — exactly like our two-resistor divider, but adjustable by hand. - Turn the knob, and you're sliding the "midpoint" of the divider back and forth between the two ends. ] --- # The same pot, wired as a rheostat .pull-left.w50[ <img src="assets/schematics/potentiometer-rheostat.svg" alt="Potentiometer using one end and the wiper, in series with a resistor and LED across the 6 V supply; third pin unused" style="width:100%;margin-top:1em;"/> ] .pull-right.w45[ - Use only **two** terminals — one end, plus the wiper — and ignore the third end entirely. - Now the pot behaves as a single **adjustable resistor**: turning the knob changes one resistance value directly, instead of splitting a voltage between two. - This is called using the pot as a **rheostat**. It's the same physical part, wired differently, doing a different job — controlling current instead of tapping a voltage. ] --- # Quick exercise A potentiometer's two ends are connected across a 6 V supply, wiper output goes to `\(V_{out}\)`. 1. Where should the wiper sit for `\(V_{out} = 6\,\text{V}\)`? 2. Where should it sit for `\(V_{out} = 0\,\text{V}\)`? 3. Where should it sit for `\(V_{out} = 3\,\text{V}\)`? 4. Now imagine it's wired as a rheostat instead (end + wiper only), in series with an LED and a fixed resistor. At which of those same wiper positions would the LED be **brightest**? Why? --- # Choosing resistor values for the dimmer Goal: the LED should visibly dim and brighten across the **whole** knob turn — bright at one end, still glowing (not dark) at the other — without ever exceeding a safe current. As a rheostat, the pot's resistance *can* reach 0 Ω at one end — but the 220 Ω is always in series with it, so that end is never a bare short. It's the safety floor under every "brightest" number below. `$$I = \frac{V_{in} - V_f}{R_{fixed} + R_{pot}}$$` With `\(V_{in} = 6\,\text{V}\)`, `\(V_f \approx 2\,\text{V}\)` (red LED), `\(R_{fixed} = 220\,\Omega\)` — the same pair you've used since Class 2: | `\(R_{pot}\)` | Brightest (`\(R_{pot}=0\)`) | Dimmest (`\(R_{pot}=\)` max) | |---|---|---| | 1 kΩ | 18.2 mA | 3.3 mA | | 10 kΩ | 18.2 mA | 0.39 mA | | 100 kΩ | 18.2 mA | 0.04 mA | Only the **1 kΩ** pot keeps the LED visibly lit across its *entire* range — that's why Build 1 uses it. **Quick exercise:** verify the 10 kΩ row's dimmest-current number yourself using the formula above, then explain in one sentence why that pot would make a disappointing dimmer. --- class: center, middle # Build 1 (15 min): potentiometer LED dimmer <img src="assets/schematics/potentiometer-rheostat.svg" alt="Potentiometer using one end and the wiper, in series with a 220 ohm resistor and LED across the 6 V supply; third pin unused" style="max-height:320px;margin-top:0.5em;"/> --- # Build 1 instructions With your partner, using your breadboard, 6 V battery pack, multimeter, **your 1 kΩ potentiometer**, an LED, and a 220 Ω resistor: 1. Build a fixed voltage divider with two resistors of your choice. **Predict** `\(V_{out}\)` first, then measure it. Do they match? 2. Swap in the potentiometer in place of your two resistors — same two end-terminals across the supply, wiper to `\(V_{out}\)`. Measure `\(V_{out}\)` at three positions: fully one way, fully the other way, and roughly in the middle. 3. Now rewire it as a **rheostat**: one end terminal + the wiper only, in series with your 220 Ω resistor and the LED, across the 6 V supply. Leave the third terminal unconnected. 4. Slowly turn the knob end to end. The LED should dim and brighten smoothly — does it match your quick-exercise prediction? 5. In your notebook, sketch both circuits (3-terminal divider vs. 2-terminal rheostat) and label what each one is actually doing. --- # The photoresistor .pull-left.w40[ <svg viewBox="0 0 100 100" width="100%" style="max-height:200px;"> <line x1="2" y1="50" x2="20" y2="50" stroke="#333" stroke-width="3"/> <circle cx="50" cy="50" r="30" fill="none" stroke="#333" stroke-width="2.5"/> <polyline points="30,50 36,40 42,60 48,40 54,60 60,40 70,50" fill="none" stroke="#333" stroke-width="3"/> <line x1="80" y1="50" x2="98" y2="50" stroke="#333" stroke-width="3"/> <line x1="4" y1="10" x2="19" y2="25" stroke="#333" stroke-width="2"/> <polyline points="13,25 19,25 19,19" fill="none" stroke="#333" stroke-width="2"/> <line x1="16" y1="4" x2="31" y2="19" stroke="#333" stroke-width="2"/> <polyline points="25,19 31,19 31,13" fill="none" stroke="#333" stroke-width="2"/> </svg> ] .pull-right.w55[ - A photoresistor (LDR, "light-dependent resistor") is a resistor whose resistance changes with the light hitting it. - **Dark → high resistance** (megaohms). **Bright → low resistance** (hundreds of ohms). - It's a passive component — no polarity, no "forward voltage" to worry about, just a resistance that reacts to light. ] --- # Turning light into a voltage .pull-left.w55[ A photoresistor alone doesn't give you a voltage you can read — it just changes resistance. Put it in the **voltage divider** you already know, with a fixed resistor, and the midpoint voltage now tracks light level. `$$V_{out} = V_{in} \times \frac{R_{fixed}}{R_{LDR} + R_{fixed}}$$` **Quick exercise:** if the LDR is on top (`\(R_1\)`) and the fixed resistor is on the bottom (`\(R_2\)`), what happens to `\(V_{out}\)` as the room gets darker (LDR resistance rises)? Predict, then check with the equation. ] .pull-right.w40[ <img src="assets/schematics/photoresistor-divider.svg" alt="Fixed resistor R1 on top, photoresistor R2 on the bottom, Vout tapped between them" style="max-height:340px;display:block;margin:0 auto;"/> ] --- # Which side should the LDR go on? Think ahead to Build 2 today — and to the Unit 1 milestone in a few classes: a nightlight that should get brighter as it gets **darker**. That means you want `\(V_{out}\)` to go **up** as light goes **down** — which tells you exactly which position the LDR needs to sit in in the divider. Work it out with your partner: top (`\(R_1\)`) or bottom (`\(R_2\)`)? Be ready to justify it with the equation, not just a guess. --- # Choosing the fixed resistor .pull-left.w50[ Every LDR is different, so there's no single "right" value — but there's a principle. We want `\(V_{out}\)` to swing *across* the LED's ~2 V threshold between light and dark, not sit stuck above or below it. - Too **small** (close to `\(R_{bright}\)`) → `\(V_{out}\)` stays high even in bright light — LED never turns off. - Too **large** (close to `\(R_{dark}\)`) → `\(V_{out}\)` stays low even in the dark — LED barely turns on. - **Sweet spot** — the *geometric mean*: `$$R_{fixed} \approx \sqrt{R_{bright} \times R_{dark}}$$` ] .pull-right.w45[ **Worked example:** LDR reads 1 kΩ bright, 100 kΩ covered. `$$\sqrt{1{,}000 \times 100{,}000} = 10\,\text{k}\Omega$$` That's exactly your kit's 10 kΩ pot, left untouched — why Build 2's tip suggests trying it as the fixed resistor. ] --- class: center, middle # Build 2 (20 min): photoresistor night-light preview <img src="assets/schematics/photoresistor-led-tap.svg" alt="Photoresistor divider with an LED and 220 ohm resistor tapped from Vout to ground, in parallel with the LDR" style="max-height:320px;margin-top:0.5em;"/> --- # Build 2 instructions With your partner, using your breadboard, 6 V battery pack, multimeter, photoresistor, a fixed resistor, a second LED, and a second 220 Ω resistor: 1. With the photoresistor alone (not yet in the circuit), measure its resistance in normal room light, then covered by your hand. Calculate `\(\sqrt{R_{bright} \times R_{dark}}\)` — that's your target fixed resistor. Pick the closest value you have, including your 10 kΩ or 100 kΩ pot left untouched. 2. Build a voltage divider using the photoresistor and your chosen fixed resistor, with the LDR in the position you justified earlier. 3. Measure `\(V_{out}\)` under normal room light, then cover the photoresistor with your hand and measure again. Did it move the direction you predicted? 4. Now tap an LED (with its own 220 Ω resistor) from `\(V_{out}\)` to ground — same idea as the dimmer in Build 1, but now a sensor is turning the knob instead of your hand. 5. Cover and uncover the photoresistor. Watch the LED. 6. Try a different fixed-resistor value, further from your calculated target. Is the effect less dramatic, like the calculation predicts? .small-font[(If you used a pot as the fixed resistor, this is just a knob-twist.)] .small-font[Notice: once the LED is connected, it's drawing current out of the divider too, which nudges Vout away from your clean equation. That's a real-world wrinkle — and exactly why, in a few classes, you'll use a transistor to let the sensor *control* the LED without being loaded down by it.] --- class: center, middle # Homework .hw-box[ - In your notebook, explain in your own words why a potentiometer is "a voltage divider you can turn" — and separately, why the same part can also act as "a resistor you can turn." - Describe what you saw in Build 2: which direction did the LED respond to darkness, and does that match what a real nightlight needs to do? - Record any measurements from either build you didn't finish in class. ]