Electronics theory, one circuit at a time
Start with the trainer: a battery, a switch, a resistor and an LED. Change the parts, break things on purpose, and the notes explain what happened. Tap any part on the board to read about it. Then work through the topic library, from Ohm's law to PLCs.
Current in the loop
Where the voltage goes
What you're seeing
The parts of a circuit
Every circuit needs a source, a path, and something that uses the energy. These are the six parts on the trainer, one at a time.
+−The power sourceThe energy provider of every circuit
What is a Power Source?
A power source is what provides the electrical energy needed to make a circuit work. Without it, nothing happens - it's like trying to drive a car without fuel.
Think of it like a water pump in a plumbing system: it creates the pressure that pushes water through the pipes. Similarly, a power source creates electrical pressure (voltage) that pushes electrons through wires.
How Voltage Works
Voltage (V) is the measure of electrical "pressure" or potential difference. It's what pushes electrons through a circuit.
- Higher voltage = More electrical pressure = Can push current through more resistance
- Lower voltage = Less electrical pressure = Can only push current through lower resistance
- Common voltages: 1.5V (AA battery), 9V (9V battery), 5V (USB), 12V (car battery), 230V (mains in Ireland, the UK and Europe), 120V (North American mains)
Types of Power Sources
- Batteries (DC): Chemical energy → Electrical energy. Come in many sizes (AA, AAA, 9V, coin cells, lithium polymer)
- Wall Adapters (AC to DC): Convert household AC power to DC power for electronics (like phone chargers)
- USB Power: Provides standardized 5V power (USB-A, USB-C can provide higher voltages with negotiation)
- Solar Panels: Convert light energy → Electrical energy
- Power Supplies: Benchtop units for electronics work (adjustable voltage and current)
🔋 Example: AA Battery
A standard AA alkaline battery provides 1.5V
It can deliver this voltage until it's depleted. If you need more voltage, you stack them in series: 2×AA = 3V, 4×AA = 6V, etc.
The capacity (how long it lasts) is measured in mAh (milliamp-hours). A typical AA has ~2000-3000 mAh.
DC vs AC Power
DC (Direct Current): Electrons flow in one direction constantly. Used in batteries, electronics, LEDs.
AC (Alternating Current): Electrons flow back and forth rapidly (60 Hz in USA). Used in wall outlets, appliances.
Most electronics need DC, so we use adapters to convert AC from the wall to DC for our circuits!
Important Safety Notes
- Always match voltage requirements - too high can damage components!
- Respect polarity (+ and -) - connecting backwards can damage components
- Never work with AC mains voltage (120V/240V) unless you're trained - it's deadly!
- Even low voltages can cause fires if there's a short circuit with enough current
—WiresThe path the current follows
What are Wires?
Wires are conductors that provide a path for electricity to flow from one point to another. They're made of materials that allow electrons to move easily through them.
Think of wires like pipes in a water system - they don't create the flow, they just provide the path for it.
What Makes a Good Conductor?
Materials that have "free electrons" make good conductors. Metals are the best:
- Copper - Most common for wires (excellent conductivity, affordable)
- Silver - Best conductor, but expensive (used in high-end electronics)
- Gold - Doesn't corrode, used for connectors and contacts
- Aluminum - Lighter than copper, used in power lines
The Complete Loop Requirement
Critical concept: For electricity to flow, you MUST have a complete circuit - a continuous path from the power source's positive terminal, through the components, and back to the negative terminal.
- Closed Circuit: Complete path → Electricity flows → Circuit works ✓
- Open Circuit: Break in the path → No flow → Circuit doesn't work ✗
- This is why switches work - they create or break the complete path!
Wire Thickness (Gauge)
Wire thickness is measured by AWG (American Wire Gauge) - lower numbers = thicker wire
- Thick wires (low AWG): Can carry more current, less resistance (used for high power)
- Thin wires (high AWG): Carry less current, more resistance (used for signals, low power)
- Example: 22 AWG is common for breadboards, 14 AWG for household wiring
- Using wire that's too thin for high current = overheating and fire risk!
⚡ Example: LED Circuit
In an LED circuit: Wire connects battery + → resistor → LED → back to battery -
If ANY connection is broken (wire disconnected, component loose), the circuit is "open" and the LED won't light!
This is why breadboards and connectors are so important - they must make solid electrical contact.
Wire Resistance
Even conductors have some resistance (opposition to current flow):
- Longer wire = more resistance
- Thinner wire = more resistance
- For most circuits, wire resistance is negligible
- For long runs or high current, wire resistance must be considered
RThe resistorSetting how much current flows
What is a Resistor?
A resistor is a component that limits or controls the flow of electric current in a circuit. It "resists" the flow of electrons.
Think of it like a narrow section in a water pipe - it restricts how much water can flow through, even if there's high pressure behind it.
Why We Need Resistors
- Protect Components: LEDs and other components can't handle full battery voltage - resistors limit current to safe levels
- Control Current: Set precise current levels for proper component operation
- Divide Voltage: Create specific voltages from a higher voltage source
- Set Timing: Work with capacitors to create timing circuits
- Pull-up/Pull-down: Set default logic levels in digital circuits
Measuring Resistance
Ohm (Ω) is the unit of resistance:
- 1 Ω = Very low resistance (wire has ~0.01 Ω)
- 1 kΩ (1,000 Ω) = Common for LEDs, pull-ups
- 1 MΩ (1,000,000 Ω) = High resistance, used in sensors
Color Code System
Resistors have colored bands that tell you their value:
- Band 1 & 2: First two digits
- Band 3: Multiplier (number of zeros)
- Band 4: Tolerance (how accurate it is)
Colors: Black=0, Brown=1, Red=2, Orange=3, Yellow=4, Green=5, Blue=6, Violet=7, Gray=8, White=9
💡 Example: LED Current Limiting
You have a 9V battery and want to power a red LED (needs 2V and 20mA max current)
Calculation:
Voltage across resistor = 9V - 2V = 7V
Using Ohm's Law: R = V/I = 7V / 0.02A = 350Ω
Use a 330Ω or 470Ω resistor (standard values) to safely limit current!
Types of Resistors
- Fixed Resistors: Carbon film, metal film - have one set value
- Variable Resistors (Potentiometers): Can adjust resistance by turning a knob
- Thermistors: Resistance changes with temperature
- Photoresistors (LDR): Resistance changes with light
Power Rating
Resistors also have a power rating (usually 1/4W or 1/2W for hobby electronics)
Power = I² × R or V² / R
If you exceed the power rating, the resistor will overheat and potentially burn!
▶|The load: an LEDWhere the energy does something useful
What is a Load?
A "load" is any component that uses electrical energy to do useful work. It's the reason you built the circuit in the first place!
The load converts electrical energy into another form of energy: light (LED), motion (motor), sound (speaker), heat (heater), or data (microcontroller).
LED Basics
LED (Light Emitting Diode) is one of the most common loads in electronics projects.
- Converts electrical energy → Light energy
- Very efficient (doesn't waste much energy as heat)
- Long-lasting (can work for 50,000+ hours)
- Available in many colors: red, green, blue, yellow, white, RGB
- Low voltage (typically 1.8V - 3.3V forward voltage)
Polarity Matters!
Critical: LEDs only work in one direction - they have polarity!
- Anode (+): Longer leg, connects to positive
- Cathode (-): Shorter leg, connects to negative/ground
- Connect it backwards → It won't light
- Apply too much reverse voltage → It can be damaged
Forward Voltage & Current
Each LED color has a specific forward voltage (Vf) - the voltage it needs to light up:
- Red: ~1.8-2.2V
- Yellow/Green: ~2.0-2.2V
- Blue/White: ~3.0-3.4V
LEDs also need limited current (typically 20mA max) - this is why we ALWAYS use a resistor with LEDs!
⚠️ What Happens Without a Resistor?
If you connect an LED directly to a battery without a resistor:
The LED will try to draw unlimited current → It will get extremely bright for a brief moment → Then it will burn out and die!
Always use a current-limiting resistor with LEDs!
Other Common Loads
- Motors: Convert electrical energy → Rotational motion (fans, robots, drones)
- Speakers/Buzzers: Convert electrical energy → Sound waves
- Heating Elements: Convert electrical energy → Heat (toasters, soldering irons)
- Relays: Use small current to control large current (like an electrical switch)
- Displays: LCDs, OLEDs, 7-segment displays show information
- Microcontrollers: Process data and control other components (Arduino, ESP32)
RGB LEDs
RGB LEDs contain 3 LEDs in one package (Red, Green, Blue)
By controlling the brightness of each color, you can create millions of colors!
Each color needs its own resistor since they have different forward voltages.
⏻The switchOpening and closing the loop on purpose
What is a Switch?
A switch is a component that controls whether a circuit is complete (ON) or broken (OFF). It's like a drawbridge for electricity!
When CLOSED: The path is complete → Electricity flows → Circuit works
When OPEN: The path is broken → No electricity flows → Circuit is off
Common Types of Switches
- Toggle Switch: Flip it to stay ON or OFF (like a light switch)
- Push Button (Momentary): Only ON while you're pressing it (doorbell, keyboard keys)
- Push Button (Latching): Press once for ON, press again for OFF (power buttons)
- Slide Switch: Slide to switch between positions (small electronics)
- Rocker Switch: Rock back and forth (power supplies, appliances)
- DIP Switch: Tiny switches for configuration (multiple switches in one package)
Switch Configurations
Switches come in different configurations describing their connections:
- SPST (Single Pole Single Throw): Simple ON/OFF, 2 terminals
- SPDT (Single Pole Double Throw): Choose between 2 paths, 3 terminals
- DPST (Double Pole Single Throw): Control 2 circuits simultaneously, 4 terminals
- DPDT (Double Pole Double Throw): Switch 2 circuits between 2 paths, 6 terminals
💡 Example: Flashlight Switch
A flashlight uses a simple SPST slide or push button switch:
Switch OFF: Circuit is open → No current flows → LED stays dark
Switch ON: Circuit is complete → Current flows through resistor and LED → LED lights up!
The switch is usually placed between the battery positive and the rest of the circuit.
Transistors as Electronic Switches
Transistors can act as electronic switches with NO moving parts:
- Controlled by a small signal instead of physical movement
- Can switch millions of times per second (mechanical switches can't!)
- Used in all digital electronics, computers, microcontrollers
- MOSFETs can switch very high currents (motors, LEDs strips)
Switch Ratings
Every switch has voltage and current ratings - don't exceed them!
- Voltage Rating: Maximum voltage the switch can safely handle
- Current Rating: Maximum current the switch can safely pass
- Exceeding ratings → Arcing, melting, fire hazard!
- Example: A 5V 100mA switch should NOT be used for 12V 5A (will fail/burn)
Debouncing
Mechanical switches "bounce" - they make and break contact several times when pressed!
This happens in milliseconds but can confuse microcontrollers.
Solution: Add a small capacitor, or use software debouncing in code.
⏚GroundThe 0 V reference everything is measured from
What is Ground?
Ground (GND) is the reference point in a circuit - it's defined as 0 volts (0V). All other voltages in the circuit are measured relative to ground.
Think of ground like "sea level" for elevations: we measure mountains as "+1000m above sea level" and ocean depths as "-200m below sea level." Similarly, voltages can be positive or negative relative to ground.
Why Ground is Essential
- Common Reference: Provides a stable reference point for all measurements
- Return Path: Completes the circuit - current flows back to the power source through ground
- Safety: In AC systems, ground provides a safe path for fault currents
- Noise Reduction: A good ground plane reduces electrical noise and interference
Types of Ground
- Circuit Ground (GND): The 0V reference in your circuit (negative terminal of battery)
- Earth Ground: Literally connected to the Earth (third prong on outlets) - for safety
- Chassis Ground: Connected to the metal case/frame of equipment
- Digital Ground (DGND): Ground for digital circuits
- Analog Ground (AGND): Ground for sensitive analog circuits (kept separate to reduce noise)
🔋 Example: 9V Battery Circuit
In a 9V battery LED circuit:
Positive terminal: +9V (relative to ground)
Negative terminal: 0V = Ground (our reference point)
Current flows from +9V → through components → back to 0V (ground)
Voltage "drops" across each component, always measured relative to ground!
The Complete Circuit Loop
Ground completes the circuit loop:
- Power source positive → through components → back to power source negative (ground)
- Without this return path to ground, current can't flow
- Ground symbols (⏚) mark connection points to the common 0V reference
- All ground symbols in a circuit are connected together
Ground in Microcontroller Circuits
When connecting multiple devices (Arduino, sensors, displays):
- Always connect grounds together! This gives them a common reference
- Without common ground → erratic behavior, communication failures
- Example: Arduino GND must connect to breadboard GND, sensor GND, etc.
Measuring Voltage
When you measure "5V" with a multimeter, you're measuring the voltage difference between that point and ground (0V).
- Multimeter black probe → Ground (0V)
- Multimeter red probe → Point you want to measure
- Display shows voltage difference: (Measurement point) - (Ground)
⚠️ Common Mistake
Problem: "My Arduino and sensor won't communicate!"
Likely cause: Grounds aren't connected
Solution: Connect Arduino GND to sensor GND
Even if both have separate power supplies, they MUST share a common ground for signals to be interpreted correctly!
Topic library
Twenty-one topics in four chapters. Open one to read it, or jump straight in.
Foundations
How current flows, and the rules every circuit obeys.
⟳How circuits workCurrent, voltage, and the complete loop
A circuit is a complete, closed path that allows electric current to flow. Think of electricity like water in a pipe — the battery is the pump, the wires are the pipes, and the components are devices powered by the flow.
🔋 Closed Circuit
A complete unbroken loop. Current flows, components work. The path goes from + terminal, through components, back to − terminal.
✂️ Open Circuit
A break anywhere in the loop stops all current flow. Like a gap in a pipe — nothing works. A switch creates a controlled open circuit.
⚡ Short Circuit
Current finds a low-resistance path bypassing components. Causes high current, heat, and potential damage. Fuses protect against this.
🌊 Conventional Current
By convention, current flows from + to −. In reality, electrons flow from − to +. Both models are used in electronics.
ΩOhm's lawThe fundamental relationship between V, I, and R
Ohm's Law states that the current through a conductor is directly proportional to the voltage across it and inversely proportional to the resistance. It is the single most used equation in electronics.
🔍 Find Voltage
V = I × R
Example: 0.02A through 470Ω = 9.4V
🔍 Find Current
I = V ÷ R
Example: 9V ÷ 470Ω = 0.019A (19mA)
🔍 Find Resistance
R = V ÷ I
Example: 9V ÷ 0.02A = 450Ω
⚡ Power Formula
P = V × I
Also: P = I²R and P = V²/R. Measured in Watts (W).
∥Series and parallel circuitsTwo fundamental ways to connect components
Components in a circuit can be connected in series (one after another) or in parallel (side by side). Each arrangement behaves very differently.
⬛ Series Circuit
- One path for current
- Same current everywhere: Itotal = I₁ = I₂
- Voltage splits: Vtotal = V₁ + V₂
- Resistance adds: Rtotal = R₁ + R₂
- One break stops everything
- Used in: Christmas lights (old), fuses
⬛ Parallel Circuit
- Multiple paths for current
- Same voltage across each: Vtotal = V₁ = V₂
- Current splits: Itotal = I₁ + I₂
- Resistance reduces: 1/Rtotal = 1/R₁ + 1/R₂
- One break doesn't stop others
- Used in: Home wiring, LED strips
∿AC vs DCTwo types of electrical power
〜 Alternating Current (AC)
- Direction reverses periodically
- UK mains: 230V, 50Hz
- US mains: 120V, 60Hz
- Efficient for long-distance transmission
- Used in homes, industrial power
- Transformers change AC voltage easily
- Dangerous — can cause fibrillation
⎓ Direct Current (DC)
- Flows in one direction only
- Batteries: 1.5V, 3.7V, 9V, 12V
- All microcontrollers run on DC
- USB: 5V DC
- Produced by batteries, solar cells, rectifiers
- Easier to store (batteries/capacitors)
- Safer for electronics work
!Electrical safetyEssential rules for working with electronics
✅ Safe Voltages
Always work with low-voltage DC for learning: 3.3V, 5V, 9V, 12V. Use a bench power supply with current limiting, not mains directly.
🔧 ESD Protection
Electrostatic discharge can destroy microcontrollers and ICs instantly. Use an anti-static wrist strap and mat when handling sensitive components.
🔥 Short Circuit
Always use a fuse or current-limited supply. A short circuit can overheat wires, melt insulation, and start fires within seconds.
🔋 Battery Safety
Never short-circuit batteries. LiPo cells can catch fire if overcharged, over-discharged, or punctured. Use a proper battery management system (BMS).
👓 Eye Protection
Wear safety glasses when soldering. Solder flux can spit. Capacitors under stress can vent. Laser modules require appropriate laser safety eyewear.
💨 Ventilation
Solder fumes contain rosin flux vapour — use a fume extractor or work in a well-ventilated area. Lead-free solder is safer but still produces fumes.
Components
The parts you will meet on almost every board.
CCapacitorsStoring and releasing electrical charge
A capacitor stores electrical charge between two conductive plates separated by an insulator. It charges up when connected to voltage and releases that charge when the voltage is removed — like a small rechargeable reservoir.
🔵 Electrolytic
High capacitance (1µF–10,000µF). Polarised — must be connected + to + and − to −. Used for power supply smoothing.
🟡 Ceramic
Small capacitance (1pF–100nF). Non-polarised. Used for decoupling and noise filtering in high-frequency circuits.
⏱️ RC Time Constant
τ = R × C. Time (seconds) for a capacitor to charge to ~63% of supply voltage. After 5τ it's considered fully charged.
🔊 AC vs DC
Capacitors block DC current but pass AC signals. This makes them useful for coupling audio signals and filtering power rails.
LInductors and transformersEnergy storage in magnetic fields — the partner to capacitors
An inductor is a coil of wire that stores energy in a magnetic field when current flows through it. It resists changes in current the same way a capacitor resists changes in voltage. Together, inductors and capacitors form the foundation of filtering, oscillators, and power conversion.
🌀 How Inductors Work
When current flows through a coil, it creates a magnetic field. If current changes, the field collapses and induces a voltage opposing the change (Lenz's Law). This is called back-EMF. The faster the current changes, the larger the opposing voltage.
📏 Inductance (L)
Measured in Henries (H), millihenries (mH), microhenries (µH). The larger the coil, the more inductance. Adding a ferromagnetic core (iron, ferrite) multiplies inductance dramatically. Typical values: 1µH (RF) to 100mH (audio).
⚡ Inductive Reactance (XL)
XL = 2πfL. At higher frequencies, inductors present higher resistance to AC signals (opposite to capacitors). At DC (f=0), an ideal inductor is a short circuit — just wire resistance. At high frequency, it blocks AC completely.
🔋 Energy Storage
E = ½LI². An inductor storing 1A through 1H holds 0.5 joules. Unlike capacitors, inductors store energy in a magnetic field, not an electric field. When power is cut, this energy must go somewhere — causing voltage spikes that can destroy transistors.
🔒 Flyback Diode
When an inductor (relay coil, motor) is switched off, the collapsing field produces a reverse voltage spike that can reach hundreds of volts. A flyback diode (also called a freewheeling diode) placed across the inductor provides a safe path for this energy, protecting your transistor or MOSFET driver.
🔄 Transformers
Two coils sharing a magnetic core. The turns ratio determines voltage step-up or step-down: Vs/Vp = Ns/Np. Power is conserved: if voltage doubles, current halves. Used in mains power supplies, audio isolation, and impedance matching. Transformers only work with AC — not DC.
📦 Common Inductor Types
Air core: Low inductance, used at RF. Ferrite core: High inductance, used in switch-mode power supplies (SMPS). Toroid: Self-shielding ring core, low EMI, used in power supplies. Choke: Blocks high-frequency noise in power lines.
🔁 LC Oscillators
An inductor and capacitor in a tank circuit oscillate at f = 1/(2π√LC). Energy sloshes back and forth between magnetic field (L) and electric field (C). This principle underlies radio transmitters, receivers, and analog oscillators.
▶|Diodes and LEDsOne-way valves for electrical current
A diode allows current to flow in only one direction — from anode (+) to cathode (−). In the reverse direction it blocks current completely (up to its breakdown voltage). This makes diodes essential for rectification, protection, and signal routing.
▶ Standard Diode
~0.7V forward voltage drop (silicon). Used in rectifier circuits to convert AC to DC. The cathode is marked with a silver band.
💡 LED
Light Emitting Diode. Forward voltage ~1.8V–3.5V depending on colour. Always needs a current-limiting resistor to prevent burnout.
⚡ Zener Diode
Designed to operate in reverse breakdown at a precise voltage. Used as voltage regulators and references in power supplies.
🔒 Schottky Diode
Very low forward voltage (~0.2–0.4V) and fast switching. Used in high-frequency circuits and preventing reverse current in battery systems.
QTransistorsAmplifiers and electronic switches
A transistor is a three-terminal semiconductor device that can amplify signals or act as a switch. It is the fundamental building block of all modern electronics — billions are in every smartphone.
📦 BJT — NPN
Terminals: Base, Collector, Emitter. A small base current controls a larger collector current. Common for switching loads like motors and LEDs.
📦 BJT — PNP
Opposite polarity to NPN. Current flows from Emitter to Collector, controlled by pulling Base low. Used in high-side switching.
⚡ MOSFET
Voltage-controlled device (Gate, Drain, Source). Extremely low power consumption in logic state. Used in power switching and microcontroller output stages.
🔢 Gain (hFE / β)
The current amplification factor. If β = 100 and base current = 1mA, then collector current = 100mA. Allows small signals to control large loads.
▷Operational amplifiersVersatile analog building blocks for amplification, filtering, and signal processing
An op-amp is a high-gain differential amplifier in an IC package. It amplifies the difference between two inputs (V+ and V−). With just a few resistors, the same op-amp can be a voltage amplifier, comparator, oscillator, filter, or mathematical operator.
📌 Pinout (8-pin DIP)
Pin 2: Inverting input (V−) · Pin 3: Non-inverting input (V+) · Pin 6: Output · Pins 4 & 7: Negative and positive supply rails. Common ICs: LM741, LM358, TL071.
🔁 Inverting Amplifier
Input connects to V− through Rin. Feedback resistor Rf connects output to V−. Gain = −Rf / Rin. Output is inverted. Example: Rin=10kΩ, Rf=100kΩ → Gain = −10.
➕ Non-Inverting Amplifier
Input connects to V+. Feedback divider to V−. Gain = 1 + (Rf / Rin). Output is in phase with input. Always gain ≥ 1. Great for buffering high-impedance sensors.
⚖️ Voltage Comparator
No feedback — output swings to rail (HIGH or LOW) based on which input is greater. Used to detect threshold crossings: temperature alarms, zero-crossing detectors, light sensors.
🔋 Unity Gain Buffer
Output connected directly to V−. Gain = 1. Acts as an impedance buffer — copies voltage but draws virtually no current from the source. Protects sensitive signal sources.
➗ Summing Amplifier
Multiple input resistors to V−. Output = −(V1/R1 + V2/R2 + V3/R3) × Rf. Mixes multiple signals. Used in audio mixers, DAC circuits, and weighted adders.
📐 Virtual Ground
In a closed-loop inverting amp, the V− input is held at virtually 0V by feedback — it's called a "virtual ground". This simplifies circuit analysis enormously.
⚡ Slew Rate
Maximum rate the output can change (V/µs). If the input changes faster than the slew rate, the output distorts. LM741: 0.5 V/µs. TL071: 13 V/µs. Choose IC for frequency.
🔊 Integrator & Differentiator
Integrator: replace Rf with a capacitor → output is the integral of the input (ramp from constant). Differentiator: replace Rin with capacitor → outputs the rate of change.
🛡️ Rail-to-Rail Op-Amps
Standard op-amps can't reach their supply rails. Rail-to-rail types (e.g. MCP6001, LMV358) output near 0V and near Vcc. Essential for single-supply 3.3V/5V systems.
555The 555 timerOne of the most versatile and widely used ICs ever made
The NE555 timer (introduced 1972) generates precise time delays and oscillations using just a few resistors and a capacitor. It operates in three main modes: monostable (one-shot pulse), astable (free-running oscillator), and bistable (flip-flop). Runs from 5V–15V and can source/sink up to 200mA.
📌 Pinout (8-pin DIP)
1: GND · 2: Trigger (starts timing, active LOW) · 3: Output · 4: Reset (active LOW) · 5: Control Voltage · 6: Threshold (stops timing) · 7: Discharge · 8: Vcc
⚡ Monostable Mode
Triggered by a LOW pulse on pin 2. Output goes HIGH for a precise time then returns LOW. One single pulse regardless of trigger length. Timer ends when capacitor reaches 2/3 Vcc.
〜 Astable Mode
No external trigger needed — continuously oscillates. Output is a square wave. Charge time (HIGH): 0.693×(Ra+Rb)×C. Discharge time (LOW): 0.693×Rb×C. Frequency = 1.44 / ((Ra+2Rb)×C).
🔀 Bistable Mode
Pin 2 (trigger) sets output HIGH. Pin 4 (reset) sets output LOW. Behaves like an SR latch — holds its state until triggered. No capacitor needed. Used for debouncing switches.
🔁 Duty Cycle
In astable mode: Duty = (Ra + Rb) / (Ra + 2Rb) × 100%. For 50% duty cycle, use a diode to bypass Ra on discharge path — or use the CMOS 555 variant (TLC555).
🎛️ Control Voltage (Pin 5)
Normally bypassed with 10nF cap to GND. Applying a voltage here shifts the internal threshold — allows voltage-controlled oscillation (VCO). Used in tone modulators.
🔊 Tone Generator
Astable 555 directly driving a small speaker or buzzer produces an audible tone. Frequency = 1.44/((Ra+2Rb)×C). Ra=1kΩ, Rb=10kΩ, C=10nF → approx 1.3kHz.
💡 LED Flasher
Classic beginner project: astable 555 with Ra=4.7kΩ, Rb=47kΩ, C=100µF → ~0.2Hz flash rate (5s cycle). Add second LED on opposite phase via inverter for alternating flash.
🛡️ CMOS 555 (TLC555)
Operates from 2V–15V, draws only 1µA quiescent current vs 6mA for bipolar 555. Essential for battery-powered circuits. Same pinout, more stable frequency at low voltages.
⏳ Long Timers
For delays beyond a few minutes, use large R×C values or chain two 555s. With R=10MΩ and C=470µF: t ≈ 5166s (86 minutes). Leakage current limits accuracy at very long intervals.
Signals and control
Switching, timing and shaping signals.
&Logic gatesBoolean logic — the language of digital electronics
Logic gates process binary signals (HIGH = 1 = ~5V or 3.3V, LOW = 0 = 0V) according to Boolean rules. All digital systems — from calculators to computers — are built from combinations of these gates.
AND Gate
Output is HIGH only when ALL inputs are HIGH. Symbol: D-shape. Used in safety interlock systems.
| A | B | OUT |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR Gate
Output is HIGH when ANY input is HIGH. Symbol: Curved shield. Used in alarm systems.
| A | B | OUT |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT Gate (Inverter)
Flips the input. HIGH becomes LOW, LOW becomes HIGH. One input only. The bubble symbol means inversion.
| A | OUT |
|---|---|
| 0 | 1 |
| 1 | 0 |
NAND & NOR
NAND = AND + NOT (inverted output). NOR = OR + NOT. Both are "universal gates" — any logic circuit can be built using only NAND or only NOR gates.
XOR Gate
Exclusive OR — output HIGH only when inputs are DIFFERENT. Used in binary adders, error detection, and encryption circuits.
| A | B | OUT |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Boolean Laws
A AND 1 = A
A OR 0 = A
A AND 0 = 0
A OR 1 = 1
NOT NOT A = A
De Morgan's: NOT(A AND B) = NOT A OR NOT B
HzSignal theoryUnderstanding waveforms, frequency, and how signals carry information
Every electrical measurement in electronics is a signal — a voltage or current that varies with time to carry information. Understanding how signals are characterised, measured, and manipulated is fundamental to all electronics work beyond simple DC circuits.
📊 Signal Parameters
Amplitude: Peak voltage from zero (or peak-to-peak). Frequency (f): Cycles per second in Hz. Period (T): Time for one cycle, T = 1/f. Phase: Time offset between two signals of same frequency, measured in degrees (0–360°) or radians.
🌊 RMS Voltage
Root Mean Square — the DC-equivalent heating value of an AC signal. For a sine wave: Vrms = Vpeak × 0.707. Mains voltage is quoted in RMS (230Vrms = 325V peak). Multimeters measure AC in RMS. Use RMS for power calculations: P = Vrms²/R.
🔲 Duty Cycle
For square/PWM waves: Duty Cycle = (t_on / Period) × 100%. 50% duty = equal on/off time. PWM at 25% duty, 5V peak → 1.25V average. Average voltage = Vpeak × duty cycle. Used to control motor speed, LED brightness, and servo position.
🎯 Bandwidth
The range of frequencies a circuit can handle. An audio amplifier might have 20Hz–20kHz bandwidth. An oscilloscope probe must have bandwidth higher than the signal being measured. The -3dB frequency is where amplitude drops to 70.7% of its value — the conventional bandwidth limit.
🎸 Harmonics
A square wave is actually a sum of sine waves: fundamental frequency + all odd harmonics (3rd, 5th, 7th…). This is Fourier decomposition. A 1kHz square wave contains 1kHz, 3kHz, 5kHz, 7kHz... components. This is why filters and bandwidth matter for square wave circuits.
📉 Decibels (dB)
Logarithmic ratio used to express gains and losses. Voltage: dB = 20 × log10(Vout/Vin). Power: dB = 10 × log10(Pout/Pin). Key values: +6dB ≈ voltage doubled · -3dB = voltage ÷ √2 (half power) · 0dB = no change · -20dB = ÷10 in voltage.
📡 Analog vs Digital Signals
Analog: continuous voltage — can be any value within a range (audio, sensor outputs). Digital: only two voltage levels (HIGH/LOW). Digital signals are more immune to noise but require ADC conversion to represent real-world values. Most real-world signals are analog; most processors are digital.
🔊 Signal-to-Noise Ratio (SNR)
SNR = 20·log10(Vsignal/Vnoise) in dB. Higher SNR = cleaner signal. CD audio: 96dB SNR. A noisy sensor might have 40dB. Improve SNR by shielding cables, decoupling power supply, using differential signalling (like RS-485), and averaging multiple ADC readings.
fcFilters and frequency responseShaping signals by allowing or blocking specific frequencies
A filter selectively passes or blocks signals based on frequency. Passive filters use only resistors, capacitors, and inductors. Active filters add op-amps for amplification and sharper roll-off. Filters are essential in audio, power supplies, communication systems, and noise reduction.
🔻 Low-Pass Filter (LPF)
Passes low frequencies, blocks high. RC circuit: R in series, C to ground. At cutoff frequency, output = 70.7% of input (−3dB). Used to smooth PWM output and remove high-frequency noise.
🔺 High-Pass Filter (HPF)
Passes high frequencies, blocks low (and DC). C in series, R to ground. Same cutoff formula. Used to remove DC offset from audio signals and isolate AC components of a waveform.
〰️ Band-Pass Filter
Passes a range of frequencies between two cutoff points. HPF + LPF in series (or resonant LC). Used in radio tuners, audio equalisers, and communication receivers.
🚫 Band-Stop (Notch) Filter
Blocks a specific frequency band — the opposite of band-pass. Twin-T notch filter eliminates one frequency precisely. Classic use: removing 50/60Hz mains hum from audio signals.
📐 Cutoff Frequency Examples
R=10kΩ, C=1µF → fc = 15.9Hz (audio subsonic filter) · R=1kΩ, C=100nF → fc = 1.59kHz · R=100Ω, C=10nF → fc = 159kHz (RF bypass)
⚡ LC Filters
Inductor (L) + capacitor (C) filters have steeper roll-off (−40dB/decade) than RC (−20dB/decade). Used in power supply output filters and RF circuits. Resonant frequency: f = 1/(2π√(LC)).
🔊 Active Sallen-Key Filter
Op-amp based 2nd-order filter with −40dB/decade roll-off. Butterworth: maximally flat passband. Chebyshev: steeper roll-off with ripple. Bessel: best phase linearity for audio.
📻 Decoupling Capacitors
Every IC power pin needs a 100nF ceramic capacitor to GND, placed as close as possible. Acts as a local charge reservoir and high-frequency low-pass filter, preventing noise from corrupting the supply rail.
📉 Roll-Off & Order
1st order (single RC): −20dB/decade above fc. 2nd order (two RC stages): −40dB/decade. Each additional order adds −20dB/decade steepness. Higher order = sharper cutoff = more components.
🎚️ PWM Smoothing
To convert 1kHz PWM into smooth DC: choose fc at least 1/10th of PWM frequency. For 1kHz PWM: fc = 100Hz → R=10kΩ, C=160nF (use 150nF). Ripple ≈ Vavg/(f×R×C).
⎍PWM and motor controlPulse Width Modulation — controlling power with digital signals
PWM (Pulse Width Modulation) varies the average power delivered to a load by rapidly switching between fully ON and fully OFF. The ratio of ON time to total period is the duty cycle. Since the switching happens faster than the load responds, it sees a steady average voltage. Used for motor speed control, LED dimming, servo positioning, and digital-to-analog conversion.
📊 Duty Cycle
Duty cycle = (ON time / Period) × 100%. 0% = always OFF. 100% = always ON. 50% duty at 12V delivers average 6V to the load. Higher frequency = smoother result.
⚡ Average Voltage
Vavg = Vsupply × (Duty / 100). A 5V PWM at 75% duty gives 3.75V average. Add an RC low-pass filter (see Filters section) to smooth PWM into a true DC analog voltage.
🔌 MOSFET Switch
A logic-level MOSFET (e.g. IRLZ44N) driven by a microcontroller PWM pin can switch amps of motor current. Add a flyback diode across the motor — never omit this.
🔁 H-Bridge
Four switches (MOSFETs or BJTs) in an H-bridge arrangement allow bidirectional motor control — forward, reverse, brake, and coast. ICs: L298N (5A), L293D (1A), DRV8833 (1.5A).
🤖 Servo Motors
Servos use PWM at 50Hz (20ms period). Pulse width 1ms = 0°, 1.5ms = 90°, 2ms = 180°. Microcontrollers generate this easily. Servos have built-in position feedback and gearing.
💡 LED Dimming
PWM dimming maintains constant LED colour temperature at all brightness levels (unlike resistor dimming which changes colour). Use 1kHz+ frequency to avoid visible flicker. Persistence of vision threshold ~100Hz.
🔢 PWM Frequency Selection
Motors: 1–20kHz (audible whine at low freq). LEDs: >200Hz (flicker-free). Servos: 50Hz. Audio DAC: >40kHz (above hearing). Higher freq = more switching losses in MOSFETs.
🛡️ Dead Time & Shoot-Through
In H-bridges, both high and low side switches must never be ON simultaneously — this causes shoot-through (dead short). Gate drivers add dead-time to prevent this. Critical in power electronics.
🔋 Stepper Motors
Stepper motors move in discrete steps (e.g. 200 steps/revolution). Driven by sequences of pulses to coil pairs. Drivers: A4988, DRV8825. Steps can be microstepped for smoother motion.
📐 Back-EMF & Current Sensing
Running motors generate a back-EMF opposing the supply. Back-EMF ∝ motor speed — used to measure RPM without sensors. A small series resistor (0.1Ω) measures current via voltage drop (I=V/R).
WPower electronicsVoltage regulators, MOSFETs, and controlling power efficiently
Power electronics deals with converting, controlling, and conditioning electrical power. From the humble voltage regulator to switch-mode power supplies and motor drives, these circuits handle energy rather than just signals.
📉 Linear Regulators (LDO)
The simplest voltage regulator — drops excess voltage as heat. 7805: 5V out, needs at least 7V in. LM317: adjustable 1.25–37V. Low Dropout (LDO) types like LD1117 work with just 1.1–1.3V headroom. Efficiency = Vout/Vin. At 5V out from 12V in: only 41% efficient — the rest is wasted as heat.
🔄 Switch-Mode Power Supplies (SMPS)
Switch transistors on/off at 20–500kHz to transfer energy efficiently through an inductor. Buck converter: steps voltage down. Boost converter: steps voltage up. Buck-boost: either. Typical efficiency 85–95% vs 40–60% for linear regulators. More complex but essential for battery-powered devices.
🔌 MOSFETs as Switches
N-channel MOSFET (IRFZ44N, 2N7000): Gate voltage above threshold (~2–4V) fully turns it ON — low resistance (RDS_on). Used for high-side and low-side switching. Gate is voltage-controlled (no gate current needed). P-channel MOSFETs switch the high side more simply but have higher RDS_on. Logic-level MOSFETs (threshold 2–3V) can be driven directly by MCU pins.
🔋 Battery Technologies
Li-Po / Li-Ion: 3.7V nominal, 4.2V full, 3.0V cutoff. High energy density. Never discharge below 3V or overcharge above 4.2V — use a BMS. NiMH: 1.2V/cell, safe, rechargeable. LiFePO4: 3.2V, safer chemistry, longer cycle life, used in EVs and solar storage. Always use the correct charger.
🌡️ Thermal Management
Power = heat. P_dissipated = (Vin – Vout) × Iout for linear regulators. Thermal resistance (°C/W): junction-to-case + case-to-ambient. TO-220 package on heatsink: 5–10°C/W. Without heatsink: 50°C/W. Junction temperature must stay below 125–150°C. Add heatsinks whenever dissipating more than 0.5W in a small package.
🔁 H-Bridge Motor Driver
Four switches arranged in an H-shape allow current to flow through a motor in either direction (forward/reverse). Common ICs: L298N (2A), TB6612FNG (1.2A), DRV8833 (1.5A). Enable pin controls speed via PWM. Always include flyback diodes across motor terminals to suppress back-EMF spikes.
°CSensors and transducersHow the physical world connects to electronic circuits
A sensor converts a physical quantity (temperature, light, pressure, motion) into an electrical signal. A transducer converts energy from one form to another in either direction (a speaker and microphone are both transducers for sound/electrical energy). Understanding how to interface sensors correctly is essential for any embedded system project.
🌡️ Temperature Sensors
NTC Thermistor: Resistance decreases with temperature. Use voltage divider with fixed resistor, read with ADC. Cheap but nonlinear — use Steinhart-Hart equation. LM35: Analog, 10mV/°C, 0–150°C, direct ADC. DS18B20: Digital, 1-Wire protocol, ±0.5°C accuracy, multiple on one wire. DHT22: Temperature + humidity, digital, 2-wire.
💡 Light Sensors
LDR (Photoresistor): Resistance decreases in light. Use voltage divider, read with ADC. Slow response, adequate for ambient light. Photodiode: Fast, linear — used in optical links, receivers. Phototransistor: Amplified photodiode, used in IR receivers. BH1750: I2C digital lux sensor with calibrated output.
📐 Distance & Proximity
HC-SR04 Ultrasonic: Sends 40kHz burst, measures echo time. Range 2cm–4m. Distance = (time × 343m/s) / 2. Good for robotics. IR Proximity (TCRT5000): Detects nearby objects at ~1cm. VL53L0X: Time-of-Flight laser, I2C, 0–2m, ±3% accuracy. PIR (HC-SR501): Detects motion via infrared — used in alarm systems.
🧲 IMU — Motion Sensing
MPU-6050: 3-axis accelerometer + gyroscope on one I2C chip. Accelerometer measures linear acceleration (including gravity). Gyroscope measures rotation rate in °/s. Combine with complementary or Kalman filter to get stable angle estimation. Used in drones, robots, gesture detection.
🎵 Sound & Pressure
Electret Microphone: Requires 3.3–10V bias through 10kΩ resistor, outputs AC audio signal. Add op-amp preamp (×100 gain) before ADC. INMP441: I2S digital MEMS microphone, direct to ESP32. BMP280/BME280: Barometric pressure + altitude + temperature, I2C/SPI. Altitude from pressure: every 100m rise ≈ 12 hPa drop.
⚙️ Encoder & Position
Rotary encoder: Two quadrature signals (A/B) give both position and direction. Count rising edges on A; check B to determine direction. Hall Effect sensor (SS49E): Analog output proportional to magnetic field — used for non-contact current sensing, gear tooth detection. Potentiometer: Simplest position sensor — resistive divider, read with ADC.
Systems and practice
From microcontrollers and PLCs to the soldering iron and the fault-finding mindset.
µCMicrocontrollersProgrammable digital brains — the core of modern embedded systems
A microcontroller (MCU) is a complete computer on a single chip: processor, RAM, flash memory, and I/O peripherals in one package. Unlike a microprocessor (which needs external memory and peripherals), an MCU is self-contained and designed to run embedded code that interacts directly with hardware.
📌 GPIO — Digital I/O
General Purpose Input/Output pins. Configurable as input (read button/sensor) or output (drive LED/relay). Logic HIGH = Vcc (3.3V or 5V), LOW = 0V. Most MCU pins source 8–25mA maximum — use transistors for larger loads.
〜 ADC — Analog to Digital
Converts analog voltage to a digital number. 10-bit ADC: 0–1023 (Arduino Uno). 12-bit ADC: 0–4095 (STM32, RP2040). Resolution = Vref / 2^N. Used to read potentiometers, temperature sensors, microphones.
🎛️ PWM Output
Hardware PWM channels generate precise duty cycles without CPU overhead. Used for motor speed, LED dimming, servo control, and buzzer tones. Arduino: analogWrite(pin, 0–255) = 0–100% duty at ~490Hz.
📡 UART — Serial Communication
Two-wire asynchronous serial: TX (transmit) and RX (receive). Common baud rates: 9600, 115200 bps. Used to communicate with PCs, GPS modules, Bluetooth/Wi-Fi modules. No clock line — both ends must agree on baud rate.
🔗 I2C — Two-Wire Bus
SDA (data) and SCL (clock). Multiple devices share one bus, each with a unique 7-bit address. Speeds: 100kHz (standard), 400kHz (fast). Needs pull-up resistors (4.7kΩ typical). Used for sensors, displays, EEPROMs.
⚡ SPI — High-Speed Bus
4 wires: MOSI, MISO, SCK, CS. Full-duplex, faster than I2C (up to 50MHz+). Each device needs its own CS (chip select) line. Used for SD cards, display drivers, fast ADCs, and flash memory.
🟦 Arduino (ATmega328P)
5V, 16MHz, 32KB flash, 2KB RAM. 14 digital I/O, 6 PWM, 6 ADC pins. Huge library ecosystem. 5V logic — level-shift before connecting 3.3V peripherals. Best for beginners and prototyping.
🟢 Raspberry Pi Pico (RP2040)
3.3V, dual-core ARM Cortex-M0+ at 133MHz, 264KB RAM, 2MB flash. 26 GPIO, 2 UART, 2 SPI, 2 I2C, 16 PWM, 3 ADC. Programmable in MicroPython or C/C++. Excellent for real-time applications.
🔵 STM32
Professional 32-bit ARM Cortex-M series. 3.3V. Wide range from STM32F0 (48MHz, budget) to STM32H7 (480MHz, dual-core). Used in industrial, automotive, and medical devices. Steep learning curve, powerful peripherals.
🌐 ESP32
3.3V dual-core 240MHz, Wi-Fi + Bluetooth built in, 34 GPIO, 12-bit ADC, touch sensing, Hall sensor, 4MB flash. Programmable via Arduino IDE or ESP-IDF. The go-to choice for IoT and wireless projects.
🔺 Pull-Up & Pull-Down Resistors
Floating inputs pick up noise and read randomly. A pull-up (10kΩ to Vcc) holds pin HIGH until pulled LOW by a switch. A pull-down (10kΩ to GND) holds pin LOW. Most MCUs have built-in pull-ups — enable in software.
⚡ Level Shifting
5V and 3.3V devices must not be connected directly — 5V signals damage 3.3V MCU pins. Use a voltage divider (R1=1kΩ, R2=2kΩ) for one-way logic, or a dedicated level shifter (TXB0108, BSS138 FETs) for bidirectional I2C/SPI.
🔋 Power Considerations
Power the MCU from a regulated supply (LDO or SMPS). Decouple Vcc pin with 100nF + 10µF capacitors to GND. USB power from a PC is limited to 500mA. Use external 5V/1A+ adapter for motor projects.
⏱️ Interrupts & Timers
Hardware interrupts respond to pin changes instantly without polling. Timers run independently of main code — used for PWM generation, measuring pulse width, scheduled tasks, and watchdog resets to recover from crashes.
LDPLC basicsProgrammable Logic Controllers: the computers that run factories
A PLC (Programmable Logic Controller) is a ruggedised industrial computer that controls machinery — conveyors, presses, packaging lines, traffic lights, building systems. Where a hobby microcontroller runs one program on a breadboard, a PLC runs 24/7 in electrical cabinets, survives vibration, electrical noise, and temperature extremes, and is programmed in a language electricians can read: ladder logic.
🔄 The Scan Cycle
A PLC runs an endless loop: 1) Read all inputs into memory, 2) Execute the logic top-to-bottom, 3) Write all outputs at once. One full loop is a "scan," typically 1–20 ms. This matters: an input that changes mid-scan isn't seen until the next scan, and outputs only update at the end — never mid-logic.
🪜 Ladder Logic
Programs look like relay wiring diagrams: two vertical power rails with horizontal "rungs" between them. Each rung reads left to right: conditions (contacts) on the left, actions (coils) on the right. If the logical path across a rung is TRUE, the coil energises. It was designed so plant electricians could read programs like the relay panels they replaced.
⚡ Contacts: NO and NC
Normally Open —| |— passes power when its input is ON (like a push button making contact). Normally Closed —|/|— passes power when its input is OFF. Contacts don't switch real electricity — they test the state of an input, output, or internal bit in memory. Series contacts = AND logic; parallel branches = OR logic.
🔔 Coils & Outputs
A coil —( )— sets a bit ON when its rung is true, OFF when false. Output coils drive real hardware: motor contactors, valves, lamps. Internal coils (memory bits) store states like "machine running" for use in other rungs. Set (S) and Reset (R) coils latch a bit ON or OFF until the opposite instruction fires.
🔒 The Seal-In Circuit
The most famous rung in industry — Start/Stop motor control: a Start button (NO) in parallel with the motor's own output contact, in series with a Stop button (NC). Press Start → motor coil energises → its contact closes and "seals in" around the Start button, so the motor stays running when you release it. Press Stop → the rung breaks → motor drops out. Every PLC programmer learns this first.
⏱️ Timers
TON (On-Delay): output turns ON after the input has been true for the preset time — e.g. "run the fan 5 s after the motor starts." TOF (Off-Delay): output stays ON for a time after the input goes false — e.g. "keep the cooling fan running 30 s after shutdown." RTO (Retentive): accumulates time across interruptions until reset — used for maintenance-hour counters.
🔢 Counters
CTU (Count Up) increments on each rising edge of its input — count bottles past a sensor, boxes on a pallet. CTD (Count Down) decrements. When the accumulated count reaches the preset, the counter's done bit turns ON — "24 bottles counted → index the crate." Counters keep their value between scans and need an explicit Reset.
🔌 Real I/O
Inputs: push buttons, limit switches, proximity sensors, photo-eyes — usually 24V DC signals. Outputs: relay outputs switch anything but are slow; transistor outputs switch fast DC for indicator lamps and solenoid valves. Sinking vs sourcing describes current direction — mixing them up is the most common wiring fault in new installations.
🤖 PLC vs Microcontroller
An Arduino costs £20; a PLC costs £200–£2000. The difference: certified reliability, screw-terminal I/O at 24V industrial levels, hot-swappable modules, online editing (change logic while the machine runs), and decades of guaranteed spare parts. Use a microcontroller for products and prototypes; use a PLC when downtime costs money and an electrician must maintain it.
SnSoldering and practical skillsThe craft behind real circuits — tools, technique, and inspection
Soldering is the process of joining electrical conductors using a fusible metal alloy (solder). A good solder joint is both electrically and mechanically reliable. Poor soldering — cold joints, bridges, or insufficient heat — is the cause of more project failures than bad circuit design.
🌡️ Iron Temperature
Lead solder (Sn63/Pb37): melt point 183°C — iron at 320–350°C. Lead-free (Sn96.5/Ag3/Cu0.5): melt point 217°C — iron at 350–380°C. Too cold: cold joints, dull finish. Too hot: damaged pads, burnt flux, delaminated PCB. A quality iron with temperature control (Hakko FX-888D, TS100) is worth the investment.
🔬 Joint Inspection
Good joint: Bright, shiny (leaded) or slightly matte (lead-free), concave fillet, flows all around pin and pad. Cold joint: Dull, grainy, cracked — electrically intermittent. Reheat and add fresh solder. Bridge: Solder connects two adjacent pads — use solder wick or desoldering pump to remove. Insufficient: Not enough solder for mechanical strength.
🧰 Essential Tools
Soldering iron: Temperature controlled, 40W+. Solder: 0.5–0.8mm rosin-core. Flux: Cleans oxide, improves flow — reapply for rework. Desoldering wick: Copper braid absorbs solder. Solder sucker: Pump for through-hole desoldering. PCB holder/third hand: Keeps work stable. Tip cleaner: Brass wool or wet sponge — clean before every joint.
📋 Through-Hole Technique
1. Heat pad and lead simultaneously for 2–3 seconds. 2. Apply solder to the joint (not the iron). 3. Remove solder, then iron. 4. Inspect — should flow with a concave fillet. 5. Clip excess lead after joint cools. Common mistake: heating only the lead, not the pad — solder doesn't flow onto cold copper.
🔬 SMD Soldering
Surface Mount Devices. Drag soldering: apply flux, drag iron across IC pins. Solder paste + hot air: apply paste, place components, heat with hot air gun (350°C). Reflow oven: professional method. 0402 and smaller need magnification. Tweezer tip iron helps with fine pitch ICs. Flux is your best friend — use generously and clean afterwards.
📏 PCB Basics
PCB layers: copper traces, soldermask (green/black/red coating), silkscreen (white labels). FR4 standard substrate. Track width vs current: 0.25mm handles ~0.5A, 1mm handles ~2.5A (IPC-2221). Ground planes reduce noise and thermal resistance. Via: plated hole connecting layers. Minimum via diameter 0.3mm in most fab processes.
?Troubleshooting and debuggingA systematic approach to finding and fixing faults
Debugging is a skill that separates experienced engineers from beginners. The difference is not luck — it's a systematic process: observe the symptom, form a hypothesis, test it, and iterate. Random component swapping without measurement is the slowest route to a working circuit.
🔋 Power First
Start every debug session by verifying power. Measure Vcc at the IC pin, not just at the power connector. Check for voltage sag under load — a weak supply may read 5V unloaded but 3.2V with everything connected. Measure GND continuity between all boards in the system. Most failures trace back to poor power delivery.
⚡ Multimeter Techniques
Continuity: Test wiring before powering up. Voltage: Always measure with respect to GND. Diode test: Check LEDs, protection diodes. Resistance: Measure off-circuit to avoid parallel paths giving false readings. DC current: Must break the circuit to insert meter in series. Set to highest range first, work down.
📈 Oscilloscope Debugging
See what the multimeter can't: signal shape, glitches, timing relationships. Check clock signals — are they present and at the right frequency? Look for noise on power rails (ripple, switching spikes). Verify UART/SPI/I2C communication by checking for activity. Measure rise/fall times for signal integrity.
🌡️ Thermal Clues
Components running too hot reveal problems. A linear regulator burning hot means high current draw — find the load. A transistor running hot when it should be off suggests it's never fully saturated. LEDs running hot means current is too high. Thermal imaging cameras (FLIR, cheap USB units) are excellent for quickly spotting hot spots on a PCB.
🧩 Divide and Conquer
Don't debug the whole system at once. Isolate subsystems: disconnect modules one at a time and see if the problem disappears. Comment out code sections to find software issues. Replace ICs one at a time to find a faulty component. Add test points (pads or loops of wire) at key nodes on your PCB during design — they're invaluable for debugging.
📋 Common Faults
Intermittent: Cold solder joint — flex the PCB while probing. Works on bench, fails in product: Power supply too weak. MCU crashes: Floating inputs, missing decoupling caps. No comms: Wrong baud rate, missing pull-up resistors (I2C). Motor won't spin: Insufficient current, flyback diode wrong way. Oscillates: Op-amp without feedback resistor, insufficient bypass caps.
Components at a glance
What each part does, the values you'll usually see, and the mistake to avoid.
| Part | Unit | What it does | Typical values | Watch out for |
|---|---|---|---|---|
| Resistor | Ω | Limits current and turns the excess into heat | 10 Ω – 1 MΩ, ¼ W | Power rating: P = I² × R must stay under it |
| Capacitor | F | Stores charge; blocks DC, passes AC | 10 pF – 1000 µF | Electrolytics are polarised and have a voltage rating |
| Inductor | H | Stores energy in a magnetic field; resists changes in current | 1 µH – 10 mH | Switching one off makes a voltage spike: fit a flyback diode |
| Diode | Vf | Lets current flow one way only | 0.7 V (silicon), 0.3 V (Schottky) | The band marks the cathode (−) |
| LED | Vf | A diode that gives out light | 2 V red, 3 V blue or white · 20 mA | Always needs a series resistor |
| Transistor (BJT) | hFE | A small base current switches a larger collector current | gain 100–300, VBE 0.7 V | A base resistor is essential |
| MOSFET | RDS(on) | Voltage-controlled switch for bigger loads | 10 mΩ – 1 Ω | Pick a logic-level part for 3.3 V or 5 V drive |
| Op-amp | Av | Amplifies the difference between its inputs | gain set by two resistors | Output can't swing past its supply rails |
| 555 timer | Hz | Makes pulses, delays and oscillators | 0.1 Hz – 100 kHz | Timing capacitor tolerance sets the accuracy |
| Fuse | A | Melts to break the circuit when current is too high | 100 mA – 13 A | Replace with the same rating, never bigger |
Check yourself
Six questions across the library. Each answer comes with the reason.
Formula sheet
The equations from the library on one card.
V = I × ROhm's lawP = V × IPower, also I²R and V²/RR = (Vs − Vf) ÷ ILED series resistorR = R1 + R2Series resistors1/R = 1/R1 + 1/R2Parallel resistorsτ = R × CRC time constant: 63% charged after τfc = 1 ÷ (2πRC)RC filter cut-off frequencyf = 1.44 ÷ ((R1 + 2R2)C)555 astable frequencyVavg = D × VhighPWM average voltageVrms = Vpk ÷ √2RMS of a sine waveVs ÷ Vp = Ns ÷ NpTransformer turns ratioGain = 1 + Rf ÷ R1Non-inverting op-amp