Theory summary
Electronics is the science of making tiny electric pushes do useful jobs: lighting a lamp, playing music, running a phone, or carrying a 0 and a 1 inside a computer. Everything starts with very small particles called electronstiny particles with a negative charge that live around the centre of every atom moving through wires and parts.
Why should a programmer care? Because a logic level in your code, a 1 or a 0, is really a voltage on a wire. A power supply, a sensor, a speaker and a battery charger are all electronics. If you can read a simple drawing of a circuit and do a little arithmetic, you can understand how the machine under your code behaves.
In this summary we go step by step. First we meet charge, current and voltage. Then the units and symbols, resistance and power, magnets, and the clever tricks to simplify circuits (dividers, Thévenin and Norton). Then we learn how to measure things safely, what each part does (resistors, capacitors, coils, transformers, diodes, transistors, integrated circuits), and how parts team up in power supplies, filters and signal generators.
At the end you will be able to calculate a current, pick a resistor for an LED, read a resistor's colours, say what an instrument shows, and explain how a power supply turns the wall socket into something a chip can use. Use the table of contents to jump to any topic.
Electricity: charge, voltage, current and Ohm's law
Everything is made of atoms. An atom is like a tiny solar system. In the middle is the nucleus, with protons (positive charge) and neutrons (no charge). Around it fly electrons, which have a negative charge. A normal atom is neutral because it has as many electrons as protons.
- Only electrons move. Protons stay locked in the nucleus. A body becomes negative by gaining electrons and positive by losing them.
- Charges of the same sign repel, charges of opposite signs attract. The force is bigger when the charges are bigger or closer.
- Charge is never created. If body B gives electrons to body A, A ends with exactly the charge that B lost, with the opposite sign. This is the conservation of chargethe total amount of charge never changes, it only moves from one place to another.
Current, voltage and resistance
Electric current is a flow of charges, like water flowing in a pipe. It is measured in amperes (A). One ampere means one coulomb of charge passing a point each second, and a coulomb is about 6.25 × 10^18 electrons, a gigantic crowd. Voltage (V, in volts) is the push that makes the current flow, like water pressure. Resistance (R, in ohms, Ω) is how much the path resists, like a narrow pipe.
Ohm's law ties the three together: I = V / R, or V = R × I, or R = V / I. With the same voltage, more resistance means less current. For 12 V across 60 Ω the current is 12 / 60 = 0.2 A.
v = 12 # volts
r = 60 # ohms
i = v / r # amperes
print(i) # 0.2
print(r * i) # 12.0, back to the voltage: a quick checkCircuits and the two laws of Kirchhoff
A circuit is a closed path for the current. In an open circuit the path is broken and no current flows. In a closed circuit the path is complete through the load. In a short circuit the two poles of the source are joined by an almost zero resistance, the current grows out of control and things burn. Fuses and circuit breakers exist to cut it.
| Property | Series (one path) | Parallel (many paths) |
|---|---|---|
| Current | The same in every part | Splits among the branches |
| Voltage | Shared among the parts | The same on every branch |
| Sources of voltage | Voltages add (a backwards cell subtracts) | Same voltage, but more current capacity (only join equal sources) |
The loop law: going around a closed path, the voltages of the sources equal the sum of the voltage drops on the parts. So with a 9 V source and two drops of 2 V and 3 V, the third drop is 9 − 2 − 3 = 4 V. The node law: the current that arrives at a meeting point equals the current that leaves. If 3 A arrive and two branches take 1.2 A and 0.5 A, the third takes 3 − 1.2 − 0.5 = 1.3 A. Parts do not use up current: they turn electrical energy into light, heat or motion, and the same current that enters leaves.
+9 V ──┬─[ R1: 2 V ]─[ R2: 3 V ]─[ R3: ? ]─┐
│ │
GND ───┴──────────────────────────────────────┘
loop law: 9 = 2 + 3 + R3 -> R3 drop = 4 VDirection of the current. Electrons really move from the negative pole to the positive one. But by an old convention, schematics use the conventional current, which flows from positive to negative outside the source. Both give the same results if you do not mix them.
↑ Back to the contentsDirect and alternating voltage
A battery gives direct current (DC): the push always goes the same way. The wall socket gives alternating current (AC): the push goes one way, then the other, again and again, like a child on a swing. Its picture is a wavy line called a sine wave.
Frequency (f) is how many full swings happen in one second, measured in hertz (Hz). The period (T) is the time of one swing: T = 1 / f. The Brazilian mains used in this quiz run at 60 Hz, so one cycle lasts 1 / 60 s, about 16.7 ms (each half cycle about 8.3 ms). At 50 Hz the period is 20 ms.
An AC voltage changes all the time, so which number do we quote? The answer is the RMS value: the DC voltage that would heat a resistor with the same power. Wall voltages such as 127 V or 220 V are RMS values. For a sine wave, the peak is the RMS times √2 (about 1.414), and the peak-to-peak value is twice the peak.
| Mains (RMS) | Peak (RMS × 1.414) | Peak to peak |
|---|---|---|
| 127 V | about 180 V | about 360 V |
| 220 V | about 311 V | about 622 V |
- RMS
- 127 V
- Peak
- 180 V
- Peak to peak
- 360 V
Phase
Phase shift says how much one wave is late compared with another wave of the same frequency. One full cycle is 360°. Waves at 0° rise and fall together and add up. Waves at 180° are opposites: when one is at the top, the other is at the bottom, and adding two equal ones gives zero. That is why AC sources can only be combined when their phase is taken into account.
time -> 1 2 3 4 5 6 7 8
wave A +1 +2 +1 0 -1 -2 -1 0
wave B (0) +1 +2 +1 0 -1 -2 -1 0
A + B +2 +4 +2 0 -2 -4 -2 0
wave C (180) -1 -2 -1 0 +1 +2 +1 0
A + C 0 0 0 0 0 0 0 0Units, prefixes and schematic symbols
To talk about electricity everybody uses the same measuring words, the International System (SI). Each quantity has its own unit and a standard symbol. Mixing them up makes you use the wrong formula.
| Quantity | Unit | Symbol |
|---|---|---|
| Voltage | volt | V |
| Current | ampere | A |
| Resistance | ohm | Ω |
| Conductance (the opposite of resistance) | siemens | S |
| Capacitance | farad | F |
| Inductance | henry | H |
| Electric charge | coulomb | C |
| Magnetic flux | weber | Wb |
| Power | watt | W |
| Frequency | hertz | Hz |
Prefixes
Real values are tiny or huge, so we use prefixes that move in steps of a thousand: pico (p, 10^-12), nano (n, 10^-9), micro (µ, 10^-6), milli (m, 10^-3), kilo (k, 10^3), mega (M, 10^6). Going to the next smaller prefix multiplies the number by 1,000. So 0.047 µF = 47 nF = 47,000 pF.
Before a formula, convert everything to base units (ohm, ampere, volt). A shortcut: kΩ × mA = V. For 20 mA through 4.7 kΩ, the voltage is 20 × 4.7 = 94 V. A mistake in a prefix changes the result by 1,000 times or more.
Rounding: the odd and even rule
If you always round a 5 up, your results lean a little towards large numbers. The odd and even rule fixes that when the discarded digit is exactly 5: the digit before it goes up if it is odd and stays if it is even. So 2.45 becomes 2.4 and 2.35 becomes 2.4. Half of the cases go up and half stay.
Reading a schematic
A schematic is a map of the circuit. Each part has a designator: a letter for its type plus a number.
| Letter | Part |
|---|---|
| R | resistor |
| C | capacitor |
| L | coil (inductor) |
| D | diode |
| Q | transistor |
| T | transformer |
| U or IC | integrated circuit |
The number only tells two parts apart inside that drawing. C1 in a power supply and C1 in another maker's amplifier are unrelated: their values and jobs must be read from each parts list.
- An arrow drawn across a symbol means the value is variable.
- Two small arrows next to a symbol mean light. Pointing away from it, the part emits light (an LED). Pointing at it, the part senses light (photodiode, phototransistor, LDR).
- For coils and transformers, the lines beside the winding tell the core: no line is air, solid lines are iron, dashed lines are ferrite. Two windings that are not connected but share a core form a transformer.
Resistance, impedance and power
A resistor is a part that makes the current's life harder, like a narrow part of a corridor. When we connect several resistors, we can replace them with one equivalent resistance that behaves the same.
Series and parallel
In series the current must pass through all of them one after the other, so resistances add: 100 + 220 + 330 = 650 Ω. The result is bigger than the biggest resistor. In parallel each resistor opens one more path, so the total resistance goes down. For two resistors: R = (R1 × R2) / (R1 + R2), so 300 Ω ∥ 600 Ω = 200 Ω. The result is always smaller than the smallest one. If your answer is larger than that, you made a mistake.
- Equal resistors in parallel: divide the value by how many there are. Four 1 kΩ in parallel are 250 Ω.
- General rule:
1/R = 1/R1 + 1/R2 + 1/R3 ... - Mixed network: reduce the parallel part first, then add the series part. Example: 9 V on 100 Ω in series with (300 Ω ∥ 600 Ω = 200 Ω): total 300 Ω, current 30 mA, the parallel part gets 6 V, so R2 carries 6 / 300 = 20 mA.
Reactance and impedance
In AC, capacitors and coils also resist the current, but in a way that depends on the frequency. This is reactance (in ohms). A capacitora part that stores electric charge between two plates and a coila wire wound in loops, also called inductor, that stores energy in a magnetic field behave in opposite ways.
| Property | Capacitor | Coil (inductor) |
|---|---|---|
| Reactance | XC = 1 / (2π f C) | XL = 2π f L |
| When frequency goes up | reactance falls (passes more) | reactance rises (blocks more) |
| In steady DC | behaves as an open circuit (blocks) | behaves as a plain wire (only its small wire resistance) |
At 60 Hz, 2πf is about 377, so a 100 mH coil has XL = 377 × 0.1 = 37.7 Ω. If the frequency of a capacitor signal doubles, XC is halved.
Impedance (Z) is the total opposition to AC. Resistance and reactance are at 90° to each other, so they combine like the sides of a right triangle: Z = √(R² + X²). With R = 30 Ω and X = 40 Ω, Z = 50 Ω. In a series RLC circuit, the net reactance is X = XL − XC; if XL > XC the circuit is inductive, otherwise capacitive. When XL = XC we have resonance: reactances cancel and Z = R. With R = 60 Ω, XL = 120 Ω, XC = 40 Ω: X = 80 Ω, Z = 100 Ω, inductive.
Power
Power is the energy turned into something else each second, in watts (W). P = V × I, and with Ohm's law also P = R × I² and P = V² / R. A 12 V lamp drawing 2 A uses 24 W. 50 mA through 100 Ω dissipates 100 × 0.05² = 0.25 W. Because the current is squared, doubling the current makes four times the heat.
Every resistor has a power rating (1/8 W, 1/4 W, 1/2 W, 1 W, 2 W...). 12 V across 470 Ω gives 144 / 470 = 0.31 W, so 1/4 W is too small and 1/2 W is the smallest rating that is not exceeded (engineers often choose twice the calculated power to run cool).
Decibel and the source's internal resistance
The decibel compares two powers on a log scale: dB = 10 × log10(P2 / P1). Ten times the power is 10 dB, 100 times is 20 dB, and about 3 dB is a doubling.
Every real source (a battery) has an internal resistance, in series with the load, so they split the voltage like a divider. The load receives the maximum power when its resistance equals the internal resistance. But then half of the total power is lost inside the source, so the efficiency is only 50%. A 12 V source with 2 Ω inside and a 2 Ω load: the current is 12 / (2 + 2) = 3 A, the load gets 2 × 3² = 18 W and the source burns another 18 W inside.
↑ Back to the contentsElectromagnetism
Electricity and magnetism are cousins. Every current creates a magnetic field around the wire, and the bigger the current, the stronger the field. Charges that are standing still make only an electric field, no magnetic one.
If you wind the wire into a coil, the little fields of all the turns add up and make a strong one. That is an electromagnet. Its strength depends on three things: the current, the number of turns, and the core inside. A core of soft iron (a ferromagnetic material) concentrates the field and makes it far stronger than air. Soft iron also loses its magnetism when the current stops, so the magnet can be switched on and off.
Where we use it
- Relay: a switch moved by an electromagnet. A small current in its coil closes contacts that control a large current or even the mains. The coil and the contacts are electrically separate, so a small safe circuit can command a dangerous one.
- Loudspeaker: a coil attached to a cone sits in the field of a permanent magnet. The current makes a force on the coil, the cone moves, and the moving air is sound. It needs a changing (audio) current. A constant DC voltage only pushes the cone to one side and heats the coil.
- Transformer and inductor: see the section on passive components.
The coil fights changes
A coil stores energy in its magnetic field. When you try to change the current, it induces a voltage that tries to keep the old current going. If you cut the current suddenly, the voltage jumps to a high spike across the switch. When a transistor switches a relay coil off, this spike can destroy it. The cure is a protection diode (flyback diode) in parallel with the coil, which gives the current a place to flow and fade away.
+12 V ──┬──────────┐
│ [ Relay coil ]
diode ▲ │ <- diode in parallel, stripe
│ │ towards +12 V
└──────────┤
collector
[ NPN transistor ]
emitter -> GNDDividers, delta and star, Thévenin and Norton
Big circuits look scary, but a few tricks make them small. These tricks are tools to simplify. Let us learn them one at a time.
Voltage divider
Two resistors in series share the voltage in proportion to their sizes. The bigger one takes the bigger drop. Taking the output across R2: Vout = Vin × R2 / (R1 + R2). It is always smaller than Vin. With 12 V, R1 = 1 kΩ and R2 = 2 kΩ, Vout = 12 × 2 / 3 = 8 V.
Vin ──[ R1 ]──┬── Vout
│
[ R2 ]
│
GND ──────────┴- What matters is the ratio, not the absolute values. Two equal resistors always give half, with 100 Ω or with 100 kΩ. The absolute values set how much current is drawn.
- To get 3.3 V from 5 V with R2 = 3.3 kΩ: R1 must drop 1.7 V, so R1 / R2 = 1.7 / 3.3 and R1 is about 1.7 kΩ (use the nearest commercial value).
- The formula assumes no load. A load in parallel with R2 lowers the lower section and pulls the output down. Two 10 kΩ resistors on 10 V give 5 V; with a 10 kΩ load on R2, the lower part becomes 5 kΩ and the output falls to 10 × 5 / 15 = 3.33 V. For the effect to be small, the load must be about ten times larger than the divider resistors.
Current divider
In parallel all branches have the same voltage and the total current is shared inversely to the resistance: the smaller resistor takes the larger share. For two branches, the current in one branch is the total times the other resistance divided by the sum. With 3 A into 20 Ω ∥ 10 Ω, the 10 Ω branch gets 3 × 20 / 30 = 2 A (and the 20 Ω gets 1 A). Equal branches share equally: 4 A into two equal resistors is 2 A each.
With three or more branches, find the voltage across the set (total current × equivalent resistance) and apply Ohm's law to each branch. For 6 A into 10, 20 and 20 Ω: equivalent 5 Ω, voltage 30 V, so the 10 Ω carries 3 A. The power in a branch is P = R × I²: with 10 mA into 1 kΩ ∥ 4 kΩ, the 4 kΩ carries 2 mA and dissipates 4000 × (0.002)² = 16 mW.
Delta to star
Some circuits, like an unbalanced bridge, have three resistors forming a closed triangle (delta, Δ) between three nodes. You cannot reduce them with series and parallel rules. The trick is to swap the triangle for a star (Y): three resistors that meet in a central point. Seen from the three nodes, they behave exactly the same.
DELTA (triangle) STAR (Y)
A A
| . |
Rab Rca Ra
| . |
B--Rbc--C Rb --+-- Rc
| |
B CThe rule: each star resistor equals the product of the two delta resistors that touch its node, divided by the sum of the three. For node A: Ra = Rab × Rca / (Rab + Rbc + Rca). Three equal 30 Ω delta resistors give 30 × 30 / 90 = 10 Ω each (one third). With Rab = 10, Rbc = 20, Rca = 30: Ra = 10 × 30 / 60 = 5 Ω. The star resistors are always smaller than the delta sides next to them. The classic mistake is to pick the wrong two resistors: the opposite side only appears in the denominator.
Thévenin and Norton
Thévenin's theorem: any linear circuit, seen from two terminals, can be replaced by one voltage source VTH in series with one resistor RTH. VTH is the voltage between the terminals with nothing connected (open circuit). RTH is the resistance seen from the terminals with the load removed and the sources set to zero: a voltage source becomes a short (0 V) and a current source becomes an open circuit (0 A). This is a pencil-and-paper device: never short a real, powered source.
Example: 12 V, R1 = 4 kΩ, R2 = 12 kΩ, output across R2. VTH = 12 × 12 / 16 = 9 V, and RTH = 4 kΩ ∥ 12 kΩ = 3 kΩ. Another: 24 V with R1 = 6 kΩ and R2 = 3 kΩ, load RX = 2 kΩ across R2. VTH = 8 V, RTH = 2 kΩ, so the load current is I = VTH / (RTH + RX) = 8 / 4 kΩ = 2 mA. The big win: you compute VTH and RTH once and then try many loads.
Norton's theorem is the twin: a current source IN in parallel with a resistor RN. The two are the same circuit seen in different clothes: RN = RTH, IN = VTH / RTH (the short-circuit current) and VTH = IN × RN. A Thévenin of 10 V and 5 Ω is a Norton of 2 A and 5 Ω. A load on the Norton source forms a current divider: with IN = 3 A, RN = 6 Ω and a 12 Ω load, the load gets 3 × 6 / 18 = 1 A.
To find IN, imagine a short between the terminals and compute its current. Careful: a resistor placed directly across those terminals gets no voltage and carries nothing. For 12 V in series with R1 = 3 Ω, then R2 = 6 Ω across the terminals: shorted, IN = 12 / 3 = 4 A. RN is found by zeroing the source: R1 ∥ R2 = 2 Ω. Check: IN × RN = 8 V, which is the open-circuit voltage 12 × 6 / 9 = 8 V.
| Property | Thévenin | Norton |
|---|---|---|
| Source | voltage VTH | current IN |
| Resistor | RTH in series | RN in parallel (same value) |
| How to find the source | open-circuit voltage | short-circuit current |
Measuring instruments: from the galvanometer to the oscilloscope
To know what a circuit is doing, we measure it. There are old analogue instruments with a moving pointer and new digital ones with a number on a screen. Both teach the same lesson: an instrument must disturb the circuit as little as possible.
The galvanometer
The moving-coil galvanometer is the heart of analogue meters. A light coil hangs in the field of a permanent magnet. Current in the coil makes a torque (a twisting force) proportional to the current, and a spiral spring pushes back. The pointer stops where the two forces balance, so the scale is linear. Because the torque follows the direction of the current, the terminals are marked + and −: connect it backwards and the pointer hits the stop at the left end. (A centre-zero meter shows both directions.)
Two numbers describe it: the full-scale current (the current that sends the pointer to the end) and the coil resistance. By Ohm's law, they give the maximum voltage: 1 mA through 100 Ω is 0.1 V. That is tiny. A 50 µA, 2 kΩ galvanometer connected straight to a 1.5 V cell would carry 0.75 mA, 15 times more than its limit, and the coil would burn or the pointer bend. So it always works with resistors around it.
Ammeter: always in series
An ammeter measures the current that passes through it, so it is connected in series, opening the circuit where you want to measure. Its resistance must be very low. Never connect it in parallel with a source: it is almost a short circuit.
To measure more than the galvanometer can take, a low shunt resistor is put in parallel with it. Both have the same voltage (0.1 V in our example). For 100 mA total and 1 mA in the coil, the shunt takes 99 mA: Rshunt = 0.1 V / 99 mA = about 1.01 Ω. Even a real ammeter has some resistance: a 5 V source with a 4.5 Ω load should give 1.11 A, but a 0.5 Ω ammeter makes it 5 / 5 = 1 A. The error grows in low-resistance circuits. A clamp meter measures the magnetic field around a conductor without opening the circuit, but it must hold one conductor: around a cord with go and return, the fields cancel and it reads about zero.
Voltmeter: always in parallel
A voltmeter measures the voltage between two points, so it goes in parallel with the part, with the circuit working. It must have a very high resistance so that it takes almost no current. To build one, a multiplier resistor goes in series with the galvanometer: for a 10 V range with 1 mA and 100 Ω, total resistance 10 V / 1 mA = 10 kΩ, so the resistor is 10 kΩ − 100 Ω = 9.9 kΩ. Digital multimeters have about 10 MΩ of input.
The sensitivity of an analogue voltmeter is in ohms per volt (it is 1 / full-scale current). Multiply by the chosen range for the internal resistance: 20 kΩ/V on the 10 V range is 200 kΩ. If the measured circuit has resistances of similar size, the instrument loads it. Two 200 kΩ resistors on 12 V should give 6 V across the lower one, but with the 200 kΩ voltmeter in parallel the lower part is 100 kΩ and the meter shows 12 × 100 / 300 = 4 V. Even a 10 MΩ multimeter on a 1 MΩ source with 11 V open-circuit shows 11 × 10 / 11 = 10 V.
Ohmmeter
An ohmmeter sends its own small current from its battery and measures the result, so you must measure resistance with the circuit turned off, capacitors discharged and, if possible, one leg of the part lifted. Any outside voltage or parallel path falsifies the reading. In a series ohmmeter the current is I = Vbattery / (Rinternal + Rx).
- With the probes touching, you adjust the zero so the pointer is at full scale. Do it at every range. If it cannot reach zero, the battery is weak.
- At mid-scale the unknown resistance equals the internal resistance. With 3 V and 1 mA, the internal resistance is 3 kΩ, so mid-scale is 3 kΩ.
- The deflection is
Rint / (Rint + Rx): with Rx = 3 times Rint the pointer is at 1/4; with 9 kΩ and 3 kΩ inside, it is at 3/12 = 1/4 of full scale. - So the ohms scale is reversed (zero at the right) and crowded near infinity, where readings are imprecise.
- The continuity test is a resistance test with a beep: a beep means a path of very low resistance. The circuit must also be off.
The Wheatstone bridge
Two voltage dividers side by side, with a galvanometer between their middle points. If the ratio is the same in both, the middle points are at the same voltage and the galvanometer reads zero: the bridge is balanced. The condition is R1 / R3 = R2 / R4, or equal cross products, R1 × R4 = R2 × R3. Knowing three resistors, the fourth is found. For R1 = 100, R2 = 200, R3 = 150: R4 = 200 × 150 / 100 = 300 Ω.
+V
/ ╲
R1 R2
│ │
A──[G]───B
│ │
R3 R4
╲ /
GND- The balance does not depend on the source voltage: each midpoint holds a fixed fraction. A bigger voltage only makes the meter more sensitive to a small imbalance.
- It measures resistance by comparison, and is used with resistive sensors (temperature, strain).
- With a high-resistance voltmeter in place of G, the imbalance is the difference between the two dividers. With 10 V and R1 = R2 = R3 = 1 kΩ, R4 = 1.5 kΩ, one midpoint is at 5 V and the other at 10 × 1.5 / 2.5 = 6 V (or 4 V, depending on which side R4 sits), so the voltmeter shows 1 V.
The multimeter
- To measure current: red probe in the current jack, start with the highest range, and put the meter in series. Afterwards, return the probe to the voltage jack.
- The current jack has almost zero resistance. If the probe stays there and you touch an outlet to measure voltage, you make a short circuit (sparks, blown fuse). Always check jack and range before touching a live point.
- On AC, an ordinary meter rectifies, takes the average and multiplies by a factor made for sine waves at 50 or 60 Hz. With dimmers or square waves, it is wrong. A True RMS meter reads the real RMS of any waveform.
The oscilloscope
An oscilloscope draws a graph of voltage (up) against time (across). The vertical knob is in volts per division, the horizontal one (time base) in time per division. It shows shape, amplitude, period and phase, which a multimeter cannot.
| Question | How to read it | Example |
|---|---|---|
| Peak to peak | vertical divisions × V/div | 4 div × 2 V/div = 8 V pp |
| Peak | peak to peak / 2 | 4 V |
| RMS (sine) | peak / √2 | about 2.83 V |
| Period | horizontal divisions × time/div | 5 div × 2 ms = 10 ms |
| Frequency | 1 / period | 1 / 10 ms = 100 Hz |
Another reading: 6 div pp at 0.5 V/div is 3 V pp, peak 1.5 V, RMS 1.06 V. One cycle of 4 div at 50 µs is 200 µs, so 5 kHz. The input coupling switch has three positions: DC shows the whole signal, AC puts a capacitor that blocks the DC level, so only the variation shows (great for the ripple of a power supply), and GND grounds the input to place the zero line.
↑ Back to the contentsResistors, capacitors, coils and transformers
These parts are passive: they do not make energy, they only use, store or move it. Let us meet each one.
Resistors
A resistor's value is painted as coloured bands. In the four-band code, bands 1 and 2 are digits, band 3 is the multiplier (the number of zeros), and band 4 is the tolerance: gold ±5%, silver ±10%. Read from the end opposite to the tolerance band.
| Colour | Digit | Colour | Digit |
|---|---|---|---|
| black | 0 | green | 5 |
| brown | 1 | blue | 6 |
| red | 2 | violet | 7 |
| orange | 3 | grey | 8 |
| yellow | 4 | white | 9 |
Brown, black, red, gold = 1, 0, ×100, ±5% = 1,000 Ω = 1 kΩ. Yellow, violet, orange, gold = 4, 7, ×1000 = 47 kΩ. Red, orange and brown are easy to confuse on old resistors, so check with an ohmmeter.
SMD (tiny surface-mount) resistors use a three-digit code: two digits and the number of zeros. 103 is 10 + 000 = 10 kΩ. With ±1% tolerance the good range is 9.9 kΩ to 10.1 kΩ, so a reliable reading of 10.2 kΩ is out of tolerance.
- The power rating is the most heat it can lose without overheating. Compute P with
V²/RorR × I²and pick a bigger rating. - An LDR (light-dependent resistor) has high resistance in the dark and low resistance under light. In a voltage divider it turns brightness into voltage (a lamp that turns on at dusk).
Capacitors
A capacitor is two metal plates with an insulator (the dielectric) between them. It stores charge, like a tiny rechargeable bucket. Its capacitance grows with more plate area, less distance between plates and a better dielectric. That is why big capacitors are rolled-up sheets with very thin insulation.
| Connection | Capacitors | Resistors and inductors |
|---|---|---|
| Parallel | capacitances add: 10 µF + 22 µF = 32 µF | reciprocal rule: the result is smaller than the smallest |
| Series | reciprocal rule: 10 µF and 15 µF give 10 × 15 / 25 = 6 µF, smaller than the smallest | resistances and inductances add |
Small ceramic capacitors have a code in picofarads: two digits and the number of zeros. 104 = 100,000 pF = 100 nF. 222 = 2,200 pF = 2.2 nF.
A capacitor discharging through a resistor does it exponentially with the time constant τ = R × C. After each τ the voltage falls to about 37% of what it was. In a power supply, a 470 µF capacitor at 300 V with a 100 kΩ bleeder has τ = 47 s, and after 47 s it still holds 110 V.
Coils (inductors)
A coil stores energy in the magnetic field made by its current. Its inductance (henry) grows with the number of turns and with an iron or ferrite core. A capacitor opposes changes of voltage; a coil opposes changes of current. Inductors in series add (4.7 mH + 10 mH = 14.7 mH), and in parallel use the reciprocal rule, as long as their magnetic fields do not couple.
- Saturation: a core can carry only so much magnetic flux. Beyond that the inductance collapses and the current shoots up. That is why each inductor has a maximum current.
- RL time constant:
τ = L / R. A 100 mH coil in series with 50 Ω gives 2 ms. The current rises to about 63% in one τ. A bigger R makes it faster (unlike RC). - Resonance: an L and a C together have a frequency where XL = XC:
f = 1 / (2π√(LC)). For 10 mH and 100 nF it is about 5 kHz. A series LC then has minimum impedance, and a parallel LC has maximum impedance. It is the base of tuners and filters.
Transformers
A transformer has two coils (primary and secondary) on one core. A changing current in the primary makes a changing magnetic field, which induces a voltage in the secondary. The two windings are not electrically connected: the energy crosses through the field. This galvanic isolation is a big safety feature, separating a low-voltage circuit from the mains.
- Voltage ratio equals turns ratio:
V1 / V2 = N1 / N2. To go from 220 V to 12 V with 1,100 turns in the primary, the secondary needs 1,100 × 12 / 220 = 60 turns. - An ideal transformer keeps the power:
V1 × I1 = V2 × I2. A 10:1 step-down with 2 A in the secondary draws only 0.2 A from the primary. The low-voltage winding uses thicker wire. - Impedance matching: the load seen at the primary is the secondary load times the square of the turns ratio. To make an 8 Ω speaker look like 800 Ω, the ratio squared is 100, so the turns ratio is 10:1 primary:secondary.
Diodes, thyristors and transistors
A semiconductor (silicon is the famous one) is a material that conducts a little, between a metal and an insulator. When it is mixed with special atoms it makes parts that can control current. They are the bricks of every chip.
The diode
A diode is a one-way street for current. It is made of a PN junction and has two terminals: the anode (A) and the cathode (K). It conducts when the anode is more positive than the cathode (forward bias). To start conducting it must pass a small barrier: about 0.7 V in silicon, 0.3 V in germanium and even less in Schottky diodes. That voltage drop must be subtracted in your calculations. On the body of the part the painted band marks the cathode, as the bar does in the symbol.
anode ──▶|── cathode
(band here)
current flows A -> K onlyThe LED
An LED is a diode that gives light. Once it conducts, its voltage barely changes, so the circuit around it sets the current. Without a limiting resistor it takes too much current and burns. Compute R = (Vsupply − Vled) / I. For a 2 V LED on 5 V at 15 mA: R = 3 / 0.015 = 200 Ω.
The Zener diode
A Zener diode is used in reverse bias. In its Zener region the voltage across it stays almost fixed (for example 5.1 V), so it works as a small voltage regulator. Its power is P = VZ × I, so the maximum current is Pmax / VZ: for 6.8 V and 500 mW, 500 / 6.8 = about 73.5 mA.
In a simple regulator, a series resistor takes the difference between input and Zener voltage and carries the load current plus the Zener current. A 5.1 V Zener from 12 V, with 20 mA to the load and 10 mA kept in the Zener: R = (12 − 5.1) / 30 mA = 230 Ω. If the load is removed, all the current goes through the Zener, which must withstand it.
Thyristors: SCR and TRIAC
A thyristor is an electronic switch with a latch. The SCR has three terminals: anode, cathode and gate. It blocks current until, with the anode positive, a small pulse on the gate triggers it. After that it conducts like a diode, even if the gate signal is removed. It only turns off when the anode-cathode current falls below the holding current.
- In DC, a triggered SCR keeps the lamp on forever, until you interrupt the circuit.
- In AC, it turns itself off at every zero crossing of the current. But an SCR conducts only in the half cycles where the anode is positive, so at most half the power reaches the load (with the pulse right at the start of the half cycle).
- The TRIAC conducts in both directions. It is the usual part for AC loads such as dimmers.
- In phase-angle control, the TRIAC is triggered a little after each zero crossing. The later it fires, the less power. Firing at 90° (the voltage peak) delivers exactly half the power.
The bipolar transistor
A transistor is like a tap controlled by a tiny hand: a small base current controls a much larger collector current. The ratio is the gain β (also called hFE), typically tens to hundreds. It varies a lot between parts and with temperature, so good designs do not depend on its exact value.
In the active region, Ic = β × Ib (100 × 50 µA = 5 mA), and the emitter current is the sum of the two, only a little more than Ic. In saturation this proportionality stops: the outside circuit limits Ic.
As a switch, the transistor lives at the two extremes: cutoff (not conducting, the whole voltage is across it) and saturation (fully on, tiny voltage across it). Either the current or the voltage is almost zero, so it dissipates little power. To design it: take the load current divided by the minimum β, multiply by a safety factor, then Rb = (Vcontrol − 0.7 V) / Ib. For 100 mA, β = 100 min, factor 5: Ib = 1 mA × 5 = 5 mA, Rb = 4.3 / 5 mA = 860 Ω.
| Amplifier class | Conducts for | Fidelity | Efficiency |
|---|---|---|---|
| A | the whole cycle | best | lowest |
| B and AB | about half a cycle per transistor | good | better |
| C | less than half a cycle | much distortion | high |
Integrated circuits
An integrated circuit (IC), or chip, puts many tiny transistors, resistors and other parts on one piece of silicon. Instead of building a circuit with many separate parts, you buy one black rectangle with legs. Two famous ones are the operational amplifier and the 555 timer.
The operational amplifier (op-amp)
An op-amp is a high-gain amplifier with two inputs, inverting (−) and non-inverting (+). Alone its gain is huge, so we add feedback (a resistor from the output back to an input) and then the gain depends only on resistors.
| Circuit | Gain | Notes |
|---|---|---|
| Inverting | −Rf / R1 | the minus sign means the signal is flipped upside down |
| Non-inverting | 1 + Rf / R1 | no inversion |
| Voltage follower (buffer) | 1 | output wired to the inverting input |
Example, inverting with Rf = 100 kΩ and R1 = 10 kΩ: gain −10, so 0.2 V in gives −2 V out. The voltage follower has a gain of 1, but it is useful for its impedances: very high input (it does not load the previous stage) and very low output (it can feed a load). It joins dividers or high-impedance sensors to stages that draw current.
The 555 timer
The 555 has two classic modes.
- Astable: it oscillates by itself and makes a rectangular wave. Frequency depends on two resistors and a capacitor (more details in the classic circuits section).
- Monostable: it rests, and each trigger makes one pulse. The pulse lasts until the capacitor charges, through the resistor, to two thirds of the supply:
t = 1.1 × R × C. For 100 kΩ and 10 µF, t = 1.1 × 100,000 × 0.00001 = 1.1 s. It does not depend on the supply voltage.
Power supplies, multipliers, filters and generators
Now let us put parts together into circuits you will meet everywhere.
Linear power supply
Chips need low, steady DC. The wall gives high AC. A linear power supply fixes this in four stages, in this order:
wall AC -> [transformer] -> [rectifier] -> [filter] -> [regulator] -> DC load
lowers V one way smooths keeps it
isolates only (diodes) (capacitor) constant- A full-wave bridge rectifier flips the negative half cycles, so the pulses are at twice the mains frequency: 120 Hz on 60 Hz mains (100 Hz on 50 Hz). Closer pulses mean the capacitor discharges less.
- The filter capacitor charges to the peak of the secondary minus the diode drops. In a bridge the current goes through two diodes (about 1.4 V). With a 12 V RMS secondary: 12 × 1.414 = 17 V, minus 1.4 = about 15.6 V (little load).
- Between peaks, the capacitor alone feeds the load and its voltage falls. The ripple is
ΔV = I / (f × C). For 1 A, 120 Hz and 4,700 µF: 1 / (120 × 0.0047) = about 1.77 V peak to peak. More current gives more ripple. More capacitance or full-wave rectification gives less.
A switched-mode supply rectifies the mains directly, chops the DC at a high frequency with a transistor, and only then uses a ferrite transformer. At high frequency the core can be much smaller for the same power, so the supply is small, light and efficient. The price is more complexity and electrical noise.
Voltage multipliers
A voltage multiplier uses only diodes and capacitors, fed with AC, to get a DC voltage of 2, 3 or more times the peak of the input. Each capacitor charges to the peak in a half cycle and the voltages stack up, like building blocks.
- A doubler on 12 V RMS: peak 17 V, output about 34 V (twice the peak, never twice the RMS).
- A tripler on 127 V RMS mains: 127 × 1.414 × 3 = about 539 V DC, which can be lethal. Capacitors stay charged after switching off. Discharge them with a suitable resistor and measure before touching.
- Each diode can see the sum of the input peak and a charged capacitor. For a 170 V peak, a half-wave doubler's diode must withstand at least about 340 V. Size parts by the peak, with margin, never by the RMS.
- The limit: a multiplier trades current for voltage. Output power never exceeds input power, and the ripple grows fast with the current. It fits high-voltage, very small-current loads.
Filters
A filter lets some frequencies pass and weakens the others. There are four basic types, named after what they pass or block: low-pass (passes low, cuts high), high-pass, band-pass and band-stop. The cutoff frequency is the border between what passes and what is attenuated. The filter does not cut suddenly: it fades gradually.
For a first-order RC filter, fc = 1 / (2π × R × C). At that point the capacitor's reactance equals R, and the output voltage falls to 70.7% of the input, which is −3 dB, or half the power. With R = 10 kΩ and C = 10 nF: 1 / (2π × 10,000 × 0.00000001) = about 1.6 kHz. Passive filters use only R, C and L: no power, but they always attenuate and are affected by the load. Active filters add an amplifier (usually an op-amp, like the Sallen-Key), giving gain and isolation without bulky coils.
An LC filter acts at f = 1 / (2π√(LC)). To reject 60 Hz with C = 10 µF: L = 1 / ((2π × 60)² × C) = about 0.7 H, a big coil, which is why active filters are preferred at low frequency.
Waveform generators
An astable multivibrator is a square-wave oscillator with no resting state: it keeps flipping between two states. With two transistors, each half cycle lasts about 0.693 × R × C, so the symmetrical period is 1.386 × R × C. For R = 47 kΩ and C = 10 nF, the period is 0.65 ms, so about 1.5 kHz. Different values on each side give a rectangular wave (duty cycle not 50%).
The 555 astable: the capacitor charges through RA + RB and discharges through RB only, so f = 1.44 / ((RA + 2×RB) × C) (period 0.693 × (RA + 2RB) × C). For RA = 1 kΩ, RB = 10 kΩ and C = 100 nF: 1.44 / (21,000 × 0.0000001) = about 686 Hz. Since charging is longer than discharging, the duty cycle is always above 50%: the high time is 0.693 × (RA + RB) and the period is 0.693 × (RA + 2×RB), so the duty cycle is 11 / 21, about 52%. The smaller RA is compared with RB, the closer to 50%.
To make a triangular wave, feed the square wave to an integrator. Integrating a constant voltage gives a ramp: the output rises or falls in a straight line while the input holds. A square wave alternates between two levels, so the output is rising and falling ramps. Function generators combine a comparator (square) and an integrator (triangle).
↑ Back to the contentsPutting it all together
Now you have the whole map. Here is a list of the ideas that connect the pieces, and the mistakes that trip people up most often.
| Idea | Formula or rule | Remember |
|---|---|---|
| Ohm's law | V = R × I | more R, less I |
| Power | P = V × I = R × I² = V² / R | double current, four times the heat |
| Series resistors | R = R1 + R2 | bigger than the biggest |
| Parallel resistors | R = R1 × R2 / (R1 + R2) | smaller than the smallest |
| RMS and peak | Vrms = Vpeak / √2 | sizing uses the peak |
| Voltage divider | Vout = Vin × R2 / (R1 + R2) | only exact with no load |
| Thévenin / Norton | IN = VTH / RTH | same resistance |
| RC and RL | τ = R × C, τ = L / R | one τ is 63% |
| Transformer | V1 / V2 = N1 / N2 | needs AC |
| Transistor | Ic = β × Ib | as a switch: cutoff or saturation |
- Half-wave
- 60 Hz
- Full-wave
- 120 Hz
Common mistakes
- Mixing prefixes: m (milli) with M (mega), or forgetting to convert µA to A.
- Using the RMS value to size parts that must withstand the peak.
- Forgetting the load when using the voltage divider formula.
- Measuring resistance in a circuit that is powered, or connecting an ammeter in parallel.
- Forgetting the 0.7 V drop of a silicon diode or of a transistor's base.
- Trusting a charged capacitor to be safe after some time. Measure it.
- Connecting an LED without a series resistor, or a relay coil without a diode.
- Mixing up a formula's direction: capacitors in parallel add, resistors in parallel do not.