Lesson 1: Electronics Essentials for MakersNew-age
Everything a robot does starts with electricity. A wheel turns because current flows through a motor; a sensor reports a distance because a voltage changes on a pin. If you cannot predict what the electricity will do, you are building by trial and error — and trial and error with batteries and motors ends in hot components and dead boards. This lesson gives you the four quantities that govern every circuit in this course and teaches you to calculate before you connect.
The four quantities and Ohm's law
Voltage (V, measured in volts) is the electrical pressure that pushes charge around a circuit — the difference in electrical energy between two points. Current (I, measured in amperes, or amps) is the rate at which charge flows past a point. Resistance (R, measured in ohms, symbol Ω) is how much a component opposes that flow. Power (P, measured in watts) is the rate at which electrical energy is converted to heat, light or motion.
They are tied together by two equations you will use in every lesson of this course:
- Ohm's law: V = I × R
- Power law: P = V × I
Ohm's law has three faces, and you should be able to produce each without thinking: I = V / R and R = V / I. Worked example: a 9 V battery is connected across a 470 Ω resistor. The current is I = V / R = 9 / 470 = 0.0191 A, about 19.1 mA. The power turned into heat in the resistor is P = V × I = 9 × 0.0191 ≈ 0.17 W. That second number matters: a standard small resistor is rated at 0.25 W, so this one survives — but with little margin. Checking the power rating is a habit, not an afterthought.
Components you will meet
| Component | What it does | Key fact |
|---|---|---|
| Resistor | Limits current, divides voltage | Value in ohms; check its power rating too |
| LED | Emits light when current flows the right way | Drops a roughly fixed voltage (red ≈ 2 V); always needs a series resistor |
| Capacitor | Stores charge, smooths supply noise | Measured in farads; robot circuits use µF sizes |
| Diode | Lets current pass in one direction only | Protects against reversed connections and motor spikes |
| Transistor / MOSFET | An electronic switch for bigger loads | Lets a small pin current control a large load current |
| Push button | A manual input | Connects or breaks a circuit when pressed |
| Battery | The energy source | Rated in volts and milliamp-hours (mAh) |
Sizing an LED resistor, step by step
An LED does not limit its own current. Connect one straight across 5 V and it will try to draw far more than it can survive. The series resistor's job is to absorb the leftover voltage and set the current. Worked example, the classic one: a red LED with a forward voltage of about 2 V, a 5 V supply, and a target current of 10 mA (0.010 A).
- Step 1: voltage the resistor must drop = 5 − 2 = 3 V.
- Step 2: R = V / I = 3 / 0.010 = 300 Ω.
- Step 3: resistors come in standard values; the nearest common one is 330 Ω. The actual current becomes 3 / 330 ≈ 9.1 mA — close enough, and slightly gentler on the LED.
- Step 4: check the resistor's power: P = 3 × 0.0091 ≈ 0.027 W, far below 0.25 W. Safe.
The same four steps size a resistor for any LED and any supply. The pattern — subtract the LED's drop, divide by the current you want, pick the nearest standard value, check the power — is worth memorising.
Series, parallel and the voltage divider
Resistors in series (one after another on the same path) add: 1 kΩ + 2 kΩ = 3 kΩ, and the same current flows through both. Resistors in parallel (side by side, sharing both ends) combine as 1/R = 1/R₁ + 1/R₂, and the result is always smaller than the smallest: 2 kΩ in parallel with 3 kΩ gives 1 / (1/2000 + 1/3000) = 1.2 kΩ.
Two resistors in series across a supply form a voltage divider, and this humble circuit is how most simple sensors talk. The voltage at the midpoint is Vout = Vsupply × R₂ / (R₁ + R₂), where R₂ is the lower resistor (the one connected to ground). With two 10 kΩ resistors on 5 V, Vout = 5 × 10/20 = 2.5 V, exactly half.
Now make R₂ a light-dependent resistor (LDR), whose resistance falls as light rises. Fix R₁ at 10 kΩ. In bright light the LDR measures about 2 kΩ, so Vout = 5 × 2/12 ≈ 0.83 V. In darkness the LDR rises to about 100 kΩ, so Vout = 5 × 100/110 ≈ 4.55 V. One resistor that reacts to the world plus one fixed resistor turns light level into a voltage a microcontroller can measure. Thermistors (temperature), force-sensitive resistors (pressure) and soil probes (moisture) all speak through the same divider pattern.
Analogue, digital and the ADC
A digital signal has two states: HIGH (near the supply voltage) or LOW (near 0 V). A button is digital. An analogue signal varies continuously — the divider output above can be 0.83 V, 2.4 V, 4.55 V, anything in between. A computer cannot store "anything in between" directly, so microcontrollers contain an ADC (analogue-to-digital converter) that maps a voltage to a number.
The Arduino Uno's ADC has 10 bits, so it reports an integer from 0 to 1023 for inputs from 0 V to 5 V. Each step is worth 5 / 1024 ≈ 4.88 mV. Our LDR divider therefore reads about 0.83 / 5 × 1023 ≈ 171 in bright light and 4.55 / 5 × 1023 ≈ 930 in darkness. A program can now make decisions: "if the reading rises above 700, the room is dark — switch the light on." Notice the two conversions you must always track: physical quantity to voltage (the divider), then voltage to count (the ADC). Lesson 3 builds full sensor calibration on exactly this chain.
Battery life is the last core calculation. A battery rated 500 mAh can ideally supply 500 mA for one hour, or 25 mA for 500 / 25 = 20 hours. Real batteries deliver less, especially at high currents, but this estimate tells you whether a design is in the right ballpark before you build it.
Reading a datasheet
Every component has a datasheet: the manufacturer's specification document. Beginners ignore them; engineers read them first. Here is an extract for a typical 5 mm red LED:
| Parameter | Value | What it means for you |
|---|---|---|
| Forward voltage (typical) | 2.0 V | Use this in the resistor calculation |
| Forward voltage (maximum) | 2.4 V | Design so the circuit still works at this |
| Continuous forward current (max) | 30 mA | An absolute maximum — exceeding it damages the part |
| Recommended operating current | 10–20 mA | Where you should actually design |
Two reading skills matter. First, distinguish typical values (what you calculate with) from absolute maximum ratings (limits you must never cross, even briefly). Second, designs should target the recommended operating region, not hover at the edge of the maximum. Lesson 3 applies the same reading skill to a full sensor datasheet.
Safety first
- Never connect a battery directly across a component without knowing the current that will flow — a short circuit can make wires hot enough to burn and can destroy lithium batteries dangerously.
- Check polarity. LEDs, diodes, capacitors and batteries all care about which way round they go.
- Disconnect power before changing wiring. Moving a wire on a live circuit creates accidental shorts.
- Respect pin limits. A microcontroller pin is a signal, not a power supply: on an Uno, plan for at most 20 mA per pin. Motors and lamps need transistors or driver chips (Lesson 3).
- Fuse your thinking: if a calculation says a component will exceed its rating, believe the calculation, not the hope.
Common mistakes
- LED with no resistor. The LED does not "take what it needs"; it takes what the supply forces through it, briefly, and then it fails.
- Forgetting the power rating. A correctly valued resistor can still burn if it must dissipate more than its rating.
- Confusing series and parallel. Series shares current and adds resistance; parallel shares voltage and reduces total resistance. Mixing them up inverts your prediction.
- Treating the divider output as unloaded. The divider formula assumes almost nothing draws current from the midpoint. An ADC input draws almost nothing, which is why dividers and ADCs pair so well; a motor connected there would collapse the voltage.
- Guessing instead of calculating. Every worked example in this lesson took under a minute. That minute is the difference between designing and gambling.
Real-World Challenge
The task. You are designing the indicator and light-sensing front end for a greenhouse controller that runs from a 9 V supply rail, with a 5 V logic section for the sensor. (a) The status LED is a red LED (forward voltage 2.0 V) on the 9 V rail, and you want a bright but safe 15 mA. Calculate the series resistor, choose the nearest standard value, and check that a 0.25 W resistor is adequate. (b) The light sensor is an LDR in a divider on the 5 V logic supply, with a fixed 10 kΩ resistor on top and the LDR below. The LDR measures 1 kΩ in full sun and 50 kΩ at dusk. Calculate the output voltage and the 10-bit ADC count at both light levels, and choose a threshold count that separates "day" from "dusk".
Worked solution. (a) The resistor must drop 9 − 2 = 7 V at 0.015 A, so R = 7 / 0.015 ≈ 467 Ω; the nearest standard value is 470 Ω, giving an actual current of 7 / 470 ≈ 14.9 mA. Power in the resistor: P = 7 × 0.0149 ≈ 0.105 W. A 0.25 W resistor can handle this (about 42% of its rating), though if the controller lived in a hot greenhouse you would sensibly step up to a 0.5 W part for margin — ratings fall as ambient temperature rises. (b) Full sun: Vout = 5 × 1 / (10 + 1) ≈ 0.45 V, ADC ≈ 0.45 / 5 × 1023 ≈ 93. Dusk: Vout = 5 × 50 / 60 ≈ 4.17 V, ADC ≈ 853. The two levels are far apart, which is what you want from a sensor front end. A threshold near the middle of the count range — say 470 — separates them with a wide safety margin against noise and component variation: below 470 the controller calls it day; above, dusk. In Lesson 4 you will see why a single threshold can chatter at the boundary and how controllers fix that.
Extension. Swap the divider: put the LDR on top and the fixed 10 kΩ resistor below, and recompute both output voltages. The output now falls as darkness falls. Explain, in two sentences, which orientation you would choose if the program's rule is "when the count rises above the threshold, switch the greenhouse lights on", and why matching the sensor's direction to the rule's direction makes the code easier to read and debug.
🎬 Watch & Learn
Free YouTube video lessons on “Electronics Essentials for Makers” — pick a result below:
✅ Check your understanding
Quick recall check, generated from this lesson’s key terms. It is practice only and is not graded.