class: center, middle, inverse, title-slide .title[ # Ohm’s Law & the LED Driver Circuit ] .subtitle[ ## Programmable Electronics — Unit 1 ] .date[ ### Class 2 and beyond ] --- # Learning Targets .lt-box[ - Develop the intuition behind how electricity works. - Apply Ohm's law (`\(V = IR\)`) to calculate the resistor value needed to safely light an LED. - Read a resistor's value directly off its color bands. - Build a working LED driver circuit on a breadboard from a schematic. ] .eu-label[Essential Understanding:] What electricity is. What current, voltage, and resistance are. How to use Ohm's law in a basic LED driver circuit. --- # Agenda .agenda-box[ 1. What is electricity? Electrons and current 2. How electrons flow: conductors and the water-tank analogy 3. What an LED needs, and why it needs a resistor 4. Ohm's law: deriving the resistor value 5. Reading resistor color bands 6. Build: LED driver circuit on the breadboard 7. Measure & verify 8. Homework ] --- class: center, middle # What is electricity? # What makes electrons move? Talk it over with your partner for one minute before we define anything. --- # Electrons and current - Matter is made of atoms: a nucleus of protons (+) and neutrons, surrounded by electrons (–). - Normally, an atom's protons and electrons balance out — but electrons in the outermost shell can be knocked loose and made to move. - **Current** (`\(I\)`) is a *rate*: how many electrons flow past a point every second, measured in amps (A). - One amp means about `\(6.242 \times 10^{18}\)` electrons pass that point every second — roughly 6.24 quintillion. --- .pull-left.w55[ - A circuit only works if it's a closed loop: source → path → load → back to source. - Break the loop anywhere — open the switch — and current stops everywhere at once, not just past the break. ] .pull-right.w40[ <img src="assets/circuit-battery-switch.gif" alt="A battery, lightbulb, and switch; closing the switch completes the circuit and current flows." width="100%"/> .footnote[Image: SparkFun Electronics, CC BY-SA 4.0] ] --- # How electrons flow .pull-left.w50[ - In a **conductor** (copper, silver, most metals), the outermost electrons are loosely held and free to drift from atom to atom. - In an **insulator** (rubber, plastic, glass), electrons are held tightly — nothing moves. - Apply voltage across a conductor, and free electrons drift steadily in one direction: that drift *is* the current. ] .pull-right.w45[ <img src="assets/electron-flow.gif" alt="A simplified model of electrons drifting through atoms to create current." width="100%"/> .footnote[Image: SparkFun Electronics, CC BY-SA 4.0] ] --- # Voltage: the water-tank analogy .pull-left.w45[ <img src="assets/water-tank-voltage.png" alt="Voltage is like the pressure created by the water." width="100%"/> .footnote[Image: SparkFun Electronics, CC BY-SA 4.0] ] .pull-right.w50[ - Picture a water tank raised above the ground, with a hose at the bottom. - The **water** in the tank represents the electrons available to flow. - The **pressure** at the end of the hose is like voltage (`\(V\)`) — it's what pushes those electrons through a circuit. - Drain the tank and the pressure drops — just like a battery's voltage sags as it runs down. ] --- # Current and resistance: same analogy .pull-left.w45[ <img src="assets/water-tank-two-pressures.png" alt="Two tanks at the same pressure, but one has a narrower hose than the other." width="100%"/> .footnote[Image: SparkFun Electronics, CC BY-SA 4.0] ] .pull-right.w50[ - Two tanks, same pressure (voltage), but one hose is narrower. - **Flow rate** through the hose is like current (`\(I\)`). - The narrow hose "resists" the flow more than the wide one — that's **resistance** (`\(R\)`), measured in ohms (`\(\Omega\)`). - Same voltage, more resistance → less current. This is the relationship Ohm's law makes exact. ] --- class: medium-font # Putting the analogy together .center[ <img src="assets/water-tank-equivalents.png" alt="Two tanks at the same 1-volt pressure: a 1-ohm hose passes 1 amp, a 2-ohm hose passes only 0.5 amp." style="max-height: 340px;"/> ] Same pressure (voltage) in both tanks. Double the resistance, and the flow (current) is cut in half — that's Ohm's law, before we've written a single equation. Next, we make it exact. .footnote[Image: SparkFun Electronics, CC BY-SA 4.0] --- class: center, middle # LED Driver circuit Putting voltage, current, and resistance to work in a very simple circuit. --- # What is an LED, really? .pull-left.w60[ - LED = Light-Emitting Diode. A diode only lets current flow **one direction**. - An LED has a **forward voltage** (`\(V_f\)`) — roughly fixed, depends on color: - Red ≈ 2.0 V, Green ≈ 2.1 V, Blue/White ≈ 3.0–3.2 V - Below `\(V_f\)`: effectively no current flows, no light. - Above `\(V_f\)`: current rises **very fast** for a tiny increase in voltage. If you connect an LED straight to a supply above roughly 3 V with nothing else in the circuit, current keeps rising until the LED burns out. ] .pull-right.w30[ <img src="assets/led-fvoltage.png" alt="." height="500"/> ] --- # The fix: a current-limiting resistor .pull-left.w30[ - Put a resistor in series with the LED. - The resistor "absorbs" the extra voltage the LED doesn't use, and limits the current to a safe value. - This is the **LED driver circuit** — the simplest one you'll build all semester, and the one every other circuit today builds on. ] .pull-right.w60[ <img src="assets/LED-driver.png" alt="A working LED circuit with a current-limiting resistor in series." width="100%"/> Supply → Resistor → LED → Ground ] --- # Exercises 1. Calculate the **nominal** current that is being applied to your LED, considering: - Source Voltage of `\(6V\)` (`\(4 \times 1.5 V\)`) - Resistance of `\(220 Ω\)` class: center, middle ### How to know the value of the resistor we need to light the LED safely? What would we need to know? ### How many electrons pass through the LED in one second? How can we figure this out? Talk it over with your partner for one minute. --- # Ohm's Law `$$V = IR$$` Where: - `\(V\)` = voltage, in volts - `\(I\)` = current, in amps - `\(R\)` = resistance, in ohms (`\(\Omega\)`) Solved for resistance, since we're picking `\(R\)`: `$$R = \frac{V}{I}$$` --- # LED datasheet ### Current <img src="assets/led-current-datasheet.jpeg" alt="." width="100%"/> --- ### Voltage <img src="assets/led-voltage-datasheet.jpg" alt="" width="100%"/> --- # Sizing the resistor for an LED The resistor only sees the voltage the LED *doesn't* use, and needs to pass the current we want the LED to run at: `$$R = \frac{V_{supply} - V_{f}}{I_{LED}}$$` **Worked example:** 5 V supply, red LED (`\(V_f \approx 2.0\,\text{V}\)`), target current 15 mA: `$$R = \frac{5\,\text{V} - 2.0\,\text{V}}{0.015\,\text{A}} = \frac{3\,\text{V}}{0.015\,\text{A}} = 200\,\Omega$$` We'll round **up** to the nearest resistor we actually have (e.g. 220 Ω) — rounding up means *less* current than calculated, which is the safe direction. --- # Try it yourself With your partner, calculate `\(R\)` for: 1. A 9 V supply, green LED (`\(V_f = 2.1\,\text{V}\)`), target current 15 mA. 2. A 5 V supply, blue LED (`\(V_f = 3.0\,\text{V}\)`), target current 20 mA. Show your work in your notebook: the formula, the numbers plugged in, and the final answer rounded up to a standard resistor value. --- # Reading a resistor: the color code Resistors are too small to print numbers on, so they use **color bands** instead. A standard 4-band resistor: - Band 1: 1st digit - Band 2: 2nd digit - Band 3: multiplier (how many zeros) - Band 4: tolerance (how close to the stated value it actually is) --- # Digit colors <div style="line-height: 2.6;"> <span class="swatch" style="background:#000000; color:#fff;">Black = 0</span> <span class="swatch" style="background:#8B4513; color:#fff;">Brown = 1</span> <span class="swatch" style="background:#FF0000; color:#fff;">Red = 2</span> <span class="swatch" style="background:#FFA500; color:#000;">Orange = 3</span> <span class="swatch" style="background:#FFFF00; color:#000;">Yellow = 4</span> <span class="swatch" style="background:#008000; color:#fff;">Green = 5</span> <span class="swatch" style="background:#0000FF; color:#fff;">Blue = 6</span> <span class="swatch" style="background:#8F00FF; color:#fff;">Violet = 7</span> <span class="swatch" style="background:#808080; color:#fff;">Gray = 8</span> <span class="swatch" style="background:#FFFFFF; color:#000;">White = 9</span> </div> Band 3 (multiplier) reuses this same color scale as "×10^n" — Black is ×1, Brown is ×10, Red is ×100, and so on — plus two colors unique to the multiplier band: <span class="swatch" style="background:#D4AF37; color:#000;">Gold = ×0.1</span> <span class="swatch" style="background:#C0C0C0; color:#000;">Silver = ×0.01</span> --- # Worked example: reading a resistor **Yellow – Violet – Red – Gold** - Band 1 (Yellow) = 4 - Band 2 (Violet) = 7 - Band 3 (Red) = ×100 - Band 4 (Gold) = ±5% tolerance `$$47 \times 100 = 4{,}700\,\Omega = 4.7\,\text{k}\Omega$$` So this resistor is **4.7 kΩ, ±5%**. --- # Your turn: decode these Work in your notebook. For each, give the value in ohms and the tolerance. 1. Red – Red – Brown – Gold 2. Brown – Black – Orange – Gold 3. Green – Blue – Red – Silver 4. Orange – Orange – Black – Gold *(Answers reviewed together before we start building.)* --- # Video: reading resistor color bands <iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> *Swap in your own video's embed link — copy the "Embed" URL from YouTube's Share menu and drop the ID after `/embed/`.* --- # Build: LED driver circuit With your partner: 1. Pick an LED and read its likely `\(V_f\)` from the reference sheet. 2. Calculate the resistor value for a 5 V supply and 15 mA target current. 3. Find a resistor close to that value and **decode its bands** to confirm before you use it — don't trust the bin label. 4. Build the circuit on your breadboard: supply → resistor → LED (long leg to resistor) → ground. 5. Power on. It should light without getting hot. --- # Measure & verify Using the multimeter: - Measure the actual voltage across the resistor. - Measure the actual voltage across the LED. - Calculate the actual current from the resistor's voltage and its resistance (`\(I = V/R\)`). Record all three numbers in your notebook next to your prediction. If they don't match closely, that's not a failure — that's data. Where do you think the difference came from? --- class: center, middle # Homework .hw-box[ - Finish decoding the four practice resistors if you didn't in class. - In your notebook, write the LED driver formula from memory and explain each term. - Bring your notebook and kit — next class we measure series and parallel networks. ]