Electronics Fundamentals

From Bespoke Robot Society
Jump to navigation Jump to search
Electronics Fundamentals
Competency Electronics
Difficulty Beginner
Time Required 2-4 hours (split across multiple sessions)
Prerequisites None - complete beginner friendly
Materials Needed Multimeter ($15-30), breadboard, LED, resistor (220Ω), 9V battery or power supply
Next Steps SimpleBot assembly, Motor Control Basics, Sensor Interfacing

Electronics Fundamentals is your introduction to understanding circuits, components, and electronic systems for robotics. This tutorial covers the essential knowledge you need to build and understand SimpleBot and other BRS robots.

By the end of this tutorial, you'll understand:

  • How to read schematics
  • What voltage, current, and resistance mean
  • How to use a multimeter
  • How digital and analog signals work
  • How to prototype circuits on a breadboard

This tutorial is hands-on. You'll need a multimeter and a few basic components to follow along.

Part 1: Understanding Voltage, Current, and Resistance

The Water Analogy

Electricity is invisible, so we use analogies to understand it. The water pipe analogy is the most common:

  • Voltage (V) - Water pressure in the pipes
    • Higher voltage = more "push" on electrons
    • Measured in volts (V)
    • Example: A 9V battery pushes harder than a 3V battery
  • Current (I) - Flow rate of water through the pipe
    • Higher current = more electrons flowing per second
    • Measured in amperes or amps (A)
    • Example: An LED draws 20mA (0.02A), a motor draws 200mA (0.2A)
  • Resistance (R) - Size of the pipe (restriction to flow)
    • Higher resistance = harder for current to flow
    • Measured in ohms (Ω)
    • Example: A resistor limits current flow

Ohm's Law: The Fundamental Equation

The relationship between voltage, current, and resistance is:

V=I×R

Examples:

  • If voltage = 9V and resistance = 450Ω, then current = 9V / 450Ω = 0.02A = 20mA
  • If current = 0.5A and resistance = 10Ω, then voltage = 0.5A × 10Ω = 5V

Why this matters for robotics:

  • LEDs need current-limiting resistors (too much current burns them out)
  • Motors draw variable current depending on load
  • You need to calculate wire thickness based on current

Power: Energy Consumption

Power is how much energy is consumed per second:

P=V×I

Examples:

  • If voltage = 5V and current = 0.1A, then power = 5V × 0.1A = 0.5W
  • A 9V battery powering a 200mA motor consumes 9V × 0.2A = 1.8W

Why this matters for robotics:

  • Battery life depends on power consumption
  • Components have maximum power ratings (exceed them and they overheat)
  • More power = shorter battery life or bigger batteries needed

Part 2: Using a Multimeter

A multimeter is your most important electronics tool. It measures voltage, current, resistance, and continuity.

Multimeter Basics

Most multimeters have these modes:

  • V⎓ or DCV - DC voltage (what robots use)
  • V~ or ACV - AC voltage (wall power - not used in robotics)
  • A⎓ or DCA - DC current
  • Ω - Resistance
  • Diode symbol or Continuity - Beeps when circuit is complete

Measuring Voltage

Voltage is measured in parallel (multimeter probes touch two points in the circuit):

  1. Set multimeter to DC voltage mode (20V range for 9V battery)
  2. Touch red probe to positive (+) terminal
  3. Touch black probe to negative (-) terminal
  4. Read the voltage on display

Exercise: Measure a 9V battery. It should read 9V (or slightly higher if fresh, slightly lower if used).

Common mistake: Probes reversed? You'll see a negative voltage (-9V). No damage, just flip the probes.

Measuring Resistance

Resistance is measured with power OFF (multimeter sends its own small current):

  1. Set multimeter to resistance mode (2kΩ range for 220Ω resistor)
  2. Touch probes to both ends of resistor (polarity doesn't matter)
  3. Read the resistance on display

Exercise: Measure a 220Ω resistor. You should read approximately 220Ω (resistors have tolerance, typically ±5%).

Measuring Continuity

Continuity mode checks if there's a complete circuit (useful for finding broken wires):

  1. Set multimeter to continuity mode (diode symbol or speaker icon)
  2. Touch probes to two points in the circuit
  3. If it beeps, there's a complete circuit (low resistance path)
  4. If silent, the circuit is open (broken wire or no connection)

Exercise: Touch the probes together - it should beep. Separate them - it should be silent.

Measuring Current

Current is measured in series (multimeter becomes part of the circuit). Warning: Most multimeters have a fuse that blows if you exceed the current limit!

  1. Set multimeter to DC current mode (200mA range for LED)
  2. Break the circuit and insert multimeter in series
  3. Current flows through the multimeter
  4. Read the current on display

For beginners: Skip current measurement until you're comfortable with voltage and resistance. It's easy to blow the fuse.

Part 3: Reading Resistor Color Codes

Resistors use colored bands to indicate resistance value:

Band 1 Band 2 Band 3 (Multiplier) Band 4 (Tolerance)
First digit Second digit Number of zeros Accuracy
Red = 2 Red = 2 Red = ×100 Gold = ±5%
Result: 22 × 100 = 2200Ω = 2.2kΩ, ±5%

Color code:

  • Black = 0, Brown = 1, Red = 2, Orange = 3, Yellow = 4
  • Green = 5, Blue = 6, Violet = 7, Gray = 8, White = 9

Common resistor values in robotics:

  • 220Ω (red-red-brown) - LED current limiting
  • 1kΩ (brown-black-red) - Pull-up/pull-down resistors
  • 10kΩ (brown-black-orange) - General-purpose pull-up/pull-down

Tip: Use your multimeter to verify resistor values if you can't read the bands!

Part 4: Breadboards and Prototyping

A breadboard lets you build circuits without soldering. It has internal connections:

  • Horizontal rows (in the middle) - 5 holes connected together
  • Vertical rails (on the sides) - Entire column connected (for power and ground)

Breadboard Anatomy

    + Rail (Red)     [Connected vertically]
    - Rail (Blue)    [Connected vertically]
    ====================================
    Row 1: a b c d e   f g h i j  [a-b-c-d-e connected, f-g-h-i-j connected]
    Row 2: a b c d e   f g h i j
    ...

Building Your First Circuit: LED + Resistor

Goal: Light an LED using a 9V battery and resistor.

Why the resistor? LEDs need about 20mA of current. Without a resistor, they draw too much current and burn out. The resistor "limits" the current to a safe level.

Calculating resistor value:

  • LED needs 20mA (0.02A) at 2V forward voltage
  • Battery provides 9V
  • Voltage across resistor = 9V - 2V = 7V
  • Ohm's Law: R = V / I = 7V / 0.02A = 350Ω
  • Use 220Ω or 470Ω resistor (standard values close to 350Ω)

Wiring:

  1. Insert 9V battery clip into breadboard (+red to + rail, -black to - rail)
  2. Insert resistor from + rail to row 1
  3. Insert LED long leg (anode, +) into row 1, short leg (cathode, -) to - rail
  4. LED should light up!

Troubleshooting:

  • LED not lighting? Check polarity (long leg = +, short leg = -)
  • LED very dim? Battery might be dead
  • LED too bright/hot? Resistor value too small

Part 5: Digital Signals (HIGH and LOW)

Robots use digital signals - voltage is either HIGH or LOW:

  • HIGH (logic 1) - Voltage is at the supply level (3.3V or 5V)
  • LOW (logic 0) - Voltage is at ground (0V)

Example: A microcontroller GPIO pin can be set HIGH (3.3V) or LOW (0V) to turn an LED on or off.

Pull-up and Pull-down Resistors

Digital inputs need to be either HIGH or LOW - never floating (undefined). Pull-up/pull-down resistors set the default state:

  • Pull-up resistor - Connects input to HIGH voltage (default HIGH, button press = LOW)
  • Pull-down resistor - Connects input to LOW voltage (default LOW, button press = HIGH)

Why this matters for robots:

  • Infrared Line Detector sensors use pull-up resistors (output LOW when line detected)
  • Button inputs need pull-up or pull-down resistors to avoid erratic behavior

Typical value: 10kΩ (not too strong to waste power, not too weak to be unreliable)

Active HIGH vs Active LOW

Components can be triggered by HIGH or LOW signals:

  • Active HIGH - HIGH signal activates the component (LED turns on when pin is HIGH)
  • Active LOW - LOW signal activates the component (LED turns on when pin is LOW)

Example: SimpleBot's Infrared Line Detector sensors are active LOW:

  • Output HIGH (3.3V) when no line detected (white surface)
  • Output LOW (0V) when line detected (black tape)

This is important when writing software - you need to know which logic level means "detected"!

Part 6: Analog Signals (Variable Voltage)

Not all signals are digital (HIGH/LOW). Analog signals have variable voltage:

  • Temperature sensor - Voltage increases with temperature
  • Potentiometer (dial) - Voltage varies from 0V to supply voltage
  • Photoresistor - Resistance changes with light level

Analog-to-Digital Conversion (ADC)

Microcontrollers use ADC to convert analog voltage to a number:

  • 10-bit ADC (Raspberry Pi Pico) - 1024 possible values (0-1023)
  • 12-bit ADC (ESP32) - 4096 possible values (0-4095)

Example: If ADC reads 512 on a 10-bit ADC with 3.3V reference:

  • 512 / 1024 = 0.5 (50% of maximum)
  • Voltage = 0.5 × 3.3V = 1.65V

Why this matters for robots:

  • Capability:Optical Odometry uses photoresistors (analog signal indicates wheel position)
  • Battery voltage monitoring uses ADC to measure remaining charge

Part 7: PWM (Pulse Width Modulation)

PWM is a way to simulate analog voltage using rapid digital pulses:

  • HIGH for 50% of the time, LOW for 50% = equivalent to half voltage
  • HIGH for 75% of the time, LOW for 25% = equivalent to 75% voltage

Duty cycle = percentage of time signal is HIGH

Why this matters for robots:

  • Motor speed control - 50% duty cycle = half speed, 100% = full speed
  • LED brightness - 25% duty cycle = dim, 100% = full brightness

Frequency: PWM typically runs at 1kHz - 20kHz (too fast to see flickering)

Part 8: Reading Schematics

Schematics are circuit diagrams using standard symbols:

Component Symbol Description
Resistor Zigzag line (US) or rectangle (European)
LED Triangle with arrows pointing out
Battery Long line (+) and short line (-)
Ground Three horizontal lines or triangle pointing down
Switch Gap with movable connector
Motor Circle with M inside
IC (chip) Rectangle with pin numbers

Example schematic: LED circuit

+9V ----[220Ω]----[LED]---- GND

Legend: [220Ω] = resistor, [LED] = LED, GND = ground

Reading tips:

  • Trace the path from + to - (current flows from positive to negative)
  • Components in series (one after another) share the same current
  • Components in parallel (side-by-side) share the same voltage
  • Ground symbol (⏚) means 0V reference point

Part 9: Practical Skills Checklist

By now, you should be able to:

  • ☐ Explain voltage, current, resistance, and power
  • ☐ Use Ohm's Law to calculate voltage, current, or resistance
  • ☐ Measure voltage with a multimeter
  • ☐ Measure resistance with a multimeter
  • ☐ Check continuity with a multimeter
  • ☐ Read resistor color codes (or use multimeter to verify)
  • ☐ Build a simple LED circuit on a breadboard
  • ☐ Understand digital signals (HIGH/LOW)
  • ☐ Explain what pull-up/pull-down resistors do
  • ☐ Understand what PWM is and why it's used
  • ☐ Read simple schematics

If you can check most of these boxes, you're ready to build SimpleBot!

Next Steps

Build SimpleBot

You now have the foundational knowledge to understand SimpleBot's electronics:

Learn More Electronics

Hands-on Practice

  • Buy an electronics kit ($20-40) with assorted components
  • Build classic circuits: blinking LED, button-controlled LED, photoresistor nightlight
  • Use a breadboard to prototype before soldering

Common Beginner Mistakes

  • Using voltage mode to measure current - This shorts the circuit and can blow the multimeter fuse or damage components
  • Measuring resistance with power ON - Gives incorrect readings and can damage the multimeter
  • Forgetting current-limiting resistors for LEDs - LEDs burn out instantly
  • Reversing polarity - Some components (LEDs, electrolytic capacitors, ICs) are polarity-sensitive and can be damaged
  • Confusing mA and A - 200mA = 0.2A, not 200A! (Off by 1000×)
  • Breadboard wiring errors - Double-check that components are in the same row to be connected

Troubleshooting Tips

  • Circuit not working? Check continuity with multimeter (is everything connected?)
  • Component hot? It's drawing too much current - check for short circuits or wrong resistor values
  • Inconsistent behavior? Check for floating inputs (add pull-up/pull-down resistors)
  • Multimeter shows 0V everywhere? Battery is dead or not connected
  • Can't read resistor colors? Use multimeter to measure resistance directly

Tools and Resources

Recommended First Purchases

  • Multimeter - $15-30 (any basic model works, look for DC voltage, resistance, continuity)
  • Breadboard - $5-10 (get a full-size 830-point breadboard)
  • Jumper wire kit - $5-10 (includes various lengths)
  • Electronics component kit - $20-40 (resistors, LEDs, capacitors, transistors)

External Resources

See Also