<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bespokerobotsociety.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=John</id>
	<title>Bespoke Robot Society - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bespokerobotsociety.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=John"/>
	<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/wiki/Special:Contributions/John"/>
	<updated>2026-04-25T08:40:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=User_talk:John&amp;diff=95</id>
		<title>User talk:John</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=User_talk:John&amp;diff=95"/>
		<updated>2025-10-12T23:35:22Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;== Hi ==  I&amp;#039;m John McCardle, founder and BDFL of Bespoke Robot Society&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Hi ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m John McCardle, founder and BDFL of Bespoke Robot Society&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Category:Raspberry_Pi&amp;diff=94</id>
		<title>Category:Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Category:Raspberry_Pi&amp;diff=94"/>
		<updated>2025-10-12T22:53:20Z</updated>

		<summary type="html">&lt;p&gt;John: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Category:MCU&amp;diff=93</id>
		<title>Category:MCU</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Category:MCU&amp;diff=93"/>
		<updated>2025-10-12T22:46:40Z</updated>

		<summary type="html">&lt;p&gt;John: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=BRS_Differential_Drive_Robot_Control_Board&amp;diff=92</id>
		<title>BRS Differential Drive Robot Control Board</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=BRS_Differential_Drive_Robot_Control_Board&amp;diff=92"/>
		<updated>2025-10-11T20:32:49Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PCB&lt;br /&gt;
| name = BRS Differential Drive Robot Control Board&lt;br /&gt;
| image = BRS_DDRCB.png&lt;br /&gt;
| purpose = Integrated motor control and sensor interface for differential drive robots&lt;br /&gt;
| type = Through-Hole (THT) / Surface-Mount (SMT variant planned)&lt;br /&gt;
| microcontroller = [[Raspberry Pi Pico]] or compatible 40-pin boards&lt;br /&gt;
| components = {{TB6612FNG}}, {{MP1584}}, {{LM393}}, nRF24L01 header, MPU6050 header, sensor expansion&lt;br /&gt;
| layers = 2-layer PCB&lt;br /&gt;
| cost = $5-10 for 5 PCBs (JLCPCB) + ~$10-15 components&lt;br /&gt;
| gerbers = [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/diffdrive_robot_microcontroller_board--tht_Gerber.zip GitHub Repository]&lt;br /&gt;
| repository = [https://github.com/Bespoke-Robot-Society/simplebot GitHub - SimpleBot]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;BRS Differential Drive Robot Control Board&#039;&#039;&#039; is a custom PCB designed for [[SimpleBot]] and other small differential drive robots. It integrates all electronics needed for motor control, power regulation, optical odometry, and sensor expansion onto a single compact board.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
This PCB was designed with BRS&#039;s core mission in mind: &#039;&#039;&#039;lower the barrier to entry&#039;&#039;&#039; for robotics. The through-hole version uses only THT (through-hole technology) components, making it ideal for:&lt;br /&gt;
&lt;br /&gt;
* Educational environments (schools, workshops)&lt;br /&gt;
* Beginners learning to solder&lt;br /&gt;
* Rapid prototyping without specialized equipment&lt;br /&gt;
* Easy component replacement and repair&lt;br /&gt;
&lt;br /&gt;
A surface-mount variant is planned for more compact builds and higher-volume production.&lt;br /&gt;
&lt;br /&gt;
== Key Features ==&lt;br /&gt;
&lt;br /&gt;
=== Integrated Components ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Raspberry Pi Pico]] Socket&#039;&#039;&#039; - 40-pin header for any Pico-compatible board&lt;br /&gt;
* &#039;&#039;&#039;Motor Driver&#039;&#039;&#039; - [[TB6612FNG]] module socket or external H-bridge header&lt;br /&gt;
* &#039;&#039;&#039;Power Regulation&#039;&#039;&#039; - [[MP1584]] buck converter (6V → 3.3V)&lt;br /&gt;
* &#039;&#039;&#039;Optical Encoders&#039;&#039;&#039; - [[LM393]]-based comparator circuit for wheel encoders&lt;br /&gt;
* &#039;&#039;&#039;Expansion Headers&#039;&#039;&#039;:&lt;br /&gt;
** nRF24L01 2.4 GHz radio (SPI)&lt;br /&gt;
** MPU6050 IMU (I²C)&lt;br /&gt;
** 4× sensor headers (3.3V + GND + GPIO)&lt;br /&gt;
** Analog expansion (3× ADC pins)&lt;br /&gt;
** Digital expansion (GPIOs)&lt;br /&gt;
&lt;br /&gt;
=== Design Philosophy ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Through-Hole First&#039;&#039;&#039; - Easy to solder for beginners&lt;br /&gt;
* &#039;&#039;&#039;Modular&#039;&#039;&#039; - Use standard breakout modules where possible&lt;br /&gt;
* &#039;&#039;&#039;Expandable&#039;&#039;&#039; - Room for additional sensors and features&lt;br /&gt;
* &#039;&#039;&#039;Repairable&#039;&#039;&#039; - Socketed components can be replaced&lt;br /&gt;
* &#039;&#039;&#039;Open Source&#039;&#039;&#039; - Full schematics and KiCad files available&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&lt;br /&gt;
The PCB is organized into functional sections:&lt;br /&gt;
&lt;br /&gt;
=== Power Section ===&lt;br /&gt;
&lt;br /&gt;
[[File:PCB_power.png|thumb|300px|Power regulation section]]&lt;br /&gt;
&lt;br /&gt;
The power section converts 6V from 4× AA batteries to regulated 3.3V:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Input&#039;&#039;&#039;: 4.5V – 6.5V from battery pack (via power switch)&lt;br /&gt;
* &#039;&#039;&#039;Buck Converter&#039;&#039;&#039;: [[MP1584]] module provides 3.3V at up to 3A&lt;br /&gt;
* &#039;&#039;&#039;Important&#039;&#039;&#039;: Buck converter must be pre-tuned to 3.3V BEFORE soldering to PCB&lt;br /&gt;
&lt;br /&gt;
The power switch should be wired to disconnect batteries when USB is connected, preventing back-feeding.&lt;br /&gt;
&lt;br /&gt;
=== Microcontroller Section ===&lt;br /&gt;
&lt;br /&gt;
40-pin socket for [[Raspberry Pi Pico]] or compatible boards:&lt;br /&gt;
* Raspberry Pi Pico (official or clone)&lt;br /&gt;
* Raspberry Pi Pico W (adds Wi-Fi)&lt;br /&gt;
* Raspberry Pi Pico 2 / 2W (RP2350-based)&lt;br /&gt;
&lt;br /&gt;
The socket allows easy replacement if the Pico is damaged, and permits swapping between different Pico variants.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Section ===&lt;br /&gt;
&lt;br /&gt;
[[File:PCB_motor.png|thumb|300px|Motor driver section]]&lt;br /&gt;
&lt;br /&gt;
Two options for motor control:&lt;br /&gt;
&lt;br /&gt;
==== Option 1: TB6612FNG Module (Standard) ====&lt;br /&gt;
&lt;br /&gt;
* Solder [[TB6612FNG]] breakout module directly to PCB&lt;br /&gt;
* Controls two TT motors independently&lt;br /&gt;
* PWM speed control via Pico GPIOs&lt;br /&gt;
* Direction control via logic pins&lt;br /&gt;
&lt;br /&gt;
==== Option 2: External H-Bridge (Advanced) ====&lt;br /&gt;
&lt;br /&gt;
* Install 2×5 DuPont header underneath TB6612FNG footprint&lt;br /&gt;
* Provides PWM, direction, and logic signals to external H-bridge&lt;br /&gt;
* Allows use of higher-power motor drivers&lt;br /&gt;
* &#039;&#039;&#039;Same Python code works&#039;&#039;&#039; - control signals are identical&lt;br /&gt;
&lt;br /&gt;
This flexibility allows SimpleBot to be upgraded to more powerful motors without redesigning electronics or software.&lt;br /&gt;
&lt;br /&gt;
=== Optical Encoder Section ===&lt;br /&gt;
&lt;br /&gt;
[[File:PCB_Optoencoder.png|thumb|300px|Optical encoder circuit]]&lt;br /&gt;
&lt;br /&gt;
The odometry section uses [[LM393]] dual comparator to convert analog encoder signals to digital pulses:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Per Channel&#039;&#039;&#039;:&lt;br /&gt;
** 1× IR LED (emitter)&lt;br /&gt;
** 1× Photoresistor (detector)&lt;br /&gt;
** Voltage divider resistors&lt;br /&gt;
** Comparator output to Pico GPIO&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Function&#039;&#039;&#039;:&lt;br /&gt;
# LED shines through slotted encoder wheel&lt;br /&gt;
# Photoresistor detects light/dark transitions&lt;br /&gt;
# LM393 converts analog voltage to clean digital pulses&lt;br /&gt;
# Pico counts pulses using interrupts&lt;br /&gt;
# Software calculates distance traveled&lt;br /&gt;
&lt;br /&gt;
This provides &#039;&#039;&#039;optical odometry&#039;&#039;&#039; for dead reckoning and position tracking.&lt;br /&gt;
&lt;br /&gt;
=== Expansion Headers ===&lt;br /&gt;
&lt;br /&gt;
==== nRF24L01 Radio (SPI) ====&lt;br /&gt;
&lt;br /&gt;
* 2.4 GHz wireless communication&lt;br /&gt;
* SPI interface (SCK, MOSI, MISO, CS)&lt;br /&gt;
* Range: 10-100m depending on antenna and environment&lt;br /&gt;
* Use cases: Remote control, swarm robotics, telemetry&lt;br /&gt;
&lt;br /&gt;
==== MPU6050 IMU (I²C) ====&lt;br /&gt;
&lt;br /&gt;
* 3-axis accelerometer + 3-axis gyroscope&lt;br /&gt;
* I²C interface (SDA, SCL)&lt;br /&gt;
* Heading estimation, tilt detection, dynamic balancing&lt;br /&gt;
&lt;br /&gt;
==== Sensor Headers (4×) ====&lt;br /&gt;
&lt;br /&gt;
Each header provides:&lt;br /&gt;
* 3.3V power&lt;br /&gt;
* Ground&lt;br /&gt;
* GPIO pin from Pico&lt;br /&gt;
&lt;br /&gt;
Use for:&lt;br /&gt;
* Additional line sensors&lt;br /&gt;
* Ultrasonic distance sensors&lt;br /&gt;
* Bump switches&lt;br /&gt;
* Custom sensors&lt;br /&gt;
&lt;br /&gt;
==== Analog/Digital Expansion ====&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Analog Header&#039;&#039;&#039;: 3× ADC pins for custom analog sensors&lt;br /&gt;
* &#039;&#039;&#039;Digital Header&#039;&#039;&#039;: Multiple GPIO pins for digital I/O&lt;br /&gt;
&lt;br /&gt;
== PCB Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Top View ===&lt;br /&gt;
[[File:PCB_front.png|thumb|300px|PCB top side (component placement)]]&lt;br /&gt;
&lt;br /&gt;
The top side contains:&lt;br /&gt;
* All component footprints&lt;br /&gt;
* Module sockets (Pico, TB6612FNG, MP1584)&lt;br /&gt;
* Expansion headers&lt;br /&gt;
* Power and motor terminals&lt;br /&gt;
&lt;br /&gt;
=== Bottom View ===&lt;br /&gt;
[[File:PCB_back.png|thumb|300px|PCB bottom side (traces and ground plane)]]&lt;br /&gt;
&lt;br /&gt;
The bottom side contains:&lt;br /&gt;
* Signal traces&lt;br /&gt;
* Ground plane (for noise reduction and current return)&lt;br /&gt;
* Minimal components (optional pull-up resistors)&lt;br /&gt;
&lt;br /&gt;
=== All Layers ===&lt;br /&gt;
[[File:PCB_all_layers.png|thumb|300px|Complete PCB stack-up]]&lt;br /&gt;
&lt;br /&gt;
The 2-layer design uses:&lt;br /&gt;
* &#039;&#039;&#039;Top Layer&#039;&#039;&#039;: Signal routing and power traces&lt;br /&gt;
* &#039;&#039;&#039;Bottom Layer&#039;&#039;&#039;: Ground plane + additional signal routing&lt;br /&gt;
&lt;br /&gt;
== Bill of Materials ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Description !! Qty !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; style=&amp;quot;background-color: #e0e0e0; font-weight: bold;&amp;quot; | &#039;&#039;&#039;Modules&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Raspberry Pi Pico]] || Microcontroller board || 1 || Or Pico W for Wi-Fi&lt;br /&gt;
|-&lt;br /&gt;
| [[TB6612FNG]] Module || Dual H-bridge motor driver || 1 || Or external H-bridge&lt;br /&gt;
|-&lt;br /&gt;
| [[MP1584]] Module || Buck converter || 1 || Pre-tune to 3.3V!&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; style=&amp;quot;background-color: #e0e0e0; font-weight: bold;&amp;quot; | &#039;&#039;&#039;ICs&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[LM393]] || Dual comparator IC || 1 || DIP-8 package&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; style=&amp;quot;background-color: #e0e0e0; font-weight: bold;&amp;quot; | &#039;&#039;&#039;Passive Components&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| Resistors || Various values for encoders and pull-ups || ~10 || See schematic&lt;br /&gt;
|-&lt;br /&gt;
| IR LEDs || Encoder emitters (940nm) || 2 || Through-hole&lt;br /&gt;
|-&lt;br /&gt;
| Photoresistors || Encoder detectors || 2 || Through-hole&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; style=&amp;quot;background-color: #e0e0e0; font-weight: bold;&amp;quot; | &#039;&#039;&#039;Connectors&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 40-pin header || Pico socket || 2 || Female, 2×20&lt;br /&gt;
|-&lt;br /&gt;
| Motor terminals || Screw terminals or header || 2 || 2-pin each&lt;br /&gt;
|-&lt;br /&gt;
| Power terminals || Battery input || 1 || 2-pin screw terminal&lt;br /&gt;
|-&lt;br /&gt;
| Sensor headers || Expansion connections || 4 || 3-pin male header&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; style=&amp;quot;background-color: #e0e0e0; font-weight: bold;&amp;quot; | &#039;&#039;&#039;Optional&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| nRF24L01 header || Radio module socket || 1 || 2×4 female header&lt;br /&gt;
|-&lt;br /&gt;
| MPU6050 header || IMU socket || 1 || 2×4 female header&lt;br /&gt;
|-&lt;br /&gt;
| DuPont header || External H-bridge || 1 || 2×5 male header&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Full BOM with part numbers and suppliers available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository].&lt;br /&gt;
&lt;br /&gt;
== Assembly Guide ==&lt;br /&gt;
&lt;br /&gt;
=== Assembly Order ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Pre-tune buck converter&#039;&#039;&#039; to 3.3V (CRITICAL!)&lt;br /&gt;
# Install low-profile components (resistors, ICs)&lt;br /&gt;
# Install sockets and headers&lt;br /&gt;
# Install modules (buck converter, TB6612FNG)&lt;br /&gt;
# Test voltage output before connecting Pico&lt;br /&gt;
# Insert Pico into socket&lt;br /&gt;
# Connect motors and sensors&lt;br /&gt;
# Upload code and test!&lt;br /&gt;
&lt;br /&gt;
Full step-by-step assembly instructions: [[SimpleBot PCB Guide]] or [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/PCB_GUIDE.md GitHub version]&lt;br /&gt;
&lt;br /&gt;
=== Critical Steps ===&lt;br /&gt;
&lt;br /&gt;
==== 1. Buck Converter Adjustment ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO THIS FIRST&#039;&#039;&#039;:&lt;br /&gt;
# Connect multimeter to buck converter output&lt;br /&gt;
# Apply power to buck converter input&lt;br /&gt;
# Adjust potentiometer to exactly 3.3V&lt;br /&gt;
# Verify voltage is stable&lt;br /&gt;
# ONLY THEN solder to PCB&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Failure to do this can damage your Pico!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== 2. Test Before Connecting Pico ====&lt;br /&gt;
&lt;br /&gt;
After soldering the buck converter:&lt;br /&gt;
# Apply battery power (do NOT connect Pico yet)&lt;br /&gt;
# Verify 3.3V on all power rails&lt;br /&gt;
# Check for shorts with multimeter&lt;br /&gt;
# Only after confirming correct voltage, insert Pico&lt;br /&gt;
&lt;br /&gt;
== Manufacturing Files ==&lt;br /&gt;
&lt;br /&gt;
=== Gerber Files ===&lt;br /&gt;
&lt;br /&gt;
Ready-to-manufacture Gerber files available:&lt;br /&gt;
* &#039;&#039;&#039;[https://github.com/Bespoke-Robot-Society/simplebot/blob/master/diffdrive_robot_microcontroller_board--tht_Gerber.zip Through-Hole Version]&#039;&#039;&#039; - Beginner-friendly THT components&lt;br /&gt;
* SMT version (coming soon) - Compact surface-mount design&lt;br /&gt;
&lt;br /&gt;
=== PCB Specifications ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Dimensions&#039;&#039;&#039;: ~90mm × 70mm (approximate)&lt;br /&gt;
* &#039;&#039;&#039;Layers&#039;&#039;&#039;: 2-layer PCB&lt;br /&gt;
* &#039;&#039;&#039;Thickness&#039;&#039;&#039;: 1.6mm (standard)&lt;br /&gt;
* &#039;&#039;&#039;Material&#039;&#039;&#039;: FR-4&lt;br /&gt;
* &#039;&#039;&#039;Surface Finish&#039;&#039;&#039;: HASL or ENIG&lt;br /&gt;
* &#039;&#039;&#039;Min Trace/Space&#039;&#039;&#039;: 0.3mm / 0.3mm&lt;br /&gt;
* &#039;&#039;&#039;Min Drill&#039;&#039;&#039;: 0.8mm&lt;br /&gt;
&lt;br /&gt;
=== Ordering ===&lt;br /&gt;
&lt;br /&gt;
Upload the Gerber ZIP file to any PCB manufacturer:&lt;br /&gt;
* &#039;&#039;&#039;JLCPCB&#039;&#039;&#039; - ~$2 for 5 PCBs + shipping&lt;br /&gt;
* &#039;&#039;&#039;PCBWay&#039;&#039;&#039; - ~$5 for 5 PCBs + shipping&lt;br /&gt;
* &#039;&#039;&#039;OSH Park&#039;&#039;&#039; - ~$20 for 3 PCBs (US-based, high quality)&lt;br /&gt;
* &#039;&#039;&#039;Seeed Studio&#039;&#039;&#039; - ~$5 for 5 PCBs + shipping&lt;br /&gt;
&lt;br /&gt;
Manufacturing typically takes 2-5 days + shipping time.&lt;br /&gt;
&lt;br /&gt;
== Design Files ==&lt;br /&gt;
&lt;br /&gt;
The PCB was designed in &#039;&#039;&#039;KiCad&#039;&#039;&#039; (open-source EDA software):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Schematic&#039;&#039;&#039;: Full circuit diagram in KiCad format&lt;br /&gt;
* &#039;&#039;&#039;PCB Layout&#039;&#039;&#039;: Complete board design with traces and copper pours&lt;br /&gt;
* &#039;&#039;&#039;Gerber Files&#039;&#039;&#039;: Manufacturing-ready outputs&lt;br /&gt;
* &#039;&#039;&#039;Bill of Materials&#039;&#039;&#039;: Component list with part numbers&lt;br /&gt;
&lt;br /&gt;
All files available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository] under open-source license.&lt;br /&gt;
&lt;br /&gt;
== Usage in Projects ==&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot ===&lt;br /&gt;
&lt;br /&gt;
This PCB was designed specifically for [[SimpleBot]], but the design is generic enough for any differential drive robot with:&lt;br /&gt;
* Two DC motors&lt;br /&gt;
* Wheel encoders&lt;br /&gt;
* Line sensors or similar digital/analog sensors&lt;br /&gt;
* Battery power (4.5V – 6.5V input)&lt;br /&gt;
&lt;br /&gt;
=== Other Robots ===&lt;br /&gt;
&lt;br /&gt;
The modular design makes this PCB suitable for:&lt;br /&gt;
* Line-following robots&lt;br /&gt;
* Maze-solving robots&lt;br /&gt;
* Dead-reckoning navigation platforms&lt;br /&gt;
* Educational robotics projects&lt;br /&gt;
* Small autonomous vehicles&lt;br /&gt;
&lt;br /&gt;
== Variations ==&lt;br /&gt;
&lt;br /&gt;
=== External H-Bridge Variant ===&lt;br /&gt;
&lt;br /&gt;
Install the 2×5 DuPont header instead of TB6612FNG module to use external motor drivers:&lt;br /&gt;
* &#039;&#039;&#039;L298N&#039;&#039;&#039; - Lower efficiency but higher current&lt;br /&gt;
* &#039;&#039;&#039;BTS7960&#039;&#039;&#039; - Much higher current (43A!) for large motors&lt;br /&gt;
* &#039;&#039;&#039;Cytron MD30C&#039;&#039;&#039; - High power with heat sink&lt;br /&gt;
&lt;br /&gt;
Same Pico code works with all drivers - only change is physical wiring.&lt;br /&gt;
&lt;br /&gt;
=== Custom Sensor Configurations ===&lt;br /&gt;
&lt;br /&gt;
Use the sensor headers for:&lt;br /&gt;
* Additional line sensors (6-8 sensor arrays)&lt;br /&gt;
* Ultrasonic sensors (HC-SR04)&lt;br /&gt;
* IR distance sensors (Sharp GP2Y0A)&lt;br /&gt;
* Bump switches&lt;br /&gt;
* Servo motor control&lt;br /&gt;
&lt;br /&gt;
=== Future Variants ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SMT Version&#039;&#039;&#039; - All surface-mount components for compact design&lt;br /&gt;
* &#039;&#039;&#039;High-Power Version&#039;&#039;&#039; - Integrated high-current motor driver&lt;br /&gt;
* &#039;&#039;&#039;All-in-One Version&#039;&#039;&#039; - Integrated sensors (no external modules)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[SimpleBot]] - Robot using this PCB&lt;br /&gt;
* [[Raspberry Pi Pico]] - Microcontroller platform&lt;br /&gt;
* [[TB6612FNG]] - Motor driver&lt;br /&gt;
* [[MP1584]] - Buck converter&lt;br /&gt;
* [[LM393]] - Comparator IC&lt;br /&gt;
* [[PCB Design]] - General PCB design guide&lt;br /&gt;
* [[KiCad]] - PCB design software tutorial&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository] - Design files, Gerbers, BOM&lt;br /&gt;
* [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/PCB_GUIDE.md PCB Assembly Guide] - Detailed assembly instructions&lt;br /&gt;
* [[Soldering Guide]] - Learn through-hole soldering techniques&lt;br /&gt;
&lt;br /&gt;
[[Category:PCB]]&lt;br /&gt;
[[Category:Motor Control]]&lt;br /&gt;
[[Category:Robot Electronics]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=File:BRS_DDRCB.png&amp;diff=91</id>
		<title>File:BRS DDRCB.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=File:BRS_DDRCB.png&amp;diff=91"/>
		<updated>2025-10-11T20:32:35Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=SimpleBot&amp;diff=90</id>
		<title>SimpleBot</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=SimpleBot&amp;diff=90"/>
		<updated>2025-10-11T20:29:15Z</updated>

		<summary type="html">&lt;p&gt;John: /* Design Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Robot&lt;br /&gt;
| name = SimpleBot&lt;br /&gt;
| image = simplebot.jpeg&lt;br /&gt;
| caption = SimpleBot - BRS&#039;s first robot design&lt;br /&gt;
| use_case = Educational robot for learning line following, optical odometry, and basic robotics&lt;br /&gt;
| microcontroller = [[Raspberry Pi Pico]] or [[Raspberry Pi Pico W]]&lt;br /&gt;
| sensors = 2× [[Infrared Line Detector]], 2× Optical Encoders (custom), optional [[MPU6050]] IMU, optional nRF24L01 radio&lt;br /&gt;
| power = 4× AA batteries (6V nominal) via [[MP1584]] buck converter (3.3V output)&lt;br /&gt;
| pcb = [[BRS Differential Drive Robot Control Board]] (through-hole assembly)&lt;br /&gt;
| cost = &#039;&#039;&#039;Under $20&#039;&#039;&#039; (with batteries)&lt;br /&gt;
| repository = [https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot&#039;&#039;&#039; is the Bespoke Robot Society&#039;s original robot design, created for students, educators, and cost-conscious makers. It&#039;s a fully functional {{Wikipedia|Differential_wheeled_robot|differential drive robot}} that demonstrates core robotics concepts including motor control, sensor integration, and autonomous navigation.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot was designed with BRS&#039;s core mission in mind:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enable Real-World Use Cases&#039;&#039;&#039; - SimpleBot is a demonstrator for dead reckoning and line maze problems, required study for all entry-level roboticists.&lt;br /&gt;
* &#039;&#039;&#039;Design and build custom robots&#039;&#039;&#039; - 3D-printed chassis with modular sensor mounts&lt;br /&gt;
* &#039;&#039;&#039;Lower the barrier to entry&#039;&#039;&#039; - Under $20 total cost with Optical odometry and line following sensors included.&lt;br /&gt;
* &#039;&#039;&#039;Teach robotics fundamentals&#039;&#039;&#039; - Every component serves an educational purpose&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot is based on commonly available &amp;quot;Arduino Smart Car&amp;quot; components (motors, wheels, battery holder) combined with a custom 3D-printed chassis and optional custom PCB. The robot can be built three ways:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Breadboard Version&#039;&#039;&#039; - Wire everything on a breadboard (fastest to prototype)&lt;br /&gt;
# &#039;&#039;&#039;Protoboard Version&#039;&#039;&#039; - Solder components to perfboard (more permanent)&lt;br /&gt;
# &#039;&#039;&#039;Custom PCB Version&#039;&#039;&#039; - Use the [[BRS Differential Drive Robot Control Board]] (most compact)&lt;br /&gt;
&lt;br /&gt;
All three versions run the same code and have identical functionality.&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
&lt;br /&gt;
=== Line Following ===&lt;br /&gt;
Two [[Infrared Line Detector|infrared line detectors]] mounted under the chassis track a black line on a white surface (or vice versa). The robot adjusts its motor speeds to stay centered on the line.&lt;br /&gt;
&lt;br /&gt;
=== Optical Odometry ===&lt;br /&gt;
Custom encoder circuits use LEDs and photoresistors to count pulses from slotted wheels attached to the motors. This allows the robot to measure distance traveled and perform [[dead reckoning]].&lt;br /&gt;
&lt;br /&gt;
=== Motor Control ===&lt;br /&gt;
The [[TB6612FNG]] dual H-bridge provides independent speed and direction control for both wheels via PWM signals from the Pico.&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ready ===&lt;br /&gt;
The PCB includes headers for:&lt;br /&gt;
* &#039;&#039;&#039;MPU6050&#039;&#039;&#039; 6-axis IMU (accelerometer + gyroscope) via I²C&lt;br /&gt;
* &#039;&#039;&#039;nRF24L01&#039;&#039;&#039; 2.4 GHz radio module via SPI&lt;br /&gt;
* &#039;&#039;&#039;4× sensor headers&#039;&#039;&#039; for additional sensors (3.3V + GND + GPIO)&lt;br /&gt;
* &#039;&#039;&#039;Analog/digital breakout headers&#039;&#039;&#039; for custom additions&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
=== Base Components ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Description !! Qty !! Est. Cost&lt;br /&gt;
|-&lt;br /&gt;
| Arduino Smart Car Kit || 2× TT motors with wheels, encoder discs, battery holder, power switch, caster wheel || 1 || $6&lt;br /&gt;
|-&lt;br /&gt;
| [[Raspberry Pi Pico]] || Microcontroller board (or Pico W for Wi-Fi) || 1 || $4&lt;br /&gt;
|-&lt;br /&gt;
| [[TB6612FNG]] Module || Dual H-bridge motor driver || 1 || $3&lt;br /&gt;
|-&lt;br /&gt;
| [[MP1584]] Module || Buck converter (6V → 3.3V) || 1 || $1&lt;br /&gt;
|-&lt;br /&gt;
| [[Infrared Line Detector]] || Line following sensors || 2 || $1&lt;br /&gt;
|-&lt;br /&gt;
| [[LM393]] IC || Dual comparator for optical encoders || 1 || $0.25&lt;br /&gt;
|-&lt;br /&gt;
| Resistors, LEDs, photoresistors || Encoder circuit components || Set || $1&lt;br /&gt;
|-&lt;br /&gt;
| 4× AA Batteries || Power supply (1.5V each = 6V total) || 4 || $2&lt;br /&gt;
|-&lt;br /&gt;
| 3D Printed Parts || Chassis, motor mounts, sensor mounts || Set || $2 (filament)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Total&#039;&#039;&#039; || || || &#039;&#039;&#039;~$20&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PCB Options ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[BRS Differential Drive Robot Control Board]]&#039;&#039;&#039; (Through-Hole) - $5-10 for 5 PCBs from JLCPCB, ~$5 in components&lt;br /&gt;
* &#039;&#039;&#039;Breadboard/Perfboard&#039;&#039;&#039; - Cheaper but less compact&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot uses a modular 3D-printed chassis with several key features:&lt;br /&gt;
&lt;br /&gt;
=== Chassis Modules ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Main Chassis Plate&#039;&#039;&#039; - Central platform with mounting points for all modules&lt;br /&gt;
* &#039;&#039;&#039;Battery Block&#039;&#039;&#039; - Secures 4× AA battery holder with velcro strap retention&lt;br /&gt;
* &#039;&#039;&#039;Caster Assembly&#039;&#039;&#039; - Front-mounted caster wheel with adjustable height&lt;br /&gt;
* &#039;&#039;&#039;Motor Mounts&#039;&#039;&#039; - Dovetail attachment system for easy motor positioning&lt;br /&gt;
* &#039;&#039;&#039;Sensor Rail&#039;&#039;&#039; - Underside mounting for adjustable line sensors&lt;br /&gt;
&lt;br /&gt;
All STL files and the FreeCAD source are available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository].&lt;br /&gt;
&lt;br /&gt;
=== Assembly ===&lt;br /&gt;
&lt;br /&gt;
See the detailed [[SimpleBot Assembly Guide]] (or [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/ASSEMBLY_GUIDE.md GitHub version]) for step-by-step mechanical assembly instructions with images.&lt;br /&gt;
&lt;br /&gt;
== Electronics ==&lt;br /&gt;
&lt;br /&gt;
=== Circuit Design ===&lt;br /&gt;
&lt;br /&gt;
The electronics integrate:&lt;br /&gt;
* Power regulation (6V battery → 3.3V via buck converter)&lt;br /&gt;
* Motor control (TB6612FNG dual H-bridge)&lt;br /&gt;
* Optical encoder circuits (LM393 comparators)&lt;br /&gt;
* Sensor interfaces (line detectors, IMU, radio)&lt;br /&gt;
* GPIO expansion (analog and digital headers)&lt;br /&gt;
&lt;br /&gt;
=== PCB Design ===&lt;br /&gt;
&lt;br /&gt;
See the detailed [[SimpleBot PCB Guide]] (or [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/PCB_GUIDE.md GitHub version]) for:&lt;br /&gt;
* Full schematic&lt;br /&gt;
* PCB layout views&lt;br /&gt;
* Component placement&lt;br /&gt;
* Assembly instructions&lt;br /&gt;
* Gerber files for manufacturing&lt;br /&gt;
&lt;br /&gt;
The PCB uses &#039;&#039;&#039;through-hole components&#039;&#039;&#039; for easy hand-soldering, making it ideal for educational builds and beginners.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot runs &#039;&#039;&#039;MicroPython&#039;&#039;&#039; on the [[Raspberry Pi Pico]], making it accessible to beginners while providing full control over hardware.&lt;br /&gt;
&lt;br /&gt;
=== Programming ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://thonny.org/ Thonny IDE] or use any MicroPython-compatible editor&lt;br /&gt;
# Connect Pico via USB&lt;br /&gt;
# Copy Python files from the repository to the Pico&lt;br /&gt;
# Edit configuration for your specific hardware&lt;br /&gt;
# Run and test!&lt;br /&gt;
&lt;br /&gt;
=== Code Structure ===&lt;br /&gt;
&lt;br /&gt;
The SimpleBot code is organized into modular files:&lt;br /&gt;
* &#039;&#039;&#039;motor.py&#039;&#039;&#039; - Motor control class with PWM speed control&lt;br /&gt;
* &#039;&#039;&#039;encoder.py&#039;&#039;&#039; - Optical encoder pulse counting&lt;br /&gt;
* &#039;&#039;&#039;line_sensor.py&#039;&#039;&#039; - Line detector interface&lt;br /&gt;
* &#039;&#039;&#039;robot.py&#039;&#039;&#039; - High-level robot control (drive forward, turn, etc.)&lt;br /&gt;
* &#039;&#039;&#039;main.py&#039;&#039;&#039; - Main program loop&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from robot import SimpleBot&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Initialize robot&lt;br /&gt;
bot = SimpleBot()&lt;br /&gt;
&lt;br /&gt;
# Drive forward 30cm using odometry&lt;br /&gt;
bot.drive_distance(30)  # cm&lt;br /&gt;
&lt;br /&gt;
# Follow a line&lt;br /&gt;
while True:&lt;br /&gt;
    left, right = bot.read_line_sensors()&lt;br /&gt;
&lt;br /&gt;
    if not left and not right:&lt;br /&gt;
        bot.forward(speed=50)  # Both on white - go straight&lt;br /&gt;
    elif left:&lt;br /&gt;
        bot.turn_right(speed=40)  # Left on line - turn right&lt;br /&gt;
    elif right:&lt;br /&gt;
        bot.turn_left(speed=40)  # Right on line - turn left&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full code examples available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository].&lt;br /&gt;
&lt;br /&gt;
== Build Paths ==&lt;br /&gt;
&lt;br /&gt;
Choose the path that matches your skill level and available resources:&lt;br /&gt;
&lt;br /&gt;
=== Path 1: Buy Everything (Easiest) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Complete beginners, classrooms&lt;br /&gt;
&lt;br /&gt;
# Purchase all components from the bill of materials&lt;br /&gt;
# 3D print the chassis parts (or use a print service)&lt;br /&gt;
# Order the pre-assembled PCB (or use breadboard)&lt;br /&gt;
# Follow assembly guide&lt;br /&gt;
# Upload code and go!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; 2-4 hours assembly + printing time&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Solder It Yourself (Learning) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Learning electronics, gaining soldering experience&lt;br /&gt;
&lt;br /&gt;
# Purchase components and blank PCB&lt;br /&gt;
# Order Gerber files from JLCPCB (~$2 for 5 PCBs)&lt;br /&gt;
# Learn through-hole soldering techniques&lt;br /&gt;
# Assemble PCB step by step&lt;br /&gt;
# Integrate into 3D-printed chassis&lt;br /&gt;
# Upload code and test!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; 4-8 hours including soldering practice&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Design Your Own (Advanced) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Experienced makers, custom requirements&lt;br /&gt;
&lt;br /&gt;
# Use SimpleBot as a reference design&lt;br /&gt;
# Modify the FreeCAD chassis for your needs&lt;br /&gt;
# Adapt the PCB design in KiCad&lt;br /&gt;
# Add custom sensors or actuators&lt;br /&gt;
# Create your own robot variant!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Unlimited - this is your custom project!&lt;br /&gt;
&lt;br /&gt;
== Learning Outcomes ==&lt;br /&gt;
&lt;br /&gt;
Building and programming SimpleBot teaches:&lt;br /&gt;
&lt;br /&gt;
=== 3D Printing ===&lt;br /&gt;
* Printing functional mechanical parts&lt;br /&gt;
* Working with heat-set inserts&lt;br /&gt;
* Designing for printability&lt;br /&gt;
&lt;br /&gt;
=== Electronics ===&lt;br /&gt;
* Motor control with H-bridges&lt;br /&gt;
* Sensor interfacing (analog and digital)&lt;br /&gt;
* Power regulation with buck converters&lt;br /&gt;
* PCB assembly (through-hole soldering)&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* MicroPython programming&lt;br /&gt;
* PWM for motor speed control&lt;br /&gt;
* Interrupt-driven encoder counting&lt;br /&gt;
* Sensor polling and decision making&lt;br /&gt;
* PID control (optional advanced topic)&lt;br /&gt;
&lt;br /&gt;
=== Robotics Concepts ===&lt;br /&gt;
* Differential drive kinematics&lt;br /&gt;
* Optical odometry for position tracking&lt;br /&gt;
* Line following algorithms&lt;br /&gt;
* Dead reckoning navigation&lt;br /&gt;
* Sensor fusion (with IMU)&lt;br /&gt;
&lt;br /&gt;
== Variations ==&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot Mini ===&lt;br /&gt;
A smaller version designed to fit standard micromouse mazes (under development).&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot Pro ===&lt;br /&gt;
Enhanced version with additional sensors, faster motors, and ROS integration (future development).&lt;br /&gt;
&lt;br /&gt;
=== Community Variants ===&lt;br /&gt;
See [[Build Logs:SimpleBot]] for community members&#039; custom builds and modifications.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot is designed as an educational platform, so it has intentional limitations:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Speed&#039;&#039;&#039; - Deliberately slow for safety and learning&lt;br /&gt;
* &#039;&#039;&#039;Maze Size&#039;&#039;&#039; - Too large for standard micromouse mazes (see SimpleBot Mini)&lt;br /&gt;
* &#039;&#039;&#039;Terrain&#039;&#039;&#039; - Designed for flat, smooth surfaces only&lt;br /&gt;
* &#039;&#039;&#039;Line Following&#039;&#039;&#039; - Two-sensor configuration is simple but less robust than arrays&lt;br /&gt;
&lt;br /&gt;
These limitations are features, not bugs - they provide opportunities for learning and improvement!&lt;br /&gt;
&lt;br /&gt;
== Next Steps After Building SimpleBot ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve built and programmed SimpleBot, consider:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Master line following&#039;&#039;&#039; - Optimize your code for speed and accuracy&lt;br /&gt;
# &#039;&#039;&#039;Add the IMU&#039;&#039;&#039; - Implement heading-based navigation&lt;br /&gt;
# &#039;&#039;&#039;Add the radio&#039;&#039;&#039; - Control remotely or implement swarm behavior&lt;br /&gt;
# &#039;&#039;&#039;Design custom sensors&#039;&#039;&#039; - Add ultrasonic, IR distance, or other sensors&lt;br /&gt;
# &#039;&#039;&#039;Build a maze&#039;&#039;&#039; - Create line-following challenges&lt;br /&gt;
# &#039;&#039;&#039;Modify the chassis&#039;&#039;&#039; - Add a pen holder for drawing robots&lt;br /&gt;
# &#039;&#039;&#039;Teach others&#039;&#039;&#039; - Document your build and help newcomers&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository]&#039;&#039;&#039; - CAD files, code, PCB designs&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot Assembly Guide]]&#039;&#039;&#039; - Step-by-step mechanical assembly&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot PCB Guide]]&#039;&#039;&#039; - Electronics and PCB information&lt;br /&gt;
* &#039;&#039;&#039;[[Raspberry Pi Pico]]&#039;&#039;&#039; - Microcontroller documentation&lt;br /&gt;
* &#039;&#039;&#039;[[BRS Differential Drive Robot Control Board]]&#039;&#039;&#039; - PCB details&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Differential Drive]] - Theory behind two-wheeled robots&lt;br /&gt;
* [[Optical Odometry]] - Measuring distance with encoders&lt;br /&gt;
* [[Line Following]] - Algorithms and techniques&lt;br /&gt;
* [[Motor Control]] - PWM and H-bridge operation&lt;br /&gt;
* [[3D Printing for Robotics]] - Designing and printing robot parts&lt;br /&gt;
&lt;br /&gt;
== Community ==&lt;br /&gt;
&lt;br /&gt;
Share your SimpleBot build:&lt;br /&gt;
* Post photos and videos on the [[Discord]]&lt;br /&gt;
* Create a [[Build Logs:SimpleBot|build log]] on the wiki&lt;br /&gt;
* Submit improvements via pull request on GitHub&lt;br /&gt;
* Help answer questions from new builders&lt;br /&gt;
&lt;br /&gt;
[[Category:Robot]]&lt;br /&gt;
[[Category:Educational]]&lt;br /&gt;
[[Category:Line Following]]&lt;br /&gt;
[[Category:Differential Drive]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=SimpleBot&amp;diff=89</id>
		<title>SimpleBot</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=SimpleBot&amp;diff=89"/>
		<updated>2025-10-11T20:27:27Z</updated>

		<summary type="html">&lt;p&gt;John: /* Design Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Robot&lt;br /&gt;
| name = SimpleBot&lt;br /&gt;
| image = simplebot.jpeg&lt;br /&gt;
| caption = SimpleBot - BRS&#039;s first robot design&lt;br /&gt;
| use_case = Educational robot for learning line following, optical odometry, and basic robotics&lt;br /&gt;
| microcontroller = [[Raspberry Pi Pico]] or [[Raspberry Pi Pico W]]&lt;br /&gt;
| sensors = 2× [[Infrared Line Detector]], 2× Optical Encoders (custom), optional [[MPU6050]] IMU, optional nRF24L01 radio&lt;br /&gt;
| power = 4× AA batteries (6V nominal) via [[MP1584]] buck converter (3.3V output)&lt;br /&gt;
| pcb = [[BRS Differential Drive Robot Control Board]] (through-hole assembly)&lt;br /&gt;
| cost = &#039;&#039;&#039;Under $20&#039;&#039;&#039; (with batteries)&lt;br /&gt;
| repository = [https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot&#039;&#039;&#039; is the Bespoke Robot Society&#039;s original robot design, created for students, educators, and cost-conscious makers. It&#039;s a fully functional {{Wikipedia|Differential_wheeled_robot|differential drive robot}} that demonstrates core robotics concepts including motor control, sensor integration, and autonomous navigation.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot was designed with BRS&#039;s core mission in mind:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Optical odometry and line following&#039;&#039;&#039; - SimpleBot is a demonstrator for dead reckoning and line maze problems, required study for all entry-level roboticists.&lt;br /&gt;
* &#039;&#039;&#039;Design and build custom robots&#039;&#039;&#039; - 3D-printed chassis with modular sensor mounts&lt;br /&gt;
* &#039;&#039;&#039;Lower the barrier to entry&#039;&#039;&#039; - Under $20 total cost with all batteries included&lt;br /&gt;
* &#039;&#039;&#039;Teach robotics fundamentals&#039;&#039;&#039; - Every component serves an educational purpose&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot is based on commonly available &amp;quot;Arduino Smart Car&amp;quot; components (motors, wheels, battery holder) combined with a custom 3D-printed chassis and optional custom PCB. The robot can be built three ways:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Breadboard Version&#039;&#039;&#039; - Wire everything on a breadboard (fastest to prototype)&lt;br /&gt;
# &#039;&#039;&#039;Protoboard Version&#039;&#039;&#039; - Solder components to perfboard (more permanent)&lt;br /&gt;
# &#039;&#039;&#039;Custom PCB Version&#039;&#039;&#039; - Use the [[BRS Differential Drive Robot Control Board]] (most compact)&lt;br /&gt;
&lt;br /&gt;
All three versions run the same code and have identical functionality.&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
&lt;br /&gt;
=== Line Following ===&lt;br /&gt;
Two [[Infrared Line Detector|infrared line detectors]] mounted under the chassis track a black line on a white surface (or vice versa). The robot adjusts its motor speeds to stay centered on the line.&lt;br /&gt;
&lt;br /&gt;
=== Optical Odometry ===&lt;br /&gt;
Custom encoder circuits use LEDs and photoresistors to count pulses from slotted wheels attached to the motors. This allows the robot to measure distance traveled and perform [[dead reckoning]].&lt;br /&gt;
&lt;br /&gt;
=== Motor Control ===&lt;br /&gt;
The [[TB6612FNG]] dual H-bridge provides independent speed and direction control for both wheels via PWM signals from the Pico.&lt;br /&gt;
&lt;br /&gt;
=== Expansion Ready ===&lt;br /&gt;
The PCB includes headers for:&lt;br /&gt;
* &#039;&#039;&#039;MPU6050&#039;&#039;&#039; 6-axis IMU (accelerometer + gyroscope) via I²C&lt;br /&gt;
* &#039;&#039;&#039;nRF24L01&#039;&#039;&#039; 2.4 GHz radio module via SPI&lt;br /&gt;
* &#039;&#039;&#039;4× sensor headers&#039;&#039;&#039; for additional sensors (3.3V + GND + GPIO)&lt;br /&gt;
* &#039;&#039;&#039;Analog/digital breakout headers&#039;&#039;&#039; for custom additions&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
=== Base Components ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Description !! Qty !! Est. Cost&lt;br /&gt;
|-&lt;br /&gt;
| Arduino Smart Car Kit || 2× TT motors with wheels, encoder discs, battery holder, power switch, caster wheel || 1 || $6&lt;br /&gt;
|-&lt;br /&gt;
| [[Raspberry Pi Pico]] || Microcontroller board (or Pico W for Wi-Fi) || 1 || $4&lt;br /&gt;
|-&lt;br /&gt;
| [[TB6612FNG]] Module || Dual H-bridge motor driver || 1 || $3&lt;br /&gt;
|-&lt;br /&gt;
| [[MP1584]] Module || Buck converter (6V → 3.3V) || 1 || $1&lt;br /&gt;
|-&lt;br /&gt;
| [[Infrared Line Detector]] || Line following sensors || 2 || $1&lt;br /&gt;
|-&lt;br /&gt;
| [[LM393]] IC || Dual comparator for optical encoders || 1 || $0.25&lt;br /&gt;
|-&lt;br /&gt;
| Resistors, LEDs, photoresistors || Encoder circuit components || Set || $1&lt;br /&gt;
|-&lt;br /&gt;
| 4× AA Batteries || Power supply (1.5V each = 6V total) || 4 || $2&lt;br /&gt;
|-&lt;br /&gt;
| 3D Printed Parts || Chassis, motor mounts, sensor mounts || Set || $2 (filament)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Total&#039;&#039;&#039; || || || &#039;&#039;&#039;~$20&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== PCB Options ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[BRS Differential Drive Robot Control Board]]&#039;&#039;&#039; (Through-Hole) - $5-10 for 5 PCBs from JLCPCB, ~$5 in components&lt;br /&gt;
* &#039;&#039;&#039;Breadboard/Perfboard&#039;&#039;&#039; - Cheaper but less compact&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot uses a modular 3D-printed chassis with several key features:&lt;br /&gt;
&lt;br /&gt;
=== Chassis Modules ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Main Chassis Plate&#039;&#039;&#039; - Central platform with mounting points for all modules&lt;br /&gt;
* &#039;&#039;&#039;Battery Block&#039;&#039;&#039; - Secures 4× AA battery holder with velcro strap retention&lt;br /&gt;
* &#039;&#039;&#039;Caster Assembly&#039;&#039;&#039; - Front-mounted caster wheel with adjustable height&lt;br /&gt;
* &#039;&#039;&#039;Motor Mounts&#039;&#039;&#039; - Dovetail attachment system for easy motor positioning&lt;br /&gt;
* &#039;&#039;&#039;Sensor Rail&#039;&#039;&#039; - Underside mounting for adjustable line sensors&lt;br /&gt;
&lt;br /&gt;
All STL files and the FreeCAD source are available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository].&lt;br /&gt;
&lt;br /&gt;
=== Assembly ===&lt;br /&gt;
&lt;br /&gt;
See the detailed [[SimpleBot Assembly Guide]] (or [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/ASSEMBLY_GUIDE.md GitHub version]) for step-by-step mechanical assembly instructions with images.&lt;br /&gt;
&lt;br /&gt;
== Electronics ==&lt;br /&gt;
&lt;br /&gt;
=== Circuit Design ===&lt;br /&gt;
&lt;br /&gt;
The electronics integrate:&lt;br /&gt;
* Power regulation (6V battery → 3.3V via buck converter)&lt;br /&gt;
* Motor control (TB6612FNG dual H-bridge)&lt;br /&gt;
* Optical encoder circuits (LM393 comparators)&lt;br /&gt;
* Sensor interfaces (line detectors, IMU, radio)&lt;br /&gt;
* GPIO expansion (analog and digital headers)&lt;br /&gt;
&lt;br /&gt;
=== PCB Design ===&lt;br /&gt;
&lt;br /&gt;
See the detailed [[SimpleBot PCB Guide]] (or [https://github.com/Bespoke-Robot-Society/simplebot/blob/master/PCB_GUIDE.md GitHub version]) for:&lt;br /&gt;
* Full schematic&lt;br /&gt;
* PCB layout views&lt;br /&gt;
* Component placement&lt;br /&gt;
* Assembly instructions&lt;br /&gt;
* Gerber files for manufacturing&lt;br /&gt;
&lt;br /&gt;
The PCB uses &#039;&#039;&#039;through-hole components&#039;&#039;&#039; for easy hand-soldering, making it ideal for educational builds and beginners.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot runs &#039;&#039;&#039;MicroPython&#039;&#039;&#039; on the [[Raspberry Pi Pico]], making it accessible to beginners while providing full control over hardware.&lt;br /&gt;
&lt;br /&gt;
=== Programming ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://thonny.org/ Thonny IDE] or use any MicroPython-compatible editor&lt;br /&gt;
# Connect Pico via USB&lt;br /&gt;
# Copy Python files from the repository to the Pico&lt;br /&gt;
# Edit configuration for your specific hardware&lt;br /&gt;
# Run and test!&lt;br /&gt;
&lt;br /&gt;
=== Code Structure ===&lt;br /&gt;
&lt;br /&gt;
The SimpleBot code is organized into modular files:&lt;br /&gt;
* &#039;&#039;&#039;motor.py&#039;&#039;&#039; - Motor control class with PWM speed control&lt;br /&gt;
* &#039;&#039;&#039;encoder.py&#039;&#039;&#039; - Optical encoder pulse counting&lt;br /&gt;
* &#039;&#039;&#039;line_sensor.py&#039;&#039;&#039; - Line detector interface&lt;br /&gt;
* &#039;&#039;&#039;robot.py&#039;&#039;&#039; - High-level robot control (drive forward, turn, etc.)&lt;br /&gt;
* &#039;&#039;&#039;main.py&#039;&#039;&#039; - Main program loop&lt;br /&gt;
&lt;br /&gt;
=== Example Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from robot import SimpleBot&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Initialize robot&lt;br /&gt;
bot = SimpleBot()&lt;br /&gt;
&lt;br /&gt;
# Drive forward 30cm using odometry&lt;br /&gt;
bot.drive_distance(30)  # cm&lt;br /&gt;
&lt;br /&gt;
# Follow a line&lt;br /&gt;
while True:&lt;br /&gt;
    left, right = bot.read_line_sensors()&lt;br /&gt;
&lt;br /&gt;
    if not left and not right:&lt;br /&gt;
        bot.forward(speed=50)  # Both on white - go straight&lt;br /&gt;
    elif left:&lt;br /&gt;
        bot.turn_right(speed=40)  # Left on line - turn right&lt;br /&gt;
    elif right:&lt;br /&gt;
        bot.turn_left(speed=40)  # Right on line - turn left&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Full code examples available in the [https://github.com/Bespoke-Robot-Society/simplebot GitHub repository].&lt;br /&gt;
&lt;br /&gt;
== Build Paths ==&lt;br /&gt;
&lt;br /&gt;
Choose the path that matches your skill level and available resources:&lt;br /&gt;
&lt;br /&gt;
=== Path 1: Buy Everything (Easiest) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Complete beginners, classrooms&lt;br /&gt;
&lt;br /&gt;
# Purchase all components from the bill of materials&lt;br /&gt;
# 3D print the chassis parts (or use a print service)&lt;br /&gt;
# Order the pre-assembled PCB (or use breadboard)&lt;br /&gt;
# Follow assembly guide&lt;br /&gt;
# Upload code and go!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; 2-4 hours assembly + printing time&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Solder It Yourself (Learning) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Learning electronics, gaining soldering experience&lt;br /&gt;
&lt;br /&gt;
# Purchase components and blank PCB&lt;br /&gt;
# Order Gerber files from JLCPCB (~$2 for 5 PCBs)&lt;br /&gt;
# Learn through-hole soldering techniques&lt;br /&gt;
# Assemble PCB step by step&lt;br /&gt;
# Integrate into 3D-printed chassis&lt;br /&gt;
# Upload code and test!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; 4-8 hours including soldering practice&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Design Your Own (Advanced) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best for:&#039;&#039;&#039; Experienced makers, custom requirements&lt;br /&gt;
&lt;br /&gt;
# Use SimpleBot as a reference design&lt;br /&gt;
# Modify the FreeCAD chassis for your needs&lt;br /&gt;
# Adapt the PCB design in KiCad&lt;br /&gt;
# Add custom sensors or actuators&lt;br /&gt;
# Create your own robot variant!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time:&#039;&#039;&#039; Unlimited - this is your custom project!&lt;br /&gt;
&lt;br /&gt;
== Learning Outcomes ==&lt;br /&gt;
&lt;br /&gt;
Building and programming SimpleBot teaches:&lt;br /&gt;
&lt;br /&gt;
=== 3D Printing ===&lt;br /&gt;
* Printing functional mechanical parts&lt;br /&gt;
* Working with heat-set inserts&lt;br /&gt;
* Designing for printability&lt;br /&gt;
&lt;br /&gt;
=== Electronics ===&lt;br /&gt;
* Motor control with H-bridges&lt;br /&gt;
* Sensor interfacing (analog and digital)&lt;br /&gt;
* Power regulation with buck converters&lt;br /&gt;
* PCB assembly (through-hole soldering)&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* MicroPython programming&lt;br /&gt;
* PWM for motor speed control&lt;br /&gt;
* Interrupt-driven encoder counting&lt;br /&gt;
* Sensor polling and decision making&lt;br /&gt;
* PID control (optional advanced topic)&lt;br /&gt;
&lt;br /&gt;
=== Robotics Concepts ===&lt;br /&gt;
* Differential drive kinematics&lt;br /&gt;
* Optical odometry for position tracking&lt;br /&gt;
* Line following algorithms&lt;br /&gt;
* Dead reckoning navigation&lt;br /&gt;
* Sensor fusion (with IMU)&lt;br /&gt;
&lt;br /&gt;
== Variations ==&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot Mini ===&lt;br /&gt;
A smaller version designed to fit standard micromouse mazes (under development).&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot Pro ===&lt;br /&gt;
Enhanced version with additional sensors, faster motors, and ROS integration (future development).&lt;br /&gt;
&lt;br /&gt;
=== Community Variants ===&lt;br /&gt;
See [[Build Logs:SimpleBot]] for community members&#039; custom builds and modifications.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot is designed as an educational platform, so it has intentional limitations:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Speed&#039;&#039;&#039; - Deliberately slow for safety and learning&lt;br /&gt;
* &#039;&#039;&#039;Maze Size&#039;&#039;&#039; - Too large for standard micromouse mazes (see SimpleBot Mini)&lt;br /&gt;
* &#039;&#039;&#039;Terrain&#039;&#039;&#039; - Designed for flat, smooth surfaces only&lt;br /&gt;
* &#039;&#039;&#039;Line Following&#039;&#039;&#039; - Two-sensor configuration is simple but less robust than arrays&lt;br /&gt;
&lt;br /&gt;
These limitations are features, not bugs - they provide opportunities for learning and improvement!&lt;br /&gt;
&lt;br /&gt;
== Next Steps After Building SimpleBot ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve built and programmed SimpleBot, consider:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Master line following&#039;&#039;&#039; - Optimize your code for speed and accuracy&lt;br /&gt;
# &#039;&#039;&#039;Add the IMU&#039;&#039;&#039; - Implement heading-based navigation&lt;br /&gt;
# &#039;&#039;&#039;Add the radio&#039;&#039;&#039; - Control remotely or implement swarm behavior&lt;br /&gt;
# &#039;&#039;&#039;Design custom sensors&#039;&#039;&#039; - Add ultrasonic, IR distance, or other sensors&lt;br /&gt;
# &#039;&#039;&#039;Build a maze&#039;&#039;&#039; - Create line-following challenges&lt;br /&gt;
# &#039;&#039;&#039;Modify the chassis&#039;&#039;&#039; - Add a pen holder for drawing robots&lt;br /&gt;
# &#039;&#039;&#039;Teach others&#039;&#039;&#039; - Document your build and help newcomers&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository]&#039;&#039;&#039; - CAD files, code, PCB designs&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot Assembly Guide]]&#039;&#039;&#039; - Step-by-step mechanical assembly&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot PCB Guide]]&#039;&#039;&#039; - Electronics and PCB information&lt;br /&gt;
* &#039;&#039;&#039;[[Raspberry Pi Pico]]&#039;&#039;&#039; - Microcontroller documentation&lt;br /&gt;
* &#039;&#039;&#039;[[BRS Differential Drive Robot Control Board]]&#039;&#039;&#039; - PCB details&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Differential Drive]] - Theory behind two-wheeled robots&lt;br /&gt;
* [[Optical Odometry]] - Measuring distance with encoders&lt;br /&gt;
* [[Line Following]] - Algorithms and techniques&lt;br /&gt;
* [[Motor Control]] - PWM and H-bridge operation&lt;br /&gt;
* [[3D Printing for Robotics]] - Designing and printing robot parts&lt;br /&gt;
&lt;br /&gt;
== Community ==&lt;br /&gt;
&lt;br /&gt;
Share your SimpleBot build:&lt;br /&gt;
* Post photos and videos on the [[Discord]]&lt;br /&gt;
* Create a [[Build Logs:SimpleBot|build log]] on the wiki&lt;br /&gt;
* Submit improvements via pull request on GitHub&lt;br /&gt;
* Help answer questions from new builders&lt;br /&gt;
&lt;br /&gt;
[[Category:Robot]]&lt;br /&gt;
[[Category:Educational]]&lt;br /&gt;
[[Category:Line Following]]&lt;br /&gt;
[[Category:Differential Drive]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Sensor_Interfacing&amp;diff=88</id>
		<title>Sensor Interfacing</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Sensor_Interfacing&amp;diff=88"/>
		<updated>2025-10-11T20:16:48Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Sensor Interfacing |competency=Electronics |difficulty=Intermediate |time=4-6 hours |prerequisites=Electronics Fundamentals, MicroPython Basics, basic understanding of digital signals |materials=Microcontroller (Raspberry Pi Pico), breadboard, I2C sensor (MPU6050 IMU), analog sensor (photoresistor), digital sensor (IR line detector), 10kΩ resistors, jumper wires, multimeter, logic analyzer (optional but helpful) |next_steps=Add IMU or distan...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Sensor Interfacing&lt;br /&gt;
|competency=[[Electronics]]&lt;br /&gt;
|difficulty=Intermediate&lt;br /&gt;
|time=4-6 hours&lt;br /&gt;
|prerequisites=[[Electronics Fundamentals]], [[MicroPython Basics]], basic understanding of digital signals&lt;br /&gt;
|materials=Microcontroller (Raspberry Pi Pico), breadboard, I2C sensor (MPU6050 IMU), analog sensor (photoresistor), digital sensor (IR line detector), 10kΩ resistors, jumper wires, multimeter, logic analyzer (optional but helpful)&lt;br /&gt;
|next_steps=Add IMU or distance sensors to your robot, [[MicroPython Programming]], build advanced capabilities&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sensor Interfacing&#039;&#039;&#039; teaches you how to connect and read sensors in robotics applications. You&#039;ll learn about communication protocols (I2C, SPI), analog sensors with ADC, pull-up resistors, and active HIGH/LOW logic. By the end of this tutorial, you&#039;ll be able to integrate new sensors into your robots and troubleshoot sensor communication issues.&lt;br /&gt;
&lt;br /&gt;
This tutorial builds on [[Electronics Fundamentals]] and [[MicroPython Basics]] - you should understand voltage, digital signals, and basic Python programming.&lt;br /&gt;
&lt;br /&gt;
== Why Sensor Interfacing Matters ==&lt;br /&gt;
&lt;br /&gt;
Sensors are your robot&#039;s perception of the world:&lt;br /&gt;
* &#039;&#039;&#039;Vision&#039;&#039;&#039; - Detect lines, obstacles, colors (cameras, distance sensors)&lt;br /&gt;
* &#039;&#039;&#039;Motion&#039;&#039;&#039; - Measure acceleration, rotation, orientation (IMUs, gyroscopes)&lt;br /&gt;
* &#039;&#039;&#039;Position&#039;&#039;&#039; - Track wheel rotation, distance traveled (encoders, odometry)&lt;br /&gt;
* &#039;&#039;&#039;Environment&#039;&#039;&#039; - Detect light, temperature, sound (photoresistors, thermistors, microphones)&lt;br /&gt;
&lt;br /&gt;
Without proper sensor interfacing, you cannot:&lt;br /&gt;
* Add new capabilities to your robot&lt;br /&gt;
* Debug sensor communication problems&lt;br /&gt;
* Select appropriate sensors for your application&lt;br /&gt;
* Understand sensor datasheets and specifications&lt;br /&gt;
&lt;br /&gt;
== Part 1: Sensor Types and Outputs ==&lt;br /&gt;
&lt;br /&gt;
=== Digital Sensors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digital sensors&#039;&#039;&#039; output HIGH or LOW signals:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Active HIGH&#039;&#039;&#039; - HIGH means &amp;quot;detected&amp;quot; (e.g., button pressed = HIGH)&lt;br /&gt;
* &#039;&#039;&#039;Active LOW&#039;&#039;&#039; - LOW means &amp;quot;detected&amp;quot; (e.g., [[Infrared Line Detector]] on black line = LOW)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: SimpleBot line sensors&#039;&#039;&#039;&lt;br /&gt;
* Output HIGH when no line (white surface reflects IR light)&lt;br /&gt;
* Output LOW when on line (black tape absorbs IR light)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reading digital sensors:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
# Configure with pull-up resistor (sensor is active LOW)&lt;br /&gt;
sensor = Pin(10, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
if sensor.value() == 0:  # LOW = line detected&lt;br /&gt;
    print(&amp;quot;Line detected!&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;No line&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Analog Sensors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Analog sensors&#039;&#039;&#039; output variable voltage:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Photoresistor&#039;&#039;&#039; - Resistance changes with light (requires voltage divider)&lt;br /&gt;
* &#039;&#039;&#039;Temperature sensor&#039;&#039;&#039; - Voltage proportional to temperature&lt;br /&gt;
* &#039;&#039;&#039;Potentiometer&#039;&#039;&#039; - Voltage varies from 0V to Vcc&lt;br /&gt;
* &#039;&#039;&#039;Pressure sensor&#039;&#039;&#039; - Voltage indicates force&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADC (Analog-to-Digital Conversion)&#039;&#039;&#039; converts voltage to number:&lt;br /&gt;
* Raspberry Pi Pico: 12-bit ADC (0-4095) with 3.3V reference&lt;br /&gt;
* ESP32: 12-bit ADC (0-4095) with configurable reference&lt;br /&gt;
* Arduino Uno: 10-bit ADC (0-1023) with 5V reference&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reading analog sensors:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import ADC&lt;br /&gt;
&lt;br /&gt;
# Configure ADC on GPIO26 (ADC0 on Raspberry Pi Pico)&lt;br /&gt;
sensor = ADC(26)&lt;br /&gt;
&lt;br /&gt;
# Read raw ADC value (0-65535 on Pico using 16-bit conversion)&lt;br /&gt;
raw_value = sensor.read_u16()&lt;br /&gt;
&lt;br /&gt;
# Convert to voltage (Pico uses 3.3V reference)&lt;br /&gt;
voltage = raw_value * 3.3 / 65535&lt;br /&gt;
&lt;br /&gt;
print(f&amp;quot;ADC: {raw_value}, Voltage: {voltage:.2f}V&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Communication Protocol Sensors ===&lt;br /&gt;
&lt;br /&gt;
Advanced sensors use digital communication protocols:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;I2C&#039;&#039;&#039; - Two-wire bus, multiple devices, addresses (IMUs, distance sensors)&lt;br /&gt;
* &#039;&#039;&#039;SPI&#039;&#039;&#039; - Four-wire, high-speed, chip-select per device (displays, SD cards)&lt;br /&gt;
* &#039;&#039;&#039;UART&#039;&#039;&#039; - Two-wire, point-to-point (GPS modules, serial sensors)&lt;br /&gt;
* &#039;&#039;&#039;1-Wire&#039;&#039;&#039; - Single data wire (temperature sensors)&lt;br /&gt;
&lt;br /&gt;
Most modern robot sensors use &#039;&#039;&#039;I2C&#039;&#039;&#039; because:&lt;br /&gt;
* Only 2 wires (SDA and SCL) for multiple devices&lt;br /&gt;
* Built-in addressing (up to 127 devices on one bus)&lt;br /&gt;
* Widely supported by microcontrollers&lt;br /&gt;
* Good for moderate-speed data (100 kHz - 400 kHz typical)&lt;br /&gt;
&lt;br /&gt;
== Part 2: Pull-up and Pull-down Resistors ==&lt;br /&gt;
&lt;br /&gt;
=== The Floating Input Problem ===&lt;br /&gt;
&lt;br /&gt;
Digital inputs must be either HIGH or LOW - never &#039;&#039;&#039;floating&#039;&#039;&#039; (undefined):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Floating input&#039;&#039;&#039; - Not connected to anything, voltage drifts randomly&lt;br /&gt;
* &#039;&#039;&#039;Symptom&#039;&#039;&#039; - Erratic readings, false triggers, unpredictable behavior&lt;br /&gt;
* &#039;&#039;&#039;Solution&#039;&#039;&#039; - Pull-up or pull-down resistor&lt;br /&gt;
&lt;br /&gt;
=== Pull-up Resistors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pull-up resistor&#039;&#039;&#039; connects input to HIGH voltage (3.3V or 5V):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    +3.3V&lt;br /&gt;
      |&lt;br /&gt;
     [10kΩ]  ← Pull-up resistor&lt;br /&gt;
      |&lt;br /&gt;
      +------- Input Pin&lt;br /&gt;
      |&lt;br /&gt;
    [Switch] ← When closed, pulls to GND&lt;br /&gt;
      |&lt;br /&gt;
     GND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Behavior:&#039;&#039;&#039;&lt;br /&gt;
* Switch open → Input = HIGH (pulled up by resistor)&lt;br /&gt;
* Switch closed → Input = LOW (connected to GND)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default state: HIGH&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: I2C communication requires pull-ups on SDA and SCL lines&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Pull-down Resistors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pull-down resistor&#039;&#039;&#039; connects input to LOW voltage (GND):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    +3.3V&lt;br /&gt;
      |&lt;br /&gt;
    [Switch] ← When closed, pulls to +3.3V&lt;br /&gt;
      |&lt;br /&gt;
      +------- Input Pin&lt;br /&gt;
      |&lt;br /&gt;
     [10kΩ]  ← Pull-down resistor&lt;br /&gt;
      |&lt;br /&gt;
     GND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Behavior:&#039;&#039;&#039;&lt;br /&gt;
* Switch open → Input = LOW (pulled down by resistor)&lt;br /&gt;
* Switch closed → Input = HIGH (connected to +3.3V)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default state: LOW&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Internal Pull-up/Pull-down ===&lt;br /&gt;
&lt;br /&gt;
Most microcontrollers have &#039;&#039;&#039;internal pull-up/pull-down resistors&#039;&#039;&#039; (typically 10-50kΩ):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
# Enable internal pull-up&lt;br /&gt;
sensor_pull_up = Pin(10, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
# Enable internal pull-down&lt;br /&gt;
sensor_pull_down = Pin(11, Pin.IN, Pin.PULL_DOWN)&lt;br /&gt;
&lt;br /&gt;
# No pull resistor (floating - avoid this for digital inputs!)&lt;br /&gt;
sensor_floating = Pin(12, Pin.IN)  # BAD PRACTICE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use external pull-ups:&#039;&#039;&#039;&lt;br /&gt;
* I2C communication (typically 4.7kΩ or 10kΩ)&lt;br /&gt;
* Multiple devices sharing the same line&lt;br /&gt;
* When internal pull-up is too weak (long wires, high capacitance)&lt;br /&gt;
&lt;br /&gt;
=== Resistor Value Selection ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Typical values:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;10kΩ&#039;&#039;&#039; - General-purpose pull-up/pull-down&lt;br /&gt;
* &#039;&#039;&#039;4.7kΩ&#039;&#039;&#039; - I2C pull-ups (standard value)&lt;br /&gt;
* &#039;&#039;&#039;1kΩ&#039;&#039;&#039; - Strong pull-up for high-speed or long wires&lt;br /&gt;
* &#039;&#039;&#039;100kΩ&#039;&#039;&#039; - Weak pull-up to save power&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Trade-offs:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Lower resistance&#039;&#039;&#039; (1kΩ) - Stronger pull, faster signals, more power consumption&lt;br /&gt;
* &#039;&#039;&#039;Higher resistance&#039;&#039;&#039; (100kΩ) - Weaker pull, slower signals, less power consumption&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb:&#039;&#039;&#039; 10kΩ works for most applications. Use 4.7kΩ for I2C.&lt;br /&gt;
&lt;br /&gt;
== Part 3: I2C Communication ==&lt;br /&gt;
&lt;br /&gt;
=== What is I2C? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;I2C (Inter-Integrated Circuit)&#039;&#039;&#039; is a two-wire communication protocol:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SDA&#039;&#039;&#039; - Serial Data (bidirectional data line)&lt;br /&gt;
* &#039;&#039;&#039;SCL&#039;&#039;&#039; - Serial Clock (clock signal from master)&lt;br /&gt;
* &#039;&#039;&#039;Plus&#039;&#039;&#039; - Ground (GND) and power (VCC)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Characteristics:&#039;&#039;&#039;&lt;br /&gt;
* Multi-master, multi-slave (but typically one master)&lt;br /&gt;
* 7-bit or 10-bit device addresses&lt;br /&gt;
* Speeds: 100 kHz (standard), 400 kHz (fast), up to 3.4 MHz (high-speed)&lt;br /&gt;
* Open-drain design requires pull-up resistors&lt;br /&gt;
&lt;br /&gt;
=== I2C Device Addressing ===&lt;br /&gt;
&lt;br /&gt;
Each I2C device has a unique &#039;&#039;&#039;7-bit address&#039;&#039;&#039; (0x00 - 0x7F):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common sensor addresses:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;MPU6050 IMU&#039;&#039;&#039; - 0x68 (default) or 0x69 (alternate)&lt;br /&gt;
* &#039;&#039;&#039;VL53L0X distance sensor&#039;&#039;&#039; - 0x29&lt;br /&gt;
* &#039;&#039;&#039;BMP280 pressure sensor&#039;&#039;&#039; - 0x76 or 0x77&lt;br /&gt;
* &#039;&#039;&#039;OLED display (SSD1306)&#039;&#039;&#039; - 0x3C or 0x3D&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Address conflicts:&#039;&#039;&#039;&lt;br /&gt;
If two sensors have the same address, you cannot use them on the same I2C bus (unless they have configurable addresses via ADR pin).&lt;br /&gt;
&lt;br /&gt;
=== Wiring I2C Sensors ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Raspberry Pi Pico → MPU6050 IMU:&lt;br /&gt;
- GP0 (I2C0 SDA) → SDA&lt;br /&gt;
- GP1 (I2C0 SCL) → SCL&lt;br /&gt;
- 3.3V → VCC&lt;br /&gt;
- GND → GND&lt;br /&gt;
&lt;br /&gt;
Pull-up resistors (4.7kΩ):&lt;br /&gt;
- SDA to 3.3V&lt;br /&gt;
- SCL to 3.3V&lt;br /&gt;
&lt;br /&gt;
Note: Some breakout boards have built-in pull-ups&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039;&lt;br /&gt;
* Use I2C-capable pins (check your microcontroller pinout)&lt;br /&gt;
* Raspberry Pi Pico has two I2C buses: I2C0 (GP0/GP1, GP4/GP5, etc.) and I2C1 (GP2/GP3, GP6/GP7, etc.)&lt;br /&gt;
* Add pull-up resistors if not present on breakout board&lt;br /&gt;
&lt;br /&gt;
=== I2C Code Example: Scanning for Devices ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import I2C, Pin&lt;br /&gt;
&lt;br /&gt;
# Initialize I2C bus&lt;br /&gt;
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)&lt;br /&gt;
&lt;br /&gt;
# Scan for devices&lt;br /&gt;
devices = i2c.scan()&lt;br /&gt;
&lt;br /&gt;
if devices:&lt;br /&gt;
    print(f&amp;quot;Found {len(devices)} I2C device(s):&amp;quot;)&lt;br /&gt;
    for device in devices:&lt;br /&gt;
        print(f&amp;quot;  - Address: 0x{device:02X}&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;No I2C devices found&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Expected output (MPU6050 connected):&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Found 1 I2C device(s):&lt;br /&gt;
  - Address: 0x68&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I2C Code Example: Reading MPU6050 IMU ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import I2C, Pin&lt;br /&gt;
import time&lt;br /&gt;
import struct&lt;br /&gt;
&lt;br /&gt;
class MPU6050:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Simple MPU6050 IMU driver&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # I2C address&lt;br /&gt;
    ADDR = 0x68&lt;br /&gt;
&lt;br /&gt;
    # Register addresses&lt;br /&gt;
    PWR_MGMT_1 = 0x6B  # Power management&lt;br /&gt;
    ACCEL_XOUT_H = 0x3B  # Accelerometer data start&lt;br /&gt;
    GYRO_XOUT_H = 0x43   # Gyroscope data start&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, i2c):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Initialize MPU6050 on given I2C bus&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.i2c = i2c&lt;br /&gt;
&lt;br /&gt;
        # Wake up sensor (clear sleep bit)&lt;br /&gt;
        self.i2c.writeto_mem(self.ADDR, self.PWR_MGMT_1, b&#039;\x00&#039;)&lt;br /&gt;
        time.sleep_ms(100)&lt;br /&gt;
&lt;br /&gt;
    def read_accel(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Read accelerometer data (m/s²)&lt;br /&gt;
&lt;br /&gt;
        Returns:&lt;br /&gt;
            Tuple (x, y, z) in m/s²&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Read 6 bytes starting at ACCEL_XOUT_H&lt;br /&gt;
        data = self.i2c.readfrom_mem(self.ADDR, self.ACCEL_XOUT_H, 6)&lt;br /&gt;
&lt;br /&gt;
        # Unpack as three 16-bit signed integers (big-endian)&lt;br /&gt;
        ax, ay, az = struct.unpack(&#039;&amp;gt;hhh&#039;, data)&lt;br /&gt;
&lt;br /&gt;
        # Convert to m/s² (16384 LSB/g for default ±2g range)&lt;br /&gt;
        scale = 9.81 / 16384&lt;br /&gt;
        return (ax * scale, ay * scale, az * scale)&lt;br /&gt;
&lt;br /&gt;
    def read_gyro(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Read gyroscope data (deg/s)&lt;br /&gt;
&lt;br /&gt;
        Returns:&lt;br /&gt;
            Tuple (x, y, z) in deg/s&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Read 6 bytes starting at GYRO_XOUT_H&lt;br /&gt;
        data = self.i2c.readfrom_mem(self.ADDR, self.GYRO_XOUT_H, 6)&lt;br /&gt;
&lt;br /&gt;
        # Unpack as three 16-bit signed integers (big-endian)&lt;br /&gt;
        gx, gy, gz = struct.unpack(&#039;&amp;gt;hhh&#039;, data)&lt;br /&gt;
&lt;br /&gt;
        # Convert to deg/s (131 LSB/(deg/s) for default ±250 deg/s range)&lt;br /&gt;
        scale = 1 / 131&lt;br /&gt;
        return (gx * scale, gy * scale, gz * scale)&lt;br /&gt;
&lt;br /&gt;
# Initialize I2C and sensor&lt;br /&gt;
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)&lt;br /&gt;
imu = MPU6050(i2c)&lt;br /&gt;
&lt;br /&gt;
# Read sensor data&lt;br /&gt;
while True:&lt;br /&gt;
    accel = imu.read_accel()&lt;br /&gt;
    gyro = imu.read_gyro()&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Accel: X={accel[0]:6.2f} Y={accel[1]:6.2f} Z={accel[2]:6.2f} m/s²&amp;quot;)&lt;br /&gt;
    print(f&amp;quot;Gyro:  X={gyro[0]:6.2f} Y={gyro[1]:6.2f} Z={gyro[2]:6.2f} deg/s&amp;quot;)&lt;br /&gt;
    print()&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I2C Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;No devices found (empty scan):&#039;&#039;&#039;&lt;br /&gt;
* Check wiring (SDA, SCL, GND, VCC all connected)&lt;br /&gt;
* Verify power supply (3.3V or 5V depending on sensor)&lt;br /&gt;
* Check pull-up resistors (need 4.7kΩ on SDA and SCL)&lt;br /&gt;
* Try lower I2C frequency (100 kHz instead of 400 kHz)&lt;br /&gt;
* Verify I2C pins (use correct pins for your microcontroller)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OSError: [Errno 5] EIO (Input/Output Error):&#039;&#039;&#039;&lt;br /&gt;
* Wrong I2C address (use scan to find actual address)&lt;br /&gt;
* Sensor not responding (check power, try different sensor)&lt;br /&gt;
* Bus contention (multiple masters or short circuit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Intermittent readings:&#039;&#039;&#039;&lt;br /&gt;
* Weak pull-up resistors (use 4.7kΩ or 2.2kΩ)&lt;br /&gt;
* Long wires (keep I2C wires &amp;lt;1 meter, preferably &amp;lt;30cm)&lt;br /&gt;
* EMI interference (route I2C wires away from motors)&lt;br /&gt;
* Bad connections (check breadboard connections)&lt;br /&gt;
&lt;br /&gt;
== Part 4: Analog Sensors and ADC ==&lt;br /&gt;
&lt;br /&gt;
=== Voltage Dividers for Resistive Sensors ===&lt;br /&gt;
&lt;br /&gt;
Many sensors (photoresistors, thermistors, FSRs) are &#039;&#039;&#039;variable resistors&#039;&#039;&#039;. To read them, create a voltage divider:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    +3.3V&lt;br /&gt;
      |&lt;br /&gt;
     [R1]  ← Fixed resistor (e.g., 10kΩ)&lt;br /&gt;
      |&lt;br /&gt;
      +------- ADC Input (Vout)&lt;br /&gt;
      |&lt;br /&gt;
  [Photoresistor] ← Variable resistor&lt;br /&gt;
      |&lt;br /&gt;
     GND&lt;br /&gt;
&lt;br /&gt;
Vout = 3.3V × R_photo / (R1 + R_photo)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;How it works:&#039;&#039;&#039;&lt;br /&gt;
* Bright light → Photoresistor low resistance (~1kΩ) → Vout low&lt;br /&gt;
* Dark → Photoresistor high resistance (~100kΩ) → Vout high&lt;br /&gt;
&lt;br /&gt;
=== Reading Analog Sensors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: Photoresistor for optical encoders (SimpleBot)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import ADC, Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Configure ADC on GP26 (ADC0)&lt;br /&gt;
photoresistor = ADC(26)&lt;br /&gt;
&lt;br /&gt;
# Read continuously&lt;br /&gt;
while True:&lt;br /&gt;
    # Read 16-bit value (0-65535)&lt;br /&gt;
    raw = photoresistor.read_u16()&lt;br /&gt;
&lt;br /&gt;
    # Convert to voltage (3.3V reference)&lt;br /&gt;
    voltage = raw * 3.3 / 65535&lt;br /&gt;
&lt;br /&gt;
    # Convert to percentage (0-100%)&lt;br /&gt;
    percentage = raw / 655.35&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Raw: {raw:5d}  Voltage: {voltage:.2f}V  Brightness: {percentage:.1f}%&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC Reference Voltage ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reference voltage&#039;&#039;&#039; is the maximum voltage the ADC can read:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Raspberry Pi Pico&#039;&#039;&#039; - 3.3V reference (ADC input max 3.3V)&lt;br /&gt;
* &#039;&#039;&#039;ESP32&#039;&#039;&#039; - Configurable (0-3.3V typical, can be attenuated to read higher voltages)&lt;br /&gt;
* &#039;&#039;&#039;Arduino Uno&#039;&#039;&#039; - 5V reference (ADC input max 5V)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Critical warning:&#039;&#039;&#039; Exceeding ADC input voltage can damage your microcontroller!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Voltage divider for higher voltages:&#039;&#039;&#039;&lt;br /&gt;
To measure a 9V battery with a 3.3V ADC:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    +9V Battery&lt;br /&gt;
      |&lt;br /&gt;
     [20kΩ]  ← R1&lt;br /&gt;
      |&lt;br /&gt;
      +------- ADC Input (Vout = 3V when battery = 9V)&lt;br /&gt;
      |&lt;br /&gt;
     [10kΩ]  ← R2&lt;br /&gt;
      |&lt;br /&gt;
     GND&lt;br /&gt;
&lt;br /&gt;
Vout = Vin × R2 / (R1 + R2) = 9V × 10kΩ / 30kΩ = 3V&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Read battery voltage (9V nominal, divided by 3)&lt;br /&gt;
adc = ADC(26)&lt;br /&gt;
raw = adc.read_u16()&lt;br /&gt;
divided_voltage = raw * 3.3 / 65535&lt;br /&gt;
actual_voltage = divided_voltage * 3  # Multiply by divider ratio&lt;br /&gt;
print(f&amp;quot;Battery: {actual_voltage:.2f}V&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC Noise and Averaging ===&lt;br /&gt;
&lt;br /&gt;
ADC readings contain noise. &#039;&#039;&#039;Averaging&#039;&#039;&#039; multiple readings improves stability:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def read_adc_average(adc, samples=10):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Read ADC and return average of multiple samples&lt;br /&gt;
&lt;br /&gt;
    Args:&lt;br /&gt;
        adc: ADC object&lt;br /&gt;
        samples: Number of samples to average&lt;br /&gt;
&lt;br /&gt;
    Returns:&lt;br /&gt;
        Average ADC value (0-65535)&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    total = 0&lt;br /&gt;
    for _ in range(samples):&lt;br /&gt;
        total += adc.read_u16()&lt;br /&gt;
    return total // samples&lt;br /&gt;
&lt;br /&gt;
# Usage&lt;br /&gt;
adc = ADC(26)&lt;br /&gt;
averaged_value = read_adc_average(adc, samples=20)&lt;br /&gt;
print(f&amp;quot;Averaged ADC: {averaged_value}&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Optical Encoders (SimpleBot Example) ===&lt;br /&gt;
&lt;br /&gt;
SimpleBot uses &#039;&#039;&#039;optical encoders&#039;&#039;&#039; to measure wheel rotation:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Slotted wheel&#039;&#039;&#039; attached to motor shaft&lt;br /&gt;
* &#039;&#039;&#039;LED&#039;&#039;&#039; shines through slots&lt;br /&gt;
* &#039;&#039;&#039;Photoresistor&#039;&#039;&#039; detects light pulses&lt;br /&gt;
* &#039;&#039;&#039;Count pulses&#039;&#039;&#039; to measure distance&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import ADC&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Configure optical encoder on ADC0&lt;br /&gt;
encoder = ADC(26)&lt;br /&gt;
&lt;br /&gt;
# Threshold for detecting slot vs spoke&lt;br /&gt;
THRESHOLD = 30000  # Tune based on your setup&lt;br /&gt;
&lt;br /&gt;
# Track state&lt;br /&gt;
pulse_count = 0&lt;br /&gt;
prev_state = False&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    # Read sensor&lt;br /&gt;
    value = encoder.read_u16()&lt;br /&gt;
&lt;br /&gt;
    # Detect light (slot) or dark (spoke)&lt;br /&gt;
    current_state = (value &amp;gt; THRESHOLD)&lt;br /&gt;
&lt;br /&gt;
    # Count rising edges (transition from dark to light)&lt;br /&gt;
    if current_state and not prev_state:&lt;br /&gt;
        pulse_count += 1&lt;br /&gt;
        print(f&amp;quot;Pulse count: {pulse_count}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    prev_state = current_state&lt;br /&gt;
    time.sleep(0.01)  # Poll at 100 Hz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Better approach:&#039;&#039;&#039; Use interrupts for faster, more reliable pulse counting (see advanced section).&lt;br /&gt;
&lt;br /&gt;
== Part 5: SPI Communication ==&lt;br /&gt;
&lt;br /&gt;
=== What is SPI? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SPI (Serial Peripheral Interface)&#039;&#039;&#039; is a four-wire communication protocol:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;MOSI&#039;&#039;&#039; - Master Out, Slave In (data from controller to device)&lt;br /&gt;
* &#039;&#039;&#039;MISO&#039;&#039;&#039; - Master In, Slave Out (data from device to controller)&lt;br /&gt;
* &#039;&#039;&#039;SCK&#039;&#039;&#039; - Serial Clock (clock signal from master)&lt;br /&gt;
* &#039;&#039;&#039;CS&#039;&#039;&#039; - Chip Select (one per device, active LOW)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Characteristics:&#039;&#039;&#039;&lt;br /&gt;
* Full-duplex (simultaneous send and receive)&lt;br /&gt;
* High speed (MHz range, faster than I2C)&lt;br /&gt;
* No addressing (use CS pin to select device)&lt;br /&gt;
* Requires one CS pin per device&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common SPI devices:&#039;&#039;&#039;&lt;br /&gt;
* SD cards&lt;br /&gt;
* TFT displays&lt;br /&gt;
* LoRa radio modules&lt;br /&gt;
* Flash memory chips&lt;br /&gt;
* ADC/DAC chips&lt;br /&gt;
&lt;br /&gt;
=== Wiring SPI Devices ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Raspberry Pi Pico → SPI Device:&lt;br /&gt;
- GP18 (SPI0 SCK) → SCK&lt;br /&gt;
- GP19 (SPI0 MOSI) → MOSI&lt;br /&gt;
- GP16 (SPI0 MISO) → MISO&lt;br /&gt;
- GP17 (any GPIO) → CS&lt;br /&gt;
- 3.3V → VCC&lt;br /&gt;
- GND → GND&lt;br /&gt;
&lt;br /&gt;
Multiple devices:&lt;br /&gt;
- Share SCK, MOSI, MISO&lt;br /&gt;
- Each device gets unique CS pin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPI Code Example: Reading an ID Register ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import SPI, Pin&lt;br /&gt;
&lt;br /&gt;
# Initialize SPI bus&lt;br /&gt;
spi = SPI(0, baudrate=1000000, polarity=0, phase=0,&lt;br /&gt;
          sck=Pin(18), mosi=Pin(19), miso=Pin(16))&lt;br /&gt;
&lt;br /&gt;
# Chip select pin&lt;br /&gt;
cs = Pin(17, Pin.OUT)&lt;br /&gt;
cs.value(1)  # Deselect (CS is active LOW)&lt;br /&gt;
&lt;br /&gt;
def read_device_id(register_addr):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Read device ID register via SPI&lt;br /&gt;
&lt;br /&gt;
    Args:&lt;br /&gt;
        register_addr: Register address to read&lt;br /&gt;
&lt;br /&gt;
    Returns:&lt;br /&gt;
        Register value&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    cs.value(0)  # Select device&lt;br /&gt;
&lt;br /&gt;
    # Write register address&lt;br /&gt;
    spi.write(bytearray([register_addr]))&lt;br /&gt;
&lt;br /&gt;
    # Read response&lt;br /&gt;
    response = spi.read(1)&lt;br /&gt;
&lt;br /&gt;
    cs.value(1)  # Deselect device&lt;br /&gt;
&lt;br /&gt;
    return response[0]&lt;br /&gt;
&lt;br /&gt;
# Example: Read ID register at 0x0F (common for many sensors)&lt;br /&gt;
device_id = read_device_id(0x0F)&lt;br /&gt;
print(f&amp;quot;Device ID: 0x{device_id:02X}&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SPI vs I2C Comparison ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Feature !! I2C !! SPI&lt;br /&gt;
|-&lt;br /&gt;
| Wires || 2 (SDA, SCL) || 4 (MOSI, MISO, SCK, CS)&lt;br /&gt;
|-&lt;br /&gt;
| Speed || 100-400 kHz typical || 1-10 MHz typical&lt;br /&gt;
|-&lt;br /&gt;
| Addressing || 7-bit address || Chip Select pin&lt;br /&gt;
|-&lt;br /&gt;
| Multiple devices || Easy (shared bus) || Requires one CS pin per device&lt;br /&gt;
|-&lt;br /&gt;
| Complexity || Moderate || Simple hardware, more wiring&lt;br /&gt;
|-&lt;br /&gt;
| Power || Lower || Higher (faster switching)&lt;br /&gt;
|-&lt;br /&gt;
| Distance || &amp;lt;1m typical || &amp;lt;30cm typical&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use I2C:&#039;&#039;&#039;&lt;br /&gt;
* Multiple sensors with unique addresses&lt;br /&gt;
* Moderate data rates&lt;br /&gt;
* Fewer available GPIO pins&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use SPI:&#039;&#039;&#039;&lt;br /&gt;
* High-speed data (displays, SD cards)&lt;br /&gt;
* Full-duplex communication needed&lt;br /&gt;
* Plenty of GPIO pins available&lt;br /&gt;
&lt;br /&gt;
== Part 6: Debugging Sensor Communication ==&lt;br /&gt;
&lt;br /&gt;
=== Logic Analyzer ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;logic analyzer&#039;&#039;&#039; captures and displays digital signals:&lt;br /&gt;
&lt;br /&gt;
* Shows timing of SDA, SCL, MOSI, MISO, etc.&lt;br /&gt;
* Decodes I2C, SPI, UART protocols automatically&lt;br /&gt;
* Essential for debugging communication issues&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Affordable options:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Saleae Logic clone&#039;&#039;&#039; ($10-20) - 8 channels, USB&lt;br /&gt;
* &#039;&#039;&#039;DSLogic Plus&#039;&#039;&#039; ($100) - 16 channels, high speed&lt;br /&gt;
* &#039;&#039;&#039;Oscilloscope with protocol decode&#039;&#039;&#039; ($200+) - Shows analog waveforms too&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;How to use:&#039;&#039;&#039;&lt;br /&gt;
1. Connect logic analyzer probes to I2C/SPI lines (SDA, SCL, etc.)&lt;br /&gt;
2. Connect ground to circuit ground&lt;br /&gt;
3. Capture communication sequence&lt;br /&gt;
4. Analyze timing, decode data, identify errors&lt;br /&gt;
&lt;br /&gt;
=== I2C Debugging Checklist ===&lt;br /&gt;
&lt;br /&gt;
If I2C communication fails:&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Scan for devices&#039;&#039;&#039; - Does `i2c.scan()` find your sensor?&lt;br /&gt;
2. &#039;&#039;&#039;Check address&#039;&#039;&#039; - Is device address correct? (Some have alternate addresses)&lt;br /&gt;
3. &#039;&#039;&#039;Verify wiring&#039;&#039;&#039; - SDA, SCL, GND, VCC all connected?&lt;br /&gt;
4. &#039;&#039;&#039;Pull-up resistors&#039;&#039;&#039; - 4.7kΩ on SDA and SCL?&lt;br /&gt;
5. &#039;&#039;&#039;Power supply&#039;&#039;&#039; - Is sensor getting correct voltage (3.3V or 5V)?&lt;br /&gt;
6. &#039;&#039;&#039;Clock speed&#039;&#039;&#039; - Try lower frequency (100 kHz instead of 400 kHz)&lt;br /&gt;
7. &#039;&#039;&#039;Multiple masters&#039;&#039;&#039; - Only one device should control I2C bus&lt;br /&gt;
8. &#039;&#039;&#039;Cable length&#039;&#039;&#039; - Keep I2C wires short (&amp;lt;30cm preferred)&lt;br /&gt;
&lt;br /&gt;
=== Common Sensor Problems ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sensor returns garbage data:&#039;&#039;&#039;&lt;br /&gt;
* Incorrect data format (check datasheet for byte order, signed/unsigned)&lt;br /&gt;
* Wrong register address&lt;br /&gt;
* Sensor needs initialization sequence&lt;br /&gt;
* Data needs calibration or offset correction&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sensor works then stops:&#039;&#039;&#039;&lt;br /&gt;
* Power supply voltage sag (motors drawing too much current)&lt;br /&gt;
* Loose connection (check breadboard contacts)&lt;br /&gt;
* Thermal shutdown (sensor overheating)&lt;br /&gt;
* EMI from motors (add capacitors, shield wires)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Readings are noisy or fluctuate:&#039;&#039;&#039;&lt;br /&gt;
* ADC noise (use averaging, add filter capacitor)&lt;br /&gt;
* EMI from motors (route sensor wires away from motor wires)&lt;br /&gt;
* Poor ground connection (ensure solid GND)&lt;br /&gt;
* Floating inputs (add pull-up/pull-down resistors)&lt;br /&gt;
&lt;br /&gt;
=== Multimeter Debugging ===&lt;br /&gt;
&lt;br /&gt;
Use a multimeter to check:&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Power supply&#039;&#039;&#039; - Measure voltage at sensor VCC pin (should be 3.3V or 5V)&lt;br /&gt;
2. &#039;&#039;&#039;Ground continuity&#039;&#039;&#039; - Check continuity between sensor GND and microcontroller GND&lt;br /&gt;
3. &#039;&#039;&#039;Signal levels&#039;&#039;&#039; - Measure SDA/SCL when idle (should be pulled up to 3.3V/5V)&lt;br /&gt;
4. &#039;&#039;&#039;Analog sensor output&#039;&#039;&#039; - Measure voltage at ADC pin (should vary with sensor input)&lt;br /&gt;
&lt;br /&gt;
== Part 7: Advanced Sensor Techniques ==&lt;br /&gt;
&lt;br /&gt;
=== Interrupts for Fast Sensors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Polling&#039;&#039;&#039; (checking sensor in loop) is slow and wastes CPU time. &#039;&#039;&#039;Interrupts&#039;&#039;&#039; trigger code immediately when signal changes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
# Global counter&lt;br /&gt;
pulse_count = 0&lt;br /&gt;
&lt;br /&gt;
def encoder_interrupt(pin):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Called when encoder signal changes&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    global pulse_count&lt;br /&gt;
    pulse_count += 1&lt;br /&gt;
&lt;br /&gt;
# Configure encoder pin with interrupt&lt;br /&gt;
encoder_pin = Pin(10, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
encoder_pin.irq(trigger=Pin.IRQ_RISING, handler=encoder_interrupt)&lt;br /&gt;
&lt;br /&gt;
# Main loop can do other things&lt;br /&gt;
while True:&lt;br /&gt;
    print(f&amp;quot;Pulses: {pulse_count}&amp;quot;)&lt;br /&gt;
    time.sleep(1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use interrupts:&#039;&#039;&#039;&lt;br /&gt;
* High-speed encoders (&amp;gt;100 Hz)&lt;br /&gt;
* Critical timing (missing a pulse matters)&lt;br /&gt;
* Freeing CPU for other tasks&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When NOT to use interrupts:&#039;&#039;&#039;&lt;br /&gt;
* Slow sensors (&amp;lt;10 Hz) - polling is simpler&lt;br /&gt;
* Complex processing needed - interrupts should be fast&lt;br /&gt;
* Debugging (harder to troubleshoot)&lt;br /&gt;
&lt;br /&gt;
=== Kalman Filters for Sensor Fusion ===&lt;br /&gt;
&lt;br /&gt;
Combine multiple sensors for better accuracy:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;IMU + Encoders&#039;&#039;&#039; - Accurate position and orientation&lt;br /&gt;
* &#039;&#039;&#039;Camera + Distance sensor&#039;&#039;&#039; - 3D object localization&lt;br /&gt;
* &#039;&#039;&#039;GPS + IMU&#039;&#039;&#039; - Precise outdoor navigation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Kalman filter&#039;&#039;&#039; is an algorithm that optimally combines sensor data, accounting for noise and uncertainty. This is an advanced topic beyond this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Low-Pass Filters for Noisy Sensors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Low-pass filter&#039;&#039;&#039; smooths noisy analog readings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class LowPassFilter:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Simple exponential moving average low-pass filter&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, alpha=0.1):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Initialize filter&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            alpha: Smoothing factor (0-1). Lower = smoother but slower.&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.alpha = alpha&lt;br /&gt;
        self.value = None&lt;br /&gt;
&lt;br /&gt;
    def update(self, new_value):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Update filter with new reading&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            new_value: Latest sensor reading&lt;br /&gt;
&lt;br /&gt;
        Returns:&lt;br /&gt;
            Filtered value&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        if self.value is None:&lt;br /&gt;
            self.value = new_value&lt;br /&gt;
        else:&lt;br /&gt;
            self.value = self.alpha * new_value + (1 - self.alpha) * self.value&lt;br /&gt;
        return self.value&lt;br /&gt;
&lt;br /&gt;
# Usage&lt;br /&gt;
filter = LowPassFilter(alpha=0.2)&lt;br /&gt;
adc = ADC(26)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    raw = adc.read_u16()&lt;br /&gt;
    filtered = filter.update(raw)&lt;br /&gt;
    print(f&amp;quot;Raw: {raw:5d}  Filtered: {filtered:5.0f}&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpha parameter:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;alpha = 1.0&#039;&#039;&#039; - No filtering (output = input)&lt;br /&gt;
* &#039;&#039;&#039;alpha = 0.5&#039;&#039;&#039; - Moderate filtering&lt;br /&gt;
* &#039;&#039;&#039;alpha = 0.1&#039;&#039;&#039; - Heavy filtering (smooth but slow response)&lt;br /&gt;
&lt;br /&gt;
=== Sensor Calibration ===&lt;br /&gt;
&lt;br /&gt;
Many sensors need calibration to convert raw values to real-world units:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: Calibrating a line sensor threshold&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Configure sensor&lt;br /&gt;
sensor = Pin(10, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
# Calibration procedure&lt;br /&gt;
print(&amp;quot;Calibration: Place sensor on WHITE surface&amp;quot;)&lt;br /&gt;
time.sleep(3)&lt;br /&gt;
white_count = 0&lt;br /&gt;
for _ in range(100):&lt;br /&gt;
    if sensor.value():&lt;br /&gt;
        white_count += 1&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
white_confidence = white_count / 100&lt;br /&gt;
&lt;br /&gt;
print(f&amp;quot;White confidence: {white_confidence:.2f}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Calibration: Place sensor on BLACK surface&amp;quot;)&lt;br /&gt;
time.sleep(3)&lt;br /&gt;
black_count = 0&lt;br /&gt;
for _ in range(100):&lt;br /&gt;
    if not sensor.value():&lt;br /&gt;
        black_count += 1&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
black_confidence = black_count / 100&lt;br /&gt;
&lt;br /&gt;
print(f&amp;quot;Black confidence: {black_confidence:.2f}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Use calibrated thresholds&lt;br /&gt;
if white_confidence &amp;gt; 0.8 and black_confidence &amp;gt; 0.8:&lt;br /&gt;
    print(&amp;quot;Calibration successful!&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Calibration failed - adjust potentiometer&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 8: Practical Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Explain the difference between digital and analog sensors&lt;br /&gt;
* ☐ Configure pull-up/pull-down resistors for digital inputs&lt;br /&gt;
* ☐ Understand active HIGH vs active LOW logic&lt;br /&gt;
* ☐ Wire and read an I2C sensor (IMU, distance sensor)&lt;br /&gt;
* ☐ Scan for I2C devices and identify addresses&lt;br /&gt;
* ☐ Read analog sensors using ADC&lt;br /&gt;
* ☐ Create voltage dividers for resistive sensors&lt;br /&gt;
* ☐ Understand SPI communication basics&lt;br /&gt;
* ☐ Debug sensor communication issues with multimeter&lt;br /&gt;
* ☐ Implement averaging and filtering for noisy sensors&lt;br /&gt;
* ☐ Use interrupts for fast sensors (encoders)&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready to add sensors to your robots!&lt;br /&gt;
&lt;br /&gt;
== Part 9: Sensor Selection Guide ==&lt;br /&gt;
&lt;br /&gt;
=== Choosing the Right Sensor ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sensor Type !! Use Case !! Interface !! Cost !! Complexity&lt;br /&gt;
|-&lt;br /&gt;
| IR Line Detector || Line following || Digital || $0.50 || Beginner&lt;br /&gt;
|-&lt;br /&gt;
| Ultrasonic (HC-SR04) || Obstacle avoidance || Digital (trigger/echo) || $1-2 || Beginner&lt;br /&gt;
|-&lt;br /&gt;
| MPU6050 IMU || Tilt, acceleration, rotation || I2C || $2-5 || Intermediate&lt;br /&gt;
|-&lt;br /&gt;
| VL53L0X Distance || Precise distance (2m) || I2C || $3-8 || Intermediate&lt;br /&gt;
|-&lt;br /&gt;
| Optical Encoder || Wheel rotation, odometry || Analog or Digital || $1-3 || Intermediate&lt;br /&gt;
|-&lt;br /&gt;
| Camera (OV7670) || Vision, object detection || Complex (parallel/SPI) || $5-15 || Advanced&lt;br /&gt;
|-&lt;br /&gt;
| LIDAR (RPLidar) || 360° mapping || UART || $100+ || Advanced&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sensor Interface Summary ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Digital (GPIO)&#039;&#039;&#039; - Simplest, on/off sensors&lt;br /&gt;
* &#039;&#039;&#039;Analog (ADC)&#039;&#039;&#039; - Variable sensors, requires voltage divider for resistive sensors&lt;br /&gt;
* &#039;&#039;&#039;I2C&#039;&#039;&#039; - Most common for IMU, distance, environmental sensors&lt;br /&gt;
* &#039;&#039;&#039;SPI&#039;&#039;&#039; - High-speed displays, SD cards, some sensors&lt;br /&gt;
* &#039;&#039;&#039;UART&#039;&#039;&#039; - GPS modules, some distance sensors&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Servo motors, some ultrasonic sensors (output)&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Add Sensors to Your Robot ===&lt;br /&gt;
* [[Capability:IMU Sensing]] - Add MPU6050 for tilt and rotation detection&lt;br /&gt;
* [[Capability:Time-of-Flight Sensing]] - Add VL53L0X for obstacle detection&lt;br /&gt;
* [[Capability:Encoder Sensing]] - Add quadrature encoders for precise odometry&lt;br /&gt;
* [[Capability:Ultrasonic Sensing]] - Add HC-SR04 for distance measurement&lt;br /&gt;
&lt;br /&gt;
=== Build Advanced Projects ===&lt;br /&gt;
* [[SimpleBot]] - Build a robot that uses multiple sensor types&lt;br /&gt;
* [[Activity:Maze Solving]] - Use distance sensors to navigate mazes&lt;br /&gt;
* Create a self-balancing robot using IMU feedback&lt;br /&gt;
&lt;br /&gt;
=== Learn More Electronics ===&lt;br /&gt;
* [[Motor Control Basics]] - Control actuators based on sensor feedback&lt;br /&gt;
* [[Electronics]] - Full electronics competency overview&lt;br /&gt;
* [[MicroPython Programming]] - Advanced sensor data processing&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes and Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Missing pull-up resistors&#039;&#039;&#039; - I2C won&#039;t work without pull-ups on SDA/SCL&lt;br /&gt;
* &#039;&#039;&#039;Floating inputs&#039;&#039;&#039; - Digital inputs without pull-up/pull-down give random readings&lt;br /&gt;
* &#039;&#039;&#039;Wrong voltage&#039;&#039;&#039; - Exceeding ADC input voltage (3.3V on Pico) damages microcontroller&lt;br /&gt;
* &#039;&#039;&#039;Incorrect I2C address&#039;&#039;&#039; - Check datasheet, some sensors have alternate addresses&lt;br /&gt;
* &#039;&#039;&#039;Mixed logic levels&#039;&#039;&#039; - 5V sensor output can damage 3.3V microcontroller (use level shifter)&lt;br /&gt;
* &#039;&#039;&#039;Long I2C wires&#039;&#039;&#039; - Keep I2C wires short (&amp;lt;30cm) to avoid communication errors&lt;br /&gt;
* &#039;&#039;&#039;No common ground&#039;&#039;&#039; - Sensor GND must connect to microcontroller GND&lt;br /&gt;
* &#039;&#039;&#039;Polling too slowly&#039;&#039;&#039; - Fast sensors (encoders) may miss pulses if polling is too slow&lt;br /&gt;
&lt;br /&gt;
== Resources and Further Reading ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Wiki Pages ===&lt;br /&gt;
* [[Electronics Fundamentals]] - Prerequisite tutorial&lt;br /&gt;
* [[Motor Control Basics]] - Combine sensors with motors&lt;br /&gt;
* [[Capability:IMU Sensing]] - MPU6050 usage in robots&lt;br /&gt;
* [[Capability:Optical Odometry]] - Encoder implementation&lt;br /&gt;
* [[Infrared Line Detector]] - Line sensor details&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/i2c SparkFun I2C Tutorial]&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/analog-to-digital-conversion SparkFun ADC Tutorial]&lt;br /&gt;
* [https://learn.adafruit.com/working-with-i2c-devices Adafruit I2C Guide]&lt;br /&gt;
* [https://www.nxp.com/docs/en/user-guide/UM10204.pdf I2C Specification] (PDF, official)&lt;br /&gt;
&lt;br /&gt;
=== Datasheets ===&lt;br /&gt;
Reading datasheets is essential for sensor interfacing:&lt;br /&gt;
* Sensor address and register map&lt;br /&gt;
* Timing requirements&lt;br /&gt;
* Power supply specifications&lt;br /&gt;
* Communication protocol details&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Electronics Fundamentals]] - Prerequisite tutorial&lt;br /&gt;
* [[Motor Control Basics]] - Actuator control&lt;br /&gt;
* [[MicroPython Programming]] - Advanced sensor programming&lt;br /&gt;
* [[Electronics]] - Full electronics competency overview&lt;br /&gt;
* [[Capabilities]] - Hardware abilities unlocked by sensors&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Electronics]]&lt;br /&gt;
[[Category:Intermediate]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Motor_Control_Basics&amp;diff=87</id>
		<title>Motor Control Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Motor_Control_Basics&amp;diff=87"/>
		<updated>2025-10-11T20:16:34Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Motor Control Basics |competency=Electronics |difficulty=Intermediate |time=3-5 hours |prerequisites=Electronics Fundamentals, basic understanding of digital signals and PWM |materials=Breadboard, DC motor, motor driver module (TB6612FNG or L298N), microcontroller (Raspberry Pi Pico or Arduino), power supply (6-9V), jumper wires, multimeter |next_steps=SimpleBot assembly, build Capability:Differential Drive, Sensor Interfacing }}  &amp;#039;&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Motor Control Basics&lt;br /&gt;
|competency=[[Electronics]]&lt;br /&gt;
|difficulty=Intermediate&lt;br /&gt;
|time=3-5 hours&lt;br /&gt;
|prerequisites=[[Electronics Fundamentals]], basic understanding of digital signals and PWM&lt;br /&gt;
|materials=Breadboard, DC motor, motor driver module (TB6612FNG or L298N), microcontroller (Raspberry Pi Pico or Arduino), power supply (6-9V), jumper wires, multimeter&lt;br /&gt;
|next_steps=[[SimpleBot]] assembly, build [[Capability:Differential Drive]], [[Sensor Interfacing]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor Control Basics&#039;&#039;&#039; teaches you how to control DC motors in robotics applications. You&#039;ll learn about H-bridges, PWM speed control, motor driver ICs, and differential drive systems. By the end of this tutorial, you&#039;ll understand how SimpleBot controls its motors and be able to implement motor control in your own robots.&lt;br /&gt;
&lt;br /&gt;
This tutorial builds on [[Electronics Fundamentals]] - you should understand voltage, current, PWM, and digital signals before proceeding.&lt;br /&gt;
&lt;br /&gt;
== Why Motor Control Matters ==&lt;br /&gt;
&lt;br /&gt;
Motors are the primary actuators in mobile robotics. Understanding motor control is essential for:&lt;br /&gt;
* &#039;&#039;&#039;Speed control&#039;&#039;&#039; - Make your robot go faster or slower&lt;br /&gt;
* &#039;&#039;&#039;Direction control&#039;&#039;&#039; - Forward, reverse, turning&lt;br /&gt;
* &#039;&#039;&#039;Precise motion&#039;&#039;&#039; - Differential drive, straight-line driving, rotation in place&lt;br /&gt;
* &#039;&#039;&#039;Energy efficiency&#039;&#039;&#039; - Maximize battery life with proper motor control&lt;br /&gt;
* &#039;&#039;&#039;Protection&#039;&#039;&#039; - Prevent damage to motors and electronics&lt;br /&gt;
&lt;br /&gt;
Without proper motor control knowledge, you risk burning out motors, draining batteries rapidly, or damaging your microcontroller.&lt;br /&gt;
&lt;br /&gt;
== Part 1: DC Motor Fundamentals ==&lt;br /&gt;
&lt;br /&gt;
=== How DC Motors Work ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;DC (Direct Current) motor&#039;&#039;&#039; converts electrical energy into rotational motion:&lt;br /&gt;
&lt;br /&gt;
* Apply voltage across motor terminals → motor spins&lt;br /&gt;
* Higher voltage = faster speed (generally)&lt;br /&gt;
* Reverse polarity → motor spins in opposite direction&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key characteristics:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;No-load speed&#039;&#039;&#039; - Maximum RPM when nothing is attached to the shaft&lt;br /&gt;
* &#039;&#039;&#039;Stall current&#039;&#039;&#039; - Current drawn when motor is blocked (highest current)&lt;br /&gt;
* &#039;&#039;&#039;Operating voltage&#039;&#039;&#039; - Typical range (e.g., 3V-6V for hobby motors)&lt;br /&gt;
* &#039;&#039;&#039;Rated current&#039;&#039;&#039; - Typical current during normal operation&lt;br /&gt;
* &#039;&#039;&#039;Torque&#039;&#039;&#039; - Rotational force the motor can produce&lt;br /&gt;
&lt;br /&gt;
=== Current Draw and Power ===&lt;br /&gt;
&lt;br /&gt;
Motors draw &#039;&#039;&#039;variable current&#039;&#039;&#039; depending on load:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;No load&#039;&#039;&#039; - Minimum current (50-100mA typical for small motors)&lt;br /&gt;
* &#039;&#039;&#039;Normal operation&#039;&#039;&#039; - Moderate current (200-500mA typical)&lt;br /&gt;
* &#039;&#039;&#039;Stall&#039;&#039;&#039; (blocked shaft) - Maximum current (1-3A typical)&lt;br /&gt;
* &#039;&#039;&#039;Startup&#039;&#039;&#039; - Brief high current spike when starting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: SimpleBot TT Motor&#039;&#039;&#039;&lt;br /&gt;
* No-load current: ~60mA at 6V&lt;br /&gt;
* Normal operation: ~200mA at 6V&lt;br /&gt;
* Stall current: ~1.5A at 6V&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters:&#039;&#039;&#039;&lt;br /&gt;
* You cannot power motors directly from microcontroller GPIO pins (typically limited to 10-20mA)&lt;br /&gt;
* Motors need dedicated power supply (not the 3.3V regulator powering your microcontroller)&lt;br /&gt;
* Motor drivers must handle stall current without overheating&lt;br /&gt;
&lt;br /&gt;
=== Back-EMF (Electromotive Force) ===&lt;br /&gt;
&lt;br /&gt;
When a motor spins, it acts as a generator and produces voltage in the opposite direction:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Back-EMF&#039;&#039;&#039; increases with motor speed&lt;br /&gt;
* Can damage circuits when motor suddenly stops or reverses&lt;br /&gt;
* &#039;&#039;&#039;Protection required&#039;&#039;&#039;: Diodes (flyback diodes) or motor driver ICs with built-in protection&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What happens without protection:&#039;&#039;&#039;&lt;br /&gt;
# Motor spinning at full speed&lt;br /&gt;
# You cut power to motor&lt;br /&gt;
# Motor&#039;s inertia keeps it spinning briefly&lt;br /&gt;
# Motor generates voltage spike (back-EMF)&lt;br /&gt;
# Voltage spike can damage transistors, microcontrollers, or other components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution:&#039;&#039;&#039; Use motor driver ICs (like TB6612FNG) with built-in protection, or add flyback diodes across motor terminals.&lt;br /&gt;
&lt;br /&gt;
== Part 2: H-Bridge Motor Drivers ==&lt;br /&gt;
&lt;br /&gt;
=== What is an H-Bridge? ===&lt;br /&gt;
&lt;br /&gt;
An &#039;&#039;&#039;H-bridge&#039;&#039;&#039; is a circuit that allows you to control motor direction by switching the polarity of voltage across the motor:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        +V&lt;br /&gt;
         |&lt;br /&gt;
    [SW1] [SW2]&lt;br /&gt;
         |     |&lt;br /&gt;
         +--M--+  (Motor)&lt;br /&gt;
         |     |&lt;br /&gt;
    [SW3] [SW4]&lt;br /&gt;
         |&lt;br /&gt;
        GND&lt;br /&gt;
&lt;br /&gt;
Legend: SW = Switch, M = Motor, +V = Battery positive&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The circuit forms an &amp;quot;H&amp;quot; shape - hence the name.&lt;br /&gt;
&lt;br /&gt;
=== H-Bridge Operation ===&lt;br /&gt;
&lt;br /&gt;
By controlling four switches (typically transistors), you can control motor direction:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! SW1 !! SW2 !! SW3 !! SW4 !! Motor Action&lt;br /&gt;
|-&lt;br /&gt;
| OFF || ON || ON || OFF || Forward (current flows left-to-right)&lt;br /&gt;
|-&lt;br /&gt;
| ON || OFF || OFF || ON || Reverse (current flows right-to-left)&lt;br /&gt;
|-&lt;br /&gt;
| OFF || OFF || OFF || OFF || Coast (motor freewheels)&lt;br /&gt;
|-&lt;br /&gt;
| OFF || ON || OFF || ON || Brake (both terminals connected to +V)&lt;br /&gt;
|-&lt;br /&gt;
| ON || OFF || ON || OFF || Brake (both terminals connected to GND)&lt;br /&gt;
|-&lt;br /&gt;
| ON || ON || OFF || OFF || SHORT CIRCUIT! Never do this!&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Critical rule:&#039;&#039;&#039; Never turn on SW1 and SW3 at the same time, or SW2 and SW4 at the same time - this creates a short circuit from +V to GND!&lt;br /&gt;
&lt;br /&gt;
=== Building an H-Bridge (Educational - Not Recommended) ===&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;could&#039;&#039;&#039; build an H-bridge using discrete transistors (4× MOSFETs), but:&lt;br /&gt;
&lt;br /&gt;
* Requires careful gate driver design&lt;br /&gt;
* No built-in protection&lt;br /&gt;
* Easy to make mistakes that destroy components&lt;br /&gt;
* Takes up significant board space&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Better approach:&#039;&#039;&#039; Use integrated H-bridge driver ICs like the TB6612FNG, L298N, or DRV8833. These have built-in protection, current limiting, and thermal shutdown.&lt;br /&gt;
&lt;br /&gt;
== Part 3: PWM Speed Control ==&lt;br /&gt;
&lt;br /&gt;
=== How PWM Controls Motor Speed ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PWM (Pulse Width Modulation)&#039;&#039;&#039; controls motor speed by rapidly switching power on and off:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;100% duty cycle&#039;&#039;&#039; - Always ON → full speed&lt;br /&gt;
* &#039;&#039;&#039;50% duty cycle&#039;&#039;&#039; - ON half the time → ~half speed&lt;br /&gt;
* &#039;&#039;&#039;25% duty cycle&#039;&#039;&#039; - ON quarter of the time → ~quarter speed&lt;br /&gt;
* &#039;&#039;&#039;0% duty cycle&#039;&#039;&#039; - Always OFF → motor stopped&lt;br /&gt;
&lt;br /&gt;
The motor&#039;s inertia smooths out the pulses, resulting in variable speed.&lt;br /&gt;
&lt;br /&gt;
=== PWM Frequency Selection ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Typical PWM frequencies for motor control:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;1 kHz - 20 kHz&#039;&#039;&#039; - Most common range&lt;br /&gt;
* &#039;&#039;&#039;Too low&#039;&#039;&#039; (&amp;lt;100 Hz) - Motor produces audible whine, rough motion&lt;br /&gt;
* &#039;&#039;&#039;Too high&#039;&#039;&#039; (&amp;gt;50 kHz) - Switching losses in driver increase, less efficient&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot uses 1 kHz PWM&#039;&#039;&#039; - good balance between smoothness and efficiency.&lt;br /&gt;
&lt;br /&gt;
=== PWM and Direction Control Combined ===&lt;br /&gt;
&lt;br /&gt;
To control both speed and direction:&lt;br /&gt;
&lt;br /&gt;
# Set direction using H-bridge control pins (IN1, IN2)&lt;br /&gt;
# Apply PWM signal to enable/PWM pin&lt;br /&gt;
# Result: Motor spins at variable speed in chosen direction&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: TB6612FNG control&#039;&#039;&#039;&lt;br /&gt;
* Set AIN1=LOW, AIN2=HIGH → Forward direction&lt;br /&gt;
* Apply PWM to PWMA pin → Variable speed forward&lt;br /&gt;
* Change to AIN1=HIGH, AIN2=LOW → Reverse direction&lt;br /&gt;
&lt;br /&gt;
=== Non-Linear Speed Response ===&lt;br /&gt;
&lt;br /&gt;
Motor speed is &#039;&#039;&#039;not&#039;&#039;&#039; linearly proportional to PWM duty cycle:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Below ~20% duty cycle&#039;&#039;&#039; - Motor may not turn at all (not enough torque to overcome friction)&lt;br /&gt;
* &#039;&#039;&#039;20-80% duty cycle&#039;&#039;&#039; - Approximately linear speed response&lt;br /&gt;
* &#039;&#039;&#039;80-100% duty cycle&#039;&#039;&#039; - Speed approaches maximum, less sensitivity to changes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Practical implication:&#039;&#039;&#039; You may need to calibrate motor control in software:&lt;br /&gt;
* Dead zone compensation (start at 25% instead of 0%)&lt;br /&gt;
* Speed mapping function (non-linear duty cycle to achieve linear speed)&lt;br /&gt;
* Different motors may need different calibration&lt;br /&gt;
&lt;br /&gt;
== Part 4: Motor Driver ICs ==&lt;br /&gt;
&lt;br /&gt;
=== The TB6612FNG Motor Driver ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;TB6612FNG&#039;&#039;&#039; is SimpleBot&#039;s motor driver. It&#039;s a dual H-bridge driver that can control two DC motors independently.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key specifications:&#039;&#039;&#039;&lt;br /&gt;
* Motor voltage: 4.5V - 13.5V&lt;br /&gt;
* Logic voltage: 2.7V - 5.5V (3.3V compatible!)&lt;br /&gt;
* Continuous current: 1.2A per channel&lt;br /&gt;
* Peak current: 3.2A per channel&lt;br /&gt;
* Low voltage drop: ~0.3V (very efficient)&lt;br /&gt;
* Built-in protection: Thermal shutdown, low-voltage detection&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Control pins per motor:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Speed control (PWM signal)&lt;br /&gt;
* &#039;&#039;&#039;IN1&#039;&#039;&#039; - Direction control bit 1&lt;br /&gt;
* &#039;&#039;&#039;IN2&#039;&#039;&#039; - Direction control bit 2&lt;br /&gt;
* &#039;&#039;&#039;STBY&#039;&#039;&#039; - Standby (must be HIGH to enable driver)&lt;br /&gt;
&lt;br /&gt;
=== TB6612FNG Truth Table ===&lt;br /&gt;
&lt;br /&gt;
For each motor (A or B):&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! IN1 !! IN2 !! PWM !! Motor Output&lt;br /&gt;
|-&lt;br /&gt;
| LOW || HIGH || PWM || Forward (CCW)&lt;br /&gt;
|-&lt;br /&gt;
| HIGH || LOW || PWM || Reverse (CW)&lt;br /&gt;
|-&lt;br /&gt;
| LOW || LOW || any || Coast (freewheeling)&lt;br /&gt;
|-&lt;br /&gt;
| HIGH || HIGH || any || Brake (short brake)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Brake vs Coast:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Brake&#039;&#039;&#039; (IN1=HIGH, IN2=HIGH) - Motor terminals shorted together, motor stops quickly&lt;br /&gt;
* &#039;&#039;&#039;Coast&#039;&#039;&#039; (IN1=LOW, IN2=LOW) - Motor terminals disconnected, motor coasts to a stop&lt;br /&gt;
&lt;br /&gt;
=== Wiring the TB6612FNG ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Raspberry Pi Pico → TB6612FNG:&lt;br /&gt;
- GP14 → AIN1  (Motor A direction bit 1)&lt;br /&gt;
- GP15 → AIN2  (Motor A direction bit 2)&lt;br /&gt;
- GP16 → PWMA  (Motor A speed - PWM capable pin)&lt;br /&gt;
- GP17 → BIN1  (Motor B direction bit 1)&lt;br /&gt;
- GP18 → BIN2  (Motor B direction bit 2)&lt;br /&gt;
- GP19 → PWMB  (Motor B speed - PWM capable pin)&lt;br /&gt;
- GP20 → STBY  (Standby - enable driver)&lt;br /&gt;
- GND → GND    (Logic ground)&lt;br /&gt;
&lt;br /&gt;
Power Supply:&lt;br /&gt;
- 6V Battery (+) → VM    (Motor power)&lt;br /&gt;
- 3.3V → VCC             (Logic power from Pico)&lt;br /&gt;
- GND → GND (Power)      (Shared ground)&lt;br /&gt;
&lt;br /&gt;
Motors:&lt;br /&gt;
- Left Motor → AO1, AO2&lt;br /&gt;
- Right Motor → BO1, BO2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; Logic ground (from Pico) and power ground (from battery) must be connected together!&lt;br /&gt;
&lt;br /&gt;
=== Code Example: TB6612FNG Control (MicroPython) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin, PWM&lt;br /&gt;
&lt;br /&gt;
class Motor:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Control a single motor on TB6612FNG&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, pwm_pin, in1_pin, in2_pin, freq=1000):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Initialize motor control pins&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            pwm_pin: GPIO pin number for PWM control&lt;br /&gt;
            in1_pin: GPIO pin number for direction bit 1&lt;br /&gt;
            in2_pin: GPIO pin number for direction bit 2&lt;br /&gt;
            freq: PWM frequency in Hz (default 1000)&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.pwm = PWM(Pin(pwm_pin))&lt;br /&gt;
        self.pwm.freq(freq)&lt;br /&gt;
        self.in1 = Pin(in1_pin, Pin.OUT)&lt;br /&gt;
        self.in2 = Pin(in2_pin, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
    def forward(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive motor forward at specified speed&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            speed: 0-65535 (0 = stopped, 65535 = full speed)&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.value(0)&lt;br /&gt;
        self.in2.value(1)&lt;br /&gt;
        self.pwm.duty_u16(speed)&lt;br /&gt;
&lt;br /&gt;
    def reverse(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive motor reverse at specified speed&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            speed: 0-65535 (0 = stopped, 65535 = full speed)&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.value(1)&lt;br /&gt;
        self.in2.value(0)&lt;br /&gt;
        self.pwm.duty_u16(speed)&lt;br /&gt;
&lt;br /&gt;
    def brake(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Brake motor (short brake - stops quickly)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.value(1)&lt;br /&gt;
        self.in2.value(1)&lt;br /&gt;
        self.pwm.duty_u16(0)&lt;br /&gt;
&lt;br /&gt;
    def coast(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Coast motor (freewheeling - stops gradually)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.value(0)&lt;br /&gt;
        self.in2.value(0)&lt;br /&gt;
        self.pwm.duty_u16(0)&lt;br /&gt;
&lt;br /&gt;
# Initialize standby pin&lt;br /&gt;
stby = Pin(20, Pin.OUT)&lt;br /&gt;
stby.value(1)  # Enable motor driver&lt;br /&gt;
&lt;br /&gt;
# Initialize motors&lt;br /&gt;
left_motor = Motor(pwm_pin=16, in1_pin=14, in2_pin=15)&lt;br /&gt;
right_motor = Motor(pwm_pin=19, in1_pin=17, in2_pin=18)&lt;br /&gt;
&lt;br /&gt;
# Example: Drive forward at 50% speed&lt;br /&gt;
left_motor.forward(32768)   # 50% of 65535&lt;br /&gt;
right_motor.forward(32768)&lt;br /&gt;
&lt;br /&gt;
# Stop after 2 seconds&lt;br /&gt;
import time&lt;br /&gt;
time.sleep(2)&lt;br /&gt;
left_motor.brake()&lt;br /&gt;
right_motor.brake()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Alternative: L298N Motor Driver ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;L298N&#039;&#039;&#039; is an older, more common motor driver. It&#039;s less efficient than the TB6612FNG:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;L298N characteristics:&#039;&#039;&#039;&lt;br /&gt;
* Voltage drop: 2-4V (vs 0.3V for TB6612FNG)&lt;br /&gt;
* Maximum voltage: 46V (good for larger motors)&lt;br /&gt;
* Continuous current: 2A per channel&lt;br /&gt;
* Larger size, generates more heat&lt;br /&gt;
* Often includes onboard voltage regulator&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use L298N:&#039;&#039;&#039;&lt;br /&gt;
* Larger motors that need &amp;gt;1.2A continuous current&lt;br /&gt;
* Higher voltage motors (&amp;gt;13.5V)&lt;br /&gt;
* You already have one available&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use TB6612FNG:&#039;&#039;&#039;&lt;br /&gt;
* Battery-powered robots (efficiency matters)&lt;br /&gt;
* Small to medium motors (&amp;lt;1A typical)&lt;br /&gt;
* Space-constrained designs&lt;br /&gt;
* 3.3V logic (no level shifters needed)&lt;br /&gt;
&lt;br /&gt;
== Part 5: Differential Drive ==&lt;br /&gt;
&lt;br /&gt;
=== What is Differential Drive? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Differential drive&#039;&#039;&#039; is a robot motion system using two independently-controlled wheels:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Left wheel&#039;&#039;&#039; and &#039;&#039;&#039;right wheel&#039;&#039;&#039; on opposite sides of robot&lt;br /&gt;
* No steering mechanism - turns are created by speed differential&lt;br /&gt;
* Simple, effective, and commonly used in mobile robots&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot uses differential drive&#039;&#039;&#039; with two TT motors and wheels.&lt;br /&gt;
&lt;br /&gt;
=== Differential Drive Motion Control ===&lt;br /&gt;
&lt;br /&gt;
By varying the speed of left and right wheels, you can create different motions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Left Motor !! Right Motor !! Robot Motion&lt;br /&gt;
|-&lt;br /&gt;
| Forward 50% || Forward 50% || Straight forward&lt;br /&gt;
|-&lt;br /&gt;
| Reverse 50% || Reverse 50% || Straight reverse&lt;br /&gt;
|-&lt;br /&gt;
| Forward 100% || Forward 50% || Gentle turn right (arc)&lt;br /&gt;
|-&lt;br /&gt;
| Forward 50% || Forward 100% || Gentle turn left (arc)&lt;br /&gt;
|-&lt;br /&gt;
| Forward 50% || Stop || Sharp turn right&lt;br /&gt;
|-&lt;br /&gt;
| Forward 50% || Reverse 50% || Rotate clockwise (pivot turn)&lt;br /&gt;
|-&lt;br /&gt;
| Stop || Stop || Stopped&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key insight:&#039;&#039;&#039; The difference in wheel speeds determines turn radius. Equal speeds = straight line.&lt;br /&gt;
&lt;br /&gt;
=== Implementing Differential Drive ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class DifferentialDrive:&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Differential drive robot control&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    def __init__(self, left_motor, right_motor):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Initialize with two Motor objects&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.left = left_motor&lt;br /&gt;
        self.right = right_motor&lt;br /&gt;
&lt;br /&gt;
    def drive(self, left_speed, right_speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive with independent wheel speeds&lt;br /&gt;
&lt;br /&gt;
        Args:&lt;br /&gt;
            left_speed: -65535 to 65535 (negative = reverse)&lt;br /&gt;
            right_speed: -65535 to 65535 (negative = reverse)&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        # Left motor&lt;br /&gt;
        if left_speed &amp;gt; 0:&lt;br /&gt;
            self.left.forward(left_speed)&lt;br /&gt;
        elif left_speed &amp;lt; 0:&lt;br /&gt;
            self.left.reverse(-left_speed)&lt;br /&gt;
        else:&lt;br /&gt;
            self.left.coast()&lt;br /&gt;
&lt;br /&gt;
        # Right motor&lt;br /&gt;
        if right_speed &amp;gt; 0:&lt;br /&gt;
            self.right.forward(right_speed)&lt;br /&gt;
        elif right_speed &amp;lt; 0:&lt;br /&gt;
            self.right.reverse(-right_speed)&lt;br /&gt;
        else:&lt;br /&gt;
            self.right.coast()&lt;br /&gt;
&lt;br /&gt;
    def forward(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive straight forward&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(speed, speed)&lt;br /&gt;
&lt;br /&gt;
    def reverse(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive straight reverse&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(-speed, -speed)&lt;br /&gt;
&lt;br /&gt;
    def turn_left(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Turn left (arc) by slowing left wheel&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(speed // 2, speed)&lt;br /&gt;
&lt;br /&gt;
    def turn_right(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Turn right (arc) by slowing right wheel&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(speed, speed // 2)&lt;br /&gt;
&lt;br /&gt;
    def rotate_left(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Rotate left in place (pivot turn)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(-speed, speed)&lt;br /&gt;
&lt;br /&gt;
    def rotate_right(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Rotate right in place (pivot turn)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.drive(speed, -speed)&lt;br /&gt;
&lt;br /&gt;
    def stop(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Stop both motors&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.left.brake()&lt;br /&gt;
        self.right.brake()&lt;br /&gt;
&lt;br /&gt;
# Initialize differential drive&lt;br /&gt;
robot = DifferentialDrive(left_motor, right_motor)&lt;br /&gt;
&lt;br /&gt;
# Drive straight forward at 50% speed&lt;br /&gt;
robot.forward(32768)&lt;br /&gt;
time.sleep(2)&lt;br /&gt;
&lt;br /&gt;
# Turn right&lt;br /&gt;
robot.turn_right(32768)&lt;br /&gt;
time.sleep(1)&lt;br /&gt;
&lt;br /&gt;
# Rotate in place&lt;br /&gt;
robot.rotate_left(32768)&lt;br /&gt;
time.sleep(1)&lt;br /&gt;
&lt;br /&gt;
# Stop&lt;br /&gt;
robot.stop()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Straight-Line Driving Challenge ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Even with equal PWM duty cycles, motors rarely spin at exactly the same speed due to:&lt;br /&gt;
* Manufacturing tolerances&lt;br /&gt;
* Different friction in gearboxes&lt;br /&gt;
* Voltage drop differences&lt;br /&gt;
* Wheel diameter differences&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result:&#039;&#039;&#039; Robot drifts left or right instead of going straight.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions:&#039;&#039;&#039;&lt;br /&gt;
1. &#039;&#039;&#039;Calibration&#039;&#039;&#039; - Measure actual wheel speeds, adjust PWM to compensate&lt;br /&gt;
2. &#039;&#039;&#039;Closed-loop control&#039;&#039;&#039; - Use encoders (see [[Capability:Optical Odometry]]) to measure and correct speed&lt;br /&gt;
3. &#039;&#039;&#039;Trim adjustment&#039;&#039;&#039; - Add offset to one motor&#039;s speed in software&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: Simple trim adjustment&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If robot drifts right, left motor is slower - add trim&lt;br /&gt;
LEFT_MOTOR_TRIM = 1.05   # Left motor needs 5% more power&lt;br /&gt;
&lt;br /&gt;
def forward_with_trim(speed):&lt;br /&gt;
    left_speed = int(speed * LEFT_MOTOR_TRIM)&lt;br /&gt;
    right_speed = speed&lt;br /&gt;
    robot.drive(left_speed, right_speed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn Radius Calculation ===&lt;br /&gt;
&lt;br /&gt;
For a differential drive robot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;R = \frac{L}{2} \times \frac{v_L + v_R}{v_R - v_L}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* R = turn radius&lt;br /&gt;
* L = distance between wheels (track width)&lt;br /&gt;
* v_L = left wheel velocity&lt;br /&gt;
* v_R = right wheel velocity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Special cases:&#039;&#039;&#039;&lt;br /&gt;
* v_L = v_R → R = infinity (straight line)&lt;br /&gt;
* v_L = -v_R → R = 0 (rotation in place)&lt;br /&gt;
* v_L = 0 or v_R = 0 → R = L/2 (pivot around one wheel)&lt;br /&gt;
&lt;br /&gt;
== Part 6: Power Management and Protection ==&lt;br /&gt;
&lt;br /&gt;
=== Separate Power Supplies ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Best practice:&#039;&#039;&#039; Use separate power for motors and logic:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Motor power&#039;&#039;&#039; - Battery (6V, 9V, 12V depending on motors)&lt;br /&gt;
* &#039;&#039;&#039;Logic power&#039;&#039;&#039; - Regulated 3.3V or 5V from voltage regulator&lt;br /&gt;
* &#039;&#039;&#039;Shared ground&#039;&#039;&#039; - All grounds connected together&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why separate?&#039;&#039;&#039;&lt;br /&gt;
* Motors create voltage spikes and noise&lt;br /&gt;
* Motor current draw can cause voltage sag&lt;br /&gt;
* Microcontroller needs stable, clean voltage&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot power system:&#039;&#039;&#039;&lt;br /&gt;
* 4× AA batteries (6V) → MP1584 buck converter → 5V regulated&lt;br /&gt;
* 5V → Raspberry Pi Pico onboard regulator → 3.3V for microcontroller&lt;br /&gt;
* Battery 6V → TB6612FNG VM pin → Motor power&lt;br /&gt;
* 3.3V → TB6612FNG VCC pin → Logic power&lt;br /&gt;
&lt;br /&gt;
=== Decoupling Capacitors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Always add capacitors:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;0.1µF ceramic capacitor&#039;&#039;&#039; near every IC&#039;s power pins (VCC to GND)&lt;br /&gt;
* &#039;&#039;&#039;100-1000µF electrolytic capacitor&#039;&#039;&#039; across motor power supply&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Purpose:&#039;&#039;&#039;&lt;br /&gt;
* Filter high-frequency noise&lt;br /&gt;
* Provide local energy storage for current spikes&lt;br /&gt;
* Prevent voltage droops during motor startup&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Placement matters:&#039;&#039;&#039; Place decoupling capacitors as close to IC power pins as possible.&lt;br /&gt;
&lt;br /&gt;
=== Current Limiting ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Protect your system:&#039;&#039;&#039;&lt;br /&gt;
* Use motor drivers rated above your motor&#039;s stall current&lt;br /&gt;
* Add fuses or resettable fuses (PTC) in power supply line&lt;br /&gt;
* Monitor battery voltage to prevent over-discharge&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
* SimpleBot TT motors: 1.5A stall current&lt;br /&gt;
* TB6612FNG rating: 1.2A continuous, 3.2A peak&lt;br /&gt;
* Result: Motors protected during brief stalls, but extended stalls will trigger thermal shutdown&lt;br /&gt;
&lt;br /&gt;
=== Thermal Management ===&lt;br /&gt;
&lt;br /&gt;
Motor drivers generate heat, especially at high currents:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Heatsinks&#039;&#039;&#039; - Attach to motor driver IC if handling &amp;gt;1A continuously&lt;br /&gt;
* &#039;&#039;&#039;Airflow&#039;&#039;&#039; - Don&#039;t enclose motor driver in sealed box&lt;br /&gt;
* &#039;&#039;&#039;Thermal shutdown&#039;&#039;&#039; - Most modern drivers shut down automatically if overheating&lt;br /&gt;
* &#039;&#039;&#039;Duty cycle&#039;&#039;&#039; - If driver gets too hot, reduce motor duty cycle or add cooling&lt;br /&gt;
&lt;br /&gt;
== Part 7: Troubleshooting Motor Control ==&lt;br /&gt;
&lt;br /&gt;
=== Motor Not Spinning ===&lt;br /&gt;
&lt;br /&gt;
Check:&lt;br /&gt;
1. Power supply connected? (Measure voltage at VM pin)&lt;br /&gt;
2. Standby pin enabled? (STBY = HIGH)&lt;br /&gt;
3. PWM signal present? (Use oscilloscope or LED on PWM pin)&lt;br /&gt;
4. Direction pins set correctly? (Not both HIGH or both LOW for some drivers)&lt;br /&gt;
5. Motor connected? (Check continuity of motor wires)&lt;br /&gt;
6. Driver overheated? (Let cool down, check for thermal shutdown)&lt;br /&gt;
&lt;br /&gt;
=== Motor Spins Wrong Direction ===&lt;br /&gt;
&lt;br /&gt;
Fix:&lt;br /&gt;
* Swap motor wire connections (AO1 ↔ AO2)&lt;br /&gt;
* Or swap IN1/IN2 control in software&lt;br /&gt;
&lt;br /&gt;
=== Motors Work Individually But Not Together ===&lt;br /&gt;
&lt;br /&gt;
Likely causes:&lt;br /&gt;
* Insufficient current from power supply (voltage sags when both motors run)&lt;br /&gt;
* Wiring error (check all ground connections)&lt;br /&gt;
* Shared PWM channel (each motor needs independent PWM)&lt;br /&gt;
&lt;br /&gt;
=== Motors Run Erratically or Stall ===&lt;br /&gt;
&lt;br /&gt;
Check:&lt;br /&gt;
* Battery voltage sufficient? (Use multimeter under load)&lt;br /&gt;
* Stall current within driver rating?&lt;br /&gt;
* Decoupling capacitors installed?&lt;br /&gt;
* Mechanical binding? (Wheels rubbing, gears jammed)&lt;br /&gt;
&lt;br /&gt;
=== Robot Drives Straight But Won&#039;t Turn ===&lt;br /&gt;
&lt;br /&gt;
Debug:&lt;br /&gt;
* Test each motor independently (forward, reverse, variable speed)&lt;br /&gt;
* Check that both motors are receiving different commands during turns&lt;br /&gt;
* Verify IN1/IN2 pins controlling direction correctly&lt;br /&gt;
* Ensure motors can reverse (not just stop)&lt;br /&gt;
&lt;br /&gt;
=== Robot Veers to One Side ===&lt;br /&gt;
&lt;br /&gt;
Solutions:&lt;br /&gt;
* Calibrate motor speeds (add trim adjustment)&lt;br /&gt;
* Check wheel diameter (uneven wheels cause drift)&lt;br /&gt;
* Use encoders for closed-loop speed control&lt;br /&gt;
* Verify both motors receiving same PWM value when driving straight&lt;br /&gt;
&lt;br /&gt;
== Part 8: Advanced Topics ==&lt;br /&gt;
&lt;br /&gt;
=== Motor Speed Measurement ===&lt;br /&gt;
&lt;br /&gt;
To achieve precise speed control, measure actual motor speed:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Optical encoders&#039;&#039;&#039; - Count pulses from slotted wheel (see [[Capability:Optical Odometry]])&lt;br /&gt;
* &#039;&#039;&#039;Hall effect sensors&#039;&#039;&#039; - Count magnet passes&lt;br /&gt;
* &#039;&#039;&#039;Back-EMF sensing&#039;&#039;&#039; - Measure motor&#039;s generated voltage when coasting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why measure speed?&#039;&#039;&#039;&lt;br /&gt;
* Compensate for manufacturing differences&lt;br /&gt;
* Implement PID control for precise motion&lt;br /&gt;
* Measure distance traveled&lt;br /&gt;
* Detect wheel slip or stalls&lt;br /&gt;
&lt;br /&gt;
=== PID Control for Motors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PID (Proportional-Integral-Derivative)&#039;&#039;&#039; control maintains consistent motor speed:&lt;br /&gt;
&lt;br /&gt;
* Measure actual speed (using encoders)&lt;br /&gt;
* Compare to desired speed (setpoint)&lt;br /&gt;
* Calculate error and adjust PWM duty cycle&lt;br /&gt;
* Result: Motor maintains target speed despite varying load&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Benefits:&#039;&#039;&#039;&lt;br /&gt;
* Straight-line driving without drift&lt;br /&gt;
* Consistent speed regardless of battery voltage&lt;br /&gt;
* Precise turns and rotations&lt;br /&gt;
&lt;br /&gt;
This is an advanced topic - start with open-loop control (no feedback), then add encoders later.&lt;br /&gt;
&lt;br /&gt;
=== Acceleration and Deceleration ===&lt;br /&gt;
&lt;br /&gt;
Instant speed changes stress motors and can cause wheel slip. Instead, ramp speed gradually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def ramp_speed(motor, target_speed, steps=20, delay_ms=50):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Gradually increase motor speed to target&lt;br /&gt;
&lt;br /&gt;
    Args:&lt;br /&gt;
        motor: Motor object&lt;br /&gt;
        target_speed: Desired final speed (0-65535)&lt;br /&gt;
        steps: Number of incremental steps&lt;br /&gt;
        delay_ms: Delay between steps in milliseconds&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    current_speed = 0&lt;br /&gt;
    step_size = target_speed // steps&lt;br /&gt;
&lt;br /&gt;
    for i in range(steps):&lt;br /&gt;
        current_speed += step_size&lt;br /&gt;
        motor.forward(current_speed)&lt;br /&gt;
        time.sleep_ms(delay_ms)&lt;br /&gt;
&lt;br /&gt;
    # Final step to exact target&lt;br /&gt;
    motor.forward(target_speed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regenerative Braking ===&lt;br /&gt;
&lt;br /&gt;
Some motor drivers support &#039;&#039;&#039;regenerative braking&#039;&#039;&#039; - converting motor&#039;s kinetic energy back into electrical energy:&lt;br /&gt;
&lt;br /&gt;
* Motor acts as generator when coasting&lt;br /&gt;
* Energy charges battery or dissipates in brake resistor&lt;br /&gt;
* More efficient than friction braking&lt;br /&gt;
* Requires specialized motor driver with regen support&lt;br /&gt;
&lt;br /&gt;
Most hobby motor drivers (including TB6612FNG) use &#039;&#039;&#039;dynamic braking&#039;&#039;&#039; (short brake) instead - motor energy dissipates as heat in the motor and driver.&lt;br /&gt;
&lt;br /&gt;
== Part 9: Practical Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Explain how DC motors work and why they draw variable current&lt;br /&gt;
* ☐ Describe what back-EMF is and why protection is needed&lt;br /&gt;
* ☐ Understand how H-bridges enable direction control&lt;br /&gt;
* ☐ Explain how PWM controls motor speed&lt;br /&gt;
* ☐ Wire a TB6612FNG motor driver to a microcontroller and motors&lt;br /&gt;
* ☐ Write code to drive motors forward, reverse, and stop&lt;br /&gt;
* ☐ Implement differential drive motion (forward, turn, rotate)&lt;br /&gt;
* ☐ Troubleshoot common motor control problems&lt;br /&gt;
* ☐ Understand the importance of separate power supplies&lt;br /&gt;
* ☐ Calculate current requirements for motor selection&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready to build robots with motor control!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Build SimpleBot ===&lt;br /&gt;
Apply your motor control knowledge:&lt;br /&gt;
* [[SimpleBot]] - Complete robot build guide with TB6612FNG motor control&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - Use motors to follow a line&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Combine motors with encoders for precise motion&lt;br /&gt;
&lt;br /&gt;
=== Add Sensors ===&lt;br /&gt;
Combine motor control with sensing:&lt;br /&gt;
* [[Sensor Interfacing]] - Learn I2C, SPI, and analog sensors&lt;br /&gt;
* [[Capability:Optical Odometry]] - Measure wheel rotation for precise distance&lt;br /&gt;
* [[Capability:IMU Sensing]] - Add gyroscope for accurate turning&lt;br /&gt;
&lt;br /&gt;
=== Expand Capabilities ===&lt;br /&gt;
* [[Capability:Differential Drive]] - Full documentation of this motion system&lt;br /&gt;
* [[Capability:Encoder Sensing]] - Closed-loop motor speed control&lt;br /&gt;
* Build your own custom robot with motor control&lt;br /&gt;
&lt;br /&gt;
== Common Mistakes and Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Powering motors from microcontroller pins&#039;&#039;&#039; - GPIO pins cannot supply enough current; always use motor driver&lt;br /&gt;
* &#039;&#039;&#039;No standby pin control&#039;&#039;&#039; - TB6612FNG requires STBY=HIGH to enable; forgetting this means motors won&#039;t work&lt;br /&gt;
* &#039;&#039;&#039;Separate grounds&#039;&#039;&#039; - Logic ground and motor ground must be connected together&lt;br /&gt;
* &#039;&#039;&#039;Insufficient decoupling&#039;&#039;&#039; - Missing capacitors cause erratic behavior and voltage spikes&lt;br /&gt;
* &#039;&#039;&#039;Exceeding current rating&#039;&#039;&#039; - Using motors with stall current higher than driver rating damages driver&lt;br /&gt;
* &#039;&#039;&#039;No back-EMF protection&#039;&#039;&#039; - If building H-bridge from transistors, must add flyback diodes&lt;br /&gt;
* &#039;&#039;&#039;PWM frequency too low&#039;&#039;&#039; - Causes audible motor whine and rough motion&lt;br /&gt;
* &#039;&#039;&#039;Forgetting motor trim&#039;&#039;&#039; - Robots rarely drive perfectly straight without calibration&lt;br /&gt;
&lt;br /&gt;
== Resources and Further Reading ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Wiki Pages ===&lt;br /&gt;
* [[TB6612FNG]] - Detailed motor driver specifications&lt;br /&gt;
* [[Electronics]] - Full electronics competency overview&lt;br /&gt;
* [[Capability:Differential Drive]] - Motion system documentation&lt;br /&gt;
* [[SimpleBot]] - Complete robot using motor control&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.ti.com/lit/an/slva842/slva842.pdf TI Motor Driver Basics] (PDF)&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/motors-and-selecting-the-right-one SparkFun Motor Selection Guide]&lt;br /&gt;
* [https://www.pololu.com/docs/0J15 Pololu Motor Selection Guide]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Electronics Fundamentals]] - Prerequisite tutorial&lt;br /&gt;
* [[Sensor Interfacing]] - Next tutorial in electronics learning path&lt;br /&gt;
* [[Capability:Encoder Sensing]] - Measure motor speed&lt;br /&gt;
* [[Behavior:PID Control]] - Advanced motor speed regulation&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Electronics]]&lt;br /&gt;
[[Category:Intermediate]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing_for_Robotics&amp;diff=86</id>
		<title>3D Printing for Robotics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing_for_Robotics&amp;diff=86"/>
		<updated>2025-10-11T20:16:14Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=3D Printing for Robotics |competency=3D Printing |difficulty=Intermediate |time=6-8 hours (plus iterative design time) |prerequisites=3D Printing Basics, basic CAD Design knowledge |materials=FDM printer, PLA/PETG filament, calipers, test hardware (screws, nuts, bearings, motor shafts) |next_steps=CAD Design, design custom robot chassis, document implementation pages }}  &amp;#039;&amp;#039;&amp;#039;3D Printing for Robotics&amp;#039;&amp;#039;&amp;#039; teaches you how to design and print f...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=3D Printing for Robotics&lt;br /&gt;
|competency=[[3D Printing]]&lt;br /&gt;
|difficulty=Intermediate&lt;br /&gt;
|time=6-8 hours (plus iterative design time)&lt;br /&gt;
|prerequisites=[[3D Printing Basics]], basic [[CAD Design]] knowledge&lt;br /&gt;
|materials=FDM printer, PLA/PETG filament, calipers, test hardware (screws, nuts, bearings, motor shafts)&lt;br /&gt;
|next_steps=[[CAD Design]], design custom robot chassis, document implementation pages&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3D Printing for Robotics&#039;&#039;&#039; teaches you how to design and print functional mechanical parts that work reliably in robots. This is not about making pretty objects - it&#039;s about creating parts that hold motors, position sensors, transfer forces, and survive repeated use.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll learn the engineering principles specific to FDM printing: layer orientation for strength, designing tolerances for fit, minimizing supports, embedding hardware, and iterating quickly.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll be able to:&lt;br /&gt;
* Design parts that print successfully on the first try&lt;br /&gt;
* Choose print orientation for maximum strength&lt;br /&gt;
* Design holes, slots, and assemblies with correct tolerances&lt;br /&gt;
* Eliminate or minimize support material&lt;br /&gt;
* Embed hardware like nuts, bearings, and heat-set inserts&lt;br /&gt;
* Iterate designs efficiently based on test fits&lt;br /&gt;
* Design complete robot chassis from scratch&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you&#039;ve successfully printed parts designed by others (see [[3D Printing Basics]]) and have basic CAD modeling skills.&lt;br /&gt;
&lt;br /&gt;
== Part 1: Design Principles for FDM ==&lt;br /&gt;
&lt;br /&gt;
FDM printing has constraints that machined or molded parts don&#039;t have. Ignore these and your parts will fail.&lt;br /&gt;
&lt;br /&gt;
=== Layer Orientation Determines Strength ===&lt;br /&gt;
&lt;br /&gt;
FDM parts are &#039;&#039;&#039;anisotropic&#039;&#039;&#039; - strength varies dramatically with orientation:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layers parallel to force&#039;&#039;&#039; - Very strong (plastic material strength)&lt;br /&gt;
* &#039;&#039;&#039;Layers perpendicular to force&#039;&#039;&#039; - Weak (layers peel apart)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: Motor mount bracket&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Bad orientation&#039;&#039;&#039; - Mount hole on side, forces pull perpendicular to layers → bracket snaps&lt;br /&gt;
* &#039;&#039;&#039;Good orientation&#039;&#039;&#039; - Mount hole on top/bottom, forces compress layers together → strong&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb:&#039;&#039;&#039; Orient parts so primary forces push &#039;&#039;&#039;along&#039;&#039;&#039; layers, not &#039;&#039;&#039;between&#039;&#039;&#039; layers.&lt;br /&gt;
&lt;br /&gt;
=== The 45-Degree Rule ===&lt;br /&gt;
&lt;br /&gt;
FDM cannot print in mid-air. Overhangs are limited:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;0-45° overhang&#039;&#039;&#039; - Prints fine, no support needed&lt;br /&gt;
* &#039;&#039;&#039;45-60° overhang&#039;&#039;&#039; - May print, depends on geometry and cooling&lt;br /&gt;
* &#039;&#039;&#039;&amp;gt;60° overhang&#039;&#039;&#039; - Requires support material&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Horizontal holes&#039;&#039;&#039; are problematic:&lt;br /&gt;
* Top of hole is &amp;gt;45° overhang&lt;br /&gt;
* Solution: Orient part vertically, or accept support inside hole&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tear-drop holes&#039;&#039;&#039; - Flatten top of circular hole to avoid overhang&lt;br /&gt;
* Instead of perfect circle, use circle with flat top above centerline&lt;br /&gt;
* Maintains most of the circular opening without support&lt;br /&gt;
&lt;br /&gt;
=== Minimum Feature Sizes ===&lt;br /&gt;
&lt;br /&gt;
FDM has resolution limits:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Minimum wall thickness&#039;&#039;&#039; - 2× nozzle diameter (0.8mm for 0.4mm nozzle)&lt;br /&gt;
** Thinner walls may not print reliably&lt;br /&gt;
* &#039;&#039;&#039;Minimum hole diameter&#039;&#039;&#039; - 1mm (smaller may close up or need drilling)&lt;br /&gt;
* &#039;&#039;&#039;Minimum gap&#039;&#039;&#039; - 0.4mm (0.2mm may fuse together)&lt;br /&gt;
* &#039;&#039;&#039;Minimum text height&#039;&#039;&#039; - 3mm for raised text, 1mm for engraved&lt;br /&gt;
* &#039;&#039;&#039;Finest detail&#039;&#039;&#039; - Limited by layer height and nozzle diameter&lt;br /&gt;
&lt;br /&gt;
=== Bridging Capability ===&lt;br /&gt;
&lt;br /&gt;
FDM can print horizontal spans between two support points:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Short bridges&#039;&#039;&#039; (&amp;lt;20mm) - Usually successful&lt;br /&gt;
* &#039;&#039;&#039;Medium bridges&#039;&#039;&#039; (20-40mm) - May sag in middle&lt;br /&gt;
* &#039;&#039;&#039;Long bridges&#039;&#039;&#039; (&amp;gt;40mm) - Will fail without support&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design strategy:&#039;&#039;&#039; Add intermediate support pillars for long bridges.&lt;br /&gt;
&lt;br /&gt;
== Part 2: Tolerances and Fit ==&lt;br /&gt;
&lt;br /&gt;
Printed parts have dimensional variation. You must design for clearance.&lt;br /&gt;
&lt;br /&gt;
=== Understanding Tolerance ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tolerance&#039;&#039;&#039; is the allowable variation from nominal dimension:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FDM accuracy&#039;&#039;&#039; - Typically ±0.1-0.2mm (but varies by printer, material, settings)&lt;br /&gt;
* &#039;&#039;&#039;Holes print undersized&#039;&#039;&#039; - 0.1-0.2mm smaller than designed&lt;br /&gt;
* &#039;&#039;&#039;Shafts print oversized&#039;&#039;&#039; - 0.1-0.2mm larger than designed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why?&#039;&#039;&#039; First layer squish, elephant&#039;s foot, material shrinkage, thermal expansion.&lt;br /&gt;
&lt;br /&gt;
=== Design Clearances for Assemblies ===&lt;br /&gt;
&lt;br /&gt;
When parts must fit together, add clearance:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Fit Type !! Clearance !! Description !! Robotics Use&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Interference fit&#039;&#039;&#039; || -0.1mm || Parts pressed together, stay tight || Bearing press-fits&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Press fit&#039;&#039;&#039; || 0.0mm || Tight fit, may need mallet || Wheel hubs on shafts&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Slip fit&#039;&#039;&#039; || +0.2mm || Parts slide together with friction || Hinges, sliding joints&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Free fit&#039;&#039;&#039; || +0.5mm || Parts move freely, slight wobble || Rotating shafts in bearings&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Loose fit&#039;&#039;&#039; || +0.8mm || Easy assembly, significant play || Clearance holes for screws&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example: M3 screw (3.0mm nominal diameter)&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Threaded hole&#039;&#039;&#039; - Design 2.5mm, print will be ~2.6-2.7mm, tap with M3 tap&lt;br /&gt;
* &#039;&#039;&#039;Tight clearance&#039;&#039;&#039; - Design 3.2mm, allows screw to pass with minimal wobble&lt;br /&gt;
* &#039;&#039;&#039;Standard clearance&#039;&#039;&#039; - Design 3.5mm, easy assembly (most common)&lt;br /&gt;
* &#039;&#039;&#039;Loose clearance&#039;&#039;&#039; - Design 4.0mm, allows adjustment during assembly&lt;br /&gt;
&lt;br /&gt;
=== Testing and Iterating Tolerances ===&lt;br /&gt;
&lt;br /&gt;
Every printer is different. You must calibrate:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Print a tolerance test piece&#039;&#039;&#039;&lt;br /&gt;
** Design: Rectangular block with holes of different sizes (3.0mm, 3.2mm, 3.5mm, 4.0mm)&lt;br /&gt;
** Test with M3 screw - which hole gives best fit?&lt;br /&gt;
# &#039;&#039;&#039;Print a shaft test piece&#039;&#039;&#039;&lt;br /&gt;
** Design: Cylinders of different diameters (3.0mm, 3.2mm, 3.5mm, 4.0mm)&lt;br /&gt;
** Test fit in holes - which combination gives desired fit?&lt;br /&gt;
# &#039;&#039;&#039;Document your printer&#039;s behavior&#039;&#039;&#039;&lt;br /&gt;
** &amp;quot;My printer needs +0.3mm for M3 clearance holes&amp;quot;&lt;br /&gt;
** &amp;quot;My printer needs -0.2mm for press-fit shafts&amp;quot;&lt;br /&gt;
# &#039;&#039;&#039;Apply corrections to future designs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Print a &amp;quot;hardware calibration kit&amp;quot; with holes for all common screws (M2, M2.5, M3, M4) and slots for nuts. Test once, use forever.&lt;br /&gt;
&lt;br /&gt;
=== Designing Holes for Hardware ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Screw clearance holes:&#039;&#039;&#039;&lt;br /&gt;
* M2 (2.0mm) → Design 2.3-2.5mm&lt;br /&gt;
* M2.5 (2.5mm) → Design 2.8-3.0mm&lt;br /&gt;
* M3 (3.0mm) → Design 3.3-3.5mm&lt;br /&gt;
* M4 (4.0mm) → Design 4.3-4.5mm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hex nut pockets:&#039;&#039;&#039;&lt;br /&gt;
* M3 hex nut (5.5mm across flats) → Design 5.7-5.8mm hexagon&lt;br /&gt;
* M3 hex nut (2.4mm thick) → Design 2.5-2.6mm deep pocket&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bearing press-fits:&#039;&#039;&#039;&lt;br /&gt;
* 608 bearing (22mm OD) → Design 21.8-21.9mm hole&lt;br /&gt;
* Test fit and adjust by 0.1mm increments&lt;br /&gt;
&lt;br /&gt;
== Part 3: Support Strategies ==&lt;br /&gt;
&lt;br /&gt;
Supports waste time and material. Minimize them through smart design.&lt;br /&gt;
&lt;br /&gt;
=== Designing to Avoid Supports ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 1: Orient for Printability&#039;&#039;&#039;&lt;br /&gt;
* Rotate part so overhangs are &amp;lt;45°&lt;br /&gt;
* Sometimes compromises strength - weigh trade-offs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 2: Split Parts&#039;&#039;&#039;&lt;br /&gt;
* Design in two pieces that print flat&lt;br /&gt;
* Assemble with screws or glue after printing&lt;br /&gt;
* Example: Sensor bracket with 90° angle → print as two flat pieces, bolt together&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 3: Add Chamfers&#039;&#039;&#039;&lt;br /&gt;
* Chamfer bottom edges of holes to reduce overhang angle&lt;br /&gt;
* 45° chamfer = no support needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 4: Use Tear-Drop Holes&#039;&#039;&#039;&lt;br /&gt;
* Horizontal holes with flattened tops&lt;br /&gt;
* Maintains circular opening at bottom (where precision matters)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 5: Add Self-Supporting Features&#039;&#039;&#039;&lt;br /&gt;
* Design deliberate material under overhangs&lt;br /&gt;
* Example: Ribs, gussets, or small supports that become part of the design&lt;br /&gt;
&lt;br /&gt;
=== When Supports Are Necessary ===&lt;br /&gt;
&lt;br /&gt;
Some geometries require supports. Optimize them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use tree supports&#039;&#039;&#039; (PrusaSlicer, Cura) - Less material, easier removal&lt;br /&gt;
* &#039;&#039;&#039;Support enforcers&#039;&#039;&#039; - Add supports only where critical&lt;br /&gt;
* &#039;&#039;&#039;Support blockers&#039;&#039;&#039; - Remove supports where they&#039;re not needed&lt;br /&gt;
* &#039;&#039;&#039;Support interface layers&#039;&#039;&#039; - Dense layer between support and part (better surface finish)&lt;br /&gt;
* &#039;&#039;&#039;Support Z-distance&#039;&#039;&#039; - 0.2mm gap allows easier removal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design tip:&#039;&#039;&#039; Add small tabs or nubs on support surfaces - gives supports better attachment point and easier removal.&lt;br /&gt;
&lt;br /&gt;
== Part 4: Embedding Hardware ==&lt;br /&gt;
&lt;br /&gt;
Robots need metal hardware (screws, nuts, bearings) integrated into plastic parts.&lt;br /&gt;
&lt;br /&gt;
=== Heat-Set Inserts ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Heat-set inserts&#039;&#039;&#039; are brass threaded inserts melted into plastic:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Advantages&#039;&#039;&#039;: Strong, reusable threads (screws won&#039;t strip plastic)&lt;br /&gt;
* &#039;&#039;&#039;Installation&#039;&#039;&#039;: Use soldering iron with special tip, heat insert, press into plastic&lt;br /&gt;
* &#039;&#039;&#039;Design&#039;&#039;&#039;:&lt;br /&gt;
** Hole diameter: Insert OD + 0.1-0.2mm (e.g., M3 insert needs ~4.0-4.2mm hole)&lt;br /&gt;
** Hole depth: Insert length + 0.5mm (allows insert to sit flush or slightly recessed)&lt;br /&gt;
** Boss diameter: At least insert OD + 3mm (provides material for insert to grip)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common sizes for robotics:&#039;&#039;&#039;&lt;br /&gt;
* M2.5 × 4mm length (small brackets, PCB standoffs)&lt;br /&gt;
* M3 × 5mm length (general purpose, most common)&lt;br /&gt;
* M4 × 6mm length (motor mounts, high-stress points)&lt;br /&gt;
&lt;br /&gt;
=== Captive Nuts ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Captive nuts&#039;&#039;&#039; are trapped in hexagonal pockets during printing:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Design&#039;&#039;&#039;:&lt;br /&gt;
** Hexagonal pocket: Nut size + 0.2mm across flats&lt;br /&gt;
** Pocket depth: Nut thickness + 0.1mm&lt;br /&gt;
** Pocket height above surface: At least 2 layer heights (0.4mm for 0.2mm layers)&lt;br /&gt;
* &#039;&#039;&#039;Installation&#039;&#039;&#039;: Drop nut into pocket during print (pause print) or slide in from side&lt;br /&gt;
* &#039;&#039;&#039;Retention&#039;&#039;&#039;: Hex shape prevents rotation, pocket prevents pull-out&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pause method:&#039;&#039;&#039;&lt;br /&gt;
# Slice model, note layer number where pocket roof starts&lt;br /&gt;
# Add pause command at that layer (G-code: M0 or M600)&lt;br /&gt;
# During print, insert nuts when printer pauses&lt;br /&gt;
# Resume print, plastic grows over nuts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Slide-in method:&#039;&#039;&#039;&lt;br /&gt;
# Design pocket open on one side&lt;br /&gt;
# Print complete&lt;br /&gt;
# Slide nut into pocket from side&lt;br /&gt;
# Optional: Add small plastic tab to block side opening after insertion&lt;br /&gt;
&lt;br /&gt;
=== Press-Fit Bearings ===&lt;br /&gt;
&lt;br /&gt;
Ball bearings provide smooth rotation for wheels and joints:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Common types&#039;&#039;&#039;:&lt;br /&gt;
** 608 bearing (skateboard bearing): 8mm ID, 22mm OD, 7mm thick&lt;br /&gt;
** 688 bearing (miniature): 8mm ID, 16mm OD, 5mm thick&lt;br /&gt;
** MR105 bearing: 5mm ID, 10mm OD, 4mm thick&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Design for press-fit&#039;&#039;&#039;:&lt;br /&gt;
** Hole diameter: Bearing OD - 0.1 to -0.2mm (tight press fit)&lt;br /&gt;
** Hole depth: Bearing thickness + 0.5mm (bearing sits fully in)&lt;br /&gt;
** Chamfer entrance: 45° chamfer makes bearing easier to press in&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Installation&#039;&#039;&#039;:&lt;br /&gt;
** Press bearing in by hand (may need light mallet)&lt;br /&gt;
** Use vise or arbor press for very tight fits&lt;br /&gt;
** Heat plastic slightly with hot air gun (easier press)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design tip:&#039;&#039;&#039; Add a flange or stop surface so bearing doesn&#039;t press through.&lt;br /&gt;
&lt;br /&gt;
=== Shaft Collars and Set Screws ===&lt;br /&gt;
&lt;br /&gt;
Hold shafts in place without glue:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Design&#039;&#039;&#039;:&lt;br /&gt;
** Shaft hole: Shaft diameter + 0.1-0.2mm (slip fit)&lt;br /&gt;
** Perpendicular M3 threaded hole intersecting shaft hole&lt;br /&gt;
** Tighten M3 screw to pinch shaft&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Alternative: Split collar&#039;&#039;&#039;&lt;br /&gt;
** C-shaped collar wraps around shaft&lt;br /&gt;
** Bolt squeezes collar closed to grip shaft&lt;br /&gt;
** Allows shaft removal without loosening set screw&lt;br /&gt;
&lt;br /&gt;
== Part 5: Designing Assemblies ==&lt;br /&gt;
&lt;br /&gt;
Multi-part assemblies require careful planning.&lt;br /&gt;
&lt;br /&gt;
=== Snap-Fit Joints ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Snap-fits&#039;&#039;&#039; allow parts to click together without fasteners:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Cantilever snap&#039;&#039;&#039;&lt;br /&gt;
** Flexible beam with hook at end&lt;br /&gt;
** Hook catches on mating part&lt;br /&gt;
** Requires TPU or thin PLA/PETG that flexes&lt;br /&gt;
** Design: Beam thickness 0.8-1.2mm, deflection ~10-20% of beam length&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Annular snap&#039;&#039;&#039;&lt;br /&gt;
** Ring of material compresses to fit through opening&lt;br /&gt;
** Expands back to original size inside&lt;br /&gt;
** Example: Bottle cap mechanism&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Limitations:&#039;&#039;&#039; PLA is brittle - snap-fits can break after few cycles. PETG is better.&lt;br /&gt;
&lt;br /&gt;
=== Living Hinges ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Living hinges&#039;&#039;&#039; are flexible joints printed in one piece:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Material&#039;&#039;&#039;: PETG or TPU (PLA breaks after few flexes)&lt;br /&gt;
* &#039;&#039;&#039;Design&#039;&#039;&#039;:&lt;br /&gt;
** Hinge thickness: 0.4-0.6mm (thin enough to flex)&lt;br /&gt;
** Hinge width: 5-10mm (distributes stress)&lt;br /&gt;
** Layer orientation: Layers perpendicular to hinge axis (allows flexing between layers)&lt;br /&gt;
* &#039;&#039;&#039;Print settings&#039;&#039;&#039;:&lt;br /&gt;
** 100% infill in hinge area&lt;br /&gt;
** Slow print speed (better layer adhesion)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Robotics use:&#039;&#039;&#039; Gripper jaws, sensor covers, cable management clips&lt;br /&gt;
&lt;br /&gt;
=== Bolted Assemblies ===&lt;br /&gt;
&lt;br /&gt;
Most reliable for robotics:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Through-bolts&#039;&#039;&#039; - Screw passes through both parts, nut on other side&lt;br /&gt;
** Advantage: Very strong, easy to assemble/disassemble&lt;br /&gt;
** Design: Clearance hole in both parts, hex nut pocket in one part&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Standoffs&#039;&#039;&#039; - Threaded spacers between parallel plates&lt;br /&gt;
** Common: M3 brass standoffs, various lengths&lt;br /&gt;
** Design: M3 clearance holes in both plates&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Threaded inserts&#039;&#039;&#039; (see above) - One part has insert, other has clearance hole&lt;br /&gt;
** Advantage: Reusable threads, no loose nuts&lt;br /&gt;
&lt;br /&gt;
== Part 6: Strength and Structural Design ==&lt;br /&gt;
&lt;br /&gt;
=== Understanding Anisotropic Strength ===&lt;br /&gt;
&lt;br /&gt;
Test data (varies by material and settings):&lt;br /&gt;
* &#039;&#039;&#039;Tensile strength along layers&#039;&#039;&#039; - 40-60 MPa (very strong)&lt;br /&gt;
* &#039;&#039;&#039;Tensile strength between layers&#039;&#039;&#039; - 10-20 MPa (weak)&lt;br /&gt;
* &#039;&#039;&#039;Shear strength&#039;&#039;&#039; - 15-25 MPa (moderate)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design implication:&#039;&#039;&#039; A part can be 3-5× stronger in one orientation than another.&lt;br /&gt;
&lt;br /&gt;
=== Optimizing for Strength ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 1: Perimeters Over Infill&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Weak&#039;&#039;&#039;: 2 perimeters, 50% infill&lt;br /&gt;
* &#039;&#039;&#039;Strong&#039;&#039;&#039;: 4 perimeters, 20% infill&lt;br /&gt;
* Outer walls carry most load; infill just prevents wall collapse&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 2: Reinforce Stress Points&#039;&#039;&#039;&lt;br /&gt;
* Add fillets (rounded corners) to reduce stress concentration&lt;br /&gt;
* Typical fillet radius: 2-5mm&lt;br /&gt;
* Sharp corners crack under load&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 3: Increase Wall Thickness&#039;&#039;&#039;&lt;br /&gt;
* Minimum 2.4mm (6 perimeters with 0.4mm nozzle) for structural parts&lt;br /&gt;
* Thicker = stronger, but diminishing returns above 4-5mm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Strategy 4: Add Ribs and Gussets&#039;&#039;&#039;&lt;br /&gt;
* Vertical ribs increase bending stiffness without much added weight&lt;br /&gt;
* 45° gussets strengthen right-angle joints&lt;br /&gt;
* Rib thickness: 1.2-2.0mm (3-5 perimeters)&lt;br /&gt;
&lt;br /&gt;
=== Motor Mount Design Case Study ===&lt;br /&gt;
&lt;br /&gt;
Requirements for [[SimpleBot]] motor mount:&lt;br /&gt;
* Hold DC motor securely&lt;br /&gt;
* Withstand motor vibration&lt;br /&gt;
* Resist torque from wheel contact&lt;br /&gt;
* Easy to print without supports&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design decisions:&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Layer orientation&#039;&#039;&#039; - Mount flat on bed, motor axis parallel to bed&lt;br /&gt;
** Forces compress layers together (strong direction)&lt;br /&gt;
# &#039;&#039;&#039;Motor pocket&#039;&#039;&#039; - Snug fit around motor body&lt;br /&gt;
** Designed diameter: Motor OD + 0.2mm (slip fit)&lt;br /&gt;
# &#039;&#039;&#039;Mounting holes&#039;&#039;&#039; - M3 clearance holes for bolting to chassis&lt;br /&gt;
** Through-bolts with nuts on other side (strong, removable)&lt;br /&gt;
# &#039;&#039;&#039;Reinforcement&#039;&#039;&#039; - Ribs connecting motor pocket to mounting points&lt;br /&gt;
** Distributes motor vibration, prevents cracking&lt;br /&gt;
# &#039;&#039;&#039;Avoiding supports&#039;&#039;&#039; - All angles &amp;lt;45° from vertical&lt;br /&gt;
** Motor pocket has flat bottom (prints on bed, no support needed)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Testing:&#039;&#039;&#039;&lt;br /&gt;
# Print first prototype&lt;br /&gt;
# Test fit motor - too tight? Increase pocket 0.2mm&lt;br /&gt;
# Bolt to chassis, run motor at full speed&lt;br /&gt;
# Inspect for cracks or flexing&lt;br /&gt;
# Iterate design if needed&lt;br /&gt;
&lt;br /&gt;
== Part 7: Print Settings for Mechanical Parts ==&lt;br /&gt;
&lt;br /&gt;
=== Layer Height Selection ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;0.1mm&#039;&#039;&#039; - High detail, smooth surface (decorative parts)&lt;br /&gt;
** Slow, not necessary for most robotics parts&lt;br /&gt;
* &#039;&#039;&#039;0.2mm&#039;&#039;&#039; - Standard, good balance (most common)&lt;br /&gt;
** Use for general purpose parts&lt;br /&gt;
* &#039;&#039;&#039;0.3mm&#039;&#039;&#039; - Fast draft, rougher finish&lt;br /&gt;
** Use for large chassis parts, non-visible internals&lt;br /&gt;
&lt;br /&gt;
=== Infill Strategy ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;10-15%&#039;&#039;&#039; - Light parts, minimal load (sensor brackets, covers)&lt;br /&gt;
* &#039;&#039;&#039;20-30%&#039;&#039;&#039; - Standard structural parts (chassis, mounts)&lt;br /&gt;
* &#039;&#039;&#039;40-50%&#039;&#039;&#039; - High-stress parts (motor mounts, wheel hubs)&lt;br /&gt;
* &#039;&#039;&#039;100%&#039;&#039;&#039; - Small parts where mass doesn&#039;t matter (tiny gears, pins)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Infill pattern:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Grid&#039;&#039;&#039; - Fast, simple&lt;br /&gt;
* &#039;&#039;&#039;Gyroid&#039;&#039;&#039; - Strong in all directions, recommended for structural parts&lt;br /&gt;
* &#039;&#039;&#039;Honeycomb&#039;&#039;&#039; - Strong, but slower to slice and print&lt;br /&gt;
&lt;br /&gt;
=== Perimeter Count ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2 perimeters&#039;&#039;&#039; - Minimum for functional parts&lt;br /&gt;
* &#039;&#039;&#039;3 perimeters&#039;&#039;&#039; - Standard for robotics parts&lt;br /&gt;
* &#039;&#039;&#039;4+ perimeters&#039;&#039;&#039; - High-stress parts, thin walls&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule:&#039;&#039;&#039; Wall thickness = perimeter count × line width (e.g., 3 perimeters × 0.4mm = 1.2mm wall)&lt;br /&gt;
&lt;br /&gt;
=== Material Selection ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PLA&#039;&#039;&#039; - Easy printing, rigid, brittle&lt;br /&gt;
** Good for: Chassis, brackets, low-stress parts&lt;br /&gt;
** Bad for: High-impact parts, outdoor use, hot environments&lt;br /&gt;
* &#039;&#039;&#039;PETG&#039;&#039;&#039; - Moderate difficulty, strong, flexible&lt;br /&gt;
** Good for: Motor mounts, wheels, stressed parts, outdoor robots&lt;br /&gt;
** Bad for: Fine details (strings more than PLA)&lt;br /&gt;
* &#039;&#039;&#039;TPU&#039;&#039;&#039; - Difficult printing, rubber-like&lt;br /&gt;
** Good for: Tires, grippers, shock absorption&lt;br /&gt;
** Bad for: Structural parts (too flexible)&lt;br /&gt;
&lt;br /&gt;
=== Support Interface Layers ===&lt;br /&gt;
&lt;br /&gt;
When supports are unavoidable:&lt;br /&gt;
* Enable &#039;&#039;&#039;support interface layers&#039;&#039;&#039; (dense layer between support and part)&lt;br /&gt;
* Set &#039;&#039;&#039;interface layer count&#039;&#039;&#039; to 2-3&lt;br /&gt;
* Results in better surface finish where supports touch part&lt;br /&gt;
&lt;br /&gt;
== Part 8: Iterative Design Process ==&lt;br /&gt;
&lt;br /&gt;
Professional designers rarely get parts perfect on first try. Embrace iteration.&lt;br /&gt;
&lt;br /&gt;
=== Rapid Prototyping Workflow ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Design initial version&#039;&#039;&#039; in CAD&lt;br /&gt;
** Use nominal dimensions, best-guess clearances&lt;br /&gt;
# &#039;&#039;&#039;Print at 150% speed, 0.3mm layers&#039;&#039;&#039; (fast draft mode)&lt;br /&gt;
** Quality doesn&#039;t matter for first test&lt;br /&gt;
# &#039;&#039;&#039;Test fit&#039;&#039;&#039; with actual hardware&lt;br /&gt;
** Measure with calipers, identify problems&lt;br /&gt;
# &#039;&#039;&#039;Adjust design&#039;&#039;&#039; based on measurements&lt;br /&gt;
** Holes too small? Increase 0.2mm. Too large? Decrease 0.1mm&lt;br /&gt;
# &#039;&#039;&#039;Print second version&#039;&#039;&#039; at normal settings&lt;br /&gt;
** Should be close to perfect&lt;br /&gt;
# &#039;&#039;&#039;Final tweaks&#039;&#039;&#039; if needed&lt;br /&gt;
** Usually just minor adjustments&lt;br /&gt;
# &#039;&#039;&#039;Print final version&#039;&#039;&#039; for documentation&lt;br /&gt;
** Take photos, measure, document design decisions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Time saved:&#039;&#039;&#039; Fast draft print in 1 hour vs. high-quality print in 3 hours. Get feedback 3× faster.&lt;br /&gt;
&lt;br /&gt;
=== Design Validation Checklist ===&lt;br /&gt;
&lt;br /&gt;
Before printing final version:&lt;br /&gt;
* ☐ All mounting holes have clearance (+0.3mm for M3)&lt;br /&gt;
* ☐ Hex nut pockets correct size (measure actual nut with calipers)&lt;br /&gt;
* ☐ Bearing press-fit dimensions calculated (bearing OD - 0.2mm)&lt;br /&gt;
* ☐ No overhangs &amp;gt;45° (or supports enabled)&lt;br /&gt;
* ☐ Minimum wall thickness 0.8mm (2 perimeters)&lt;br /&gt;
* ☐ Fillets on stress concentration points&lt;br /&gt;
* ☐ Layer orientation optimized for primary forces&lt;br /&gt;
* ☐ Parts split or oriented to avoid supports if possible&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
When design is finalized:&lt;br /&gt;
* Export STL files for distribution&lt;br /&gt;
* Document design decisions (why you chose dimensions, orientations, materials)&lt;br /&gt;
* Create assembly guide if multi-part&lt;br /&gt;
* Share on [[SimpleBot]] wiki or create implementation page&lt;br /&gt;
&lt;br /&gt;
== Part 9: Example Project - Custom Sensor Bracket ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s design a bracket to mount an ultrasonic distance sensor ([[Capability:Ultrasonic Sensing]]) on SimpleBot.&lt;br /&gt;
&lt;br /&gt;
=== Requirements Analysis ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sensor:&#039;&#039;&#039; HC-SR04 ultrasonic sensor&lt;br /&gt;
** Dimensions: 45mm × 20mm × 15mm&lt;br /&gt;
** Mounting: 2× holes on either side (40mm spacing)&lt;br /&gt;
* &#039;&#039;&#039;Mounting position:&#039;&#039;&#039; Front of SimpleBot chassis&lt;br /&gt;
** Must clear existing line sensors&lt;br /&gt;
** Point forward for obstacle detection&lt;br /&gt;
* &#039;&#039;&#039;Constraints:&#039;&#039;&#039;&lt;br /&gt;
** Print without supports if possible&lt;br /&gt;
** Use M3 hardware (consistent with SimpleBot)&lt;br /&gt;
** Minimize material use&lt;br /&gt;
&lt;br /&gt;
=== Design Process ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Sketch concept&#039;&#039;&#039;&lt;br /&gt;
* L-shaped bracket: Vertical face for sensor, horizontal face for mounting to chassis&lt;br /&gt;
* Sensor held with M3 screws through side holes&lt;br /&gt;
* Bracket mounts to chassis with 2× M3 screws&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: CAD model&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Vertical face:&#039;&#039;&#039; 50mm × 25mm × 2mm thick&lt;br /&gt;
** 2× M3 clearance holes (3.5mm diameter, 40mm apart) for sensor mounting&lt;br /&gt;
** Center holes vertically on face&lt;br /&gt;
* &#039;&#039;&#039;Horizontal face:&#039;&#039;&#039; 50mm × 15mm × 2mm thick&lt;br /&gt;
** 2× M3 clearance holes (3.5mm diameter, 40mm apart) for chassis mounting&lt;br /&gt;
** Position 5mm from edge&lt;br /&gt;
* &#039;&#039;&#039;Connection:&#039;&#039;&#039; Vertical face perpendicular to horizontal face&lt;br /&gt;
** Add 5mm fillet for strength&lt;br /&gt;
** No overhang issues (prints flat on bed)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Print orientation&#039;&#039;&#039;&lt;br /&gt;
* Lay horizontal face on bed (L-shape standing up)&lt;br /&gt;
* Vertical face prints without support (perpendicular = vertical walls)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 4: First print (fast draft)&#039;&#039;&#039;&lt;br /&gt;
* 0.3mm layer height, 150% speed&lt;br /&gt;
* Print time: 45 minutes&lt;br /&gt;
* Test fit sensor - holes align correctly&lt;br /&gt;
* Test fit to chassis - mounting holes correct&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 5: Refinements&#039;&#039;&#039;&lt;br /&gt;
* Add 2mm clearance between sensor and vertical face (prevents pressure on sensor PCB)&lt;br /&gt;
* Increase horizontal face width to 20mm (more contact with chassis)&lt;br /&gt;
* Add small chamfer to mounting holes (easier screw insertion)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 6: Final print&#039;&#039;&#039;&lt;br /&gt;
* 0.2mm layer height, 3 perimeters, 20% infill&lt;br /&gt;
* PETG material (more durable than PLA)&lt;br /&gt;
* Print time: 1 hour 15 minutes&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 7: Assembly&#039;&#039;&#039;&lt;br /&gt;
* Mount sensor to bracket with M3×10mm screws and nuts&lt;br /&gt;
* Mount bracket to chassis with M3×8mm screws&lt;br /&gt;
* Connect sensor wiring to microcontroller&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 8: Documentation&#039;&#039;&#039;&lt;br /&gt;
* Take photos of assembled bracket&lt;br /&gt;
* Export STL file&lt;br /&gt;
* Create wiki page: [[SimpleBot:Ultrasonic Sensor Bracket]]&lt;br /&gt;
* Document design decisions and dimensions&lt;br /&gt;
&lt;br /&gt;
== Part 10: Advanced Techniques Preview ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve mastered intermediate skills, explore:&lt;br /&gt;
&lt;br /&gt;
=== Parametric Design ===&lt;br /&gt;
* Use variables in CAD instead of fixed dimensions&lt;br /&gt;
* Adjust one parameter (wheel diameter), entire assembly updates&lt;br /&gt;
* Example: Parametric chassis that scales to different motor sizes&lt;br /&gt;
&lt;br /&gt;
=== Multi-Material Printing ===&lt;br /&gt;
* Dual-extruder printers can print rigid and flexible materials&lt;br /&gt;
* Example: Rigid wheel hub with TPU tire in one print&lt;br /&gt;
&lt;br /&gt;
=== Topology Optimization ===&lt;br /&gt;
* Software removes material from non-stressed areas&lt;br /&gt;
* Creates organic-looking structures with minimal weight&lt;br /&gt;
* Requires advanced CAD software (Fusion 360 Generative Design)&lt;br /&gt;
&lt;br /&gt;
=== Functional Gears and Mechanisms ===&lt;br /&gt;
* Print gears with proper involute tooth profiles&lt;br /&gt;
* Calculate gear ratios for speed reduction&lt;br /&gt;
* Design escapements, ratchets, and complex mechanisms&lt;br /&gt;
&lt;br /&gt;
=== Composite Structures ===&lt;br /&gt;
* Embed carbon fiber rods or metal inserts during printing&lt;br /&gt;
* Creates parts stronger than solid plastic&lt;br /&gt;
* Requires printer pause and careful alignment&lt;br /&gt;
&lt;br /&gt;
== Common Design Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Ignoring layer orientation&#039;&#039;&#039; - Part snaps because forces pull layers apart&lt;br /&gt;
* &#039;&#039;&#039;Designing like metal parts&#039;&#039;&#039; - Sharp corners, thin walls, complex geometry that needs support&lt;br /&gt;
* &#039;&#039;&#039;Forgetting shrinkage&#039;&#039;&#039; - Holes too small, shafts too big&lt;br /&gt;
* &#039;&#039;&#039;Over-constraining assemblies&#039;&#039;&#039; - Parts can&#039;t fit together due to tolerance stack-up&lt;br /&gt;
* &#039;&#039;&#039;Skipping test prints&#039;&#039;&#039; - Wasting 6 hours on full-quality print that doesn&#039;t fit&lt;br /&gt;
* &#039;&#039;&#039;Using 100% infill&#039;&#039;&#039; - Wastes time and material, adds minimal strength&lt;br /&gt;
* &#039;&#039;&#039;Not adding fillets&#039;&#039;&#039; - Stress concentrations cause cracking&lt;br /&gt;
* &#039;&#039;&#039;Ignoring print direction visibility&#039;&#039;&#039; - Layer lines ugly on visible faces&lt;br /&gt;
&lt;br /&gt;
== Design Patterns for Common Robotics Parts ==&lt;br /&gt;
&lt;br /&gt;
=== Motor Mount ===&lt;br /&gt;
* Cylindrical pocket for motor body (motor OD + 0.2mm)&lt;br /&gt;
* Flat bottom of pocket (no support needed)&lt;br /&gt;
* M3 clearance holes aligned with motor mounting holes&lt;br /&gt;
* Ribs connecting motor to mounting points&lt;br /&gt;
* Layer orientation: Motor axis parallel to build plate&lt;br /&gt;
&lt;br /&gt;
=== Wheel Hub ===&lt;br /&gt;
* Press-fit hole for motor shaft (shaft diameter - 0.1mm)&lt;br /&gt;
* Perpendicular M3 set screw to lock shaft&lt;br /&gt;
* Outer rim for tire attachment&lt;br /&gt;
* Spokes to reduce weight&lt;br /&gt;
* Print flat on bed (strongest direction for torque)&lt;br /&gt;
&lt;br /&gt;
=== Sensor Bracket ===&lt;br /&gt;
* Flat mounting face perpendicular to sensor&lt;br /&gt;
* M3 clearance holes for sensor screws&lt;br /&gt;
* 45° angle support to chassis&lt;br /&gt;
* Thin walls (save material, print faster)&lt;br /&gt;
&lt;br /&gt;
=== Cable Management Clip ===&lt;br /&gt;
* C-shaped clip with slight interference fit&lt;br /&gt;
* PETG material (flexes without breaking)&lt;br /&gt;
* Mounting hole or adhesive pad for attachment&lt;br /&gt;
* Layer orientation: Flex perpendicular to layers&lt;br /&gt;
&lt;br /&gt;
=== Battery Holder ===&lt;br /&gt;
* Cavity for battery with 1-2mm clearance (easy insertion)&lt;br /&gt;
* Contact points for terminals&lt;br /&gt;
* Strap or clip to retain battery&lt;br /&gt;
* Ventilation holes (safety)&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Apply Your Skills ===&lt;br /&gt;
* &#039;&#039;&#039;Design custom parts for [[SimpleBot]]&#039;&#039;&#039;&lt;br /&gt;
** New sensor brackets for additional capabilities&lt;br /&gt;
** Modified chassis for different battery configurations&lt;br /&gt;
** Custom wheel designs for different terrains&lt;br /&gt;
* &#039;&#039;&#039;Document your designs&#039;&#039;&#039; as implementation pages&lt;br /&gt;
* &#039;&#039;&#039;Share STL files&#039;&#039;&#039; with the BRS community&lt;br /&gt;
&lt;br /&gt;
=== Continue Learning ===&lt;br /&gt;
* &#039;&#039;&#039;[[CAD Design]]&#039;&#039;&#039; - Master parametric modeling&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Understand forces and structural analysis&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Explore advanced competency overview&lt;br /&gt;
* &#039;&#039;&#039;Advanced FDM Techniques&#039;&#039;&#039; (future tutorial) - Multi-material, optimization, complex mechanisms&lt;br /&gt;
&lt;br /&gt;
=== Join the Community ===&lt;br /&gt;
* Share your designs on Printables, Thingiverse&lt;br /&gt;
* Get feedback on r/3Dprinting or r/functionalprint&lt;br /&gt;
* Contribute STL files to BRS robot repositories&lt;br /&gt;
* Create tutorials for techniques you discover&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Online Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Fusion 360&#039;&#039;&#039; (free for hobbyists) - Parametric CAD with simulation&lt;br /&gt;
* &#039;&#039;&#039;FreeCAD&#039;&#039;&#039; (free, open-source) - Full-featured parametric CAD&lt;br /&gt;
* &#039;&#039;&#039;Onshape&#039;&#039;&#039; (free for public projects) - Cloud-based CAD&lt;br /&gt;
* &#039;&#039;&#039;Blender&#039;&#039;&#039; (free) - Organic modeling (less suitable for mechanical parts)&lt;br /&gt;
&lt;br /&gt;
=== Reference Materials ===&lt;br /&gt;
* &#039;&#039;&#039;[https://www.prusa3d.com/page/print-quality-troubleshooting_464/ Prusa Print Quality Guide]&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[https://www.cnckitchen.com/ CNC Kitchen]&#039;&#039;&#039; - Engineering tests of printed parts&lt;br /&gt;
* &#039;&#039;&#039;[https://www.youtube.com/c/MakersMuseOriginals Maker&#039;s Muse]&#039;&#039;&#039; - 3D printing techniques&lt;br /&gt;
* &#039;&#039;&#039;[https://www.youtube.com/c/DesignPrototypeTest Design Prototype Test]&#039;&#039;&#039; - Functional design&lt;br /&gt;
&lt;br /&gt;
=== Community ===&lt;br /&gt;
* &#039;&#039;&#039;Reddit r/functionalprint&#039;&#039;&#039; - Share functional designs&lt;br /&gt;
* &#039;&#039;&#039;Printables&#039;&#039;&#039; / &#039;&#039;&#039;Thingiverse&#039;&#039;&#039; - Download and share STL files&lt;br /&gt;
* &#039;&#039;&#039;BRS Discord&#039;&#039;&#039; (future) - Real-time help with designs&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[3D Printing]] - Full competency overview&lt;br /&gt;
* [[3D Printing Basics]] - Foundation tutorial&lt;br /&gt;
* [[CAD Design]] - Create models to print&lt;br /&gt;
* [[SimpleBot]] - Apply your skills to build robots&lt;br /&gt;
* [[Capabilities]] - Mechanical parts enable capabilities&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:3D Printing]]&lt;br /&gt;
[[Category:Intermediate]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Mechanical_Design&amp;diff=85</id>
		<title>Mechanical Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Mechanical_Design&amp;diff=85"/>
		<updated>2025-10-11T20:15:59Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Mechanical Design |competency=Mechanics |difficulty=Beginner |time=3-5 hours (split across multiple sessions) |prerequisites=Basic familiarity with 3D printing and CAD software |materials=Calipers ($15-30), CAD software (FreeCAD or Fusion 360), ruler, existing robot parts to measure |next_steps=Design custom parts for your robot, study SimpleBot CAD files, Gear Ratio Calculation }}  &amp;#039;&amp;#039;&amp;#039;Mechanical Design&amp;#039;&amp;#039;&amp;#039; is your introduction to designing 3D...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Mechanical Design&lt;br /&gt;
|competency=[[Mechanics]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=3-5 hours (split across multiple sessions)&lt;br /&gt;
|prerequisites=Basic familiarity with 3D printing and CAD software&lt;br /&gt;
|materials=Calipers ($15-30), CAD software (FreeCAD or Fusion 360), ruler, existing robot parts to measure&lt;br /&gt;
|next_steps=Design custom parts for your robot, study [[SimpleBot]] CAD files, [[Gear Ratio Calculation]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mechanical Design&#039;&#039;&#039; is your introduction to designing 3D-printable robot parts using CAD (Computer-Aided Design) software. This tutorial covers the essential skills for creating mounts, brackets, and structural parts for robots like [[SimpleBot]].&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll understand:&lt;br /&gt;
* How to measure existing components with calipers&lt;br /&gt;
* How to design parts that fit together (tolerances)&lt;br /&gt;
* How to design mounting holes and fastener clearances&lt;br /&gt;
* How to create assemblies with multiple parts&lt;br /&gt;
* How to design for 3D printing (overhangs, bridges, support)&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039;. You&#039;ll design a sensor mount for [[SimpleBot]] as a practical example.&lt;br /&gt;
&lt;br /&gt;
== Part 1: CAD Software Setup ==&lt;br /&gt;
&lt;br /&gt;
=== Choosing CAD Software ===&lt;br /&gt;
&lt;br /&gt;
For robotics, you need &#039;&#039;&#039;parametric CAD&#039;&#039;&#039; software that can create precise mechanical parts:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FreeCAD&#039;&#039;&#039; (Free, open-source)&lt;br /&gt;
** Pros: Completely free, runs on Linux/Mac/Windows, extensible&lt;br /&gt;
** Cons: Steeper learning curve, less polished UI&lt;br /&gt;
** Best for: Open-source advocates, Linux users, learning fundamentals&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Fusion 360&#039;&#039;&#039; (Free for hobbyists, students, startups under $100k)&lt;br /&gt;
** Pros: Professional-grade, excellent tutorials, cloud storage&lt;br /&gt;
** Cons: Requires account, online-only, subscription after trial&lt;br /&gt;
** Best for: Beginners, professional workflow, collaboration&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;OnShape&#039;&#039;&#039; (Free for public projects)&lt;br /&gt;
** Pros: Browser-based, collaborative, parametric&lt;br /&gt;
** Cons: Projects are public unless you pay&lt;br /&gt;
** Best for: Collaboration, Chromebook users&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This tutorial uses FreeCAD&#039;&#039;&#039; (works on all platforms), but concepts apply to any CAD software.&lt;br /&gt;
&lt;br /&gt;
=== Installing FreeCAD ===&lt;br /&gt;
&lt;br /&gt;
# Download from [https://www.freecadweb.org/ FreeCAD.org]&lt;br /&gt;
# Install (Linux: use package manager, Windows/Mac: run installer)&lt;br /&gt;
# Launch FreeCAD and create a new document (File → New)&lt;br /&gt;
# Select &#039;&#039;&#039;Part Design&#039;&#039;&#039; workbench (dropdown at top)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key FreeCAD concepts:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Sketch&#039;&#039;&#039; - 2D drawing on a plane (constrained shapes)&lt;br /&gt;
* &#039;&#039;&#039;Pad&#039;&#039;&#039; - Extrude sketch into 3D solid (add material)&lt;br /&gt;
* &#039;&#039;&#039;Pocket&#039;&#039;&#039; - Cut sketch from 3D solid (remove material)&lt;br /&gt;
* &#039;&#039;&#039;Body&#039;&#039;&#039; - Container for features (one part = one body)&lt;br /&gt;
&lt;br /&gt;
== Part 2: Measuring with Calipers ==&lt;br /&gt;
&lt;br /&gt;
Before designing parts, you need accurate measurements. &#039;&#039;&#039;Digital calipers&#039;&#039;&#039; are essential.&lt;br /&gt;
&lt;br /&gt;
=== Caliper Basics ===&lt;br /&gt;
&lt;br /&gt;
Calipers measure:&lt;br /&gt;
* &#039;&#039;&#039;Outside dimensions&#039;&#039;&#039; - Outer diameter, width (large jaws)&lt;br /&gt;
* &#039;&#039;&#039;Inside dimensions&#039;&#039;&#039; - Inner diameter, hole size (small jaws)&lt;br /&gt;
* &#039;&#039;&#039;Depth&#039;&#039;&#039; - How deep a hole or recess is (depth probe)&lt;br /&gt;
* &#039;&#039;&#039;Step height&#039;&#039;&#039; - Difference in height between surfaces&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Accuracy:&#039;&#039;&#039; Digital calipers measure to 0.01mm (0.0005 inches)&lt;br /&gt;
&lt;br /&gt;
=== Measuring Technique ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Zero the calipers&#039;&#039;&#039; - Close jaws and press &amp;quot;zero&amp;quot; button&lt;br /&gt;
# &#039;&#039;&#039;Place part squarely&#039;&#039;&#039; - Jaws perpendicular to surface&lt;br /&gt;
# &#039;&#039;&#039;Gentle pressure&#039;&#039;&#039; - Don&#039;t squeeze too hard (deforms plastic)&lt;br /&gt;
# &#039;&#039;&#039;Read display&#039;&#039;&#039; - Switch between mm and inches with &amp;quot;mm/inch&amp;quot; button&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exercise:&#039;&#039;&#039; Measure these dimensions on your [[Infrared Line Detector]] sensor:&lt;br /&gt;
* Width of PCB&lt;br /&gt;
* Height of PCB&lt;br /&gt;
* Mounting hole diameter&lt;br /&gt;
* Distance between mounting holes (center-to-center)&lt;br /&gt;
* Height of sensor above PCB bottom&lt;br /&gt;
&lt;br /&gt;
Write down measurements - you&#039;ll use them to design a mount!&lt;br /&gt;
&lt;br /&gt;
=== Common Measurement Mistakes ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Tilted calipers&#039;&#039;&#039; - Jaws not perpendicular gives false reading&lt;br /&gt;
* &#039;&#039;&#039;Measuring over obstacles&#039;&#039;&#039; - Measure at narrowest point (not over screw heads)&lt;br /&gt;
* &#039;&#039;&#039;Forgetting to zero&#039;&#039;&#039; - Calipers drift; re-zero before each measurement&lt;br /&gt;
* &#039;&#039;&#039;Confusing inside/outside&#039;&#039;&#039; - Check which jaws you&#039;re using&lt;br /&gt;
* &#039;&#039;&#039;Rounding too aggressively&#039;&#039;&#039; - Keep 0.1mm precision, don&#039;t round to whole mm&lt;br /&gt;
&lt;br /&gt;
== Part 3: Designing a Sensor Mount ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s design a mount for an [[Infrared Line Detector]] sensor. This mount will:&lt;br /&gt;
* Hold the sensor at correct height (3-5mm from ground)&lt;br /&gt;
* Attach to SimpleBot chassis with M3 screws&lt;br /&gt;
* Keep sensor level and aligned&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Create a Sketch (Base Plate) ===&lt;br /&gt;
&lt;br /&gt;
In FreeCAD Part Design workbench:&lt;br /&gt;
&lt;br /&gt;
# Create a new &#039;&#039;&#039;Body&#039;&#039;&#039; (right-click Body in tree, select &amp;quot;Create body&amp;quot;)&lt;br /&gt;
# Create a &#039;&#039;&#039;Sketch&#039;&#039;&#039; on XY plane&lt;br /&gt;
# Draw a &#039;&#039;&#039;rectangle&#039;&#039;&#039; - 30mm × 20mm (base plate for mount)&lt;br /&gt;
# &#039;&#039;&#039;Constrain dimensions&#039;&#039;&#039; - Select each edge, press &amp;quot;C&amp;quot; (constrain), enter value&lt;br /&gt;
# Close sketch (click &amp;quot;Close&amp;quot; in toolbar)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Press &amp;quot;V&amp;quot; then &amp;quot;F&amp;quot; to fit sketch to screen.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Extrude Base Plate (Pad) ===&lt;br /&gt;
&lt;br /&gt;
# Select the closed sketch&lt;br /&gt;
# Click &#039;&#039;&#039;Pad&#039;&#039;&#039; tool (extrude icon)&lt;br /&gt;
# Set length to 2mm (base plate thickness)&lt;br /&gt;
# Click OK&lt;br /&gt;
&lt;br /&gt;
You now have a 30mm × 20mm × 2mm base plate!&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Add Mounting Holes for Chassis ===&lt;br /&gt;
&lt;br /&gt;
The base plate needs holes to attach to the robot chassis with M3 screws.&lt;br /&gt;
&lt;br /&gt;
# Select top face of base plate&lt;br /&gt;
# Create new &#039;&#039;&#039;Sketch&#039;&#039;&#039; on that face&lt;br /&gt;
# Draw two &#039;&#039;&#039;circles&#039;&#039;&#039; - 3.2mm diameter, 20mm apart horizontally, centered vertically&lt;br /&gt;
# Close sketch&lt;br /&gt;
# Select sketch and click &#039;&#039;&#039;Pocket&#039;&#039;&#039; tool (cut icon)&lt;br /&gt;
# Set depth to &amp;quot;Through All&amp;quot;&lt;br /&gt;
# Click OK&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why 3.2mm holes for M3 screws?&#039;&#039;&#039;&lt;br /&gt;
* M3 screw is 3.0mm diameter&lt;br /&gt;
* 0.2mm clearance (3D printing tolerance) = 3.2mm hole&lt;br /&gt;
* This allows screws to pass through freely (&#039;&#039;&#039;clearance hole&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Add Vertical Wall for Sensor ===&lt;br /&gt;
&lt;br /&gt;
The sensor mounts vertically on a wall:&lt;br /&gt;
&lt;br /&gt;
# Select front face of base plate&lt;br /&gt;
# Create new &#039;&#039;&#039;Sketch&#039;&#039;&#039; on that face&lt;br /&gt;
# Draw a &#039;&#039;&#039;rectangle&#039;&#039;&#039; - 25mm wide × 15mm tall&lt;br /&gt;
# Close sketch&lt;br /&gt;
# &#039;&#039;&#039;Pad&#039;&#039;&#039; forward 2mm (wall thickness)&lt;br /&gt;
&lt;br /&gt;
Now you have a base plate with a vertical wall!&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Add Sensor Mounting Holes ===&lt;br /&gt;
&lt;br /&gt;
The sensor PCB attaches to the wall with two M3 screws:&lt;br /&gt;
&lt;br /&gt;
# Select front face of vertical wall&lt;br /&gt;
# Create new &#039;&#039;&#039;Sketch&#039;&#039;&#039;&lt;br /&gt;
# Measure your sensor: holes are (example) 20mm apart, 8mm from bottom&lt;br /&gt;
# Draw two &#039;&#039;&#039;circles&#039;&#039;&#039; - 2.8mm diameter, positioned to match sensor holes&lt;br /&gt;
# Close sketch&lt;br /&gt;
# &#039;&#039;&#039;Pocket&#039;&#039;&#039; depth &amp;quot;Through All&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why 2.8mm holes for M3 screws in plastic?&#039;&#039;&#039;&lt;br /&gt;
* M3 screw is 3.0mm diameter&lt;br /&gt;
* &#039;&#039;&#039;Thread-forming screws&#039;&#039;&#039; cut threads in plastic as they&#039;re screwed in&lt;br /&gt;
* 2.8mm hole (0.2mm undersized) allows screw to cut threads tightly&lt;br /&gt;
* Alternative: Use 3.2mm holes and M3 nuts on backside&lt;br /&gt;
&lt;br /&gt;
=== Step 6: Add Chamfers (Optional) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Chamfers&#039;&#039;&#039; are angled edges that improve appearance and printability:&lt;br /&gt;
&lt;br /&gt;
# Select top edges of base plate&lt;br /&gt;
# Click &#039;&#039;&#039;Chamfer&#039;&#039;&#039; tool&lt;br /&gt;
# Set distance to 0.5mm&lt;br /&gt;
# Click OK&lt;br /&gt;
&lt;br /&gt;
This removes sharp corners and helps the print look professional.&lt;br /&gt;
&lt;br /&gt;
== Part 4: Design for 3D Printing ==&lt;br /&gt;
&lt;br /&gt;
Not all CAD designs can be 3D printed successfully. Follow these rules:&lt;br /&gt;
&lt;br /&gt;
=== Overhang Rule: 45-Degree Maximum ===&lt;br /&gt;
&lt;br /&gt;
FDM printers struggle with overhangs steeper than 45 degrees:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;OK:&#039;&#039;&#039; Walls at 90 degrees (vertical), floors at 0 degrees (horizontal)&lt;br /&gt;
* &#039;&#039;&#039;OK:&#039;&#039;&#039; 45-degree chamfers and slopes&lt;br /&gt;
* &#039;&#039;&#039;NOT OK:&#039;&#039;&#039; Upside-down 45-degree slopes (use support)&lt;br /&gt;
* &#039;&#039;&#039;NOT OK:&#039;&#039;&#039; Horizontal holes (print vertically or use support)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fix:&#039;&#039;&#039; Orient part so overhangs are under 45 degrees, or add supports.&lt;br /&gt;
&lt;br /&gt;
=== Bridging Rule: Short Gaps Only ===&lt;br /&gt;
&lt;br /&gt;
Printers can &#039;&#039;bridge&#039;&#039; gaps (print unsupported horizontal lines) up to ~20mm:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;OK:&#039;&#039;&#039; 10mm horizontal hole (bridges nicely)&lt;br /&gt;
* &#039;&#039;&#039;NOT OK:&#039;&#039;&#039; 50mm horizontal hole (sags in middle)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fix:&#039;&#039;&#039; Keep bridged gaps under 20mm, or use support.&lt;br /&gt;
&lt;br /&gt;
=== Minimum Feature Size ===&lt;br /&gt;
&lt;br /&gt;
FDM printers have limits on small features:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Minimum wall thickness:&#039;&#039;&#039; 1.2mm (2× nozzle diameter for 0.6mm nozzle)&lt;br /&gt;
* &#039;&#039;&#039;Minimum hole diameter:&#039;&#039;&#039; 2mm (smaller holes often close up)&lt;br /&gt;
* &#039;&#039;&#039;Minimum gap:&#039;&#039;&#039; 0.4mm (smaller gaps fuse together)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fix:&#039;&#039;&#039; Make features at least 2mm thick for reliability.&lt;br /&gt;
&lt;br /&gt;
=== Tolerances for Fit ===&lt;br /&gt;
&lt;br /&gt;
3D printed parts shrink slightly and have rough surfaces. Add clearance:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Press fit:&#039;&#039;&#039; 0.0 to 0.1mm clearance (tight, may need force)&lt;br /&gt;
* &#039;&#039;&#039;Sliding fit:&#039;&#039;&#039; 0.2 to 0.3mm clearance (moves smoothly)&lt;br /&gt;
* &#039;&#039;&#039;Loose fit:&#039;&#039;&#039; 0.5mm+ clearance (rattles slightly)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For our sensor mount:&#039;&#039;&#039;&lt;br /&gt;
* Chassis mounting holes: 3.2mm (clearance fit for M3 screws)&lt;br /&gt;
* Sensor mounting holes: 2.8mm (thread-forming fit)&lt;br /&gt;
&lt;br /&gt;
== Part 5: Assemblies (Multiple Parts) ==&lt;br /&gt;
&lt;br /&gt;
Real robots have many parts. CAD software can show how they fit together:&lt;br /&gt;
&lt;br /&gt;
=== Creating an Assembly in FreeCAD ===&lt;br /&gt;
&lt;br /&gt;
# Create new document&lt;br /&gt;
# Insert parts: File → Insert → Part (select your sensor mount .FCStd file)&lt;br /&gt;
# Insert sensor model (if available) or create a simple box to represent it&lt;br /&gt;
# Use &#039;&#039;&#039;Transform&#039;&#039;&#039; tool to position parts&lt;br /&gt;
# Add &#039;&#039;&#039;Constraints&#039;&#039;&#039; to lock parts in place&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Assembly shows:&#039;&#039;&#039;&lt;br /&gt;
* Do parts collide or interfere?&lt;br /&gt;
* Are mounting holes aligned?&lt;br /&gt;
* Is sensor at correct height?&lt;br /&gt;
&lt;br /&gt;
=== Common Assembly Mistakes ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Over-constrained:&#039;&#039;&#039; Too many screws in slotted holes (thermal expansion causes binding)&lt;br /&gt;
* &#039;&#039;&#039;Under-constrained:&#039;&#039;&#039; Part wobbles or shifts (add more screws or pins)&lt;br /&gt;
* &#039;&#039;&#039;Interference:&#039;&#039;&#039; Parts overlap (check clearances)&lt;br /&gt;
* &#039;&#039;&#039;Wire routing:&#039;&#039;&#039; No space for wires (leave gaps and channels)&lt;br /&gt;
&lt;br /&gt;
== Part 6: Practical Design Exercise ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s design a motor mount bracket for SimpleBot:&lt;br /&gt;
&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
* Mount a DC motor to acrylic chassis&lt;br /&gt;
* Motor diameter: 24mm (measure with calipers)&lt;br /&gt;
* Motor shaft length: 12mm (protrudes from motor)&lt;br /&gt;
* Chassis mounting: Two M3 screws, 20mm apart&lt;br /&gt;
* Motor output: Wheel must attach to shaft&lt;br /&gt;
&lt;br /&gt;
=== Design Steps ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Sketch base plate&#039;&#039;&#039; - 30mm × 30mm × 3mm thick (stronger for motor vibration)&lt;br /&gt;
# &#039;&#039;&#039;Add motor clamp&#039;&#039;&#039; - Half-circle cutout 24.2mm diameter (0.2mm clearance)&lt;br /&gt;
## Pad walls on both sides to clamp motor&lt;br /&gt;
## Add M3 screw hole through walls to tighten clamp&lt;br /&gt;
# &#039;&#039;&#039;Add chassis mounting holes&#039;&#039;&#039; - Two 3.2mm holes, 20mm apart&lt;br /&gt;
# &#039;&#039;&#039;Add wire routing&#039;&#039;&#039; - Small channel for motor wires to exit&lt;br /&gt;
# &#039;&#039;&#039;Check clearances&#039;&#039;&#039; - Wheel must not hit chassis (leave 2mm gap)&lt;br /&gt;
&lt;br /&gt;
=== Design Checklist ===&lt;br /&gt;
&lt;br /&gt;
Before printing, verify:&lt;br /&gt;
* ☐ All holes are correct size (calipers + tolerance)&lt;br /&gt;
* ☐ Mounting points are spaced correctly (measure chassis)&lt;br /&gt;
* ☐ No overhangs steeper than 45 degrees (or add supports)&lt;br /&gt;
* ☐ Minimum wall thickness 1.2mm&lt;br /&gt;
* ☐ Clearance for moving parts (wheels, gears)&lt;br /&gt;
* ☐ Space for wires to route through&lt;br /&gt;
* ☐ Chamfers on sharp edges (optional, looks better)&lt;br /&gt;
&lt;br /&gt;
== Part 7: Exporting for 3D Printing ==&lt;br /&gt;
&lt;br /&gt;
=== Export STL File ===&lt;br /&gt;
&lt;br /&gt;
# Select the &#039;&#039;&#039;Body&#039;&#039;&#039; in FreeCAD tree&lt;br /&gt;
# File → Export → Select &amp;quot;STL Mesh&amp;quot; format&lt;br /&gt;
# Save as &amp;quot;sensor_mount.stl&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;STL&#039;&#039;&#039; (STereoLithography) is the universal format for 3D printing - it stores the outer shell as triangles.&lt;br /&gt;
&lt;br /&gt;
=== Slicing (Preparing for Print) ===&lt;br /&gt;
&lt;br /&gt;
Use slicer software (Cura, PrusaSlicer, etc.):&lt;br /&gt;
&lt;br /&gt;
# Import STL file&lt;br /&gt;
# Orient part (flat side down, minimize supports)&lt;br /&gt;
# Set print settings:&lt;br /&gt;
## &#039;&#039;&#039;Layer height:&#039;&#039;&#039; 0.2mm (good balance of speed and quality)&lt;br /&gt;
## &#039;&#039;&#039;Infill:&#039;&#039;&#039; 20% (functional parts), 10% (decorative)&lt;br /&gt;
## &#039;&#039;&#039;Supports:&#039;&#039;&#039; Enable if overhangs exceed 45 degrees&lt;br /&gt;
## &#039;&#039;&#039;Material:&#039;&#039;&#039; PLA (easy), PETG (strong), ABS (heat-resistant)&lt;br /&gt;
# Slice and generate G-code&lt;br /&gt;
# Send to printer or save to SD card&lt;br /&gt;
&lt;br /&gt;
=== Print Orientation ===&lt;br /&gt;
&lt;br /&gt;
Orientation affects strength and quality:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Best strength:&#039;&#039;&#039; Forces perpendicular to layers (layers resist shear poorly)&lt;br /&gt;
* &#039;&#039;&#039;Best quality:&#039;&#039;&#039; Curved surfaces horizontal (layers follow curve)&lt;br /&gt;
* &#039;&#039;&#039;Minimize supports:&#039;&#039;&#039; Flat side down, overhangs under 45 degrees&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For sensor mount:&#039;&#039;&#039; Print base plate down (vertical wall prints nicely, no supports needed).&lt;br /&gt;
&lt;br /&gt;
== Part 8: Iteration and Testing ==&lt;br /&gt;
&lt;br /&gt;
First prints rarely fit perfectly. Iterate:&lt;br /&gt;
&lt;br /&gt;
=== Test Fit ===&lt;br /&gt;
&lt;br /&gt;
# Print part&lt;br /&gt;
# Test fit with real components (sensor, screws, chassis)&lt;br /&gt;
# Check for issues:&lt;br /&gt;
## Holes too tight? Increase diameter by 0.1-0.2mm&lt;br /&gt;
## Holes too loose? Decrease diameter by 0.1-0.2mm&lt;br /&gt;
## Part warps? Add thicker base or print slower&lt;br /&gt;
&lt;br /&gt;
=== Common Print Issues and Fixes ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Issue !! Cause !! Fix&lt;br /&gt;
|-&lt;br /&gt;
| Warping (corners lift) || Uneven cooling || Add brim or raft, lower bed temp&lt;br /&gt;
|-&lt;br /&gt;
| Holes too small || Printer over-extrudes || Increase hole diameter by 0.2mm&lt;br /&gt;
|-&lt;br /&gt;
| Weak parts || Under-extruding || Increase flow rate or check filament&lt;br /&gt;
|-&lt;br /&gt;
| Rough surface || Too fast, too hot || Slow down print, lower nozzle temp&lt;br /&gt;
|-&lt;br /&gt;
| Supports stuck || Too close to part || Increase support gap in slicer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Design Iteration Loop ===&lt;br /&gt;
&lt;br /&gt;
# Design part in CAD&lt;br /&gt;
# Export STL and slice&lt;br /&gt;
# Print part&lt;br /&gt;
# Test fit and identify issues&lt;br /&gt;
# Modify CAD design (change dimensions)&lt;br /&gt;
# Repeat until perfect fit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Print small test sections first (just one mounting hole) to check fit before printing the entire part.&lt;br /&gt;
&lt;br /&gt;
== Part 9: Advanced Techniques ==&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re comfortable with basic design:&lt;br /&gt;
&lt;br /&gt;
=== Parametric Design ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Parameters&#039;&#039;&#039; are variables you can change to update the entire design:&lt;br /&gt;
&lt;br /&gt;
* Create a parameter &amp;quot;motor_diameter = 24mm&amp;quot;&lt;br /&gt;
* Use &amp;quot;motor_diameter + 0.2mm&amp;quot; for clamp hole size&lt;br /&gt;
* Change motor_diameter to 20mm → entire mount resizes!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In FreeCAD:&#039;&#039;&#039; Use Spreadsheet workbench to create parameters.&lt;br /&gt;
&lt;br /&gt;
=== Fillets vs Chamfers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Chamfer&#039;&#039;&#039; - Angled edge (45 degrees typical), easier to print&lt;br /&gt;
* &#039;&#039;&#039;Fillet&#039;&#039;&#039; - Rounded edge, stronger, looks better, slower to print&lt;br /&gt;
&lt;br /&gt;
Use fillets for stress concentration areas (corners that bear load).&lt;br /&gt;
&lt;br /&gt;
=== Threaded Holes ===&lt;br /&gt;
&lt;br /&gt;
Instead of thread-forming screws, design threads into plastic:&lt;br /&gt;
&lt;br /&gt;
* M3 thread = 3.0mm outer diameter, 0.5mm pitch&lt;br /&gt;
* Add &#039;&#039;&#039;Helix&#039;&#039;&#039; feature (spiral) and &#039;&#039;&#039;Subtract&#039;&#039;&#039; to cut threads&lt;br /&gt;
* Requires high resolution (0.1mm layers) to print clearly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Easier alternative:&#039;&#039;&#039; Use heat-set inserts (metal threaded inserts melted into plastic).&lt;br /&gt;
&lt;br /&gt;
=== Assemblies with Motion ===&lt;br /&gt;
&lt;br /&gt;
Design parts that move (hinges, gears, linkages):&lt;br /&gt;
&lt;br /&gt;
* Add clearance for rotation (0.3mm radial clearance for shafts)&lt;br /&gt;
* Use &#039;&#039;&#039;Snap fits&#039;&#039;&#039; - flexible tabs that lock parts together&lt;br /&gt;
* Use &#039;&#039;&#039;Living hinges&#039;&#039;&#039; - thin flexible sections (0.3-0.5mm thick)&lt;br /&gt;
&lt;br /&gt;
=== Library of Standard Parts ===&lt;br /&gt;
&lt;br /&gt;
Don&#039;t redesign screws and nuts - import models:&lt;br /&gt;
&lt;br /&gt;
* [https://grabcad.com/ GrabCAD] - Free CAD library&lt;br /&gt;
* [https://www.mcmaster.com/ McMaster-Carr] - CAD models for every fastener&lt;br /&gt;
* FreeCAD Fasteners Workbench - Built-in screw library&lt;br /&gt;
&lt;br /&gt;
== Part 10: Studying Existing Designs ==&lt;br /&gt;
&lt;br /&gt;
Learn from [[SimpleBot]] CAD files:&lt;br /&gt;
&lt;br /&gt;
# Download SimpleBot repository (symlinked at ./simplebot/)&lt;br /&gt;
# Open FreeCAD files (.FCStd) in CAD software&lt;br /&gt;
# Study how parts fit together&lt;br /&gt;
# Measure features with &#039;&#039;&#039;Measure&#039;&#039;&#039; tool&lt;br /&gt;
# Modify and remix designs for your own robot&lt;br /&gt;
&lt;br /&gt;
=== What to Look For ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hole placements&#039;&#039;&#039; - How are mounting holes spaced?&lt;br /&gt;
* &#039;&#039;&#039;Tolerances&#039;&#039;&#039; - What clearances are used for screws and shafts?&lt;br /&gt;
* &#039;&#039;&#039;Wall thicknesses&#039;&#039;&#039; - How thick are structural parts?&lt;br /&gt;
* &#039;&#039;&#039;Assembly method&#039;&#039;&#039; - How do multiple parts attach?&lt;br /&gt;
* &#039;&#039;&#039;Wire routing&#039;&#039;&#039; - Where do wires pass through?&lt;br /&gt;
&lt;br /&gt;
== Part 11: Design Principles for Robotics ==&lt;br /&gt;
&lt;br /&gt;
=== Minimize Part Count ===&lt;br /&gt;
&lt;br /&gt;
Fewer parts = faster assembly, fewer failures:&lt;br /&gt;
&lt;br /&gt;
* Combine multiple features into one part (mount + bracket = one piece)&lt;br /&gt;
* Use snap fits instead of screws where appropriate&lt;br /&gt;
* Design parts to be 3D printable in one piece&lt;br /&gt;
&lt;br /&gt;
=== Design for Assembly ===&lt;br /&gt;
&lt;br /&gt;
Make parts easy to put together:&lt;br /&gt;
&lt;br /&gt;
* Use &#039;&#039;&#039;alignment pins&#039;&#039;&#039; or &#039;&#039;&#039;tabs&#039;&#039;&#039; to position parts correctly&lt;br /&gt;
* Add &#039;&#039;&#039;chamfers&#039;&#039;&#039; to screw holes (guide screws in)&lt;br /&gt;
* Leave &#039;&#039;&#039;clearance&#039;&#039;&#039; for screwdriver or hex key access&lt;br /&gt;
* Print &#039;&#039;&#039;assembly instructions&#039;&#039;&#039; into parts (arrows, labels)&lt;br /&gt;
&lt;br /&gt;
=== Design for Serviceability ===&lt;br /&gt;
&lt;br /&gt;
Robots need maintenance and upgrades:&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t trap components inside (leave access holes)&lt;br /&gt;
* Use standard fasteners (M3 screws are common)&lt;br /&gt;
* Make fragile parts replaceable (separate wheel mounts from chassis)&lt;br /&gt;
* Route wires through channels or clips (prevent tangling)&lt;br /&gt;
&lt;br /&gt;
=== Design for Strength ===&lt;br /&gt;
&lt;br /&gt;
Identify stress points and reinforce them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Thin sections&#039;&#039;&#039; break easily (use minimum 2mm thickness)&lt;br /&gt;
* &#039;&#039;&#039;Sharp corners&#039;&#039;&#039; concentrate stress (add fillets)&lt;br /&gt;
* &#039;&#039;&#039;Cantilever beams&#039;&#039;&#039; need support (add ribs or gussets)&lt;br /&gt;
* &#039;&#039;&#039;Print orientation&#039;&#039;&#039; affects strength (layers are weak in shear)&lt;br /&gt;
&lt;br /&gt;
== Part 12: Resources and Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Learn More CAD ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;FreeCAD Tutorials&#039;&#039;&#039; - [https://www.freecadweb.org/wiki/Tutorials Official wiki tutorials]&lt;br /&gt;
* &#039;&#039;&#039;Fusion 360 Tutorials&#039;&#039;&#039; - [https://www.autodesk.com/products/fusion-360/learn Autodesk Learning]&lt;br /&gt;
* &#039;&#039;&#039;YouTube Channels&#039;&#039;&#039; - Maker&#039;s Muse, Teaching Tech, 3D Printing Nerd&lt;br /&gt;
&lt;br /&gt;
=== Practice Projects ===&lt;br /&gt;
&lt;br /&gt;
# Design a custom sensor mount for your robot&lt;br /&gt;
# Design a battery holder for 4× AA batteries&lt;br /&gt;
# Design a motor mount with gear reduction&lt;br /&gt;
# Design a robot arm with 2 servos&lt;br /&gt;
# Study and remix [[SimpleBot]] chassis&lt;br /&gt;
&lt;br /&gt;
=== Advanced Topics ===&lt;br /&gt;
&lt;br /&gt;
* [[Gear Ratio Calculation]] - Design gear trains for speed/torque&lt;br /&gt;
* [[Kinematics Tutorial]] - Calculate robot motion from wheel speeds&lt;br /&gt;
* [[Inverse Kinematics]] - Multi-DOF robot arm calculations&lt;br /&gt;
* [[FEA Tutorial]] - Simulate stress in parts (advanced)&lt;br /&gt;
&lt;br /&gt;
=== Related Competencies ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Fabricate your designs&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Understand forces and motion&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Design mounts for sensors and motors&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Assemble electronics that mount to your parts&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== CAD Issues ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sketch won&#039;t close?&#039;&#039;&#039; Check for gaps or overlapping lines&lt;br /&gt;
* &#039;&#039;&#039;Can&#039;t pad sketch?&#039;&#039;&#039; Sketch must be fully constrained&lt;br /&gt;
* &#039;&#039;&#039;Part disappeared?&#039;&#039;&#039; Check if hidden (press &amp;quot;Space&amp;quot; to toggle visibility)&lt;br /&gt;
* &#039;&#039;&#039;Changes don&#039;t update?&#039;&#039;&#039; Press &amp;quot;F5&amp;quot; to recompute all features&lt;br /&gt;
&lt;br /&gt;
=== Print Issues ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Parts don&#039;t fit?&#039;&#039;&#039; Add 0.2mm clearance for sliding fits&lt;br /&gt;
* &#039;&#039;&#039;Screw holes too tight?&#039;&#039;&#039; Increase diameter by 0.2mm&lt;br /&gt;
* &#039;&#039;&#039;Parts warp?&#039;&#039;&#039; Increase bed adhesion (brim, glue stick, hairspray)&lt;br /&gt;
* &#039;&#039;&#039;Supports won&#039;t remove?&#039;&#039;&#039; Increase support gap to 0.2mm&lt;br /&gt;
&lt;br /&gt;
=== Design Issues ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Part too weak?&#039;&#039;&#039; Increase wall thickness or add ribs&lt;br /&gt;
* &#039;&#039;&#039;Motor vibration causes loosening?&#039;&#039;&#039; Add threadlocker or locknut&lt;br /&gt;
* &#039;&#039;&#039;Wires tangled?&#039;&#039;&#039; Add wire routing channels or clips&lt;br /&gt;
* &#039;&#039;&#039;Parts misaligned?&#039;&#039;&#039; Add alignment pins or reference surfaces&lt;br /&gt;
&lt;br /&gt;
== Summary Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Measure parts accurately with calipers&lt;br /&gt;
* ☐ Create sketches and extrude them into 3D parts&lt;br /&gt;
* ☐ Design mounting holes with correct clearances&lt;br /&gt;
* ☐ Add chamfers and fillets to edges&lt;br /&gt;
* ☐ Export STL files for 3D printing&lt;br /&gt;
* ☐ Design for printability (overhangs, bridging, supports)&lt;br /&gt;
* ☐ Test fit parts and iterate designs&lt;br /&gt;
* ☐ Create assemblies with multiple parts&lt;br /&gt;
* ☐ Design for strength and serviceability&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready to design custom parts for your robot!&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Mechanics]] - Full competency overview&lt;br /&gt;
* [[SimpleBot]] - Apply your skills to build a robot&lt;br /&gt;
* [[3D Printing]] - Fabrication techniques for your designs&lt;br /&gt;
* [[Gear Ratio Calculation]] - Design gear trains&lt;br /&gt;
* [[Robotics Ontology]] - How mechanical design fits into BRS&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Mechanics]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Mechanics&amp;diff=84</id>
		<title>Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Mechanics&amp;diff=84"/>
		<updated>2025-10-11T20:15:49Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=Mechanics |description=Understanding what actuates and what is actuated, what the software models, and where the electronics signals end |difficulty_range=Beginner to Advanced |time_to_basic=1-3 weeks |essential_tools=Calipers, screwdriver set, hex keys, ruler |optional_tools=CAD software (FreeCAD, Fusion 360), torque wrench, 3D printer |beginner_tutorial=Mechanical Design |unlocks_basic=Capability:Differential Drive, [[Capability:Line Sensing]...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=Mechanics&lt;br /&gt;
|description=Understanding what actuates and what is actuated, what the software models, and where the electronics signals end&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=1-3 weeks&lt;br /&gt;
|essential_tools=Calipers, screwdriver set, hex keys, ruler&lt;br /&gt;
|optional_tools=CAD software (FreeCAD, Fusion 360), torque wrench, 3D printer&lt;br /&gt;
|beginner_tutorial=[[Mechanical Design]]&lt;br /&gt;
|unlocks_basic=[[Capability:Differential Drive]], [[Capability:Line Sensing]]&lt;br /&gt;
|unlocks_advanced=[[Capability:Omni Drive]], [[Capability:Gripper Control]], [[Capability:Servo Control]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mechanics&#039;&#039;&#039; is the competency of understanding physical motion, forces, and mechanical systems in robotics. Mechanics is where electronic signals become physical movement - motors spin wheels, servos rotate arms, and gears multiply force. It encompasses understanding kinematics (motion), dynamics (forces), power transmission, and structural design.&lt;br /&gt;
&lt;br /&gt;
Mechanics is distinct from [[3D Printing]] (the fabrication technique) and [[CAD]] (the design software). This competency focuses on &#039;&#039;&#039;understanding&#039;&#039;&#039; mechanical systems: how they move, how forces propagate, and how to design mechanisms that work reliably.&lt;br /&gt;
&lt;br /&gt;
== Why Mechanics Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
Mechanics is the body and muscles of a robot:&lt;br /&gt;
* &#039;&#039;&#039;Actuators&#039;&#039;&#039; convert electrical energy into motion (motors, servos, solenoids)&lt;br /&gt;
* &#039;&#039;&#039;Transmissions&#039;&#039;&#039; modify speed and force (gears, belts, linkages)&lt;br /&gt;
* &#039;&#039;&#039;Chassis&#039;&#039;&#039; provide structural support and mounting points&lt;br /&gt;
* &#039;&#039;&#039;Wheels and drive systems&#039;&#039;&#039; enable locomotion&lt;br /&gt;
* &#039;&#039;&#039;End effectors&#039;&#039;&#039; interact with the environment (grippers, arms, tools)&lt;br /&gt;
&lt;br /&gt;
Without mechanics knowledge, you can&#039;t design effective robots, predict their behavior, or troubleshoot motion problems. The software can send perfect signals, and the electronics can deliver perfect power, but if the mechanics are wrong, the robot won&#039;t work.&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (SimpleBot Level) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to build and understand [[SimpleBot]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Basic kinematics&#039;&#039;&#039; - Understand how wheels create motion, turning radius, velocity&lt;br /&gt;
* &#039;&#039;&#039;Differential drive&#039;&#039;&#039; - Two-wheel steering (forward, backward, turning)&lt;br /&gt;
* &#039;&#039;&#039;Motors&#039;&#039;&#039; - DC motor basics, direction control, speed control&lt;br /&gt;
* &#039;&#039;&#039;Wheels and traction&#039;&#039;&#039; - Wheel diameter, friction, slipping&lt;br /&gt;
* &#039;&#039;&#039;Center of mass&#039;&#039;&#039; - Weight distribution, stability, tipping&lt;br /&gt;
* &#039;&#039;&#039;Mechanical assembly&#039;&#039;&#039; - Using screws, nuts, standoffs, spacers&lt;br /&gt;
* &#039;&#039;&#039;Basic measurements&#039;&#039;&#039; - Using calipers, measuring wheel diameter, gear pitch&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Differential Drive]] (two-motor steering)&lt;br /&gt;
* [[Capability:Line Sensing]] (sensor positioning and alignment)&lt;br /&gt;
* [[Capability:Optical Odometry]] (encoder wheel mounting)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Mechanical Design]], [[Motor Control Basics]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Build SimpleBot from parts or a kit&lt;br /&gt;
* Understand how differential drive works&lt;br /&gt;
* Mount sensors and motors to a chassis&lt;br /&gt;
* Troubleshoot basic mechanical issues (loose wheels, misaligned sensors)&lt;br /&gt;
* Calculate turning radius and basic motion planning&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (Expanding Capabilities) ===&lt;br /&gt;
&lt;br /&gt;
Skills for designing more complex mechanisms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Gear ratios&#039;&#039;&#039; - Speed reduction, torque multiplication, efficiency&lt;br /&gt;
* &#039;&#039;&#039;Torque calculations&#039;&#039;&#039; - Motor torque, load torque, stall conditions&lt;br /&gt;
* &#039;&#039;&#039;Kinematics analysis&#039;&#039;&#039; - Forward kinematics, wheel velocities, robot velocity&lt;br /&gt;
* &#039;&#039;&#039;Structural design&#039;&#039;&#039; - Load paths, stress, strain, material selection&lt;br /&gt;
* &#039;&#039;&#039;Bearings and bushings&#039;&#039;&#039; - Reducing friction in rotating joints&lt;br /&gt;
* &#039;&#039;&#039;Belt and pulley systems&#039;&#039;&#039; - Timing belts, GT2 belts, tensioning&lt;br /&gt;
* &#039;&#039;&#039;Linkages&#039;&#039;&#039; - Four-bar linkages, parallel linkages, mechanical advantage&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Encoder Sensing]] (precise motion control)&lt;br /&gt;
* [[Capability:Servo Control]] (multi-axis arms)&lt;br /&gt;
* [[Capability:Omni Drive]] (holonomic motion with omni wheels or mecanum wheels)&lt;br /&gt;
* [[Capability:Gripper Control]] (claw mechanisms)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Gear Ratio Calculation]], [[Kinematics Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Select motors based on torque and speed requirements&lt;br /&gt;
* Design gear trains for speed reduction or torque multiplication&lt;br /&gt;
* Calculate robot velocity from wheel speeds and encoder counts&lt;br /&gt;
* Design custom mounts and brackets in CAD&lt;br /&gt;
* Integrate servos and multi-DOF mechanisms&lt;br /&gt;
* Troubleshoot binding, friction, and alignment issues&lt;br /&gt;
&lt;br /&gt;
=== Advanced (Custom Designs) ===&lt;br /&gt;
&lt;br /&gt;
Skills for designing robots from scratch:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Inverse kinematics&#039;&#039;&#039; - Calculate joint angles for desired end effector position&lt;br /&gt;
* &#039;&#039;&#039;Dynamics&#039;&#039;&#039; - Forces, inertia, acceleration, momentum&lt;br /&gt;
* &#039;&#039;&#039;Motor selection&#039;&#039;&#039; - Match motor to application (torque-speed curves, efficiency)&lt;br /&gt;
* &#039;&#039;&#039;Mechanical advantage&#039;&#039;&#039; - Leverage, gear ratios, compound machines&lt;br /&gt;
* &#039;&#039;&#039;Finite element analysis&#039;&#039;&#039; - Simulate stress and deformation in parts&lt;br /&gt;
* &#039;&#039;&#039;Closed-loop control&#039;&#039;&#039; - PID control for position, velocity, torque&lt;br /&gt;
* &#039;&#039;&#039;Advanced drive systems&#039;&#039;&#039; - Omni wheels, mecanum wheels, swerve drive&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Robot Arm Control]] (multi-DOF inverse kinematics)&lt;br /&gt;
* [[Capability:Omni Drive]] (holonomic motion)&lt;br /&gt;
* [[Capability:Balancing]] (inverted pendulum, two-wheel balancing)&lt;br /&gt;
* Custom drive trains and locomotion systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Inverse Kinematics]], [[PID Control for Motors]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design multi-DOF robot arms with IK solvers&lt;br /&gt;
* Optimize mechanical systems for efficiency and performance&lt;br /&gt;
* Perform stress analysis and select materials appropriately&lt;br /&gt;
* Design custom transmissions (gearboxes, differentials)&lt;br /&gt;
* Implement advanced control algorithms for mechanical systems&lt;br /&gt;
* Troubleshoot complex mechanical vibration and resonance issues&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: SimpleBot Builder (Beginner) ===&lt;br /&gt;
# Start with [[Mechanical Design]] - Learn basic concepts and measurements&lt;br /&gt;
# Build [[SimpleBot]] - Hands-on experience with differential drive&lt;br /&gt;
# Experiment with wheel changes and sensor mounting&lt;br /&gt;
# Study [[Motor Control Basics]] - Understand motor behavior&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can build SimpleBot and understand how differential drive works.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Mechanism Designer (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (SimpleBot Builder)&lt;br /&gt;
# Study [[Gear Ratio Calculation]] - Learn about gear trains&lt;br /&gt;
# Study [[Kinematics Tutorial]] - Calculate velocities and motion&lt;br /&gt;
# Design a custom gripper or sensor mount in CAD&lt;br /&gt;
# Add encoders or servos to SimpleBot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design custom mechanical systems and calculate their behavior.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Robot Architect (Advanced) ===&lt;br /&gt;
# Complete Path 2 (Mechanism Designer)&lt;br /&gt;
# Study [[Inverse Kinematics]] - Multi-DOF robot arms&lt;br /&gt;
# Study [[PID Control for Motors]] - Closed-loop position control&lt;br /&gt;
# Design a robot arm or custom drive system&lt;br /&gt;
# Implement inverse kinematics in software&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design complex robots with multi-DOF mechanisms from scratch.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Differential Drive ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Differential drive&#039;&#039;&#039; is the simplest robot steering method - two independently-controlled wheels:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Forward&#039;&#039;&#039; - Both wheels rotate forward at same speed&lt;br /&gt;
* &#039;&#039;&#039;Backward&#039;&#039;&#039; - Both wheels rotate backward at same speed&lt;br /&gt;
* &#039;&#039;&#039;Turn right&#039;&#039;&#039; - Left wheel faster than right wheel (or right wheel backward)&lt;br /&gt;
* &#039;&#039;&#039;Turn left&#039;&#039;&#039; - Right wheel faster than left wheel (or left wheel backward)&lt;br /&gt;
* &#039;&#039;&#039;Rotate in place&#039;&#039;&#039; - One wheel forward, one wheel backward&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Turning radius&#039;&#039;&#039; depends on wheel speeds:&lt;br /&gt;
* Equal speeds = infinite turning radius (straight line)&lt;br /&gt;
* Opposite speeds = zero turning radius (rotate in place)&lt;br /&gt;
* Different speeds = turning radius between zero and infinity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot uses differential drive&#039;&#039;&#039; with two DC motors and a caster wheel for balance.&lt;br /&gt;
&lt;br /&gt;
=== Kinematics: Motion Without Forces ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Kinematics&#039;&#039;&#039; describes motion without considering forces:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Linear velocity&#039;&#039;&#039; (v) - Speed in a straight line (m/s or cm/s)&lt;br /&gt;
* &#039;&#039;&#039;Angular velocity&#039;&#039;&#039; (ω) - Rotational speed (rad/s or degrees/s)&lt;br /&gt;
* &#039;&#039;&#039;Wheel velocity&#039;&#039;&#039; - Linear velocity at wheel edge: v = ω × r (radius)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For differential drive robots:&#039;&#039;&#039;&lt;br /&gt;
* Robot velocity = average of left and right wheel velocities&lt;br /&gt;
* Robot turning rate = difference of left and right wheel velocities divided by wheel separation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; If left wheel is at 10 cm/s and right wheel is at 6 cm/s:&lt;br /&gt;
* Robot moves forward at (10 + 6) / 2 = 8 cm/s&lt;br /&gt;
* Robot turns right at (10 - 6) / wheel_separation rad/s&lt;br /&gt;
&lt;br /&gt;
=== Dynamics: Forces and Torque ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamics&#039;&#039;&#039; describes motion considering forces:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Force&#039;&#039;&#039; (F) - Push or pull measured in Newtons (N)&lt;br /&gt;
* &#039;&#039;&#039;Torque&#039;&#039;&#039; (τ) - Rotational force measured in N·m or oz-in&lt;br /&gt;
* &#039;&#039;&#039;Newton&#039;s Second Law&#039;&#039;&#039; - F = m × a (force = mass × acceleration)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For motors:&#039;&#039;&#039;&lt;br /&gt;
* Motor torque determines acceleration and maximum load&lt;br /&gt;
* &#039;&#039;&#039;Stall torque&#039;&#039;&#039; - Maximum torque when motor is not rotating&lt;br /&gt;
* &#039;&#039;&#039;Free-run speed&#039;&#039;&#039; - Maximum speed when motor has no load&lt;br /&gt;
* Operating point is between stall and free-run&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters:&#039;&#039;&#039;&lt;br /&gt;
* Underpowered motor can&#039;t move the robot (insufficient torque)&lt;br /&gt;
* Oversized motor wastes battery and adds weight&lt;br /&gt;
* Steep ramps require more torque than flat ground&lt;br /&gt;
&lt;br /&gt;
=== Gear Ratios and Mechanical Advantage ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gear ratio&#039;&#039;&#039; = Output teeth / Input teeth (or output speed / input speed)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Speed reduction&#039;&#039;&#039; - Large gear ratio (e.g., 30:1) decreases speed, increases torque&lt;br /&gt;
* &#039;&#039;&#039;Speed increase&#039;&#039;&#039; - Small gear ratio (e.g., 1:2) increases speed, decreases torque&lt;br /&gt;
* &#039;&#039;&#039;Power is conserved&#039;&#039;&#039; (minus losses) - Speed × Torque is constant&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; Motor with 100 oz-in torque at 300 RPM, 30:1 gearbox:&lt;br /&gt;
* Output torque ≈ 100 × 30 = 3000 oz-in&lt;br /&gt;
* Output speed = 300 / 30 = 10 RPM&lt;br /&gt;
* Power is approximately conserved (ignoring 5-10% friction losses)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common applications:&#039;&#039;&#039;&lt;br /&gt;
* High-speed motors with gearboxes for robot wheels&lt;br /&gt;
* Servo motors have internal gearboxes for high torque&lt;br /&gt;
* Multi-stage gearboxes for extreme ratios (100:1, 200:1)&lt;br /&gt;
&lt;br /&gt;
=== Center of Mass and Stability ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Center of mass&#039;&#039;&#039; (COM) is the average position of all the robot&#039;s mass:&lt;br /&gt;
&lt;br /&gt;
* Low COM = more stable (less likely to tip)&lt;br /&gt;
* High COM = less stable (easier to tip)&lt;br /&gt;
* COM should be centered between support points (wheels)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stability rules:&#039;&#039;&#039;&lt;br /&gt;
* Robot tips when COM moves outside support polygon&lt;br /&gt;
* Add caster wheels to expand support polygon&lt;br /&gt;
* Keep heavy components (batteries, motors) low and centered&lt;br /&gt;
* SimpleBot uses front caster for three-point stability&lt;br /&gt;
&lt;br /&gt;
=== Friction and Traction ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Friction&#039;&#039;&#039; determines how much force wheels can transfer to the ground:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Static friction&#039;&#039;&#039; - Maximum force before slipping starts&lt;br /&gt;
* &#039;&#039;&#039;Kinetic friction&#039;&#039;&#039; - Force during sliding (less than static)&lt;br /&gt;
* &#039;&#039;&#039;Coefficient of friction&#039;&#039;&#039; (μ) - Material property (rubber on wood ≈ 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Maximum force&#039;&#039;&#039; = μ × Normal force (weight on wheel)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters:&#039;&#039;&#039;&lt;br /&gt;
* Wheels slip if motor torque exceeds traction limit&lt;br /&gt;
* More weight on drive wheels = more traction&lt;br /&gt;
* Rubber wheels have better traction than plastic&lt;br /&gt;
* Encoders may give false readings if wheels slip&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design Principles ==&lt;br /&gt;
&lt;br /&gt;
=== Tolerances for 3D Printing ===&lt;br /&gt;
&lt;br /&gt;
3D printed parts need clearance for fit:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Press fit&#039;&#039;&#039; - 0.0 to 0.1mm clearance (interference fit)&lt;br /&gt;
* &#039;&#039;&#039;Sliding fit&#039;&#039;&#039; - 0.2 to 0.3mm clearance&lt;br /&gt;
* &#039;&#039;&#039;Loose fit&#039;&#039;&#039; - 0.5mm or more clearance&lt;br /&gt;
* Horizontal holes print smaller than designed (add 0.2mm)&lt;br /&gt;
* Vertical holes print more accurately&lt;br /&gt;
&lt;br /&gt;
=== Fasteners and Mounting ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;M3 screws&#039;&#039;&#039; - Most common robot fastener (3mm diameter)&lt;br /&gt;
* &#039;&#039;&#039;Standoffs&#039;&#039;&#039; - Spacers to mount PCBs and separate layers&lt;br /&gt;
* &#039;&#039;&#039;Heat-set inserts&#039;&#039;&#039; - Metal threads in 3D printed parts&lt;br /&gt;
* &#039;&#039;&#039;Thread-forming screws&#039;&#039;&#039; - Cut threads directly into plastic (one-time use)&lt;br /&gt;
&lt;br /&gt;
=== Material Selection ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PLA&#039;&#039;&#039; - Stiff, brittle, easy to print (good for prototypes)&lt;br /&gt;
* &#039;&#039;&#039;PETG&#039;&#039;&#039; - Flexible, strong, impact-resistant (good for functional parts)&lt;br /&gt;
* &#039;&#039;&#039;ABS&#039;&#039;&#039; - Strong, heat-resistant (hard to print)&lt;br /&gt;
* &#039;&#039;&#039;Acrylic&#039;&#039;&#039; - Laser-cut sheets for chassis (cheap, rigid)&lt;br /&gt;
* &#039;&#039;&#039;Aluminum&#039;&#039;&#039; - High strength-to-weight, machineable (expensive)&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Tools (Start Here) ===&lt;br /&gt;
* &#039;&#039;&#039;Calipers&#039;&#039;&#039; ($15-30) - Measure parts accurately (0.01mm precision)&lt;br /&gt;
* &#039;&#039;&#039;Screwdriver set&#039;&#039;&#039; ($10-20) - Phillips and flathead&lt;br /&gt;
* &#039;&#039;&#039;Hex key set&#039;&#039;&#039; ($5-15) - Allen wrenches for socket head screws&lt;br /&gt;
* &#039;&#039;&#039;Ruler&#039;&#039;&#039; ($5) - Quick measurements and alignment&lt;br /&gt;
* &#039;&#039;&#039;Pliers&#039;&#039;&#039; ($10) - Hold nuts, bend wire, grip small parts&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tools ===&lt;br /&gt;
* &#039;&#039;&#039;CAD software&#039;&#039;&#039; (Free - $500/year) - FreeCAD (free), Fusion 360 (hobbyist free)&lt;br /&gt;
* &#039;&#039;&#039;3D printer&#039;&#039;&#039; ($200-500) - Print custom parts&lt;br /&gt;
* &#039;&#039;&#039;Drill and bits&#039;&#039;&#039; ($30-60) - Make holes in chassis&lt;br /&gt;
* &#039;&#039;&#039;File set&#039;&#039;&#039; ($10-20) - Clean up burrs and adjust fit&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Torque wrench&#039;&#039;&#039; ($30-100) - Precise fastener tightening&lt;br /&gt;
* &#039;&#039;&#039;Dial indicator&#039;&#039;&#039; ($20-50) - Measure runout and alignment&lt;br /&gt;
* &#039;&#039;&#039;Tap and die set&#039;&#039;&#039; ($20-40) - Create or repair threads&lt;br /&gt;
* &#039;&#039;&#039;Lathe or mill&#039;&#039;&#039; ($500+) - Machine custom metal parts&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Underpowered motors&#039;&#039;&#039; - Calculate required torque before selecting motors&lt;br /&gt;
* &#039;&#039;&#039;Wheel slippage&#039;&#039;&#039; - Encoders are useless if wheels slip on smooth surfaces&lt;br /&gt;
* &#039;&#039;&#039;Loose wheels&#039;&#039;&#039; - Vibration loosens set screws; use threadlocker&lt;br /&gt;
* &#039;&#039;&#039;Misaligned sensors&#039;&#039;&#039; - Line sensors must be parallel to ground and perpendicular to line&lt;br /&gt;
* &#039;&#039;&#039;Over-constrained assemblies&#039;&#039;&#039; - Too many attachment points cause binding&lt;br /&gt;
* &#039;&#039;&#039;Ignoring tolerances&#039;&#039;&#039; - 3D printed parts won&#039;t fit together without clearance&lt;br /&gt;
* &#039;&#039;&#039;Top-heavy designs&#039;&#039;&#039; - High center of mass causes tipping&lt;br /&gt;
* &#039;&#039;&#039;Ignoring wire routing&#039;&#039;&#039; - Wires get caught in wheels or mechanisms&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanical Design]]&#039;&#039;&#039; (Beginner) - Design printable parts in CAD&lt;br /&gt;
* &#039;&#039;&#039;[[Motor Control Basics]]&#039;&#039;&#039; (Beginner) - How motors work with electronics&lt;br /&gt;
* &#039;&#039;&#039;[[Gear Ratio Calculation]]&#039;&#039;&#039; (Intermediate) - Speed/torque tradeoffs&lt;br /&gt;
* &#039;&#039;&#039;[[Kinematics Tutorial]]&#039;&#039;&#039; (Intermediate) - Calculate robot motion&lt;br /&gt;
* &#039;&#039;&#039;[[Inverse Kinematics]]&#039;&#039;&#039; (Advanced) - Multi-DOF robot arms&lt;br /&gt;
&lt;br /&gt;
=== Component Pages ===&lt;br /&gt;
* [[SimpleBot]] - Example of differential drive design&lt;br /&gt;
* [[TB6612FNG]] - Motor driver specifications and torque limits&lt;br /&gt;
* [[Raspberry Pi Pico]] - Microcontroller GPIO for motor control&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.youtube.com/@Lesics Lesics] - 3D animations of mechanical systems&lt;br /&gt;
* [https://www.engineersedge.com/ Engineers Edge] - Mechanical engineering calculators&lt;br /&gt;
* [https://www.machinedesign.com/ Machine Design] - Mechanical engineering magazine&lt;br /&gt;
* [https://grabcad.com/ GrabCAD] - CAD model library for reference&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Provides power and signals to actuators&lt;br /&gt;
* &#039;&#039;&#039;[[Software]]&#039;&#039;&#039; - Sends commands to move mechanical systems&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Fabricates mechanical parts&lt;br /&gt;
* &#039;&#039;&#039;[[CAD]]&#039;&#039;&#039; - Designs mechanical parts and assemblies&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Assembles electronics that control mechanics&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities]] - Mechanical capabilities like differential drive, omni drive&lt;br /&gt;
* [[SimpleBot]] - Apply mechanics knowledge to build a differential drive robot&lt;br /&gt;
* [[Robotics Ontology]] - How mechanics fits into the BRS knowledge structure&lt;br /&gt;
* [[Activity:Line Following]] - Example activity requiring mechanical understanding&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=MicroPython_Programming&amp;diff=83</id>
		<title>MicroPython Programming</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=MicroPython_Programming&amp;diff=83"/>
		<updated>2025-10-11T20:15:32Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=MicroPython Programming |competency=Software |difficulty=Intermediate |time=5-8 hours (split across multiple sessions) |prerequisites=MicroPython Basics, Electronics Fundamentals |materials=Raspberry Pi Pico, breadboard, motors with H-bridge (TB6612FNG), encoders, I2C sensor (optional: MPU6050 IMU) |next_steps=State Machine Design, Behavior:PID Control, SimpleBot advanced implementations }}  &amp;#039;&amp;#039;&amp;#039;MicroPython Programming&amp;#039;&amp;#039;&amp;#039; builds on...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=MicroPython Programming&lt;br /&gt;
|competency=[[Software]]&lt;br /&gt;
|difficulty=Intermediate&lt;br /&gt;
|time=5-8 hours (split across multiple sessions)&lt;br /&gt;
|prerequisites=[[MicroPython Basics]], [[Electronics Fundamentals]]&lt;br /&gt;
|materials=Raspberry Pi Pico, breadboard, motors with H-bridge (TB6612FNG), encoders, I2C sensor (optional: MPU6050 IMU)&lt;br /&gt;
|next_steps=[[State Machine Design]], [[Behavior:PID Control]], [[SimpleBot]] advanced implementations&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MicroPython Programming&#039;&#039;&#039; builds on [[MicroPython Basics]] to teach advanced techniques for robot control. This tutorial covers interrupts, PWM motor control, I2C communication, timers, and state machines - everything you need to build sophisticated robot behaviors.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll understand:&lt;br /&gt;
* Hardware interrupts for encoder counting&lt;br /&gt;
* PWM generation for precise motor speed control&lt;br /&gt;
* I2C communication for reading sensors (IMU example)&lt;br /&gt;
* Timers for non-blocking periodic tasks&lt;br /&gt;
* State machines for organizing complex behaviors&lt;br /&gt;
* Asynchronous programming with asyncio&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039; and assumes you&#039;ve completed [[MicroPython Basics]].&lt;br /&gt;
&lt;br /&gt;
== Part 1: Hardware Interrupts ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interrupts&#039;&#039;&#039; let the microcontroller respond immediately to events without constantly checking (polling).&lt;br /&gt;
&lt;br /&gt;
=== Why Use Interrupts? ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Polling (inefficient):&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
while True:&lt;br /&gt;
    if encoder.value() == 1:  # Constantly checking&lt;br /&gt;
        count += 1&lt;br /&gt;
    # Do other work&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; If encoder pulse is brief, you might miss it while doing other work.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interrupts (efficient):&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def encoder_callback(pin):&lt;br /&gt;
    count += 1  # Runs immediately when encoder pulses&lt;br /&gt;
&lt;br /&gt;
encoder.irq(trigger=Pin.IRQ_RISING, handler=encoder_callback)&lt;br /&gt;
# Do other work - encoder is counted automatically!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interrupt triggers a function&#039;&#039;&#039; when the event occurs, regardless of what the main loop is doing.&lt;br /&gt;
&lt;br /&gt;
=== Basic Interrupt Example: Count Button Presses ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
press_count = 0&lt;br /&gt;
&lt;br /&gt;
def button_callback(pin):&lt;br /&gt;
    global press_count&lt;br /&gt;
    press_count += 1&lt;br /&gt;
&lt;br /&gt;
button = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
button.irq(trigger=Pin.IRQ_FALLING, handler=button_callback)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    print(f&amp;quot;Button pressed {press_count} times&amp;quot;)&lt;br /&gt;
    time.sleep(1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Explanation:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Pin.IRQ_FALLING&#039;&#039;&#039; - Trigger when signal goes HIGH→LOW (button pressed)&lt;br /&gt;
* &#039;&#039;&#039;global press_count&#039;&#039;&#039; - Modify variable from interrupt handler&lt;br /&gt;
* Main loop can do other work while button presses are counted&lt;br /&gt;
&lt;br /&gt;
=== Interrupt-Driven Encoder Counting ===&lt;br /&gt;
&lt;br /&gt;
Optical encoders produce pulses as wheels rotate. Interrupts ensure no pulses are missed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Single encoder (counts pulses):&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
encoder_count = 0&lt;br /&gt;
&lt;br /&gt;
def encoder_callback(pin):&lt;br /&gt;
    global encoder_count&lt;br /&gt;
    encoder_count += 1&lt;br /&gt;
&lt;br /&gt;
encoder = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
encoder.irq(trigger=Pin.IRQ_RISING, handler=encoder_callback)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    print(f&amp;quot;Encoder count: {encoder_count}&amp;quot;)&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Quadrature encoder (detects direction):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quadrature encoders have two channels (A and B) that pulse 90° out of phase:&lt;br /&gt;
* A leads B → forward rotation&lt;br /&gt;
* B leads A → backward rotation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
encoder_count = 0&lt;br /&gt;
encoder_a = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
encoder_b = Pin(16, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
def encoder_a_callback(pin):&lt;br /&gt;
    global encoder_count&lt;br /&gt;
    if encoder_b.value() == 1:&lt;br /&gt;
        encoder_count += 1  # Forward&lt;br /&gt;
    else:&lt;br /&gt;
        encoder_count -= 1  # Backward&lt;br /&gt;
&lt;br /&gt;
encoder_a.irq(trigger=Pin.IRQ_RISING, handler=encoder_a_callback)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    print(f&amp;quot;Position: {encoder_count}&amp;quot;)&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why quadrature encoding matters:&#039;&#039;&#039;&lt;br /&gt;
* SimpleBot&#039;s [[Capability:Optical Odometry]] uses encoder direction to track position&lt;br /&gt;
* Essential for [[Activity:Dead Reckoning]] and precise movement&lt;br /&gt;
&lt;br /&gt;
=== Interrupt Best Practices ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO:&#039;&#039;&#039;&lt;br /&gt;
* Keep interrupt handlers SHORT and FAST&lt;br /&gt;
* Use global variables to pass data to main loop&lt;br /&gt;
* Use volatile flags to signal events&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T:&#039;&#039;&#039;&lt;br /&gt;
* Use &#039;&#039;&#039;time.sleep()&#039;&#039;&#039; in interrupt handlers (blocks everything!)&lt;br /&gt;
* Print in interrupt handlers (slow, can cause problems)&lt;br /&gt;
* Do complex calculations in interrupt handlers&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good pattern - minimal interrupt, main loop does work:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
encoder_flag = False&lt;br /&gt;
&lt;br /&gt;
def encoder_callback(pin):&lt;br /&gt;
    global encoder_flag&lt;br /&gt;
    encoder_flag = True  # Just set a flag&lt;br /&gt;
&lt;br /&gt;
encoder.irq(trigger=Pin.IRQ_RISING, handler=encoder_callback)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    if encoder_flag:&lt;br /&gt;
        # Do complex processing here&lt;br /&gt;
        calculate_position()&lt;br /&gt;
        encoder_flag = False&lt;br /&gt;
&lt;br /&gt;
    # Other work&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 2: PWM (Pulse Width Modulation) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PWM&#039;&#039;&#039; controls motor speed by rapidly switching power on and off.&lt;br /&gt;
&lt;br /&gt;
=== PWM Basics ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Frequency&#039;&#039;&#039; - How fast it switches (typically 1-20 kHz for motors)&lt;br /&gt;
* &#039;&#039;&#039;Duty cycle&#039;&#039;&#039; - Percentage of time it&#039;s ON (0% = stopped, 100% = full speed)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
* 50% duty cycle = motor at half speed&lt;br /&gt;
* 75% duty cycle = motor at 75% speed&lt;br /&gt;
&lt;br /&gt;
=== PWM on Raspberry Pi Pico ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin, PWM&lt;br /&gt;
&lt;br /&gt;
# Create PWM object&lt;br /&gt;
motor_pwm = PWM(Pin(16))&lt;br /&gt;
&lt;br /&gt;
# Set frequency (1 kHz)&lt;br /&gt;
motor_pwm.freq(1000)&lt;br /&gt;
&lt;br /&gt;
# Set duty cycle (50% = 32768 out of 65535)&lt;br /&gt;
motor_pwm.duty_u16(32768)&lt;br /&gt;
&lt;br /&gt;
# Other duty cycles:&lt;br /&gt;
motor_pwm.duty_u16(0)      # 0% - stopped&lt;br /&gt;
motor_pwm.duty_u16(16384)  # 25% - quarter speed&lt;br /&gt;
motor_pwm.duty_u16(49152)  # 75% - three-quarter speed&lt;br /&gt;
motor_pwm.duty_u16(65535)  # 100% - full speed&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why duty_u16?&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;u16&#039;&#039;&#039; = unsigned 16-bit integer (0-65535)&lt;br /&gt;
* Provides fine control (65536 different speed levels)&lt;br /&gt;
* Alternative: &#039;&#039;&#039;duty_ns(nanoseconds)&#039;&#039;&#039; for precise timing&lt;br /&gt;
&lt;br /&gt;
=== Motor Control with H-Bridge ===&lt;br /&gt;
&lt;br /&gt;
DC motors need an &#039;&#039;&#039;H-bridge&#039;&#039;&#039; to control direction and speed. Common chip: [[TB6612FNG]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;H-bridge control signals:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;IN1, IN2&#039;&#039;&#039; - Direction control for motor A (HIGH/LOW, LOW/HIGH)&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Speed control (duty cycle)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Motor control class:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin, PWM&lt;br /&gt;
&lt;br /&gt;
class Motor:&lt;br /&gt;
    def __init__(self, in1_pin, in2_pin, pwm_pin):&lt;br /&gt;
        self.in1 = Pin(in1_pin, Pin.OUT)&lt;br /&gt;
        self.in2 = Pin(in2_pin, Pin.OUT)&lt;br /&gt;
        self.pwm = PWM(Pin(pwm_pin))&lt;br /&gt;
        self.pwm.freq(1000)  # 1 kHz&lt;br /&gt;
&lt;br /&gt;
    def forward(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive forward at speed (0-100)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.high()&lt;br /&gt;
        self.in2.low()&lt;br /&gt;
        duty = int(speed * 65535 / 100)&lt;br /&gt;
        self.pwm.duty_u16(duty)&lt;br /&gt;
&lt;br /&gt;
    def backward(self, speed):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Drive backward at speed (0-100)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.low()&lt;br /&gt;
        self.in2.high()&lt;br /&gt;
        duty = int(speed * 65535 / 100)&lt;br /&gt;
        self.pwm.duty_u16(duty)&lt;br /&gt;
&lt;br /&gt;
    def stop(self):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;Stop motor (brake)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        self.in1.low()&lt;br /&gt;
        self.in2.low()&lt;br /&gt;
        self.pwm.duty_u16(0)&lt;br /&gt;
&lt;br /&gt;
# Example usage&lt;br /&gt;
motor_left = Motor(in1_pin=10, in2_pin=11, pwm_pin=12)&lt;br /&gt;
motor_right = Motor(in1_pin=13, in2_pin=14, pwm_pin=15)&lt;br /&gt;
&lt;br /&gt;
motor_left.forward(75)   # Left motor 75% forward&lt;br /&gt;
motor_right.forward(75)  # Right motor 75% forward&lt;br /&gt;
time.sleep(2)&lt;br /&gt;
motor_left.stop()&lt;br /&gt;
motor_right.stop()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Differential Drive Robot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Differential drive&#039;&#039;&#039; uses two independently controlled wheels:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class DifferentialDrive:&lt;br /&gt;
    def __init__(self, motor_left, motor_right):&lt;br /&gt;
        self.left = motor_left&lt;br /&gt;
        self.right = motor_right&lt;br /&gt;
&lt;br /&gt;
    def forward(self, speed=50):&lt;br /&gt;
        self.left.forward(speed)&lt;br /&gt;
        self.right.forward(speed)&lt;br /&gt;
&lt;br /&gt;
    def backward(self, speed=50):&lt;br /&gt;
        self.left.backward(speed)&lt;br /&gt;
        self.right.backward(speed)&lt;br /&gt;
&lt;br /&gt;
    def turn_left(self, speed=50):&lt;br /&gt;
        self.left.backward(speed)&lt;br /&gt;
        self.right.forward(speed)&lt;br /&gt;
&lt;br /&gt;
    def turn_right(self, speed=50):&lt;br /&gt;
        self.left.forward(speed)&lt;br /&gt;
        self.right.backward(speed)&lt;br /&gt;
&lt;br /&gt;
    def stop(self):&lt;br /&gt;
        self.left.stop()&lt;br /&gt;
        self.right.stop()&lt;br /&gt;
&lt;br /&gt;
# Create robot&lt;br /&gt;
robot = DifferentialDrive(motor_left, motor_right)&lt;br /&gt;
&lt;br /&gt;
# Drive in a square&lt;br /&gt;
robot.forward(50)&lt;br /&gt;
time.sleep(1)&lt;br /&gt;
robot.turn_left(50)&lt;br /&gt;
time.sleep(0.5)&lt;br /&gt;
robot.stop()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the foundation of [[Capability:Differential Drive]]!&lt;br /&gt;
&lt;br /&gt;
== Part 3: I2C Communication ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;I2C&#039;&#039;&#039; (Inter-Integrated Circuit) is a two-wire protocol for communicating with sensors.&lt;br /&gt;
&lt;br /&gt;
=== I2C Basics ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SDA&#039;&#039;&#039; - Serial Data (bidirectional data line)&lt;br /&gt;
* &#039;&#039;&#039;SCL&#039;&#039;&#039; - Serial Clock (clock signal from controller)&lt;br /&gt;
* &#039;&#039;&#039;Addresses&#039;&#039;&#039; - Each device has a unique 7-bit address (e.g., 0x68)&lt;br /&gt;
* &#039;&#039;&#039;Multi-device&#039;&#039;&#039; - Multiple sensors on same two wires&lt;br /&gt;
&lt;br /&gt;
=== I2C on Raspberry Pi Pico ===&lt;br /&gt;
&lt;br /&gt;
Pico has two I2C buses (I2C0, I2C1):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import I2C, Pin&lt;br /&gt;
&lt;br /&gt;
# I2C0 on pins 0 (SDA) and 1 (SCL)&lt;br /&gt;
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)&lt;br /&gt;
&lt;br /&gt;
# Scan for devices&lt;br /&gt;
devices = i2c.scan()&lt;br /&gt;
print(f&amp;quot;I2C devices found: {[hex(d) for d in devices]}&amp;quot;)&lt;br /&gt;
# Example output: [&#039;0x68&#039;] (MPU6050 IMU)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reading an IMU (MPU6050) ===&lt;br /&gt;
&lt;br /&gt;
The MPU6050 is a popular 6-axis IMU (3-axis accelerometer + 3-axis gyroscope) used for [[Capability:IMU Sensing]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Basic register reading:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import I2C, Pin&lt;br /&gt;
import struct&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
MPU6050_ADDR = 0x68&lt;br /&gt;
PWR_MGMT_1 = 0x6B&lt;br /&gt;
ACCEL_XOUT_H = 0x3B&lt;br /&gt;
&lt;br /&gt;
# Initialize I2C&lt;br /&gt;
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)&lt;br /&gt;
&lt;br /&gt;
# Wake up MPU6050 (it starts in sleep mode)&lt;br /&gt;
i2c.writeto_mem(MPU6050_ADDR, PWR_MGMT_1, bytes([0]))&lt;br /&gt;
&lt;br /&gt;
def read_accel():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Read accelerometer data (X, Y, Z)&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    data = i2c.readfrom_mem(MPU6050_ADDR, ACCEL_XOUT_H, 6)&lt;br /&gt;
    ax, ay, az = struct.unpack(&#039;&amp;gt;3h&#039;, data)  # Big-endian signed 16-bit&lt;br /&gt;
&lt;br /&gt;
    # Convert to g (gravity units)&lt;br /&gt;
    # MPU6050 default range: ±2g, scale: 16384 LSB/g&lt;br /&gt;
    ax_g = ax / 16384.0&lt;br /&gt;
    ay_g = ay / 16384.0&lt;br /&gt;
    az_g = az / 16384.0&lt;br /&gt;
&lt;br /&gt;
    return ax_g, ay_g, az_g&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    ax, ay, az = read_accel()&lt;br /&gt;
    print(f&amp;quot;Accel X: {ax:.2f}g, Y: {ay:.2f}g, Z: {az:.2f}g&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Complete MPU6050 class:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class MPU6050:&lt;br /&gt;
    def __init__(self, i2c, addr=0x68):&lt;br /&gt;
        self.i2c = i2c&lt;br /&gt;
        self.addr = addr&lt;br /&gt;
        # Wake up MPU6050&lt;br /&gt;
        self.i2c.writeto_mem(self.addr, 0x6B, bytes([0]))&lt;br /&gt;
&lt;br /&gt;
    def read_accel(self):&lt;br /&gt;
        data = self.i2c.readfrom_mem(self.addr, 0x3B, 6)&lt;br /&gt;
        ax, ay, az = struct.unpack(&#039;&amp;gt;3h&#039;, data)&lt;br /&gt;
        return ax / 16384.0, ay / 16384.0, az / 16384.0&lt;br /&gt;
&lt;br /&gt;
    def read_gyro(self):&lt;br /&gt;
        data = self.i2c.readfrom_mem(self.addr, 0x43, 6)&lt;br /&gt;
        gx, gy, gz = struct.unpack(&#039;&amp;gt;3h&#039;, data)&lt;br /&gt;
        # Gyro scale: 131 LSB/°/s&lt;br /&gt;
        return gx / 131.0, gy / 131.0, gz / 131.0&lt;br /&gt;
&lt;br /&gt;
    def read_temp(self):&lt;br /&gt;
        data = self.i2c.readfrom_mem(self.addr, 0x41, 2)&lt;br /&gt;
        temp_raw = struct.unpack(&#039;&amp;gt;h&#039;, data)[0]&lt;br /&gt;
        return temp_raw / 340.0 + 36.53  # Convert to °C&lt;br /&gt;
&lt;br /&gt;
# Usage&lt;br /&gt;
i2c = I2C(0, scl=Pin(1), sda=Pin(0), freq=400000)&lt;br /&gt;
imu = MPU6050(i2c)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    ax, ay, az = imu.read_accel()&lt;br /&gt;
    gx, gy, gz = imu.read_gyro()&lt;br /&gt;
    temp = imu.read_temp()&lt;br /&gt;
    print(f&amp;quot;Accel: {ax:.2f}, {ay:.2f}, {az:.2f} | Gyro: {gx:.1f}, {gy:.1f}, {gz:.1f} | Temp: {temp:.1f}°C&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why I2C matters for robotics:&#039;&#039;&#039;&lt;br /&gt;
* Many sensors use I2C: IMU, magnetometer, time-of-flight, OLED display&lt;br /&gt;
* Two wires connect many devices (versus 1 wire per device with digital I/O)&lt;br /&gt;
* Libraries abstract complexity (you don&#039;t need to know every register)&lt;br /&gt;
&lt;br /&gt;
== Part 4: Timers and Non-Blocking Code ==&lt;br /&gt;
&lt;br /&gt;
=== The Problem with time.sleep() ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blocking code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
while True:&lt;br /&gt;
    motor.forward(50)&lt;br /&gt;
    time.sleep(2)  # Blocks for 2 seconds - can&#039;t do anything else!&lt;br /&gt;
    motor.stop()&lt;br /&gt;
    time.sleep(1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Can&#039;t read sensors or respond to events during sleep.&lt;br /&gt;
&lt;br /&gt;
=== Solution 1: Time-Based Switching ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
state = &amp;quot;forward&amp;quot;&lt;br /&gt;
state_start_time = time.ticks_ms()&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    current_time = time.ticks_ms()&lt;br /&gt;
    elapsed = time.ticks_diff(current_time, state_start_time)&lt;br /&gt;
&lt;br /&gt;
    if state == &amp;quot;forward&amp;quot;:&lt;br /&gt;
        motor.forward(50)&lt;br /&gt;
        if elapsed &amp;gt; 2000:  # 2 seconds&lt;br /&gt;
            state = &amp;quot;stopped&amp;quot;&lt;br /&gt;
            state_start_time = current_time&lt;br /&gt;
&lt;br /&gt;
    elif state == &amp;quot;stopped&amp;quot;:&lt;br /&gt;
        motor.stop()&lt;br /&gt;
        if elapsed &amp;gt; 1000:  # 1 second&lt;br /&gt;
            state = &amp;quot;forward&amp;quot;&lt;br /&gt;
            state_start_time = current_time&lt;br /&gt;
&lt;br /&gt;
    # Can read sensors and do other work here!&lt;br /&gt;
    sensor_value = sensor.value()&lt;br /&gt;
    print(f&amp;quot;Sensor: {sensor_value}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.01)  # Small delay to avoid maxing CPU&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key functions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;time.ticks_ms()&#039;&#039;&#039; - Milliseconds since boot (wraps around after ~12 days)&lt;br /&gt;
* &#039;&#039;&#039;time.ticks_diff(new, old)&#039;&#039;&#039; - Time difference handling wraparound&lt;br /&gt;
&lt;br /&gt;
=== Solution 2: Hardware Timers ===&lt;br /&gt;
&lt;br /&gt;
Hardware timers trigger a callback periodically without blocking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Timer&lt;br /&gt;
&lt;br /&gt;
led_state = False&lt;br /&gt;
&lt;br /&gt;
def timer_callback(timer):&lt;br /&gt;
    global led_state&lt;br /&gt;
    led_state = not led_state&lt;br /&gt;
    led.value(led_state)&lt;br /&gt;
&lt;br /&gt;
# Create timer that fires every 500ms&lt;br /&gt;
timer = Timer(period=500, mode=Timer.PERIODIC, callback=timer_callback)&lt;br /&gt;
&lt;br /&gt;
# Main loop is free to do other work!&lt;br /&gt;
while True:&lt;br /&gt;
    sensor_value = sensor.value()&lt;br /&gt;
    print(f&amp;quot;Sensor: {sensor_value}&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to use timers:&#039;&#039;&#039;&lt;br /&gt;
* Periodic sensor readings (sample IMU every 10ms)&lt;br /&gt;
* Blinking status LEDs without blocking&lt;br /&gt;
* PID control loops (run every 20ms)&lt;br /&gt;
&lt;br /&gt;
== Part 5: State Machines ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;State machines&#039;&#039;&#039; organize complex behaviors into discrete states with transitions.&lt;br /&gt;
&lt;br /&gt;
=== Line Following State Machine ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;States:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;FORWARD&#039;&#039;&#039; - Both sensors on line&lt;br /&gt;
* &#039;&#039;&#039;TURN_LEFT&#039;&#039;&#039; - Right sensor lost line&lt;br /&gt;
* &#039;&#039;&#039;TURN_RIGHT&#039;&#039;&#039; - Left sensor lost line&lt;br /&gt;
* &#039;&#039;&#039;SEARCH&#039;&#039;&#039; - Both sensors lost line&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Sensors&lt;br /&gt;
sensor_left = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
sensor_right = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
# State machine&lt;br /&gt;
state = &amp;quot;FORWARD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    left = sensor_left.value()&lt;br /&gt;
    right = sensor_right.value()&lt;br /&gt;
&lt;br /&gt;
    # State transitions&lt;br /&gt;
    if left == 0 and right == 0:&lt;br /&gt;
        state = &amp;quot;FORWARD&amp;quot;&lt;br /&gt;
    elif left == 0 and right == 1:&lt;br /&gt;
        state = &amp;quot;TURN_LEFT&amp;quot;&lt;br /&gt;
    elif left == 1 and right == 0:&lt;br /&gt;
        state = &amp;quot;TURN_RIGHT&amp;quot;&lt;br /&gt;
    else:&lt;br /&gt;
        state = &amp;quot;SEARCH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # State actions&lt;br /&gt;
    if state == &amp;quot;FORWARD&amp;quot;:&lt;br /&gt;
        robot.forward(50)&lt;br /&gt;
        print(&amp;quot;State: FORWARD&amp;quot;)&lt;br /&gt;
    elif state == &amp;quot;TURN_LEFT&amp;quot;:&lt;br /&gt;
        robot.turn_left(40)&lt;br /&gt;
        print(&amp;quot;State: TURN_LEFT&amp;quot;)&lt;br /&gt;
    elif state == &amp;quot;TURN_RIGHT&amp;quot;:&lt;br /&gt;
        robot.turn_right(40)&lt;br /&gt;
        print(&amp;quot;State: TURN_RIGHT&amp;quot;)&lt;br /&gt;
    elif state == &amp;quot;SEARCH&amp;quot;:&lt;br /&gt;
        robot.turn_left(30)&lt;br /&gt;
        print(&amp;quot;State: SEARCH&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Advanced State Machine with Timing ===&lt;br /&gt;
&lt;br /&gt;
Add state entry/exit actions and timing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
class StateMachine:&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.state = None&lt;br /&gt;
        self.state_start_time = 0&lt;br /&gt;
&lt;br /&gt;
    def change_state(self, new_state):&lt;br /&gt;
        if new_state != self.state:&lt;br /&gt;
            self.exit_state(self.state)&lt;br /&gt;
            self.state = new_state&lt;br /&gt;
            self.state_start_time = time.ticks_ms()&lt;br /&gt;
            self.enter_state(new_state)&lt;br /&gt;
&lt;br /&gt;
    def enter_state(self, state):&lt;br /&gt;
        print(f&amp;quot;Enter state: {state}&amp;quot;)&lt;br /&gt;
        # State entry actions&lt;br /&gt;
&lt;br /&gt;
    def exit_state(self, state):&lt;br /&gt;
        print(f&amp;quot;Exit state: {state}&amp;quot;)&lt;br /&gt;
        # State cleanup actions&lt;br /&gt;
&lt;br /&gt;
    def time_in_state(self):&lt;br /&gt;
        return time.ticks_diff(time.ticks_ms(), self.state_start_time)&lt;br /&gt;
&lt;br /&gt;
# Usage&lt;br /&gt;
sm = StateMachine()&lt;br /&gt;
sm.change_state(&amp;quot;FORWARD&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    # Determine next state based on sensors&lt;br /&gt;
    if obstacle_detected:&lt;br /&gt;
        sm.change_state(&amp;quot;AVOID&amp;quot;)&lt;br /&gt;
    elif line_detected:&lt;br /&gt;
        sm.change_state(&amp;quot;FOLLOW&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    # Execute state behavior&lt;br /&gt;
    if sm.state == &amp;quot;FORWARD&amp;quot;:&lt;br /&gt;
        robot.forward(50)&lt;br /&gt;
    elif sm.state == &amp;quot;AVOID&amp;quot;:&lt;br /&gt;
        robot.turn_left(50)&lt;br /&gt;
        if sm.time_in_state() &amp;gt; 1000:  # Turn for 1 second&lt;br /&gt;
            sm.change_state(&amp;quot;FORWARD&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[State Machine Design]] for more advanced patterns.&lt;br /&gt;
&lt;br /&gt;
== Part 6: Asynchronous Programming with asyncio ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asyncio&#039;&#039;&#039; allows concurrent tasks without threads (lightweight, cooperative multitasking).&lt;br /&gt;
&lt;br /&gt;
=== Basic asyncio Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import asyncio&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
led1 = Pin(16, Pin.OUT)&lt;br /&gt;
led2 = Pin(17, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
async def blink_led1():&lt;br /&gt;
    while True:&lt;br /&gt;
        led1.toggle()&lt;br /&gt;
        await asyncio.sleep(0.5)  # Non-blocking sleep&lt;br /&gt;
&lt;br /&gt;
async def blink_led2():&lt;br /&gt;
    while True:&lt;br /&gt;
        led2.toggle()&lt;br /&gt;
        await asyncio.sleep(0.3)  # Different rate&lt;br /&gt;
&lt;br /&gt;
async def main():&lt;br /&gt;
    # Run both tasks concurrently&lt;br /&gt;
    await asyncio.gather(&lt;br /&gt;
        blink_led1(),&lt;br /&gt;
        blink_led2()&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
# Start event loop&lt;br /&gt;
asyncio.run(main())&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both LEDs blink at different rates simultaneously!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Robot with Concurrent Sensor Reading and Motor Control ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import asyncio&lt;br /&gt;
from machine import Pin, I2C&lt;br /&gt;
&lt;br /&gt;
sensor_data = {&amp;quot;distance&amp;quot;: 0, &amp;quot;imu&amp;quot;: (0, 0, 0)}&lt;br /&gt;
&lt;br /&gt;
async def read_distance_sensor():&lt;br /&gt;
    while True:&lt;br /&gt;
        # Read I2C distance sensor&lt;br /&gt;
        distance = read_distance()  # Hypothetical function&lt;br /&gt;
        sensor_data[&amp;quot;distance&amp;quot;] = distance&lt;br /&gt;
        await asyncio.sleep(0.1)  # 10 Hz&lt;br /&gt;
&lt;br /&gt;
async def read_imu():&lt;br /&gt;
    while True:&lt;br /&gt;
        # Read I2C IMU&lt;br /&gt;
        ax, ay, az = imu.read_accel()&lt;br /&gt;
        sensor_data[&amp;quot;imu&amp;quot;] = (ax, ay, az)&lt;br /&gt;
        await asyncio.sleep(0.01)  # 100 Hz&lt;br /&gt;
&lt;br /&gt;
async def motor_control():&lt;br /&gt;
    while True:&lt;br /&gt;
        # Use sensor data to control motors&lt;br /&gt;
        if sensor_data[&amp;quot;distance&amp;quot;] &amp;lt; 20:&lt;br /&gt;
            robot.stop()&lt;br /&gt;
        else:&lt;br /&gt;
            robot.forward(50)&lt;br /&gt;
        await asyncio.sleep(0.02)  # 50 Hz control loop&lt;br /&gt;
&lt;br /&gt;
async def main():&lt;br /&gt;
    await asyncio.gather(&lt;br /&gt;
        read_distance_sensor(),&lt;br /&gt;
        read_imu(),&lt;br /&gt;
        motor_control()&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
asyncio.run(main())&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why asyncio is useful:&#039;&#039;&#039;&lt;br /&gt;
* Multiple sensors at different rates (IMU at 100 Hz, distance at 10 Hz)&lt;br /&gt;
* Motor control loop independent of sensor reading&lt;br /&gt;
* No blocking delays - everything runs &amp;quot;simultaneously&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Part 7: Practical Example - Encoder-Based Odometry ==&lt;br /&gt;
&lt;br /&gt;
Combine interrupts, PWM, and state machines for [[Activity:Dead Reckoning]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin, PWM&lt;br /&gt;
import time&lt;br /&gt;
import math&lt;br /&gt;
&lt;br /&gt;
class Odometry:&lt;br /&gt;
    def __init__(self, encoder_left_pin, encoder_right_pin, wheel_diameter, wheel_base, counts_per_rev):&lt;br /&gt;
        self.wheel_diameter = wheel_diameter  # mm&lt;br /&gt;
        self.wheel_base = wheel_base  # mm&lt;br /&gt;
        self.counts_per_rev = counts_per_rev&lt;br /&gt;
&lt;br /&gt;
        # Position&lt;br /&gt;
        self.x = 0.0&lt;br /&gt;
        self.y = 0.0&lt;br /&gt;
        self.theta = 0.0  # Heading in radians&lt;br /&gt;
&lt;br /&gt;
        # Encoder counts&lt;br /&gt;
        self.left_count = 0&lt;br /&gt;
        self.right_count = 0&lt;br /&gt;
&lt;br /&gt;
        # Setup encoders with interrupts&lt;br /&gt;
        self.encoder_left = Pin(encoder_left_pin, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
        self.encoder_right = Pin(encoder_right_pin, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
        self.encoder_left.irq(trigger=Pin.IRQ_RISING, handler=self.left_callback)&lt;br /&gt;
        self.encoder_right.irq(trigger=Pin.IRQ_RISING, handler=self.right_callback)&lt;br /&gt;
&lt;br /&gt;
    def left_callback(self, pin):&lt;br /&gt;
        self.left_count += 1&lt;br /&gt;
&lt;br /&gt;
    def right_callback(self, pin):&lt;br /&gt;
        self.right_count += 1&lt;br /&gt;
&lt;br /&gt;
    def update(self):&lt;br /&gt;
        # Calculate distance traveled by each wheel&lt;br /&gt;
        mm_per_count = (math.pi * self.wheel_diameter) / self.counts_per_rev&lt;br /&gt;
        left_distance = self.left_count * mm_per_count&lt;br /&gt;
        right_distance = self.right_count * mm_per_count&lt;br /&gt;
&lt;br /&gt;
        # Reset counts&lt;br /&gt;
        self.left_count = 0&lt;br /&gt;
        self.right_count = 0&lt;br /&gt;
&lt;br /&gt;
        # Calculate robot movement&lt;br /&gt;
        distance = (left_distance + right_distance) / 2.0&lt;br /&gt;
        delta_theta = (right_distance - left_distance) / self.wheel_base&lt;br /&gt;
&lt;br /&gt;
        # Update position&lt;br /&gt;
        self.theta += delta_theta&lt;br /&gt;
        self.x += distance * math.cos(self.theta)&lt;br /&gt;
        self.y += distance * math.sin(self.theta)&lt;br /&gt;
&lt;br /&gt;
    def get_position(self):&lt;br /&gt;
        return self.x, self.y, self.theta&lt;br /&gt;
&lt;br /&gt;
# Usage&lt;br /&gt;
odom = Odometry(&lt;br /&gt;
    encoder_left_pin=15,&lt;br /&gt;
    encoder_right_pin=16,&lt;br /&gt;
    wheel_diameter=65,  # mm&lt;br /&gt;
    wheel_base=120,     # mm&lt;br /&gt;
    counts_per_rev=20   # Pulses per revolution&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    odom.update()&lt;br /&gt;
    x, y, theta = odom.get_position()&lt;br /&gt;
    print(f&amp;quot;Position: ({x:.1f}, {y:.1f}) mm, Heading: {math.degrees(theta):.1f}°&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This implements [[SimpleBot:Dead Reckoning Implementation]]!&lt;br /&gt;
&lt;br /&gt;
== Part 8: Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Use hardware interrupts for encoder counting&lt;br /&gt;
* ☐ Generate PWM signals for motor speed control&lt;br /&gt;
* ☐ Control motor direction with H-bridge (TB6612FNG)&lt;br /&gt;
* ☐ Implement differential drive robot class&lt;br /&gt;
* ☐ Communicate with I2C sensors (read IMU)&lt;br /&gt;
* ☐ Use timers for non-blocking periodic tasks&lt;br /&gt;
* ☐ Write non-blocking code with time.ticks_ms()&lt;br /&gt;
* ☐ Design state machines for robot behaviors&lt;br /&gt;
* ☐ Use asyncio for concurrent tasks&lt;br /&gt;
* ☐ Implement encoder-based odometry&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you can build advanced robot behaviors!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Apply to Real Robots ===&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Encoder odometry&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - State machine line follower&lt;br /&gt;
* Add IMU to SimpleBot for heading stabilization&lt;br /&gt;
&lt;br /&gt;
=== Learn Advanced Techniques ===&lt;br /&gt;
* [[State Machine Design]] - Hierarchical state machines, event-driven design&lt;br /&gt;
* [[Behavior:PID Control]] - Closed-loop control for speed and position&lt;br /&gt;
* [[ROS Basics]] - Distributed robotics framework&lt;br /&gt;
&lt;br /&gt;
=== Build New Capabilities ===&lt;br /&gt;
* [[Capability:Encoder Sensing]] - Precise wheel rotation measurement&lt;br /&gt;
* [[Capability:IMU Sensing]] - Orientation and acceleration&lt;br /&gt;
* [[Capability:Time-of-Flight Sensing]] - I2C distance measurement&lt;br /&gt;
&lt;br /&gt;
== Common Intermediate Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Modifying variables in interrupts without &amp;quot;global&amp;quot;&#039;&#039;&#039; - Forgot global declaration&lt;br /&gt;
* &#039;&#039;&#039;Long interrupt handlers&#039;&#039;&#039; - Causes missed interrupts and timing issues&lt;br /&gt;
* &#039;&#039;&#039;Ignoring PWM frequency effects&#039;&#039;&#039; - Too low = audible whine, too high = inefficient&lt;br /&gt;
* &#039;&#039;&#039;Not debouncing switches&#039;&#039;&#039; - Mechanical switches bounce, causing multiple counts&lt;br /&gt;
* &#039;&#039;&#039;Forgetting I2C pull-up resistors&#039;&#039;&#039; - I2C needs 4.7kΩ pull-ups on SDA and SCL&lt;br /&gt;
* &#039;&#039;&#039;Race conditions in asyncio&#039;&#039;&#039; - Shared variables need careful handling&lt;br /&gt;
* &#039;&#039;&#039;Integer overflow in encoder counts&#039;&#039;&#039; - Use 32-bit integers or reset periodically&lt;br /&gt;
&lt;br /&gt;
== Debugging Advanced Programs ==&lt;br /&gt;
&lt;br /&gt;
=== Logic Analyzer for I2C/SPI ===&lt;br /&gt;
&lt;br /&gt;
Use a logic analyzer ($10-60) to visualize I2C communication:&lt;br /&gt;
* See SDA and SCL signals&lt;br /&gt;
* Decode I2C addresses and data&lt;br /&gt;
* Identify timing issues and protocol errors&lt;br /&gt;
&lt;br /&gt;
=== Oscilloscope for PWM ===&lt;br /&gt;
&lt;br /&gt;
Visualize PWM signals:&lt;br /&gt;
* Verify frequency and duty cycle&lt;br /&gt;
* Check for glitches or noise&lt;br /&gt;
* Measure rise/fall times&lt;br /&gt;
&lt;br /&gt;
=== Print Timing Analysis ===&lt;br /&gt;
&lt;br /&gt;
Measure execution time:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
start = time.ticks_us()&lt;br /&gt;
# Code to measure&lt;br /&gt;
expensive_function()&lt;br /&gt;
elapsed = time.ticks_diff(time.ticks_us(), start)&lt;br /&gt;
print(f&amp;quot;Execution time: {elapsed} µs&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
* &#039;&#039;&#039;Logic analyzer&#039;&#039;&#039; - $10-60 (Saleae-compatible clones work well)&lt;br /&gt;
* &#039;&#039;&#039;Oscilloscope&#039;&#039;&#039; - $100-400 (DSO150 or Rigol DS1054Z)&lt;br /&gt;
* &#039;&#039;&#039;I2C sensors&#039;&#039;&#039; - MPU6050 IMU ($3), VL53L0X distance ($5)&lt;br /&gt;
* &#039;&#039;&#039;Motor driver&#039;&#039;&#039; - TB6612FNG breakout board ($5-10)&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
* &#039;&#039;&#039;MicroPython I2C library&#039;&#039;&#039; - Built-in, no installation needed&lt;br /&gt;
* &#039;&#039;&#039;Pulseview&#039;&#039;&#039; (Free) - Logic analyzer software&lt;br /&gt;
* &#039;&#039;&#039;mpremote&#039;&#039;&#039; (Free) - Command-line tool for MicroPython&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://docs.micropython.org/en/latest/library/machine.html MicroPython machine module]&lt;br /&gt;
* [https://docs.micropython.org/en/latest/library/asyncio.html MicroPython asyncio]&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/i2c SparkFun I2C Tutorial]&lt;br /&gt;
* [https://invensense.tdk.com/products/motion-tracking/6-axis/mpu-6050/ MPU6050 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Software]] - Full software competency overview&lt;br /&gt;
* [[MicroPython Basics]] - Prerequisites for this tutorial&lt;br /&gt;
* [[State Machine Design]] - Advanced behavior organization&lt;br /&gt;
* [[SimpleBot]] - Apply these techniques to a real robot&lt;br /&gt;
* [[Behavior:PID Control]] - Closed-loop motor control&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Intermediate]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=MicroPython_Basics&amp;diff=82</id>
		<title>MicroPython Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=MicroPython_Basics&amp;diff=82"/>
		<updated>2025-10-11T20:15:06Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=MicroPython Basics |competency=Software |difficulty=Beginner |time=3-5 hours (split across multiple sessions) |prerequisites=None - complete beginner friendly |materials=Raspberry Pi Pico ($4), USB cable, computer with Thonny IDE (free), LED, resistor (220Ω), breadboard |next_steps=SimpleBot assembly, MicroPython Programming, Electronics Fundamentals }}  &amp;#039;&amp;#039;&amp;#039;MicroPython Basics&amp;#039;&amp;#039;&amp;#039; is your introduction to programming microcontrollers for ro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=MicroPython Basics&lt;br /&gt;
|competency=[[Software]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=3-5 hours (split across multiple sessions)&lt;br /&gt;
|prerequisites=None - complete beginner friendly&lt;br /&gt;
|materials=Raspberry Pi Pico ($4), USB cable, computer with Thonny IDE (free), LED, resistor (220Ω), breadboard&lt;br /&gt;
|next_steps=[[SimpleBot]] assembly, [[MicroPython Programming]], [[Electronics Fundamentals]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MicroPython Basics&#039;&#039;&#039; is your introduction to programming microcontrollers for robotics. This tutorial covers everything you need to write your first robot program, from installing MicroPython to controlling GPIO pins.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll understand:&lt;br /&gt;
* What MicroPython is and why it&#039;s great for robotics&lt;br /&gt;
* How to install MicroPython on Raspberry Pi Pico&lt;br /&gt;
* How to use Thonny IDE and the REPL&lt;br /&gt;
* Python basics: variables, functions, loops, conditionals&lt;br /&gt;
* How to control LEDs and read buttons&lt;br /&gt;
* How to write simple robot programs&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039;. You&#039;ll write and run code on real hardware.&lt;br /&gt;
&lt;br /&gt;
== Part 1: What is MicroPython? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MicroPython&#039;&#039;&#039; is a version of Python designed for microcontrollers - tiny computers that control robots.&lt;br /&gt;
&lt;br /&gt;
=== Why MicroPython for Robotics? ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Easy to learn&#039;&#039;&#039; - Python is one of the most beginner-friendly programming languages&lt;br /&gt;
* &#039;&#039;&#039;Interactive&#039;&#039;&#039; - Test code immediately with the REPL (Read-Eval-Print Loop)&lt;br /&gt;
* &#039;&#039;&#039;Fast development&#039;&#039;&#039; - Write code quickly without compiling&lt;br /&gt;
* &#039;&#039;&#039;Rich libraries&#039;&#039;&#039; - GPIO, PWM, I2C, SPI built in&lt;br /&gt;
* &#039;&#039;&#039;Low cost&#039;&#039;&#039; - Raspberry Pi Pico costs $4 and runs MicroPython perfectly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comparison to other options:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Arduino (C/C++)&#039;&#039;&#039; - Faster execution, larger community, but harder to learn&lt;br /&gt;
* &#039;&#039;&#039;Python on Raspberry Pi&#039;&#039;&#039; - Full Python ecosystem, but not real-time, more expensive&lt;br /&gt;
* &#039;&#039;&#039;MicroPython&#039;&#039;&#039; - Best balance of simplicity and capability for beginners&lt;br /&gt;
&lt;br /&gt;
=== What is a Microcontroller? ===&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;microcontroller&#039;&#039;&#039; is a tiny computer designed to control hardware:&lt;br /&gt;
* &#039;&#039;&#039;CPU&#039;&#039;&#039; - Processes instructions (runs your code)&lt;br /&gt;
* &#039;&#039;&#039;RAM&#039;&#039;&#039; - Temporary storage for variables (264 KB on Pico)&lt;br /&gt;
* &#039;&#039;&#039;Flash&#039;&#039;&#039; - Permanent storage for programs (2 MB on Pico)&lt;br /&gt;
* &#039;&#039;&#039;GPIO&#039;&#039;&#039; - General-Purpose Input/Output pins to connect sensors and motors&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Raspberry Pi Pico&#039;&#039;&#039; specifications:&lt;br /&gt;
* Dual-core ARM Cortex-M0+ @ 133 MHz&lt;br /&gt;
* 264 KB RAM, 2 MB flash&lt;br /&gt;
* 26 GPIO pins (digital I/O, PWM, ADC, I2C, SPI, UART)&lt;br /&gt;
* USB for programming and power&lt;br /&gt;
* Costs $4&lt;br /&gt;
&lt;br /&gt;
== Part 2: Installing MicroPython ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Download MicroPython Firmware ===&lt;br /&gt;
&lt;br /&gt;
# Go to [https://micropython.org/download/rp2-pico/ MicroPython Downloads]&lt;br /&gt;
# Download the latest &#039;&#039;&#039;.uf2&#039;&#039;&#039; file (e.g., &amp;quot;rp2-pico-latest.uf2&amp;quot;)&lt;br /&gt;
# Save it to your computer&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Flash MicroPython to Pico ===&lt;br /&gt;
&lt;br /&gt;
# Hold the &#039;&#039;&#039;BOOTSEL&#039;&#039;&#039; button on Raspberry Pi Pico&lt;br /&gt;
# While holding BOOTSEL, plug USB cable into computer&lt;br /&gt;
# Release BOOTSEL button&lt;br /&gt;
# Pico appears as a USB drive named &amp;quot;RPI-RP2&amp;quot;&lt;br /&gt;
# Drag the &#039;&#039;&#039;.uf2&#039;&#039;&#039; file to the RPI-RP2 drive&lt;br /&gt;
# Pico automatically reboots with MicroPython installed!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Troubleshooting:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;RPI-RP2 drive doesn&#039;t appear?&#039;&#039;&#039; Make sure you&#039;re holding BOOTSEL &#039;&#039;before&#039;&#039; plugging in USB&lt;br /&gt;
* &#039;&#039;&#039;File won&#039;t copy?&#039;&#039;&#039; Try a different USB cable (some are power-only)&lt;br /&gt;
* &#039;&#039;&#039;Pico disconnects after copying?&#039;&#039;&#039; This is normal! It&#039;s rebooting with MicroPython&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Install Thonny IDE ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Thonny&#039;&#039;&#039; is a beginner-friendly Python IDE with built-in MicroPython support.&lt;br /&gt;
&lt;br /&gt;
# Download from [https://thonny.org/ thonny.org]&lt;br /&gt;
# Install Thonny (Windows: run installer, macOS: drag to Applications, Linux: apt install thonny)&lt;br /&gt;
# Open Thonny&lt;br /&gt;
# Click bottom-right corner where it says &amp;quot;Python&amp;quot; and select &#039;&#039;&#039;MicroPython (Raspberry Pi Pico)&#039;&#039;&#039;&lt;br /&gt;
# Connect Pico via USB - Thonny should detect it&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;You should see:&#039;&#039;&#039;&lt;br /&gt;
* A &#039;&#039;&#039;code editor&#039;&#039;&#039; (top half) - Write programs here&lt;br /&gt;
* A &#039;&#039;&#039;Shell/REPL&#039;&#039;&#039; (bottom half) - Interactive Python console&lt;br /&gt;
&lt;br /&gt;
== Part 3: Your First MicroPython Program ==&lt;br /&gt;
&lt;br /&gt;
=== The REPL (Interactive Shell) ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;REPL&#039;&#039;&#039; (Read-Eval-Print Loop) lets you test Python code immediately:&lt;br /&gt;
&lt;br /&gt;
# Type in the Shell (bottom half of Thonny)&lt;br /&gt;
# Press Enter&lt;br /&gt;
# See the result instantly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Try this:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print(&amp;quot;Hello, Robot!&amp;quot;)&lt;br /&gt;
Hello, Robot!&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; 2 + 2&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; name = &amp;quot;SimpleBot&amp;quot;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print(f&amp;quot;My robot is {name}&amp;quot;)&lt;br /&gt;
My robot is SimpleBot&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why the REPL is amazing:&#039;&#039;&#039;&lt;br /&gt;
* Test sensor readings instantly&lt;br /&gt;
* Debug code by checking variable values&lt;br /&gt;
* Learn Python by experimenting&lt;br /&gt;
&lt;br /&gt;
=== Blink the Onboard LED ===&lt;br /&gt;
&lt;br /&gt;
Raspberry Pi Pico has an LED on pin 25 (the &amp;quot;onboard LED&amp;quot;). Let&#039;s blink it!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Type this in the REPL:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; from machine import Pin&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import time&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; led = Pin(25, Pin.OUT)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; led.on()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LED should turn ON!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Now turn it OFF:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; led.off()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make it blink:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; for i in range(10):&lt;br /&gt;
...     led.toggle()&lt;br /&gt;
...     time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: After typing &amp;quot;for i in range(10):&amp;quot;, press Enter, then type the indented lines, then press Enter twice to run.&lt;br /&gt;
&lt;br /&gt;
=== Write Your First Program ===&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s write a complete program in the editor (top half):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
led = Pin(25, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    led.toggle()&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Run the program:&#039;&#039;&#039;&lt;br /&gt;
# Click the green &amp;quot;Run&amp;quot; button (or press F5)&lt;br /&gt;
# Thonny will ask &amp;quot;Where to save?&amp;quot; - choose &#039;&#039;&#039;MicroPython device&#039;&#039;&#039;&lt;br /&gt;
# Save as &#039;&#039;&#039;blink.py&#039;&#039;&#039;&lt;br /&gt;
# The LED blinks forever!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stop the program:&#039;&#039;&#039;&lt;br /&gt;
* Click the red &amp;quot;Stop&amp;quot; button or press Ctrl+C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What this code does:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;from machine import Pin&#039;&#039;&#039; - Import Pin class for GPIO control&lt;br /&gt;
* &#039;&#039;&#039;import time&#039;&#039;&#039; - Import time module for delays&lt;br /&gt;
* &#039;&#039;&#039;led = Pin(25, Pin.OUT)&#039;&#039;&#039; - Configure pin 25 as output&lt;br /&gt;
* &#039;&#039;&#039;while True:&#039;&#039;&#039; - Loop forever&lt;br /&gt;
* &#039;&#039;&#039;led.toggle()&#039;&#039;&#039; - Switch LED state (on→off or off→on)&lt;br /&gt;
* &#039;&#039;&#039;time.sleep(0.5)&#039;&#039;&#039; - Wait 0.5 seconds&lt;br /&gt;
&lt;br /&gt;
== Part 4: Python Basics for Robotics ==&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
Variables store values (sensor readings, motor speeds, states):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Numbers&lt;br /&gt;
speed = 100&lt;br /&gt;
distance = 15.5&lt;br /&gt;
&lt;br /&gt;
# Strings (text)&lt;br /&gt;
robot_name = &amp;quot;SimpleBot&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Booleans (True/False)&lt;br /&gt;
line_detected = True&lt;br /&gt;
obstacle_ahead = False&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments explain code (Python ignores them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This is a comment&lt;br /&gt;
speed = 100  # Set motor speed to 100%&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Math Operations ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Basic math&lt;br /&gt;
x = 10 + 5    # Addition: 15&lt;br /&gt;
y = 10 - 3    # Subtraction: 7&lt;br /&gt;
z = 10 * 2    # Multiplication: 20&lt;br /&gt;
w = 10 / 4    # Division: 2.5&lt;br /&gt;
q = 10 // 4   # Integer division: 2&lt;br /&gt;
r = 10 % 3    # Modulo (remainder): 1&lt;br /&gt;
&lt;br /&gt;
# Comparisons (result is True or False)&lt;br /&gt;
10 &amp;gt; 5   # Greater than: True&lt;br /&gt;
10 &amp;lt; 5   # Less than: False&lt;br /&gt;
10 == 10 # Equal: True&lt;br /&gt;
10 != 5  # Not equal: True&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals (If/Else) ===&lt;br /&gt;
&lt;br /&gt;
Make decisions based on sensor readings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
sensor = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
if sensor.value() == 0:&lt;br /&gt;
    print(&amp;quot;Line detected!&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;No line&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Multiple conditions:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sensor_left = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
sensor_right = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
if sensor_left.value() == 0 and sensor_right.value() == 0:&lt;br /&gt;
    print(&amp;quot;Both sensors on line&amp;quot;)&lt;br /&gt;
elif sensor_left.value() == 0:&lt;br /&gt;
    print(&amp;quot;Left sensor on line&amp;quot;)&lt;br /&gt;
elif sensor_right.value() == 0:&lt;br /&gt;
    print(&amp;quot;Right sensor on line&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;No line detected&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loops (While and For) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;While loop&#039;&#039;&#039; - Repeat until condition is false:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
count = 0&lt;br /&gt;
while count &amp;lt; 10:&lt;br /&gt;
    print(count)&lt;br /&gt;
    count += 1  # Shorthand for count = count + 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Infinite loop&#039;&#039;&#039; - Robot main loop:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
while True:&lt;br /&gt;
    # Read sensors&lt;br /&gt;
    # Make decisions&lt;br /&gt;
    # Control motors&lt;br /&gt;
    time.sleep(0.01)  # Small delay&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For loop&#039;&#039;&#039; - Repeat a specific number of times:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for i in range(5):&lt;br /&gt;
    print(i)  # Prints 0, 1, 2, 3, 4&lt;br /&gt;
&lt;br /&gt;
# Blink LED 10 times&lt;br /&gt;
for i in range(10):&lt;br /&gt;
    led.toggle()&lt;br /&gt;
    time.sleep(0.2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Functions ===&lt;br /&gt;
&lt;br /&gt;
Functions organize code into reusable blocks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def blink_led(times, delay):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Blink LED a specific number of times&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    for i in range(times):&lt;br /&gt;
        led.toggle()&lt;br /&gt;
        time.sleep(delay)&lt;br /&gt;
&lt;br /&gt;
# Call the function&lt;br /&gt;
blink_led(5, 0.3)  # Blink 5 times, 0.3 second delay&lt;br /&gt;
blink_led(10, 0.1) # Blink 10 times, 0.1 second delay&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Functions with return values:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def read_sensor():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Read sensor and return True if line detected&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    sensor = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
    return sensor.value() == 0  # Returns True or False&lt;br /&gt;
&lt;br /&gt;
# Use the function&lt;br /&gt;
if read_sensor():&lt;br /&gt;
    print(&amp;quot;Line detected!&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 5: GPIO Control ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;GPIO&#039;&#039;&#039; (General-Purpose Input/Output) pins connect sensors and actuators to the microcontroller.&lt;br /&gt;
&lt;br /&gt;
=== Digital Output (Control LED) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wiring:&#039;&#039;&#039;&lt;br /&gt;
* LED long leg → GPIO pin 15&lt;br /&gt;
* LED short leg → 220Ω resistor → GND&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
led = Pin(15, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
led.on()   # Turn LED on (pin = HIGH = 3.3V)&lt;br /&gt;
led.off()  # Turn LED off (pin = LOW = 0V)&lt;br /&gt;
led.value(1)  # Alternative: 1 = on, 0 = off&lt;br /&gt;
led.toggle()  # Switch state&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Digital Input (Read Button) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wiring:&#039;&#039;&#039;&lt;br /&gt;
* Button one side → GPIO pin 14&lt;br /&gt;
* Button other side → GND&lt;br /&gt;
* Internal pull-up resistor (no external resistor needed)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
button = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    if button.value() == 0:  # Button pressed (connects to GND = LOW)&lt;br /&gt;
        print(&amp;quot;Button pressed!&amp;quot;)&lt;br /&gt;
    else:&lt;br /&gt;
        print(&amp;quot;Button not pressed&amp;quot;)&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why Pin.PULL_UP?&#039;&#039;&#039;&lt;br /&gt;
* Without pull-up, the input &amp;quot;floats&amp;quot; (undefined voltage) when button is not pressed&lt;br /&gt;
* Pull-up resistor connects input to 3.3V by default (HIGH)&lt;br /&gt;
* When button pressed, it connects to GND (LOW)&lt;br /&gt;
* This is an &#039;&#039;&#039;active LOW&#039;&#039;&#039; button (pressed = LOW)&lt;br /&gt;
&lt;br /&gt;
=== Example: Button-Controlled LED ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
button = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
led = Pin(15, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    if button.value() == 0:  # Button pressed&lt;br /&gt;
        led.on()&lt;br /&gt;
    else:&lt;br /&gt;
        led.off()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Improvement: Toggle LED on button press&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
button = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
led = Pin(15, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
last_button_state = 1  # Not pressed initially&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    button_state = button.value()&lt;br /&gt;
&lt;br /&gt;
    # Detect button press (transition from HIGH to LOW)&lt;br /&gt;
    if button_state == 0 and last_button_state == 1:&lt;br /&gt;
        led.toggle()&lt;br /&gt;
        time.sleep(0.2)  # Debounce delay&lt;br /&gt;
&lt;br /&gt;
    last_button_state = button_state&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 6: Analog Input (Read Variable Voltage) ==&lt;br /&gt;
&lt;br /&gt;
Some sensors output variable voltage (temperature, light, distance). Use ADC (Analog-to-Digital Converter) to read them.&lt;br /&gt;
&lt;br /&gt;
=== Reading a Potentiometer ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wiring:&#039;&#039;&#039;&lt;br /&gt;
* Potentiometer middle pin → GPIO 26 (ADC0)&lt;br /&gt;
* Potentiometer left pin → 3.3V&lt;br /&gt;
* Potentiometer right pin → GND&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import ADC, Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
pot = ADC(Pin(26))  # GPIO 26 is ADC0&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    value = pot.read_u16()  # Read 16-bit value (0-65535)&lt;br /&gt;
    voltage = value * 3.3 / 65535  # Convert to voltage&lt;br /&gt;
    percent = value / 65535 * 100  # Convert to percentage&lt;br /&gt;
&lt;br /&gt;
    print(f&amp;quot;Value: {value}, Voltage: {voltage:.2f}V, Percent: {percent:.1f}%&amp;quot;)&lt;br /&gt;
    time.sleep(0.5)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What this does:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;pot.read_u16()&#039;&#039;&#039; - Returns 0 (0V) to 65535 (3.3V)&lt;br /&gt;
* Turn potentiometer dial and watch the value change&lt;br /&gt;
* This is how robots read analog sensors (photoresistors, battery voltage)&lt;br /&gt;
&lt;br /&gt;
=== Example: ADC-Controlled LED Brightness ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This requires PWM, which we&#039;ll cover in [[MicroPython Programming]]. For now, we&#039;ll use a simple threshold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import ADC, Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
pot = ADC(Pin(26))&lt;br /&gt;
led = Pin(15, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    value = pot.read_u16()&lt;br /&gt;
&lt;br /&gt;
    if value &amp;gt; 32768:  # If pot is more than 50%&lt;br /&gt;
        led.on()&lt;br /&gt;
    else:&lt;br /&gt;
        led.off()&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 7: Your First Robot Program ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s combine everything into a simple robot behavior:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scenario:&#039;&#039;&#039; A robot with two line sensors that follows a line.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simplified hardware (for testing without a robot):&#039;&#039;&#039;&lt;br /&gt;
* 2 buttons represent line sensors (pressed = line detected)&lt;br /&gt;
* 2 LEDs represent motors (on = motor running)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wiring:&#039;&#039;&#039;&lt;br /&gt;
* Button 1 (left sensor) → GPIO 14 → GND, with Pin.PULL_UP&lt;br /&gt;
* Button 2 (right sensor) → GPIO 15 → GND, with Pin.PULL_UP&lt;br /&gt;
* LED 1 (left motor) → GPIO 16 → 220Ω → GND&lt;br /&gt;
* LED 2 (right motor) → GPIO 17 → 220Ω → GND&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
# Sensors (buttons for testing)&lt;br /&gt;
sensor_left = Pin(14, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
sensor_right = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
&lt;br /&gt;
# Motors (LEDs for testing)&lt;br /&gt;
motor_left = Pin(16, Pin.OUT)&lt;br /&gt;
motor_right = Pin(17, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
def drive_forward():&lt;br /&gt;
    motor_left.on()&lt;br /&gt;
    motor_right.on()&lt;br /&gt;
&lt;br /&gt;
def turn_left():&lt;br /&gt;
    motor_left.off()&lt;br /&gt;
    motor_right.on()&lt;br /&gt;
&lt;br /&gt;
def turn_right():&lt;br /&gt;
    motor_left.on()&lt;br /&gt;
    motor_right.off()&lt;br /&gt;
&lt;br /&gt;
def stop():&lt;br /&gt;
    motor_left.off()&lt;br /&gt;
    motor_right.off()&lt;br /&gt;
&lt;br /&gt;
# Main loop&lt;br /&gt;
while True:&lt;br /&gt;
    left = sensor_left.value()&lt;br /&gt;
    right = sensor_right.value()&lt;br /&gt;
&lt;br /&gt;
    # Both sensors on line (both buttons pressed)&lt;br /&gt;
    if left == 0 and right == 0:&lt;br /&gt;
        drive_forward()&lt;br /&gt;
    # Left sensor on line, right sensor off&lt;br /&gt;
    elif left == 0 and right == 1:&lt;br /&gt;
        turn_left()&lt;br /&gt;
    # Right sensor on line, left sensor off&lt;br /&gt;
    elif left == 1 and right == 0:&lt;br /&gt;
        turn_right()&lt;br /&gt;
    # Neither sensor on line&lt;br /&gt;
    else:&lt;br /&gt;
        stop()&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.01)  # Small delay&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Try this:&#039;&#039;&#039;&lt;br /&gt;
* Press left button only → left LED off, right LED on (turning left)&lt;br /&gt;
* Press right button only → left LED on, right LED off (turning right)&lt;br /&gt;
* Press both buttons → both LEDs on (driving forward)&lt;br /&gt;
* Release both buttons → both LEDs off (stopped)&lt;br /&gt;
&lt;br /&gt;
This is the foundation of [[Activity:Line Following]]!&lt;br /&gt;
&lt;br /&gt;
== Part 8: Saving Programs to Pico ==&lt;br /&gt;
&lt;br /&gt;
=== Where Code is Stored ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;main.py&#039;&#039;&#039; - Runs automatically when Pico powers on&lt;br /&gt;
* &#039;&#039;&#039;Other .py files&#039;&#039;&#039; - Can be imported as modules&lt;br /&gt;
&lt;br /&gt;
=== Create a Startup Program ===&lt;br /&gt;
&lt;br /&gt;
# Write your code in Thonny&lt;br /&gt;
# Click &amp;quot;Save as...&amp;quot; and choose &#039;&#039;&#039;MicroPython device&#039;&#039;&#039;&lt;br /&gt;
# Name it &#039;&#039;&#039;main.py&#039;&#039;&#039;&lt;br /&gt;
# Disconnect Pico and reconnect it&lt;br /&gt;
# Your program runs automatically!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Add a delay at the start so you can interrupt it if needed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import time&lt;br /&gt;
time.sleep(2)  # 2-second delay before starting&lt;br /&gt;
# Your code here&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Organize Code into Modules ===&lt;br /&gt;
&lt;br /&gt;
You can split code into multiple files:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;robot.py&#039;&#039;&#039; (on Pico):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
class Robot:&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.led = Pin(25, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
    def blink(self, times):&lt;br /&gt;
        for i in range(times):&lt;br /&gt;
            self.led.toggle()&lt;br /&gt;
            time.sleep(0.2)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;main.py&#039;&#039;&#039; (on Pico):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from robot import Robot&lt;br /&gt;
&lt;br /&gt;
bot = Robot()&lt;br /&gt;
bot.blink(10)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Part 9: Debugging and Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Print Debugging ===&lt;br /&gt;
&lt;br /&gt;
The most useful debugging technique is printing values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
while True:&lt;br /&gt;
    sensor_value = sensor.value()&lt;br /&gt;
    print(f&amp;quot;Sensor: {sensor_value}&amp;quot;)  # See what the sensor reads&lt;br /&gt;
&lt;br /&gt;
    if sensor_value == 0:&lt;br /&gt;
        motor.on()&lt;br /&gt;
        print(&amp;quot;Motor ON&amp;quot;)  # Confirm this branch executes&lt;br /&gt;
    else:&lt;br /&gt;
        motor.off()&lt;br /&gt;
        print(&amp;quot;Motor OFF&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    time.sleep(0.1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LED Indicator Debugging ===&lt;br /&gt;
&lt;br /&gt;
When you can&#039;t connect to serial console (robot is moving), use LED patterns:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def indicate_error():&lt;br /&gt;
    for i in range(5):&lt;br /&gt;
        led.toggle()&lt;br /&gt;
        time.sleep(0.1)  # Fast blink = error&lt;br /&gt;
&lt;br /&gt;
def indicate_success():&lt;br /&gt;
    led.on()&lt;br /&gt;
    time.sleep(1)  # Long on = success&lt;br /&gt;
    led.off()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Common Errors ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IndentationError:&#039;&#039;&#039; Python uses indentation (spaces/tabs) to group code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Wrong - inconsistent indentation&lt;br /&gt;
if sensor.value() == 0:&lt;br /&gt;
  motor.on()&lt;br /&gt;
    led.on()  # Error: too many spaces&lt;br /&gt;
&lt;br /&gt;
# Correct - consistent indentation&lt;br /&gt;
if sensor.value() == 0:&lt;br /&gt;
    motor.on()&lt;br /&gt;
    led.on()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NameError:&#039;&#039;&#039; Variable not defined:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Wrong&lt;br /&gt;
print(speed)  # Error: speed not defined&lt;br /&gt;
&lt;br /&gt;
# Correct&lt;br /&gt;
speed = 100&lt;br /&gt;
print(speed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;AttributeError:&#039;&#039;&#039; Calling wrong method:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Wrong&lt;br /&gt;
led.turnon()  # Error: no such method&lt;br /&gt;
&lt;br /&gt;
# Correct&lt;br /&gt;
led.on()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== REPL Error Messages ===&lt;br /&gt;
&lt;br /&gt;
Read error messages carefully - they tell you what&#039;s wrong:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;, line 5, in &amp;lt;module&amp;gt;&lt;br /&gt;
NameError: name &#039;speed&#039; is not defined&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Line 5&#039;&#039;&#039; - Error is on line 5&lt;br /&gt;
* &#039;&#039;&#039;NameError&#039;&#039;&#039; - Variable name doesn&#039;t exist&lt;br /&gt;
* &#039;&#039;&#039;speed not defined&#039;&#039;&#039; - You forgot to create variable &amp;quot;speed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Part 10: Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Install MicroPython on Raspberry Pi Pico&lt;br /&gt;
* ☐ Use Thonny IDE to write and run code&lt;br /&gt;
* ☐ Use the REPL to test code interactively&lt;br /&gt;
* ☐ Write Python variables, conditionals, loops, functions&lt;br /&gt;
* ☐ Control digital outputs (LEDs)&lt;br /&gt;
* ☐ Read digital inputs (buttons)&lt;br /&gt;
* ☐ Read analog inputs (potentiometer, sensors)&lt;br /&gt;
* ☐ Write a simple robot behavior (line following simulation)&lt;br /&gt;
* ☐ Save programs to Pico (main.py)&lt;br /&gt;
* ☐ Debug with print statements and LED indicators&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready to program [[SimpleBot]]!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Build SimpleBot ===&lt;br /&gt;
Apply your MicroPython knowledge to a real robot:&lt;br /&gt;
* [[SimpleBot]] - Full robot assembly guide&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - Real line following code&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Encoder-based odometry&lt;br /&gt;
&lt;br /&gt;
=== Learn More Programming ===&lt;br /&gt;
* [[MicroPython Programming]] - Interrupts, PWM, I2C, state machines&lt;br /&gt;
* [[State Machine Design]] - Organize complex behaviors&lt;br /&gt;
* [[Software]] - Full competency overview&lt;br /&gt;
&lt;br /&gt;
=== Practice Projects ===&lt;br /&gt;
* &#039;&#039;&#039;Reaction timer&#039;&#039;&#039; - Press button, wait random time, LED lights, measure reaction&lt;br /&gt;
* &#039;&#039;&#039;Light tracker&#039;&#039;&#039; - Use photoresistor to control LED brightness&lt;br /&gt;
* &#039;&#039;&#039;Morse code&#039;&#039;&#039; - Blink LED in Morse code patterns&lt;br /&gt;
* &#039;&#039;&#039;Night light&#039;&#039;&#039; - Turn LED on when photoresistor detects darkness&lt;br /&gt;
&lt;br /&gt;
== Common Beginner Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Forgetting to import modules&#039;&#039;&#039; - Always &#039;&#039;&#039;from machine import Pin&#039;&#039;&#039; at the start&lt;br /&gt;
* &#039;&#039;&#039;Using time.sleep() in interrupts&#039;&#039;&#039; - Interrupts must be fast (no delays!)&lt;br /&gt;
* &#039;&#039;&#039;Not configuring pin mode&#039;&#039;&#039; - Always specify Pin.IN or Pin.OUT&lt;br /&gt;
* &#039;&#039;&#039;Forgetting pull-up/pull-down resistors&#039;&#039;&#039; - Digital inputs need them to avoid floating&lt;br /&gt;
* &#039;&#039;&#039;Mixing up HIGH/LOW logic&#039;&#039;&#039; - Check if sensor is active HIGH or active LOW&lt;br /&gt;
* &#039;&#039;&#039;Infinite loops without sleep&#039;&#039;&#039; - Always add small delay to avoid maxing out CPU&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Software ===&lt;br /&gt;
* &#039;&#039;&#039;Thonny IDE&#039;&#039;&#039; (Free) - [https://thonny.org/ thonny.org]&lt;br /&gt;
* &#039;&#039;&#039;MicroPython Firmware&#039;&#039;&#039; (Free) - [https://micropython.org/download/rp2-pico/ micropython.org]&lt;br /&gt;
&lt;br /&gt;
=== Hardware Needed ===&lt;br /&gt;
* &#039;&#039;&#039;Raspberry Pi Pico&#039;&#039;&#039; - $4 from [https://www.raspberrypi.com/products/raspberry-pi-pico/ Raspberry Pi]&lt;br /&gt;
* &#039;&#039;&#039;USB cable&#039;&#039;&#039; (micro USB) - $2-5&lt;br /&gt;
* &#039;&#039;&#039;Breadboard&#039;&#039;&#039; - $5-10&lt;br /&gt;
* &#039;&#039;&#039;Jumper wires&#039;&#039;&#039; - $5-10&lt;br /&gt;
* &#039;&#039;&#039;LEDs and resistors&#039;&#039;&#039; - $5-10 for assorted kit&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://docs.micropython.org/en/latest/rp2/quickref.html MicroPython Quick Reference for Pico]&lt;br /&gt;
* [https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico Raspberry Pi Pico Getting Started]&lt;br /&gt;
* [https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html Raspberry Pi Pico Documentation]&lt;br /&gt;
* [https://docs.python.org/3/tutorial/ Python Tutorial] - Learn Python language&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Software]] - Full software competency overview&lt;br /&gt;
* [[MicroPython Programming]] - Next tutorial in the learning path&lt;br /&gt;
* [[SimpleBot]] - Build a robot using MicroPython&lt;br /&gt;
* [[Electronics Fundamentals]] - Understand the hardware you&#039;re controlling&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Software]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Software&amp;diff=81</id>
		<title>Software</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Software&amp;diff=81"/>
		<updated>2025-10-11T20:14:50Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=Software |description=Programming robots to perform tasks and managing their behavior |difficulty_range=Beginner to Advanced |time_to_basic=2-3 weeks |essential_tools=Text editor or IDE (Thonny), USB cable, microcontroller |optional_tools=Debugger, serial monitor, version control (Git) |beginner_tutorial=MicroPython Basics |unlocks_basic=All robot capabilities (software is required for every robot) |unlocks_advanced=Capability:IMU Sensing, Ca...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=Software&lt;br /&gt;
|description=Programming robots to perform tasks and managing their behavior&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=2-3 weeks&lt;br /&gt;
|essential_tools=Text editor or IDE (Thonny), USB cable, microcontroller&lt;br /&gt;
|optional_tools=Debugger, serial monitor, version control (Git)&lt;br /&gt;
|beginner_tutorial=[[MicroPython Basics]]&lt;br /&gt;
|unlocks_basic=All robot capabilities (software is required for every robot)&lt;br /&gt;
|unlocks_advanced=[[Capability:IMU Sensing]], [[Capability:Camera Vision]], [[Activity:Autonomous Navigation]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Software&#039;&#039;&#039; is the competency of programming robots and managing their behavior. In robotics, software is the brain that coordinates sensors, actuators, and decision-making logic. It encompasses writing code, debugging programs, using libraries, and managing complex multi-process systems.&lt;br /&gt;
&lt;br /&gt;
Software is distinct from [[Electronics]] (the hardware interface) and [[Mechanics]] (the physical structure). This competency focuses on &#039;&#039;&#039;programming&#039;&#039;&#039;: writing algorithms, controlling hardware through code, and building intelligent behaviors.&lt;br /&gt;
&lt;br /&gt;
== Why Software Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
Software brings robots to life:&lt;br /&gt;
* &#039;&#039;&#039;Sensors&#039;&#039;&#039; provide data, but software interprets it&lt;br /&gt;
* &#039;&#039;&#039;Actuators&#039;&#039;&#039; can move, but software decides when and how&lt;br /&gt;
* &#039;&#039;&#039;Behaviors&#039;&#039;&#039; emerge from code that combines sensing and action&lt;br /&gt;
* &#039;&#039;&#039;Intelligence&#039;&#039;&#039; comes from algorithms, state machines, and decision logic&lt;br /&gt;
&lt;br /&gt;
Without software knowledge, you&#039;re limited to pre-programmed behaviors and cannot create custom robot capabilities.&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (SimpleBot Level) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to program [[SimpleBot]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;MicroPython basics&#039;&#039;&#039; - Variables, functions, loops, conditionals&lt;br /&gt;
* &#039;&#039;&#039;Flashing firmware&#039;&#039;&#039; - Install MicroPython on Raspberry Pi Pico&lt;br /&gt;
* &#039;&#039;&#039;Using an IDE&#039;&#039;&#039; - Write and upload code with Thonny&lt;br /&gt;
* &#039;&#039;&#039;REPL interaction&#039;&#039;&#039; - Interactive Python shell for testing&lt;br /&gt;
* &#039;&#039;&#039;GPIO control&#039;&#039;&#039; - Read sensors, control motors with digital I/O&lt;br /&gt;
* &#039;&#039;&#039;Simple programs&#039;&#039;&#039; - Blink LED, read button, control motor direction&lt;br /&gt;
* &#039;&#039;&#039;Debugging&#039;&#039;&#039; - Print statements, LED indicators, REPL error messages&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Line Sensing]] (read digital sensors)&lt;br /&gt;
* [[Capability:Differential Drive]] (control motor directions)&lt;br /&gt;
* [[Activity:Line Following]] (combine sensing + control in a loop)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[MicroPython Basics]], [[MicroPython Programming]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Write simple MicroPython programs for Raspberry Pi Pico&lt;br /&gt;
* Control LEDs, buttons, and motors with GPIO&lt;br /&gt;
* Read sensor values and make decisions based on them&lt;br /&gt;
* Debug basic program errors&lt;br /&gt;
* Implement simple robot behaviors (line following, obstacle detection)&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (Expanding Capabilities) ===&lt;br /&gt;
&lt;br /&gt;
Skills for implementing complex robot behaviors:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Interrupts&#039;&#039;&#039; - Hardware interrupts for encoder counting, timing-critical events&lt;br /&gt;
* &#039;&#039;&#039;PWM generation&#039;&#039;&#039; - Precise motor speed control, servo positioning&lt;br /&gt;
* &#039;&#039;&#039;Timers&#039;&#039;&#039; - Periodic tasks, non-blocking delays&lt;br /&gt;
* &#039;&#039;&#039;Communication protocols&#039;&#039;&#039; - I2C and SPI libraries for sensors&lt;br /&gt;
* &#039;&#039;&#039;State machines&#039;&#039;&#039; - Organize complex behaviors with states and transitions&lt;br /&gt;
* &#039;&#039;&#039;Sensor fusion&#039;&#039;&#039; - Combine multiple sensors for robust perception&lt;br /&gt;
* &#039;&#039;&#039;Asynchronous programming&#039;&#039;&#039; - Use asyncio for concurrent tasks&lt;br /&gt;
* &#039;&#039;&#039;Calibration&#039;&#039;&#039; - Tune sensor thresholds, motor speeds, PID parameters&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Encoder Sensing]] (interrupt-driven quadrature encoders)&lt;br /&gt;
* [[Capability:IMU Sensing]] (I2C communication with accelerometer/gyroscope)&lt;br /&gt;
* [[Capability:Time-of-Flight Sensing]] (I2C distance sensors)&lt;br /&gt;
* [[Activity:Dead Reckoning]] (encoder integration, coordinate tracking)&lt;br /&gt;
* [[Behavior:PID Control]] (closed-loop motor control)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[MicroPython Programming]], [[State Machine Design]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Implement interrupt-driven encoder counting&lt;br /&gt;
* Control motor speeds with PWM&lt;br /&gt;
* Read I2C and SPI sensors using libraries&lt;br /&gt;
* Design state machines for complex behaviors&lt;br /&gt;
* Write asynchronous code for concurrent tasks&lt;br /&gt;
* Calibrate sensors and tune control parameters&lt;br /&gt;
* Debug timing and concurrency issues&lt;br /&gt;
&lt;br /&gt;
=== Advanced (Autonomous Systems) ===&lt;br /&gt;
&lt;br /&gt;
Skills for building sophisticated autonomous robots:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Computer vision&#039;&#039;&#039; - OpenCV for camera-based perception&lt;br /&gt;
* &#039;&#039;&#039;ROS (Robot Operating System)&#039;&#039;&#039; - Distributed system for complex robots&lt;br /&gt;
* &#039;&#039;&#039;Path planning&#039;&#039;&#039; - A*, Dijkstra, RRT algorithms&lt;br /&gt;
* &#039;&#039;&#039;SLAM&#039;&#039;&#039; - Simultaneous Localization and Mapping&lt;br /&gt;
* &#039;&#039;&#039;Multi-process systems&#039;&#039;&#039; - Separate processes for perception, planning, control&lt;br /&gt;
* &#039;&#039;&#039;Docker containers&#039;&#039;&#039; - Portable, reproducible software environments&lt;br /&gt;
* &#039;&#039;&#039;Real-time systems&#039;&#039;&#039; - Guarantee timing constraints for safety-critical tasks&lt;br /&gt;
* &#039;&#039;&#039;Machine learning&#039;&#039;&#039; - Neural networks for perception and control&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Camera Vision]] (image processing, object detection)&lt;br /&gt;
* [[Capability:LIDAR Sensing]] (point cloud processing)&lt;br /&gt;
* [[Activity:Autonomous Navigation]] (mapping, path planning, obstacle avoidance)&lt;br /&gt;
* [[Activity:Object Manipulation]] (vision-guided grasping)&lt;br /&gt;
* Multi-robot coordination and swarm behaviors&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[ROS Basics]], [[OpenCV for Robotics]], [[Docker for Robots]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Build ROS-based systems with multiple nodes&lt;br /&gt;
* Implement computer vision algorithms with OpenCV&lt;br /&gt;
* Deploy robot software in Docker containers&lt;br /&gt;
* Design path planning and navigation algorithms&lt;br /&gt;
* Integrate machine learning models for perception&lt;br /&gt;
* Build real-time control systems&lt;br /&gt;
* Manage complex multi-process robotic systems&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: MicroPython Beginner (SimpleBot) ===&lt;br /&gt;
# Start with [[MicroPython Basics]] - Learn Python, GPIO, and basic control&lt;br /&gt;
# Build [[SimpleBot]] - Apply programming to a real robot&lt;br /&gt;
# Complete [[MicroPython Programming]] - Learn interrupts, PWM, and I2C&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can program SimpleBot and implement basic robot behaviors.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Embedded Systems Developer (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (MicroPython Beginner)&lt;br /&gt;
# Study [[State Machine Design]] - Organize complex behaviors&lt;br /&gt;
# Implement [[Behavior:PID Control]] - Closed-loop motor control&lt;br /&gt;
# Add advanced sensors (IMU, encoders) to your robot&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can write sophisticated control algorithms and handle multiple sensors.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Autonomous Robotics Engineer (Advanced) ===&lt;br /&gt;
# Complete Path 2 (Embedded Systems Developer)&lt;br /&gt;
# Learn [[ROS Basics]] - Distributed robotics framework&lt;br /&gt;
# Study [[OpenCV for Robotics]] - Computer vision for perception&lt;br /&gt;
# Build a robot with camera-based navigation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can build autonomous robots with vision, mapping, and planning capabilities.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Programming Fundamentals ===&lt;br /&gt;
* &#039;&#039;&#039;Variables&#039;&#039;&#039; - Store sensor readings, motor states, calculated values&lt;br /&gt;
* &#039;&#039;&#039;Functions&#039;&#039;&#039; - Organize code into reusable blocks (read_sensor, drive_forward)&lt;br /&gt;
* &#039;&#039;&#039;Loops&#039;&#039;&#039; - Repeat actions (while True: read sensors, decide, act)&lt;br /&gt;
* &#039;&#039;&#039;Conditionals&#039;&#039;&#039; - Make decisions (if line_detected: turn_left)&lt;br /&gt;
&lt;br /&gt;
=== Hardware Control ===&lt;br /&gt;
* &#039;&#039;&#039;Digital I/O&#039;&#039;&#039; - Read HIGH/LOW from sensors, write HIGH/LOW to motors&lt;br /&gt;
* &#039;&#039;&#039;Analog I/O&#039;&#039;&#039; - Read variable voltages with ADC (battery level, photoresistor)&lt;br /&gt;
* &#039;&#039;&#039;PWM&#039;&#039;&#039; - Generate pulse-width modulation for motor speed, servo position&lt;br /&gt;
* &#039;&#039;&#039;Interrupts&#039;&#039;&#039; - Respond immediately to events (encoder pulse, button press)&lt;br /&gt;
&lt;br /&gt;
=== Communication Protocols ===&lt;br /&gt;
* &#039;&#039;&#039;I2C&#039;&#039;&#039; - Communicate with sensors (IMU, distance sensor, OLED display)&lt;br /&gt;
* &#039;&#039;&#039;SPI&#039;&#039;&#039; - High-speed communication (SD card, some sensors)&lt;br /&gt;
* &#039;&#039;&#039;UART/Serial&#039;&#039;&#039; - Debug output, GPS modules, Bluetooth communication&lt;br /&gt;
&lt;br /&gt;
=== Control Structures ===&lt;br /&gt;
* &#039;&#039;&#039;State machines&#039;&#039;&#039; - Organize behaviors with states (SEARCHING, FOLLOWING, TURNING)&lt;br /&gt;
* &#039;&#039;&#039;PID control&#039;&#039;&#039; - Closed-loop control for speed, position, line following&lt;br /&gt;
* &#039;&#039;&#039;Sensor fusion&#039;&#039;&#039; - Combine multiple sensors for robust measurements&lt;br /&gt;
* &#039;&#039;&#039;Event-driven programming&#039;&#039;&#039; - Respond to interrupts, timers, external events&lt;br /&gt;
&lt;br /&gt;
=== Debugging Techniques ===&lt;br /&gt;
* &#039;&#039;&#039;Print debugging&#039;&#039;&#039; - Print sensor values, state transitions to serial console&lt;br /&gt;
* &#039;&#039;&#039;LED indicators&#039;&#039;&#039; - Visual feedback for program state (blinking patterns)&lt;br /&gt;
* &#039;&#039;&#039;REPL testing&#039;&#039;&#039; - Test functions interactively before running full program&lt;br /&gt;
* &#039;&#039;&#039;Oscilloscope/logic analyzer&#039;&#039;&#039; - Visualize PWM signals, I2C communication&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Tools (Start Here) ===&lt;br /&gt;
* &#039;&#039;&#039;Text editor or IDE&#039;&#039;&#039; (Free) - Thonny (recommended for beginners), VS Code, Mu Editor&lt;br /&gt;
* &#039;&#039;&#039;USB cable&#039;&#039;&#039; ($2-5) - Connect microcontroller to computer&lt;br /&gt;
* &#039;&#039;&#039;Microcontroller&#039;&#039;&#039; ($4-10) - Raspberry Pi Pico (MicroPython), ESP32, Arduino&lt;br /&gt;
* &#039;&#039;&#039;Serial terminal&#039;&#039;&#039; (Free, built into IDE) - View debug output, REPL interaction&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Version control&#039;&#039;&#039; (Free) - Git and GitHub for code management&lt;br /&gt;
* &#039;&#039;&#039;Logic analyzer&#039;&#039;&#039; ($10-60) - Debug I2C, SPI, UART communication&lt;br /&gt;
* &#039;&#039;&#039;Oscilloscope&#039;&#039;&#039; ($100-400) - Visualize PWM, timing, analog signals&lt;br /&gt;
* &#039;&#039;&#039;Debugger&#039;&#039;&#039; ($10-50) - Hardware debugger for stepping through code&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Single-board computer&#039;&#039;&#039; ($35-100) - Raspberry Pi for ROS, OpenCV&lt;br /&gt;
* &#039;&#039;&#039;Development board&#039;&#039;&#039; ($50-200) - Jetson Nano for computer vision, neural networks&lt;br /&gt;
* &#039;&#039;&#039;Docker&#039;&#039;&#039; (Free) - Container platform for reproducible environments&lt;br /&gt;
* &#039;&#039;&#039;ROS&#039;&#039;&#039; (Free) - Robot Operating System for distributed robotics&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Blocking delays&#039;&#039;&#039; - Using time.sleep() prevents interrupt handling and responsiveness&lt;br /&gt;
* &#039;&#039;&#039;Floating-point errors&#039;&#039;&#039; - Use integers for encoder counts, careful with division&lt;br /&gt;
* &#039;&#039;&#039;Race conditions&#039;&#039;&#039; - Interrupts can modify variables during main loop calculations&lt;br /&gt;
* &#039;&#039;&#039;Uninitialized variables&#039;&#039;&#039; - Always initialize variables before using them&lt;br /&gt;
* &#039;&#039;&#039;Infinite loops without exit&#039;&#039;&#039; - Always include a way to stop or reset your program&lt;br /&gt;
* &#039;&#039;&#039;Ignoring hardware timing&#039;&#039;&#039; - I2C/SPI require specific timing, PWM frequency affects motors&lt;br /&gt;
* &#039;&#039;&#039;Memory leaks&#039;&#039;&#039; - MicroPython has limited RAM; avoid creating objects in tight loops&lt;br /&gt;
&lt;br /&gt;
== Programming Environments ==&lt;br /&gt;
&lt;br /&gt;
=== MicroPython (Beginner-Friendly) ===&lt;br /&gt;
* &#039;&#039;&#039;Platforms&#039;&#039;&#039;: Raspberry Pi Pico, ESP32, PyBoard&lt;br /&gt;
* &#039;&#039;&#039;Pros&#039;&#039;&#039;: Easy to learn, interactive REPL, extensive libraries&lt;br /&gt;
* &#039;&#039;&#039;Cons&#039;&#039;&#039;: Slower than C/C++, limited RAM&lt;br /&gt;
* &#039;&#039;&#039;Best for&#039;&#039;&#039;: SimpleBot, learning robotics, rapid prototyping&lt;br /&gt;
&lt;br /&gt;
=== Arduino (C/C++) (Popular) ===&lt;br /&gt;
* &#039;&#039;&#039;Platforms&#039;&#039;&#039;: Arduino Uno, Nano, Mega, ESP32, Teensy&lt;br /&gt;
* &#039;&#039;&#039;Pros&#039;&#039;&#039;: Fast execution, huge community, extensive libraries&lt;br /&gt;
* &#039;&#039;&#039;Cons&#039;&#039;&#039;: Steeper learning curve, less interactive&lt;br /&gt;
* &#039;&#039;&#039;Best for&#039;&#039;&#039;: Performance-critical tasks, larger community support&lt;br /&gt;
&lt;br /&gt;
=== Python on SBC (Advanced) ===&lt;br /&gt;
* &#039;&#039;&#039;Platforms&#039;&#039;&#039;: Raspberry Pi, Jetson Nano, Rock Pi&lt;br /&gt;
* &#039;&#039;&#039;Pros&#039;&#039;&#039;: Full Python ecosystem (NumPy, OpenCV, ROS), multitasking&lt;br /&gt;
* &#039;&#039;&#039;Cons&#039;&#039;&#039;: Not real-time, more expensive hardware&lt;br /&gt;
* &#039;&#039;&#039;Best for&#039;&#039;&#039;: Computer vision, ROS, complex algorithms&lt;br /&gt;
&lt;br /&gt;
=== ROS (Robot Operating System) (Advanced) ===&lt;br /&gt;
* &#039;&#039;&#039;Platforms&#039;&#039;&#039;: Linux on SBC (Raspberry Pi, Jetson, x86)&lt;br /&gt;
* &#039;&#039;&#039;Pros&#039;&#039;&#039;: Distributed system, reusable nodes, rich ecosystem&lt;br /&gt;
* &#039;&#039;&#039;Cons&#039;&#039;&#039;: Steep learning curve, complex setup&lt;br /&gt;
* &#039;&#039;&#039;Best for&#039;&#039;&#039;: Multi-sensor robots, navigation, manipulation&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[MicroPython Basics]]&#039;&#039;&#039; (Beginner) - Start here if you&#039;re new to programming&lt;br /&gt;
* &#039;&#039;&#039;[[MicroPython Programming]]&#039;&#039;&#039; (Intermediate) - Interrupts, PWM, I2C, state machines&lt;br /&gt;
* &#039;&#039;&#039;[[State Machine Design]]&#039;&#039;&#039; (Intermediate) - Organize complex behaviors&lt;br /&gt;
* &#039;&#039;&#039;[[ROS Basics]]&#039;&#039;&#039; (Advanced) - Distributed robotics framework&lt;br /&gt;
* &#039;&#039;&#039;[[OpenCV for Robotics]]&#039;&#039;&#039; (Advanced) - Computer vision for perception&lt;br /&gt;
&lt;br /&gt;
=== Implementation Pages ===&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - Complete MicroPython code&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Encoder counting and odometry&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://docs.micropython.org/ MicroPython Documentation] - Official reference&lt;br /&gt;
* [https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico Raspberry Pi Pico Guide] - Getting started&lt;br /&gt;
* [https://www.arduino.cc/reference/en/ Arduino Language Reference] - C/C++ for Arduino&lt;br /&gt;
* [https://wiki.ros.org/ROS/Tutorials ROS Tutorials] - Robot Operating System&lt;br /&gt;
* [https://docs.opencv.org/4.x/d6/d00/tutorial_py_root.html OpenCV Python Tutorials] - Computer vision&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Understand the hardware that software controls&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Design the physical systems that software commands&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Build the circuits that software interfaces with&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Create robot chassis to mount sensors and actuators&lt;br /&gt;
&lt;br /&gt;
== Example Programs ==&lt;br /&gt;
&lt;br /&gt;
=== Blink LED (Hello World) ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
led = Pin(25, Pin.OUT)  # Raspberry Pi Pico onboard LED&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    led.toggle()&lt;br /&gt;
    time.sleep(0.5)  # 0.5 seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Read Button, Control LED ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
button = Pin(14, Pin.IN, Pin.PULL_UP)  # Active LOW button&lt;br /&gt;
led = Pin(25, Pin.OUT)&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    if button.value() == 0:  # Button pressed (LOW)&lt;br /&gt;
        led.on()&lt;br /&gt;
    else:&lt;br /&gt;
        led.off()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PWM Motor Speed Control ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin, PWM&lt;br /&gt;
&lt;br /&gt;
motor_pwm = PWM(Pin(16))&lt;br /&gt;
motor_pwm.freq(1000)  # 1 kHz PWM frequency&lt;br /&gt;
&lt;br /&gt;
# 50% speed&lt;br /&gt;
motor_pwm.duty_u16(32768)  # 50% of 65535 (16-bit)&lt;br /&gt;
&lt;br /&gt;
# 75% speed&lt;br /&gt;
motor_pwm.duty_u16(49152)  # 75% of 65535&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Interrupt-Driven Encoder ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from machine import Pin&lt;br /&gt;
&lt;br /&gt;
encoder_count = 0&lt;br /&gt;
&lt;br /&gt;
def encoder_callback(pin):&lt;br /&gt;
    global encoder_count&lt;br /&gt;
    encoder_count += 1&lt;br /&gt;
&lt;br /&gt;
encoder = Pin(15, Pin.IN, Pin.PULL_UP)&lt;br /&gt;
encoder.irq(trigger=Pin.IRQ_RISING, handler=encoder_callback)&lt;br /&gt;
&lt;br /&gt;
# Count pulses while doing other work&lt;br /&gt;
while True:&lt;br /&gt;
    print(f&amp;quot;Count: {encoder_count}&amp;quot;)&lt;br /&gt;
    time.sleep(1)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities]] - Software enables all robot capabilities&lt;br /&gt;
* [[Behaviors]] - Algorithms that software implements&lt;br /&gt;
* [[SimpleBot]] - Apply software knowledge to build a robot&lt;br /&gt;
* [[Robotics Ontology]] - How software fits into the BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=KiCad_Tutorial&amp;diff=80</id>
		<title>KiCad Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=KiCad_Tutorial&amp;diff=80"/>
		<updated>2025-10-11T20:14:29Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=KiCad Tutorial |competency=PCB Design |difficulty=Beginner |time=3-6 hours (spread across multiple sessions) |prerequisites=Electronics Fundamentals - Understanding of circuits, components, schematics |materials=KiCad (free download), computer, practice project (LED breakout board) |next_steps=Design custom board for your robot, study SimpleBot PCB design, order boards from JLCPCB }}  &amp;#039;&amp;#039;&amp;#039;KiCad Tutorial&amp;#039;&amp;#039;&amp;#039; is your complete guide to designing y...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=KiCad Tutorial&lt;br /&gt;
|competency=[[PCB Design]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=3-6 hours (spread across multiple sessions)&lt;br /&gt;
|prerequisites=[[Electronics Fundamentals]] - Understanding of circuits, components, schematics&lt;br /&gt;
|materials=KiCad (free download), computer, practice project (LED breakout board)&lt;br /&gt;
|next_steps=Design custom board for your robot, study [[SimpleBot]] PCB design, order boards from JLCPCB&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;KiCad Tutorial&#039;&#039;&#039; is your complete guide to designing your first printed circuit board (PCB) from start to finish. This tutorial walks you through KiCad, a free and powerful PCB design tool, using a simple LED breakout board project.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll:&lt;br /&gt;
* Install and configure KiCad&lt;br /&gt;
* Create a schematic with components and connections&lt;br /&gt;
* Assign footprints to components&lt;br /&gt;
* Layout a PCB with proper trace routing&lt;br /&gt;
* Generate Gerber files for manufacturing&lt;br /&gt;
* Order your PCB from an online manufacturer&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039;. You&#039;ll design a complete, manufacturable PCB that you can order and assemble.&lt;br /&gt;
&lt;br /&gt;
== Part 1: Installing KiCad ==&lt;br /&gt;
&lt;br /&gt;
=== Download and Install ===&lt;br /&gt;
&lt;br /&gt;
# Visit [https://www.kicad.org/download/ KiCad Downloads]&lt;br /&gt;
# Download the latest stable version for your operating system&lt;br /&gt;
# Run the installer (accept defaults)&lt;br /&gt;
# Launch KiCad&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This tutorial uses KiCad 7.x or 8.x. Interface may differ slightly in older versions.&lt;br /&gt;
&lt;br /&gt;
=== First Launch Setup ===&lt;br /&gt;
&lt;br /&gt;
When you first launch KiCad:&lt;br /&gt;
# Select default library paths (click OK/Next)&lt;br /&gt;
# KiCad will download symbol and footprint libraries (this may take a few minutes)&lt;br /&gt;
# You&#039;ll see the KiCad project manager window&lt;br /&gt;
&lt;br /&gt;
=== Understanding KiCad&#039;s Interface ===&lt;br /&gt;
&lt;br /&gt;
KiCad has several tools (all launched from the project manager):&lt;br /&gt;
* &#039;&#039;&#039;Schematic Editor&#039;&#039;&#039; - Draw circuit diagrams&lt;br /&gt;
* &#039;&#039;&#039;Symbol Editor&#039;&#039;&#039; - Create/edit component symbols&lt;br /&gt;
* &#039;&#039;&#039;PCB Editor&#039;&#039;&#039; - Layout physical board&lt;br /&gt;
* &#039;&#039;&#039;Footprint Editor&#039;&#039;&#039; - Create/edit component footprints&lt;br /&gt;
* &#039;&#039;&#039;Gerber Viewer&#039;&#039;&#039; - Preview manufacturing files&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Workflow&#039;&#039;&#039;: Schematic → Footprint Assignment → PCB Layout → Gerber Export&lt;br /&gt;
&lt;br /&gt;
== Part 2: Creating a New Project ==&lt;br /&gt;
&lt;br /&gt;
=== Project: LED Breakout Board ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll design a simple LED breakout board:&lt;br /&gt;
* &#039;&#039;&#039;Input&#039;&#039;&#039;: 5V and GND via screw terminal&lt;br /&gt;
* &#039;&#039;&#039;Components&#039;&#039;&#039;: Current-limiting resistor, LED, header pins for output&lt;br /&gt;
* &#039;&#039;&#039;Output&#039;&#039;&#039;: LED indicator, 5V/GND headers for connecting to other boards&lt;br /&gt;
&lt;br /&gt;
This teaches fundamental PCB design skills without overwhelming complexity.&lt;br /&gt;
&lt;br /&gt;
=== Create the Project ===&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;File → New Project&#039;&#039;&#039;&lt;br /&gt;
# Name it: &amp;lt;code&amp;gt;led_breakout&amp;lt;/code&amp;gt;&lt;br /&gt;
# Choose a location to save it&lt;br /&gt;
# Click &#039;&#039;&#039;Create&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll see two files created:&lt;br /&gt;
* &amp;lt;code&amp;gt;led_breakout.kicad_sch&amp;lt;/code&amp;gt; - Schematic file&lt;br /&gt;
* &amp;lt;code&amp;gt;led_breakout.kicad_pcb&amp;lt;/code&amp;gt; - PCB layout file&lt;br /&gt;
&lt;br /&gt;
== Part 3: Schematic Design ==&lt;br /&gt;
&lt;br /&gt;
=== Launch the Schematic Editor ===&lt;br /&gt;
&lt;br /&gt;
# Double-click &amp;lt;code&amp;gt;led_breakout.kicad_sch&amp;lt;/code&amp;gt; in the project manager&lt;br /&gt;
# You&#039;ll see a blank grid with a title block in the corner&lt;br /&gt;
&lt;br /&gt;
=== Adding Components (Symbols) ===&lt;br /&gt;
&lt;br /&gt;
We need these components:&lt;br /&gt;
* 1× LED&lt;br /&gt;
* 1× Resistor (220Ω)&lt;br /&gt;
* 1× Screw terminal (2-position)&lt;br /&gt;
* 1× Pin header (1×3, for 5V/LED/GND output)&lt;br /&gt;
* Power symbols (VCC, GND)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding the LED:&#039;&#039;&#039;&lt;br /&gt;
# Press &#039;&#039;&#039;A&#039;&#039;&#039; (Add symbol shortcut) or click the &amp;quot;Place Symbol&amp;quot; icon&lt;br /&gt;
# Type &amp;quot;LED&amp;quot; in the search box&lt;br /&gt;
# Select &#039;&#039;&#039;Device:LED&#039;&#039;&#039; from the list&lt;br /&gt;
# Click to place it on the schematic (middle of the grid)&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039; to exit placement mode&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding the resistor:&#039;&#039;&#039;&lt;br /&gt;
# Press &#039;&#039;&#039;A&#039;&#039;&#039; again&lt;br /&gt;
# Type &amp;quot;R&amp;quot; in the search box&lt;br /&gt;
# Select &#039;&#039;&#039;Device:R&#039;&#039;&#039; (resistor)&lt;br /&gt;
# Place it to the left of the LED&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding the screw terminal:&#039;&#039;&#039;&lt;br /&gt;
# Press &#039;&#039;&#039;A&#039;&#039;&#039;&lt;br /&gt;
# Type &amp;quot;screw terminal&amp;quot; or &amp;quot;conn_01x02&amp;quot;&lt;br /&gt;
# Select &#039;&#039;&#039;Connector:Screw_Terminal_01x02&#039;&#039;&#039; (2-position terminal)&lt;br /&gt;
# Place it on the far left&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding the output header:&#039;&#039;&#039;&lt;br /&gt;
# Press &#039;&#039;&#039;A&#039;&#039;&#039;&lt;br /&gt;
# Type &amp;quot;conn_01x03&amp;quot;&lt;br /&gt;
# Select &#039;&#039;&#039;Connector_Generic:Conn_01x03&#039;&#039;&#039; (3-pin header)&lt;br /&gt;
# Place it on the far right&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding power symbols:&#039;&#039;&#039;&lt;br /&gt;
# Press &#039;&#039;&#039;P&#039;&#039;&#039; (Power symbol shortcut)&lt;br /&gt;
# Type &amp;quot;VCC&amp;quot;&lt;br /&gt;
# Select &#039;&#039;&#039;power:VCC&#039;&#039;&#039;&lt;br /&gt;
# Place above the screw terminal&lt;br /&gt;
# Press &#039;&#039;&#039;P&#039;&#039;&#039; again&lt;br /&gt;
# Type &amp;quot;GND&amp;quot;&lt;br /&gt;
# Select &#039;&#039;&#039;power:GND&#039;&#039;&#039;&lt;br /&gt;
# Place below the screw terminal and near the LED&lt;br /&gt;
&lt;br /&gt;
Your schematic should have: screw terminal (left) → resistor → LED → header (right), with VCC/GND symbols.&lt;br /&gt;
&lt;br /&gt;
=== Connecting Components (Wiring) ===&lt;br /&gt;
&lt;br /&gt;
Now connect the components with wires (nets):&lt;br /&gt;
&lt;br /&gt;
# Press &#039;&#039;&#039;W&#039;&#039;&#039; (Wire tool) or click &amp;quot;Place Wire&amp;quot; icon&lt;br /&gt;
# Click on the screw terminal pin 1 (top pin)&lt;br /&gt;
# Click on the VCC symbol (creates a connection)&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039; to exit wire mode&lt;br /&gt;
&lt;br /&gt;
Repeat for all connections:&lt;br /&gt;
* Screw terminal pin 1 → VCC symbol&lt;br /&gt;
* Screw terminal pin 2 → GND symbol (bottom)&lt;br /&gt;
* VCC → Resistor pin 1 (left side)&lt;br /&gt;
* Resistor pin 2 (right side) → LED anode (top pin, triangle side)&lt;br /&gt;
* LED cathode (bottom pin, bar side) → GND&lt;br /&gt;
* VCC → Header pin 1&lt;br /&gt;
* LED anode → Header pin 2 (LED output)&lt;br /&gt;
* GND → Header pin 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Wires connect when you click directly on a pin (pink circle appears)&lt;br /&gt;
* Press &#039;&#039;&#039;ESC&#039;&#039;&#039; to cancel wire placement&lt;br /&gt;
* Move components with &#039;&#039;&#039;M&#039;&#039;&#039; (grab and move)&lt;br /&gt;
&lt;br /&gt;
=== Annotating Components ===&lt;br /&gt;
&lt;br /&gt;
Components need unique reference designators (R1, D1, J1):&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;Tools → Annotate Schematic&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Annotate&#039;&#039;&#039; button (uses defaults)&lt;br /&gt;
# Click &#039;&#039;&#039;Close&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Your components now have designators:&lt;br /&gt;
* J1 (screw terminal)&lt;br /&gt;
* R1 (resistor)&lt;br /&gt;
* D1 (LED)&lt;br /&gt;
* J2 (header)&lt;br /&gt;
&lt;br /&gt;
=== Setting Component Values ===&lt;br /&gt;
&lt;br /&gt;
Assign values to resistor and LED:&lt;br /&gt;
&lt;br /&gt;
# Hover over R1 and press &#039;&#039;&#039;V&#039;&#039;&#039; (Value shortcut)&lt;br /&gt;
# Type &amp;quot;220&amp;quot; (220 ohms)&lt;br /&gt;
# Press &#039;&#039;&#039;Enter&#039;&#039;&#039;&lt;br /&gt;
# Hover over D1 and press &#039;&#039;&#039;V&#039;&#039;&#039;&lt;br /&gt;
# Type &amp;quot;Red LED&amp;quot; or just &amp;quot;LED&amp;quot;&lt;br /&gt;
# Press &#039;&#039;&#039;Enter&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Adding Title Block Information ===&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;File → Page Settings&#039;&#039;&#039;&lt;br /&gt;
# Fill in:&lt;br /&gt;
** Title: &amp;quot;LED Breakout Board&amp;quot;&lt;br /&gt;
** Date: (auto-filled)&lt;br /&gt;
** Revision: &amp;quot;1.0&amp;quot;&lt;br /&gt;
** Company: (your name or &amp;quot;BRS&amp;quot;)&lt;br /&gt;
# Click &#039;&#039;&#039;OK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Electrical Rules Check (ERC) ===&lt;br /&gt;
&lt;br /&gt;
Check for errors before moving to PCB layout:&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;Inspect → Electrical Rules Checker&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Run ERC&#039;&#039;&#039;&lt;br /&gt;
# Review any errors or warnings&lt;br /&gt;
# Fix errors (warnings about unused pins are usually OK)&lt;br /&gt;
# Click &#039;&#039;&#039;Close&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common errors:&#039;&#039;&#039;&lt;br /&gt;
* Unconnected pins - Make sure all wires connect to pins (pink circle at connection)&lt;br /&gt;
* Missing power flags - Can ignore for this simple circuit&lt;br /&gt;
&lt;br /&gt;
=== Save Your Schematic ===&lt;br /&gt;
&lt;br /&gt;
# Press &#039;&#039;&#039;Ctrl+S&#039;&#039;&#039; or click &#039;&#039;&#039;File → Save&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Your schematic is complete! Next: assign footprints.&lt;br /&gt;
&lt;br /&gt;
== Part 4: Footprint Assignment ==&lt;br /&gt;
&lt;br /&gt;
=== Understanding Footprints ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Schematic symbols&#039;&#039;&#039; show logical connections (how components connect).&lt;br /&gt;
&#039;&#039;&#039;Footprints&#039;&#039;&#039; show physical layout (where pads/holes are on the PCB).&lt;br /&gt;
&lt;br /&gt;
Each component needs a footprint:&lt;br /&gt;
* LED → 5mm through-hole LED footprint&lt;br /&gt;
* Resistor → Axial resistor footprint&lt;br /&gt;
* Screw terminal → 5mm pitch screw terminal&lt;br /&gt;
* Header → 2.54mm pin header&lt;br /&gt;
&lt;br /&gt;
=== Open Footprint Assignment Tool ===&lt;br /&gt;
&lt;br /&gt;
# In schematic editor, click &#039;&#039;&#039;Tools → Assign Footprints&#039;&#039;&#039;&lt;br /&gt;
# You&#039;ll see a list of components on the left, libraries in the middle, footprints on the right&lt;br /&gt;
&lt;br /&gt;
=== Assigning Footprints ===&lt;br /&gt;
&lt;br /&gt;
For each component, select it (left column), then double-click the footprint (right column):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1 (Screw Terminal):&#039;&#039;&#039;&lt;br /&gt;
# Select J1 in left column&lt;br /&gt;
# Middle column: scroll to &#039;&#039;&#039;TerminalBlock_Phoenix&#039;&#039;&#039;&lt;br /&gt;
# Right column: double-click &#039;&#039;&#039;TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_Horizontal&#039;&#039;&#039;&lt;br /&gt;
# This is a 2-position, 5mm pitch screw terminal&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;R1 (Resistor):&#039;&#039;&#039;&lt;br /&gt;
# Select R1&lt;br /&gt;
# Middle column: scroll to &#039;&#039;&#039;Resistor_THT&#039;&#039;&#039;&lt;br /&gt;
# Right column: double-click &#039;&#039;&#039;R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal&#039;&#039;&#039;&lt;br /&gt;
# This is a standard through-hole resistor footprint&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;D1 (LED):&#039;&#039;&#039;&lt;br /&gt;
# Select D1&lt;br /&gt;
# Middle column: scroll to &#039;&#039;&#039;LED_THT&#039;&#039;&#039;&lt;br /&gt;
# Right column: double-click &#039;&#039;&#039;LED_D5.0mm&#039;&#039;&#039;&lt;br /&gt;
# This is a standard 5mm LED footprint&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2 (Header):&#039;&#039;&#039;&lt;br /&gt;
# Select J2&lt;br /&gt;
# Middle column: scroll to &#039;&#039;&#039;Connector_PinHeader_2.54mm&#039;&#039;&#039;&lt;br /&gt;
# Right column: double-click &#039;&#039;&#039;PinHeader_1x03_P2.54mm_Vertical&#039;&#039;&#039;&lt;br /&gt;
# This is a 3-pin, 2.54mm pitch (0.1&amp;quot;) header&lt;br /&gt;
&lt;br /&gt;
=== Verify Assignments ===&lt;br /&gt;
&lt;br /&gt;
All components should now have footprints listed in the left column. If any show &amp;quot;No Footprint&amp;quot;, assign one.&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;OK&#039;&#039;&#039; to save footprint assignments&lt;br /&gt;
# Close the footprint assignment window&lt;br /&gt;
&lt;br /&gt;
=== Save and Update PCB ===&lt;br /&gt;
&lt;br /&gt;
# In schematic editor, press &#039;&#039;&#039;Ctrl+S&#039;&#039;&#039; to save&lt;br /&gt;
# Click &#039;&#039;&#039;Tools → Update PCB from Schematic&#039;&#039;&#039; (or press &#039;&#039;&#039;F8&#039;&#039;&#039;)&lt;br /&gt;
# Click &#039;&#039;&#039;Update PCB&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Close&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This generates a netlist and sends it to the PCB editor.&lt;br /&gt;
&lt;br /&gt;
== Part 5: PCB Layout ==&lt;br /&gt;
&lt;br /&gt;
=== Open PCB Editor ===&lt;br /&gt;
&lt;br /&gt;
# In project manager, double-click &amp;lt;code&amp;gt;led_breakout.kicad_pcb&amp;lt;/code&amp;gt;&lt;br /&gt;
# You&#039;ll see a blank workspace&lt;br /&gt;
&lt;br /&gt;
=== Import Components from Schematic ===&lt;br /&gt;
&lt;br /&gt;
If you followed the &amp;quot;Update PCB from Schematic&amp;quot; step, components should already be imported. If not:&lt;br /&gt;
&lt;br /&gt;
# In PCB editor, click &#039;&#039;&#039;Tools → Update PCB from Schematic&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Update PCB&#039;&#039;&#039;&lt;br /&gt;
# All components appear in a cluster near the origin&lt;br /&gt;
&lt;br /&gt;
=== Setting Up the Board ===&lt;br /&gt;
&lt;br /&gt;
Before placing components, set up the PCB:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Set design rules:&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;File → Board Setup&#039;&#039;&#039;&lt;br /&gt;
# Left panel: click &#039;&#039;&#039;Constraints&#039;&#039;&#039;&lt;br /&gt;
# Set minimum values (for JLCPCB/PCBWay standard):&lt;br /&gt;
** Minimum Clearance: 0.2mm&lt;br /&gt;
** Minimum Track Width: 0.2mm&lt;br /&gt;
** Minimum Via Diameter: 0.8mm&lt;br /&gt;
** Minimum Via Drill: 0.4mm&lt;br /&gt;
# Click &#039;&#039;&#039;OK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Select layers:&#039;&#039;&#039;&lt;br /&gt;
For this beginner project, use 2 layers (F.Cu = top, B.Cu = bottom).&lt;br /&gt;
&lt;br /&gt;
=== Drawing the Board Outline ===&lt;br /&gt;
&lt;br /&gt;
Define the physical board shape:&lt;br /&gt;
&lt;br /&gt;
# Select &#039;&#039;&#039;Edge.Cuts&#039;&#039;&#039; layer (dropdown in top toolbar)&lt;br /&gt;
# Click &#039;&#039;&#039;Draw a Rectangle&#039;&#039;&#039; tool (right toolbar)&lt;br /&gt;
# Click to start at (0, 0)&lt;br /&gt;
# Click to end at (40mm, 25mm) - creates a 40mm × 25mm rectangle&lt;br /&gt;
# This is your board outline&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Grid helps with alignment (default 1mm is fine)&lt;br /&gt;
* Switch to &#039;&#039;&#039;mm&#039;&#039;&#039; units if needed (bottom status bar)&lt;br /&gt;
&lt;br /&gt;
=== Placing Components ===&lt;br /&gt;
&lt;br /&gt;
Arrange components logically on the board:&lt;br /&gt;
&lt;br /&gt;
# Switch to &#039;&#039;&#039;F.Cu&#039;&#039;&#039; layer (top copper)&lt;br /&gt;
# Press &#039;&#039;&#039;M&#039;&#039;&#039; (move) and click a component to move it&lt;br /&gt;
# Press &#039;&#039;&#039;R&#039;&#039;&#039; while moving to rotate component&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Suggested layout:&#039;&#039;&#039;&lt;br /&gt;
* J1 (screw terminal) - Left edge, centered vertically&lt;br /&gt;
* R1 (resistor) - Middle, horizontal orientation&lt;br /&gt;
* D1 (LED) - Right of resistor, vertical orientation&lt;br /&gt;
* J2 (header) - Right edge, vertical&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Layout strategy:&#039;&#039;&#039;&lt;br /&gt;
* Inputs (screw terminal) on one side&lt;br /&gt;
* Outputs (header) on opposite side&lt;br /&gt;
* Flow left-to-right matches schematic&lt;br /&gt;
&lt;br /&gt;
=== Routing Traces (Connecting Components) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ratsnest lines&#039;&#039;&#039; (thin white lines) show which pads need to be connected.&lt;br /&gt;
&lt;br /&gt;
# Select &#039;&#039;&#039;F.Cu&#039;&#039;&#039; layer&lt;br /&gt;
# Press &#039;&#039;&#039;X&#039;&#039;&#039; (Route tracks tool)&lt;br /&gt;
# Click on a pad to start a trace&lt;br /&gt;
# Follow the ratsnest line to the destination pad&lt;br /&gt;
# Click on destination pad to complete connection&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039; to finish&lt;br /&gt;
&lt;br /&gt;
Route all connections:&lt;br /&gt;
* J1 pin 1 → R1 left pad (this is the VCC net)&lt;br /&gt;
* R1 right pad → D1 anode (top pad)&lt;br /&gt;
* D1 cathode → J1 pin 2 (GND net)&lt;br /&gt;
* Branch VCC to J2 pin 1&lt;br /&gt;
* Branch LED anode to J2 pin 2&lt;br /&gt;
* Branch GND to J2 pin 3&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Trace width:&#039;&#039;&#039;&lt;br /&gt;
* For this low-current circuit, default 0.25mm traces are fine&lt;br /&gt;
* To change: Press &#039;&#039;&#039;W&#039;&#039;&#039; while routing to cycle through widths&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Route on F.Cu (top) layer when possible&lt;br /&gt;
* Use vias to switch layers if traces cross (press &#039;&#039;&#039;V&#039;&#039;&#039; while routing)&lt;br /&gt;
* Press &#039;&#039;&#039;/&#039;&#039;&#039; while routing to switch between 45° and free-angle modes&lt;br /&gt;
&lt;br /&gt;
=== Adding a Ground Plane (Copper Pour) ===&lt;br /&gt;
&lt;br /&gt;
A ground plane improves power distribution and reduces noise:&lt;br /&gt;
&lt;br /&gt;
# Select &#039;&#039;&#039;F.Cu&#039;&#039;&#039; layer&lt;br /&gt;
# Press &#039;&#039;&#039;Ctrl+Shift+Z&#039;&#039;&#039; (Add filled zone tool) or click &amp;quot;Add Filled Zone&amp;quot; icon&lt;br /&gt;
# Click to start zone around the board edge&lt;br /&gt;
# Follow the board outline (click each corner)&lt;br /&gt;
# Double-click to close the zone&lt;br /&gt;
# In the dialog:&lt;br /&gt;
** Net: select &#039;&#039;&#039;GND&#039;&#039;&#039;&lt;br /&gt;
** Clearance: 0.3mm&lt;br /&gt;
** Minimum width: 0.2mm&lt;br /&gt;
# Click &#039;&#039;&#039;OK&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The ground plane fills all unused copper with GND connection.&lt;br /&gt;
&lt;br /&gt;
# Press &#039;&#039;&#039;B&#039;&#039;&#039; to rebuild all copper zones&lt;br /&gt;
&lt;br /&gt;
Repeat for bottom layer (B.Cu) if desired (also connect to GND).&lt;br /&gt;
&lt;br /&gt;
=== Adding Mounting Holes ===&lt;br /&gt;
&lt;br /&gt;
Mounting holes let you attach the PCB to a chassis:&lt;br /&gt;
&lt;br /&gt;
# Press &#039;&#039;&#039;Ctrl+Shift+A&#039;&#039;&#039; (Add footprint) or click &amp;quot;Add Footprint&amp;quot; icon&lt;br /&gt;
# Type &amp;quot;MountingHole&amp;quot;&lt;br /&gt;
# Select &#039;&#039;&#039;MountingHole:MountingHole_3.2mm_M3&#039;&#039;&#039;&lt;br /&gt;
# Place in four corners (inside the board outline)&lt;br /&gt;
&lt;br /&gt;
Press &#039;&#039;&#039;ESC&#039;&#039;&#039; when done.&lt;br /&gt;
&lt;br /&gt;
=== Adding Text (Silkscreen) ===&lt;br /&gt;
&lt;br /&gt;
Add labels to identify the board:&lt;br /&gt;
&lt;br /&gt;
# Select &#039;&#039;&#039;F.Silkscreen&#039;&#039;&#039; layer (front silkscreen)&lt;br /&gt;
# Press &#039;&#039;&#039;Ctrl+Shift+T&#039;&#039;&#039; (Add text) or click &amp;quot;Add Text&amp;quot; icon&lt;br /&gt;
# Type &amp;quot;LED Breakout v1.0&amp;quot;&lt;br /&gt;
# Click to place near top edge&lt;br /&gt;
# Press &#039;&#039;&#039;ESC&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add polarity labels:&lt;br /&gt;
* &amp;quot;+&amp;quot; near VCC connections&lt;br /&gt;
* &amp;quot;-&amp;quot; near GND connections&lt;br /&gt;
* &amp;quot;LED OUT&amp;quot; near J2 pin 2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Keep silkscreen text away from pads (0.5mm clearance)&lt;br /&gt;
* Use F.Silkscreen for top, B.Silkscreen for bottom&lt;br /&gt;
&lt;br /&gt;
=== Design Rule Check (DRC) ===&lt;br /&gt;
&lt;br /&gt;
Check for errors before manufacturing:&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;Inspect → Design Rules Checker&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Run DRC&#039;&#039;&#039;&lt;br /&gt;
# Review errors and warnings:&lt;br /&gt;
** Errors (red) - Must fix&lt;br /&gt;
** Warnings (yellow) - Review, may be OK&lt;br /&gt;
# Fix any errors:&lt;br /&gt;
** Traces too close? Reroute with more spacing&lt;br /&gt;
** Unconnected nets? Route missing traces&lt;br /&gt;
# Re-run DRC until no errors&lt;br /&gt;
# Click &#039;&#039;&#039;Close&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== 3D Preview ===&lt;br /&gt;
&lt;br /&gt;
View your board in 3D:&lt;br /&gt;
&lt;br /&gt;
# Click &#039;&#039;&#039;View → 3D Viewer&#039;&#039;&#039; (or press &#039;&#039;&#039;Alt+3&#039;&#039;&#039;)&lt;br /&gt;
# Rotate view with mouse (left-click drag)&lt;br /&gt;
# Inspect component placement and board appearance&lt;br /&gt;
# Close 3D viewer when satisfied&lt;br /&gt;
&lt;br /&gt;
== Part 6: Generating Gerber Files ==&lt;br /&gt;
&lt;br /&gt;
=== Understanding Gerber Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gerber files&#039;&#039;&#039; are the industry-standard format for PCB manufacturing. They describe:&lt;br /&gt;
* Copper layers (traces and pads)&lt;br /&gt;
* Soldermask (green coating)&lt;br /&gt;
* Silkscreen (white text)&lt;br /&gt;
* Board outline (cut shape)&lt;br /&gt;
* Drill holes&lt;br /&gt;
&lt;br /&gt;
=== Exporting Gerbers ===&lt;br /&gt;
&lt;br /&gt;
# In PCB editor, click &#039;&#039;&#039;File → Fabrication Outputs → Gerbers (.gbr)&#039;&#039;&#039;&lt;br /&gt;
# In the dialog:&lt;br /&gt;
** Output directory: &amp;lt;code&amp;gt;gerbers/&amp;lt;/code&amp;gt;&lt;br /&gt;
** Layers to export: Check these:&lt;br /&gt;
*** F.Cu (front copper)&lt;br /&gt;
*** B.Cu (back copper)&lt;br /&gt;
*** F.Paste (front solder paste - optional)&lt;br /&gt;
*** B.Paste (back solder paste - optional)&lt;br /&gt;
*** F.Silkscreen (front silkscreen)&lt;br /&gt;
*** B.Silkscreen (back silkscreen)&lt;br /&gt;
*** F.Mask (front soldermask)&lt;br /&gt;
*** B.Mask (back soldermask)&lt;br /&gt;
*** Edge.Cuts (board outline)&lt;br /&gt;
** Format: 4.6, unit mm (defaults are fine)&lt;br /&gt;
** Check &amp;quot;Use Protel filename extensions&amp;quot; (JLCPCB/PCBWay prefer this)&lt;br /&gt;
# Click &#039;&#039;&#039;Plot&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Generate Drill Files&#039;&#039;&#039;&lt;br /&gt;
** Format: Excellon (default)&lt;br /&gt;
** Units: Millimeters&lt;br /&gt;
** Zeros: Decimal format&lt;br /&gt;
# Click &#039;&#039;&#039;Generate Drill File&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Close&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You now have Gerber files in the &amp;lt;code&amp;gt;gerbers/&amp;lt;/code&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
=== Zipping Gerber Files ===&lt;br /&gt;
&lt;br /&gt;
Manufacturers need all Gerbers in a single ZIP file:&lt;br /&gt;
&lt;br /&gt;
# Navigate to your project folder → &amp;lt;code&amp;gt;gerbers/&amp;lt;/code&amp;gt; subfolder&lt;br /&gt;
# Select all .gbr and .drl files&lt;br /&gt;
# Right-click → Send to → Compressed (zipped) folder&lt;br /&gt;
# Name it: &amp;lt;code&amp;gt;led_breakout_gerbers.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This ZIP file is ready to upload to a manufacturer.&lt;br /&gt;
&lt;br /&gt;
== Part 7: Ordering Your PCB ==&lt;br /&gt;
&lt;br /&gt;
=== Choosing a Manufacturer ===&lt;br /&gt;
&lt;br /&gt;
Recommended beginner-friendly manufacturers:&lt;br /&gt;
* &#039;&#039;&#039;JLCPCB&#039;&#039;&#039; - $2 for 5 boards, fast shipping (1-2 weeks)&lt;br /&gt;
* &#039;&#039;&#039;PCBWay&#039;&#039;&#039; - Similar pricing, good quality&lt;br /&gt;
* &#039;&#039;&#039;OSH Park&#039;&#039;&#039; - USA-based, $5 per sq inch, purple boards&lt;br /&gt;
&lt;br /&gt;
This tutorial uses JLCPCB (most popular for hobbyists).&lt;br /&gt;
&lt;br /&gt;
=== Ordering from JLCPCB ===&lt;br /&gt;
&lt;br /&gt;
# Visit [https://jlcpcb.com/ JLCPCB.com]&lt;br /&gt;
# Click &#039;&#039;&#039;Instant Quote&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Add Gerber File&#039;&#039;&#039; and upload &amp;lt;code&amp;gt;led_breakout_gerbers.zip&amp;lt;/code&amp;gt;&lt;br /&gt;
# JLCPCB auto-detects settings:&lt;br /&gt;
** Size: 40mm × 25mm (from your board outline)&lt;br /&gt;
** Layers: 2&lt;br /&gt;
** Quantity: 5 boards (default minimum)&lt;br /&gt;
# Select options:&lt;br /&gt;
** PCB Color: Green (cheapest), or choose Blue/Red/Black (+$2)&lt;br /&gt;
** Surface Finish: HASL (default, fine for through-hole)&lt;br /&gt;
** PCB Thickness: 1.6mm (default)&lt;br /&gt;
# Review price (typically $2-5 for 5 boards)&lt;br /&gt;
# Add shipping (varies by location, $5-20)&lt;br /&gt;
# Click &#039;&#039;&#039;Save to Cart&#039;&#039;&#039;&lt;br /&gt;
# Checkout and pay&lt;br /&gt;
&lt;br /&gt;
=== Waiting for Delivery ===&lt;br /&gt;
&lt;br /&gt;
* Production: 1-3 days&lt;br /&gt;
* Shipping: 1-2 weeks (standard), 3-7 days (expedited)&lt;br /&gt;
* Tracking: Emailed when shipped&lt;br /&gt;
&lt;br /&gt;
== Part 8: Assembling Your PCB ==&lt;br /&gt;
&lt;br /&gt;
When your boards arrive:&lt;br /&gt;
&lt;br /&gt;
=== Gather Components ===&lt;br /&gt;
&lt;br /&gt;
Order components to match your design:&lt;br /&gt;
* 1× 220Ω resistor (1/4W through-hole)&lt;br /&gt;
* 1× 5mm red LED&lt;br /&gt;
* 1× 2-position 5mm screw terminal&lt;br /&gt;
* 1× 1×3 pin header (2.54mm pitch)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Where to buy:&#039;&#039;&#039;&lt;br /&gt;
* Mouser, Digikey (exact parts, fast shipping, minimum order fees)&lt;br /&gt;
* Amazon, eBay (component kits, slower shipping, no fees)&lt;br /&gt;
&lt;br /&gt;
=== Soldering Components ===&lt;br /&gt;
&lt;br /&gt;
Follow [[Soldering]] tutorial for technique. Assembly order:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Resistor&#039;&#039;&#039; - Bend leads, insert, solder, trim&lt;br /&gt;
# &#039;&#039;&#039;LED&#039;&#039;&#039; - Mind polarity! Long leg = anode (+), short leg = cathode (-)&lt;br /&gt;
# &#039;&#039;&#039;Screw terminal&#039;&#039;&#039; - Insert, solder (requires more heat)&lt;br /&gt;
# &#039;&#039;&#039;Pin header&#039;&#039;&#039; - Insert, solder&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
# Connect 5V power supply to screw terminal (+ to top, - to bottom)&lt;br /&gt;
# LED should light up&lt;br /&gt;
# Measure voltage at header pins with multimeter:&lt;br /&gt;
** Pin 1: ~5V (VCC)&lt;br /&gt;
** Pin 2: ~2V (LED forward voltage)&lt;br /&gt;
** Pin 3: 0V (GND)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Troubleshooting:&#039;&#039;&#039;&lt;br /&gt;
* LED not lighting? Check polarity, test LED separately&lt;br /&gt;
* No voltage? Check solder joints for cold joints (dull, not shiny)&lt;br /&gt;
* Short circuit? Check for solder bridges between pads&lt;br /&gt;
&lt;br /&gt;
== Part 9: Next Steps ==&lt;br /&gt;
&lt;br /&gt;
Congratulations! You&#039;ve designed, ordered, and assembled your first PCB. Next:&lt;br /&gt;
&lt;br /&gt;
=== Design a Custom Board for Your Robot ===&lt;br /&gt;
&lt;br /&gt;
Apply your skills to a real project:&lt;br /&gt;
* Design a sensor breakout board for [[SimpleBot]]&lt;br /&gt;
* Create a motor driver board&lt;br /&gt;
* Design a main board integrating MCU, sensors, and power&lt;br /&gt;
&lt;br /&gt;
=== Study Existing Designs ===&lt;br /&gt;
&lt;br /&gt;
Learn from production-quality PCBs:&lt;br /&gt;
* [[SimpleBot]] PCB design (files in &amp;lt;code&amp;gt;./simplebot/kicad/&amp;lt;/code&amp;gt;)&lt;br /&gt;
** Study component placement strategy&lt;br /&gt;
** Observe trace routing and ground plane usage&lt;br /&gt;
** Note silkscreen labeling&lt;br /&gt;
&lt;br /&gt;
=== Learn Advanced Techniques ===&lt;br /&gt;
&lt;br /&gt;
Expand your PCB design skills:&lt;br /&gt;
* &#039;&#039;&#039;SMD components&#039;&#039;&#039; - Surface-mount devices for compact boards&lt;br /&gt;
* &#039;&#039;&#039;4-layer boards&#039;&#039;&#039; - Internal power and ground planes&lt;br /&gt;
* &#039;&#039;&#039;High-current traces&#039;&#039;&#039; - Calculate trace width for motor drivers&lt;br /&gt;
* &#039;&#039;&#039;Impedance control&#039;&#039;&#039; - High-speed signal integrity&lt;br /&gt;
* &#039;&#039;&#039;PCBA services&#039;&#039;&#039; - Let manufacturers assemble SMD boards&lt;br /&gt;
&lt;br /&gt;
=== Share Your Design ===&lt;br /&gt;
&lt;br /&gt;
Contribute to the BRS community:&lt;br /&gt;
* Document your PCB on the wiki&lt;br /&gt;
* Share KiCad files on GitHub&lt;br /&gt;
* Write an Implementation page&lt;br /&gt;
* Help others learn PCB design&lt;br /&gt;
&lt;br /&gt;
== Common Beginner Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Wrong footprint dimensions&#039;&#039;&#039; - Always verify footprints with calipers or datasheets before ordering&lt;br /&gt;
* &#039;&#039;&#039;Forgetting board outline&#039;&#039;&#039; - No Edge.Cuts layer = manufacturer can&#039;t cut your board&lt;br /&gt;
* &#039;&#039;&#039;Missing connections&#039;&#039;&#039; - Run DRC to find unrouted nets&lt;br /&gt;
* &#039;&#039;&#039;Traces too narrow&#039;&#039;&#039; - Use at least 0.2mm (wider for high current)&lt;br /&gt;
* &#039;&#039;&#039;No ground plane&#039;&#039;&#039; - Increases noise, makes routing harder&lt;br /&gt;
* &#039;&#039;&#039;Overlapping silkscreen&#039;&#039;&#039; - Text on pads won&#039;t print correctly&lt;br /&gt;
* &#039;&#039;&#039;Reversed component polarity&#039;&#039;&#039; - Double-check LED, capacitor, IC orientation&lt;br /&gt;
* &#039;&#039;&#039;Forgetting mounting holes&#039;&#039;&#039; - Can&#039;t attach board to chassis&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Tips ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Ratsnest lines everywhere?&#039;&#039;&#039; Press &#039;&#039;&#039;N&#039;&#039;&#039; to show/hide ratsnest (airwires)&lt;br /&gt;
* &#039;&#039;&#039;Can&#039;t route a trace?&#039;&#039;&#039; Switch layers with &#039;&#039;&#039;V&#039;&#039;&#039; (via) or rearrange components&lt;br /&gt;
* &#039;&#039;&#039;DRC errors won&#039;t clear?&#039;&#039;&#039; Zoom in closely - errors are marked with small icons&lt;br /&gt;
* &#039;&#039;&#039;Gerber upload fails?&#039;&#039;&#039; Ensure Edge.Cuts layer is included (board outline)&lt;br /&gt;
* &#039;&#039;&#039;Board too expensive?&#039;&#039;&#039; Reduce size to &amp;lt;100mm × 100mm for cheapest pricing&lt;br /&gt;
* &#039;&#039;&#039;Components don&#039;t fit?&#039;&#039;&#039; Verify footprints - measure physical parts with calipers&lt;br /&gt;
&lt;br /&gt;
== KiCad Keyboard Shortcuts Reference ==&lt;br /&gt;
&lt;br /&gt;
=== Schematic Editor ===&lt;br /&gt;
* &#039;&#039;&#039;A&#039;&#039;&#039; - Add symbol (component)&lt;br /&gt;
* &#039;&#039;&#039;P&#039;&#039;&#039; - Add power symbol&lt;br /&gt;
* &#039;&#039;&#039;W&#039;&#039;&#039; - Wire (connect components)&lt;br /&gt;
* &#039;&#039;&#039;L&#039;&#039;&#039; - Label net (name wires)&lt;br /&gt;
* &#039;&#039;&#039;M&#039;&#039;&#039; - Move component&lt;br /&gt;
* &#039;&#039;&#039;R&#039;&#039;&#039; - Rotate component&lt;br /&gt;
* &#039;&#039;&#039;V&#039;&#039;&#039; - Edit value (resistor value, etc.)&lt;br /&gt;
* &#039;&#039;&#039;Ctrl+S&#039;&#039;&#039; - Save&lt;br /&gt;
* &#039;&#039;&#039;F8&#039;&#039;&#039; - Update PCB from schematic&lt;br /&gt;
&lt;br /&gt;
=== PCB Editor ===&lt;br /&gt;
* &#039;&#039;&#039;M&#039;&#039;&#039; - Move component&lt;br /&gt;
* &#039;&#039;&#039;R&#039;&#039;&#039; - Rotate component&lt;br /&gt;
* &#039;&#039;&#039;X&#039;&#039;&#039; - Route track (trace)&lt;br /&gt;
* &#039;&#039;&#039;V&#039;&#039;&#039; - Add via (while routing)&lt;br /&gt;
* &#039;&#039;&#039;W&#039;&#039;&#039; - Change track width (while routing)&lt;br /&gt;
* &#039;&#039;&#039;/&#039;&#039;&#039; - Change routing mode (45° / free angle)&lt;br /&gt;
* &#039;&#039;&#039;Ctrl+Shift+Z&#039;&#039;&#039; - Add filled zone (copper pour)&lt;br /&gt;
* &#039;&#039;&#039;B&#039;&#039;&#039; - Rebuild all copper zones&lt;br /&gt;
* &#039;&#039;&#039;N&#039;&#039;&#039; - Toggle ratsnest display&lt;br /&gt;
* &#039;&#039;&#039;Alt+3&#039;&#039;&#039; - 3D viewer&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Software ===&lt;br /&gt;
* &#039;&#039;&#039;KiCad&#039;&#039;&#039; (Free) - [https://www.kicad.org/download/ Download]&lt;br /&gt;
* &#039;&#039;&#039;PDF reader&#039;&#039;&#039; - View component datasheets&lt;br /&gt;
&lt;br /&gt;
=== Component Suppliers ===&lt;br /&gt;
* &#039;&#039;&#039;Mouser&#039;&#039;&#039; - [https://www.mouser.com/ mouser.com] (USA)&lt;br /&gt;
* &#039;&#039;&#039;Digikey&#039;&#039;&#039; - [https://www.digikey.com/ digikey.com] (USA)&lt;br /&gt;
* &#039;&#039;&#039;LCSC&#039;&#039;&#039; - [https://www.lcsc.com/ lcsc.com] (China, cheap, slow shipping)&lt;br /&gt;
&lt;br /&gt;
=== PCB Manufacturers ===&lt;br /&gt;
* &#039;&#039;&#039;JLCPCB&#039;&#039;&#039; - [https://jlcpcb.com/ jlcpcb.com] ($2 for 5 boards)&lt;br /&gt;
* &#039;&#039;&#039;PCBWay&#039;&#039;&#039; - [https://www.pcbway.com/ pcbway.com]&lt;br /&gt;
* &#039;&#039;&#039;OSH Park&#039;&#039;&#039; - [https://oshpark.com/ oshpark.com] (USA-based)&lt;br /&gt;
&lt;br /&gt;
=== Learning Resources ===&lt;br /&gt;
* [https://docs.kicad.org/ KiCad Official Documentation]&lt;br /&gt;
* [https://www.youtube.com/c/Contextualelectronics Contextual Electronics] - KiCad video tutorials&lt;br /&gt;
* [https://www.youtube.com/playlist?list=PLy2022BX6EspFAKBCgRuEuzapuz_4aJCn Phil&#039;s Lab] - PCB design tutorials&lt;br /&gt;
* [https://www.eevblog.com/forum/kicad/ EEVblog KiCad Forum] - Community support&lt;br /&gt;
&lt;br /&gt;
== Design Files for This Tutorial ==&lt;br /&gt;
&lt;br /&gt;
If you want to compare your work or download a complete reference design:&lt;br /&gt;
&lt;br /&gt;
* LED Breakout KiCad project (schematic, PCB, Gerbers)&lt;br /&gt;
* Available in BRS repository: &amp;lt;code&amp;gt;./pcb_examples/led_breakout/&amp;lt;/code&amp;gt; (if created)&lt;br /&gt;
&lt;br /&gt;
== Expanding Your Skills ==&lt;br /&gt;
&lt;br /&gt;
After mastering this tutorial, try these progressively challenging projects:&lt;br /&gt;
&lt;br /&gt;
=== Beginner+ ===&lt;br /&gt;
* &#039;&#039;&#039;Power indicator board&#039;&#039;&#039; - Add multiple LEDs, different colors&lt;br /&gt;
* &#039;&#039;&#039;Sensor breakout&#039;&#039;&#039; - IR sensor + headers&lt;br /&gt;
* &#039;&#039;&#039;Button array&#039;&#039;&#039; - 4 buttons + pull-up resistors + header&lt;br /&gt;
&lt;br /&gt;
=== Intermediate ===&lt;br /&gt;
* &#039;&#039;&#039;Motor driver board&#039;&#039;&#039; - TB6612FNG IC + terminal blocks + logic inputs&lt;br /&gt;
* &#039;&#039;&#039;Voltage regulator board&#039;&#039;&#039; - LM7805 IC + capacitors + heatsink&lt;br /&gt;
* &#039;&#039;&#039;Sensor array&#039;&#039;&#039; - 4× IR sensors + multiplexer IC&lt;br /&gt;
&lt;br /&gt;
=== Advanced ===&lt;br /&gt;
* &#039;&#039;&#039;Robot main board&#039;&#039;&#039; - MCU + sensors + motor driver + power (like SimpleBot)&lt;br /&gt;
* &#039;&#039;&#039;SMD practice board&#039;&#039;&#039; - Recreate LED breakout with 0805 resistor, SMD LED&lt;br /&gt;
* &#039;&#039;&#039;Programmable board&#039;&#039;&#039; - ESP32 module + USB-to-serial + sensors&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PCB Design]] - Full competency overview&lt;br /&gt;
* [[Electronics]] - Understand circuits before designing PCBs&lt;br /&gt;
* [[Soldering]] - Assemble your PCBs after ordering&lt;br /&gt;
* [[SimpleBot]] - Study a production robot PCB design&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:PCB Design]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=PCB_Design&amp;diff=79</id>
		<title>PCB Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=PCB_Design&amp;diff=79"/>
		<updated>2025-10-11T20:14:17Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=PCB Design |description=Expressing electronics knowledge into custom circuit boards for professional, integrated robot designs |difficulty_range=Beginner to Advanced |time_to_basic=3-6 weeks |essential_tools=KiCad (free), PCB manufacturer account (JLCPCB, PCBWay) |optional_tools=Caliper for component measurements, PCB design rule checker |beginner_tutorial=KiCad Tutorial |unlocks_basic=Custom sensor breakout boards, simple robot PCBs |unlocks_advan...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=PCB Design&lt;br /&gt;
|description=Expressing electronics knowledge into custom circuit boards for professional, integrated robot designs&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=3-6 weeks&lt;br /&gt;
|essential_tools=KiCad (free), PCB manufacturer account (JLCPCB, PCBWay)&lt;br /&gt;
|optional_tools=Caliper for component measurements, PCB design rule checker&lt;br /&gt;
|beginner_tutorial=[[KiCad Tutorial]]&lt;br /&gt;
|unlocks_basic=Custom sensor breakout boards, simple robot PCBs&lt;br /&gt;
|unlocks_advanced=Multi-layer integrated robot boards, motor controllers, high-speed designs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PCB Design&#039;&#039;&#039; is the competency of translating circuit schematics and electronics knowledge into manufacturable printed circuit boards (PCBs). In robotics, custom PCBs transform breadboard prototypes into durable, compact, and professional designs. This competency specifically covers expressing goals and comprehension from [[Electronics]] into new custom boards and getting them assembled by a board house.&lt;br /&gt;
&lt;br /&gt;
PCB design is distinct from [[Electronics]] (understanding how circuits work) and [[Soldering]] (assembling components onto boards). This competency focuses on &#039;&#039;&#039;designing&#039;&#039;&#039; the board itself: creating schematics, laying out traces, selecting footprints, and generating manufacturing files.&lt;br /&gt;
&lt;br /&gt;
== Why PCB Design Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
Custom PCBs elevate your robot from prototype to production:&lt;br /&gt;
* &#039;&#039;&#039;Integration&#039;&#039;&#039; - Combine sensors, motor drivers, and microcontroller on one board&lt;br /&gt;
* &#039;&#039;&#039;Reliability&#039;&#039;&#039; - No loose breadboard connections or flying wires&lt;br /&gt;
* &#039;&#039;&#039;Compactness&#039;&#039;&#039; - Shrink your electronics to fit tight spaces&lt;br /&gt;
* &#039;&#039;&#039;Reproducibility&#039;&#039;&#039; - Order 5, 10, or 100 identical boards from manufacturers&lt;br /&gt;
* &#039;&#039;&#039;Professionalism&#039;&#039;&#039; - Clean, documented designs you can share or sell&lt;br /&gt;
&lt;br /&gt;
Without PCB design skills, you&#039;re limited to pre-made modules and breadboards. With PCB design, you can create exactly the board your robot needs.&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (First PCB) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to design and order your first PCB:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Schematic capture&#039;&#039;&#039; - Draw circuit diagrams in KiCad&lt;br /&gt;
* &#039;&#039;&#039;Component symbols&#039;&#039;&#039; - Find or create schematic symbols for parts&lt;br /&gt;
* &#039;&#039;&#039;Footprint assignment&#039;&#039;&#039; - Match components to their physical footprints&lt;br /&gt;
* &#039;&#039;&#039;PCB layout basics&#039;&#039;&#039; - Place components and route traces&lt;br /&gt;
* &#039;&#039;&#039;Design rules&#039;&#039;&#039; - Set trace width, clearance, via size&lt;br /&gt;
* &#039;&#039;&#039;Gerber generation&#039;&#039;&#039; - Export manufacturing files&lt;br /&gt;
* &#039;&#039;&#039;Ordering from manufacturers&#039;&#039;&#039; - Upload to JLCPCB/PCBWay, select options&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Simple breakout boards (sensor modules, connector adapters)&lt;br /&gt;
* Through-hole robot PCBs (like [[SimpleBot]] main board)&lt;br /&gt;
* LED circuits and indicator panels&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[KiCad Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design simple 2-layer through-hole PCBs&lt;br /&gt;
* Order boards from online manufacturers&lt;br /&gt;
* Create breakout boards for sensors and modules&lt;br /&gt;
* Understand SimpleBot&#039;s PCB design&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (Production-Ready Designs) ===&lt;br /&gt;
&lt;br /&gt;
Skills for designing robust, manufacturable PCBs:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;4-layer boards&#039;&#039;&#039; - Add internal power and ground planes&lt;br /&gt;
* &#039;&#039;&#039;SMD components&#039;&#039;&#039; - Use surface-mount devices for compact designs&lt;br /&gt;
* &#039;&#039;&#039;Trace width calculations&#039;&#039;&#039; - Calculate trace width for current capacity&lt;br /&gt;
* &#039;&#039;&#039;Component library management&#039;&#039;&#039; - Create custom symbols and footprints&lt;br /&gt;
* &#039;&#039;&#039;Design rule checks (DRC)&#039;&#039;&#039; - Catch errors before manufacturing&lt;br /&gt;
* &#039;&#039;&#039;Silkscreen design&#039;&#039;&#039; - Add labels, logos, version numbers&lt;br /&gt;
* &#039;&#039;&#039;Bill of Materials (BOM)&#039;&#039;&#039; - Generate parts lists for assembly&lt;br /&gt;
* &#039;&#039;&#039;PCB panelization&#039;&#039;&#039; - Arrange multiple boards on one panel&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Integrated robot main boards (MCU + sensors + motor drivers)&lt;br /&gt;
* Custom motor controller PCBs&lt;br /&gt;
* Power distribution boards with multiple voltage rails&lt;br /&gt;
* Compact sensor arrays&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: Advanced KiCad techniques, PCB layout best practices&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design compact, reliable robot PCBs&lt;br /&gt;
* Use SMD components to reduce board size&lt;br /&gt;
* Create production-ready designs with proper documentation&lt;br /&gt;
* Work with PCB assembly services (PCBA)&lt;br /&gt;
&lt;br /&gt;
=== Advanced (High-Performance Designs) ===&lt;br /&gt;
&lt;br /&gt;
Skills for specialized and high-performance PCBs:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;High-speed design&#039;&#039;&#039; - Controlled impedance, differential pairs, length matching&lt;br /&gt;
* &#039;&#039;&#039;Thermal management&#039;&#039;&#039; - Heat dissipation, thermal vias, copper pours&lt;br /&gt;
* &#039;&#039;&#039;EMI/EMC design&#039;&#039;&#039; - Shielding, filtering, grounding strategies&lt;br /&gt;
* &#039;&#039;&#039;RF design&#039;&#039;&#039; - Antenna design, impedance matching, transmission lines&lt;br /&gt;
* &#039;&#039;&#039;Flex and rigid-flex PCBs&#039;&#039;&#039; - Flexible circuits for moving parts&lt;br /&gt;
* &#039;&#039;&#039;PCB assembly optimization&#039;&#039;&#039; - Design for manufacturability (DFM)&lt;br /&gt;
* &#039;&#039;&#039;Multi-board systems&#039;&#039;&#039; - Stackable boards, connectors, modularity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Camera Vision]] boards (high-speed data transfer)&lt;br /&gt;
* [[Capability:LIDAR Sensing]] controllers (motor drivers + high-bandwidth serial)&lt;br /&gt;
* Wireless communication boards (WiFi, Bluetooth, LoRa)&lt;br /&gt;
* Custom IMU boards with sensor fusion&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design high-speed communication boards&lt;br /&gt;
* Create custom motor controllers with current sensing&lt;br /&gt;
* Design RF and antenna boards&lt;br /&gt;
* Optimize designs for cost-effective mass production&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: First PCB Designer (Beginner) ===&lt;br /&gt;
# Complete [[Electronics Fundamentals]] - Understand circuits before designing PCBs&lt;br /&gt;
# Start with [[KiCad Tutorial]] - Design a simple LED or sensor breakout board&lt;br /&gt;
# Order your first PCB from JLCPCB (5 boards for $2 + shipping)&lt;br /&gt;
# Assemble and test your board&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design simple 2-layer PCBs and order them from manufacturers.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Robot PCB Designer (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (First PCB Designer)&lt;br /&gt;
# Study [[SimpleBot]] PCB design (schematic and layout files)&lt;br /&gt;
# Design a custom breakout board for a sensor or module&lt;br /&gt;
# Learn SMD component soldering ([[Soldering]])&lt;br /&gt;
# Design a robot main board integrating MCU, sensors, and motor driver&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design integrated robot PCBs with SMD components.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Advanced PCB Designer ===&lt;br /&gt;
# Complete Path 2 (Robot PCB Designer)&lt;br /&gt;
# Study high-speed design principles (impedance control, signal integrity)&lt;br /&gt;
# Design a 4-layer board with internal power/ground planes&lt;br /&gt;
# Use PCB assembly services (PCBA) for SMD assembly&lt;br /&gt;
# Design a specialized board (motor controller, camera interface, RF module)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design production-ready, high-performance PCBs for any robot application.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== PCB Layers ===&lt;br /&gt;
&lt;br /&gt;
PCBs are built from copper layers separated by insulating material:&lt;br /&gt;
* &#039;&#039;&#039;2-layer&#039;&#039;&#039; - Top and bottom copper (beginner level)&lt;br /&gt;
* &#039;&#039;&#039;4-layer&#039;&#039;&#039; - Top, bottom, and two internal layers (typically power and ground)&lt;br /&gt;
* &#039;&#039;&#039;6+ layers&#039;&#039;&#039; - High-speed designs, dense routing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why more layers?&#039;&#039;&#039;&lt;br /&gt;
* Better power distribution (dedicated power planes)&lt;br /&gt;
* Reduced noise (solid ground plane)&lt;br /&gt;
* More routing space for complex designs&lt;br /&gt;
&lt;br /&gt;
=== Trace Width and Current Capacity ===&lt;br /&gt;
&lt;br /&gt;
Trace width determines how much current a trace can carry:&lt;br /&gt;
* &#039;&#039;&#039;Thin traces&#039;&#039;&#039; (0.2mm) - Signal traces, low current (&amp;lt;100mA)&lt;br /&gt;
* &#039;&#039;&#039;Medium traces&#039;&#039;&#039; (0.5mm) - General purpose (100mA - 500mA)&lt;br /&gt;
* &#039;&#039;&#039;Thick traces&#039;&#039;&#039; (1-2mm) - High current (1A - 3A)&lt;br /&gt;
* &#039;&#039;&#039;Copper pours&#039;&#039;&#039; - Very high current (5A+), heat dissipation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rule of thumb&#039;&#039;&#039;: 1mm trace width per 1A of current (for 1oz copper, typical PCB)&lt;br /&gt;
&lt;br /&gt;
=== Vias ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vias&#039;&#039;&#039; are holes that connect copper layers:&lt;br /&gt;
* &#039;&#039;&#039;Through-hole vias&#039;&#039;&#039; - Connect all layers (most common)&lt;br /&gt;
* &#039;&#039;&#039;Blind vias&#039;&#039;&#039; - Connect outer layer to internal layer&lt;br /&gt;
* &#039;&#039;&#039;Buried vias&#039;&#039;&#039; - Connect internal layers only&lt;br /&gt;
&lt;br /&gt;
Use vias to:&lt;br /&gt;
* Route traces to other layers&lt;br /&gt;
* Connect component pads to internal planes&lt;br /&gt;
* Improve heat dissipation (thermal vias)&lt;br /&gt;
&lt;br /&gt;
=== Design Rules ===&lt;br /&gt;
&lt;br /&gt;
Design rules ensure manufacturability:&lt;br /&gt;
* &#039;&#039;&#039;Minimum trace width&#039;&#039;&#039; - Typically 0.15mm - 0.2mm&lt;br /&gt;
* &#039;&#039;&#039;Minimum clearance&#039;&#039;&#039; - Gap between traces (typically 0.15mm - 0.2mm)&lt;br /&gt;
* &#039;&#039;&#039;Minimum via size&#039;&#039;&#039; - Drill diameter (typically 0.3mm)&lt;br /&gt;
* &#039;&#039;&#039;Soldermask expansion&#039;&#039;&#039; - Gap around pads for solder mask&lt;br /&gt;
&lt;br /&gt;
Violating design rules = manufacturing errors or rejected boards&lt;br /&gt;
&lt;br /&gt;
=== Footprints ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Footprint&#039;&#039;&#039; = physical pad layout for a component:&lt;br /&gt;
* &#039;&#039;&#039;Through-hole&#039;&#039;&#039; - Holes for component leads (resistors, DIP ICs)&lt;br /&gt;
* &#039;&#039;&#039;SMD&#039;&#039;&#039; - Surface pads for surface-mount components (0805 resistors, QFN ICs)&lt;br /&gt;
&lt;br /&gt;
Getting footprints right is critical:&lt;br /&gt;
* Wrong footprint = component doesn&#039;t fit&lt;br /&gt;
* Check datasheets for recommended footprints&lt;br /&gt;
* Test footprints with calipers before ordering&lt;br /&gt;
&lt;br /&gt;
== PCB Design Workflow ==&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Schematic Design ===&lt;br /&gt;
# Start with a tested breadboard prototype&lt;br /&gt;
# Draw schematic in KiCad schematic editor&lt;br /&gt;
# Add component symbols from libraries&lt;br /&gt;
# Connect components with wires (nets)&lt;br /&gt;
# Add power symbols (VCC, GND)&lt;br /&gt;
# Annotate components (assign reference designators: R1, C2, U3)&lt;br /&gt;
# Run electrical rules check (ERC)&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Footprint Assignment ===&lt;br /&gt;
# Assign footprints to all components&lt;br /&gt;
# Verify footprints match physical parts (check datasheets)&lt;br /&gt;
# Create custom footprints if needed&lt;br /&gt;
# Generate netlist (connects schematic to PCB layout)&lt;br /&gt;
&lt;br /&gt;
=== Step 3: PCB Layout ===&lt;br /&gt;
# Import netlist into PCB editor&lt;br /&gt;
# Define board outline (cut shape)&lt;br /&gt;
# Place components logically (MCU in center, connectors on edges)&lt;br /&gt;
# Route power traces first (wide traces for high current)&lt;br /&gt;
# Route signal traces&lt;br /&gt;
# Add ground plane (copper pour connected to GND)&lt;br /&gt;
# Add mounting holes for screws&lt;br /&gt;
# Design silkscreen labels (component names, polarity markers)&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Design Rule Check and Export ===&lt;br /&gt;
# Run design rule check (DRC) to find errors&lt;br /&gt;
# Fix all violations (spacing, trace width, unconnected nets)&lt;br /&gt;
# Generate Gerber files (manufacturing files)&lt;br /&gt;
# Generate drill files&lt;br /&gt;
# Optionally generate assembly files (BOM, pick-and-place)&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Manufacturing ===&lt;br /&gt;
# Upload Gerber files to manufacturer website&lt;br /&gt;
# Select options (board size, quantity, color, finish)&lt;br /&gt;
# Review preview and pricing&lt;br /&gt;
# Place order&lt;br /&gt;
# Wait 1-2 weeks for delivery&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Software ===&lt;br /&gt;
* &#039;&#039;&#039;KiCad&#039;&#039;&#039; (Free, open-source) - Full-featured PCB design suite&lt;br /&gt;
** Schematic editor&lt;br /&gt;
** PCB layout editor&lt;br /&gt;
** Footprint editor&lt;br /&gt;
** 3D viewer&lt;br /&gt;
** Available for Windows, Mac, Linux&lt;br /&gt;
&lt;br /&gt;
=== Alternative Software ===&lt;br /&gt;
* &#039;&#039;&#039;Eagle&#039;&#039;&#039; (Free for hobbyists, limited board size) - Popular alternative&lt;br /&gt;
* &#039;&#039;&#039;EasyEDA&#039;&#039;&#039; (Free, web-based) - Integrated with JLCPCB ordering&lt;br /&gt;
* &#039;&#039;&#039;Altium Designer&#039;&#039;&#039; ($$$$) - Professional industry standard&lt;br /&gt;
* &#039;&#039;&#039;Fusion 360 Electronics&#039;&#039;&#039; (Subscription) - Integrated with CAD&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BRS recommendation&#039;&#039;&#039;: Use KiCad (free, powerful, no limitations)&lt;br /&gt;
&lt;br /&gt;
=== Online PCB Manufacturers ===&lt;br /&gt;
* &#039;&#039;&#039;JLCPCB&#039;&#039;&#039; - $2 for 5 boards (100mm × 100mm), fast shipping, PCBA services&lt;br /&gt;
* &#039;&#039;&#039;PCBWay&#039;&#039;&#039; - Similar pricing, good quality, responsive support&lt;br /&gt;
* &#039;&#039;&#039;OSH Park&#039;&#039;&#039; - USA-based, purple boards, slower but high quality&lt;br /&gt;
* &#039;&#039;&#039;Seeed Studio&#039;&#039;&#039; - Fusion PCB service, good for prototypes&lt;br /&gt;
&lt;br /&gt;
=== Physical Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Caliper&#039;&#039;&#039; ($15-30) - Measure component dimensions for footprint verification&lt;br /&gt;
* &#039;&#039;&#039;PCB ruler&#039;&#039;&#039; ($5-10) - Check trace width and component spacing&lt;br /&gt;
* &#039;&#039;&#039;Magnifying glass&#039;&#039;&#039; ($10-20) - Inspect SMD pads and trace spacing&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Wrong footprints&#039;&#039;&#039; - Always verify footprints with datasheets and calipers before ordering&lt;br /&gt;
* &#039;&#039;&#039;Insufficient trace width&#039;&#039;&#039; - Narrow traces overheat and fail under high current&lt;br /&gt;
* &#039;&#039;&#039;Missing ground plane&#039;&#039;&#039; - Increases noise, poor power distribution&lt;br /&gt;
* &#039;&#039;&#039;No silkscreen labels&#039;&#039;&#039; - Difficult to assemble and debug without labels&lt;br /&gt;
* &#039;&#039;&#039;Ignoring DRC errors&#039;&#039;&#039; - &amp;quot;It&#039;ll probably work&amp;quot; usually means it won&#039;t&lt;br /&gt;
* &#039;&#039;&#039;Placing components too close&#039;&#039;&#039; - Difficult or impossible to solder&lt;br /&gt;
* &#039;&#039;&#039;Forgetting mounting holes&#039;&#039;&#039; - Can&#039;t attach board to robot chassis&lt;br /&gt;
* &#039;&#039;&#039;No decoupling capacitors&#039;&#039;&#039; - ICs behave erratically without local power filtering&lt;br /&gt;
&lt;br /&gt;
== SimpleBot PCB Example ==&lt;br /&gt;
&lt;br /&gt;
The [[SimpleBot]] main board is an excellent beginner-level PCB design:&lt;br /&gt;
* &#039;&#039;&#039;2-layer through-hole design&#039;&#039;&#039; - Easy to assemble with basic soldering skills&lt;br /&gt;
* &#039;&#039;&#039;Clear component layout&#039;&#039;&#039; - Components labeled and logically placed&lt;br /&gt;
* &#039;&#039;&#039;Designed in KiCad&#039;&#039;&#039; - Source files available in repository&lt;br /&gt;
* &#039;&#039;&#039;Motor driver integration&#039;&#039;&#039; - TB6612FNG motor driver IC&lt;br /&gt;
* &#039;&#039;&#039;Sensor headers&#039;&#039;&#039; - Connectors for line sensors and encoders&lt;br /&gt;
* &#039;&#039;&#039;Power regulation&#039;&#039;&#039; - MP1584 buck converter footprint&lt;br /&gt;
&lt;br /&gt;
Study the SimpleBot PCB files to learn:&lt;br /&gt;
* How to layout a robot main board&lt;br /&gt;
* Component placement strategy&lt;br /&gt;
* Trace routing for power and signals&lt;br /&gt;
* Silkscreen labeling best practices&lt;br /&gt;
&lt;br /&gt;
Files available at: `./simplebot/kicad/` (schematic and PCB layout)&lt;br /&gt;
&lt;br /&gt;
== First PCB Project Ideas ==&lt;br /&gt;
&lt;br /&gt;
Start with simple projects to build confidence:&lt;br /&gt;
&lt;br /&gt;
=== Beginner Projects ===&lt;br /&gt;
* &#039;&#039;&#039;LED circuit board&#039;&#039;&#039; - Power LED, resistor, battery connector (learn basics)&lt;br /&gt;
* &#039;&#039;&#039;Sensor breakout board&#039;&#039;&#039; - IR sensor, headers, mounting holes (learn footprints)&lt;br /&gt;
* &#039;&#039;&#039;Power distribution board&#039;&#039;&#039; - Voltage regulator, capacitors, terminal blocks (learn power design)&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Projects ===&lt;br /&gt;
* &#039;&#039;&#039;Motor controller board&#039;&#039;&#039; - H-bridge IC, terminal blocks, logic inputs&lt;br /&gt;
* &#039;&#039;&#039;Sensor array board&#039;&#039;&#039; - Multiple IR sensors, multiplexer, single I2C output&lt;br /&gt;
* &#039;&#039;&#039;Robot main board&#039;&#039;&#039; - MCU, sensors, motor driver, power regulation (like SimpleBot)&lt;br /&gt;
&lt;br /&gt;
=== Advanced Projects ===&lt;br /&gt;
* &#039;&#039;&#039;Custom IMU board&#039;&#039;&#039; - Accelerometer/gyro IC, level shifters, SMD components&lt;br /&gt;
* &#039;&#039;&#039;Camera interface board&#039;&#039;&#039; - High-speed serial, MIPI interface, impedance control&lt;br /&gt;
* &#039;&#039;&#039;Wireless module board&#039;&#039;&#039; - ESP32, antenna, RF design considerations&lt;br /&gt;
&lt;br /&gt;
== Design for Manufacturing (DFM) ==&lt;br /&gt;
&lt;br /&gt;
Make your boards easier to manufacture and assemble:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Use standard components&#039;&#039;&#039; - Common resistor values, standard ICs&lt;br /&gt;
* &#039;&#039;&#039;Add test points&#039;&#039;&#039; - Pads for probing signals with multimeter/oscilloscope&lt;br /&gt;
* &#039;&#039;&#039;Label polarity&#039;&#039;&#039; - Mark + and - for electrolytic capacitors, diodes, connectors&lt;br /&gt;
* &#039;&#039;&#039;Add version number&#039;&#039;&#039; - Silkscreen text with version/date&lt;br /&gt;
* &#039;&#039;&#039;Include fiducial marks&#039;&#039;&#039; - Alignment marks for automated assembly&lt;br /&gt;
* &#039;&#039;&#039;Add mounting holes&#039;&#039;&#039; - 3mm or M3 holes in corners&lt;br /&gt;
* &#039;&#039;&#039;Keep components on one side&#039;&#039;&#039; - Easier assembly (both sides only if necessary)&lt;br /&gt;
&lt;br /&gt;
== PCB Assembly Options ==&lt;br /&gt;
&lt;br /&gt;
=== Hand Assembly (DIY) ===&lt;br /&gt;
* Solder components yourself&lt;br /&gt;
* Requires [[Soldering]] skills&lt;br /&gt;
* Cost: $0 (just your time)&lt;br /&gt;
* Best for: Through-hole, small quantities, learning&lt;br /&gt;
&lt;br /&gt;
=== PCB Assembly Services (PCBA) ===&lt;br /&gt;
* Manufacturer assembles components onto PCB&lt;br /&gt;
* Requires BOM (bill of materials) and pick-and-place files&lt;br /&gt;
* Cost: Setup fee + component cost (economical for &amp;gt;10 boards)&lt;br /&gt;
* Best for: SMD components, production runs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Popular PCBA services&#039;&#039;&#039;:&lt;br /&gt;
* JLCPCB Assembly - Large component library, economical for prototypes&lt;br /&gt;
* PCBWay Assembly - Good for custom components&lt;br /&gt;
* Seeed Studio - Fusion PCBA service&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[KiCad Tutorial]]&#039;&#039;&#039; (Beginner) - Complete first PCB design walkthrough&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; (Beginner to Advanced) - Understand circuits before designing PCBs&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; (Beginner) - Assemble your PCBs after manufacturing&lt;br /&gt;
&lt;br /&gt;
=== Component and Robot Pages ===&lt;br /&gt;
* [[SimpleBot]] - Study the PCB design (files in `./simplebot/kicad/`)&lt;br /&gt;
* [[TB6612FNG]] - Motor driver IC used in SimpleBot PCB&lt;br /&gt;
* [[Raspberry Pi Pico]] - Microcontroller footprint and pinout&lt;br /&gt;
* [[MP1584]] - Buck converter module for power regulation&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://docs.kicad.org/ KiCad Official Documentation]&lt;br /&gt;
* [https://www.youtube.com/c/Contextualelectronics Contextual Electronics] - PCB design video tutorials&lt;br /&gt;
* [https://www.fedevel.com/welldoneblog/ Robert Feranec] - Professional PCB design tutorials&lt;br /&gt;
* [https://jlcpcb.com/capabilities/pcb-capabilities JLCPCB Capabilities] - Manufacturing specs and design rules&lt;br /&gt;
* [https://www.eevblog.com/ EEVblog] - Electronics and PCB design blog&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Understand circuits before designing PCBs&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Assemble components onto PCBs&lt;br /&gt;
* &#039;&#039;&#039;[[Software]]&#039;&#039;&#039; - Program the microcontrollers on your PCBs&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Design enclosures and mounts for your PCBs&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Integrate PCBs into robot chassis&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities]] - Hardware abilities that custom PCBs enable&lt;br /&gt;
* [[SimpleBot]] - Example robot with custom PCB&lt;br /&gt;
* [[Robotics Ontology]] - How PCB design fits into the BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Soldering_Techniques&amp;diff=78</id>
		<title>Soldering Techniques</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Soldering_Techniques&amp;diff=78"/>
		<updated>2025-10-11T20:13:54Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Soldering Techniques |competency=Soldering |difficulty=Intermediate |time=3-4 hours (practice) + 1 hour (theory) |prerequisites=Soldering Guide, experience soldering 50+ through-hole joints |materials=Temperature-controlled iron, solder, flux pen, tweezers, hot air station (optional), SMD practice board |next_steps=Custom sensor modules, PCB rework and repair, advanced motor driver assembly }}  &amp;#039;&amp;#039;&amp;#039;Soldering Techniques&amp;#039;&amp;#039;&amp;#039; is the intermediate tutor...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Soldering Techniques&lt;br /&gt;
|competency=[[Soldering]]&lt;br /&gt;
|difficulty=Intermediate&lt;br /&gt;
|time=3-4 hours (practice) + 1 hour (theory)&lt;br /&gt;
|prerequisites=[[Soldering Guide]], experience soldering 50+ through-hole joints&lt;br /&gt;
|materials=Temperature-controlled iron, solder, flux pen, tweezers, hot air station (optional), SMD practice board&lt;br /&gt;
|next_steps=Custom sensor modules, PCB rework and repair, advanced motor driver assembly&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Soldering Techniques&#039;&#039;&#039; is the intermediate tutorial for surface-mount device (SMD) soldering, desoldering, and PCB rework. This tutorial covers techniques needed to assemble advanced robot PCBs, add SMD sensors, and repair damaged electronics.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll be able to:&lt;br /&gt;
* Hand-solder SMD resistors and capacitors (0805, 0603)&lt;br /&gt;
* Solder multi-pin SMD ICs using drag soldering technique&lt;br /&gt;
* Use hot air rework station to remove and replace SMD components&lt;br /&gt;
* Apply flux effectively for improved solder flow&lt;br /&gt;
* Desolder through-hole and SMD components without damaging PCBs&lt;br /&gt;
* Repair common PCB damage (lifted pads, broken traces)&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes you&#039;ve completed [[Soldering Guide]] and are comfortable with through-hole soldering.&lt;br /&gt;
&lt;br /&gt;
== Part 1: SMD Component Sizes ==&lt;br /&gt;
&lt;br /&gt;
Surface-mount devices (SMD) are tiny components soldered directly to PCB pads (no through-holes).&lt;br /&gt;
&lt;br /&gt;
=== Standard SMD Package Sizes ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Package !! Dimensions (mm) !! Difficulty !! Applications&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;1206&#039;&#039;&#039; || 3.2 × 1.6 || Easy || Beginner practice, power resistors&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;0805&#039;&#039;&#039; || 2.0 × 1.25 || Easy || Most common resistors/capacitors&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;0603&#039;&#039;&#039; || 1.6 × 0.8 || Moderate || High-density boards, standard SMD&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;0402&#039;&#039;&#039; || 1.0 × 0.5 || Hard || Very high density, requires magnification&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;0201&#039;&#039;&#039; || 0.6 × 0.3 || Very Hard || Specialized applications, microscope required&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Start with 0805&#039;&#039;&#039; - Large enough to handle with tweezers, small enough to develop technique.&lt;br /&gt;
&lt;br /&gt;
=== IC Package Types ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SOIC&#039;&#039;&#039; (Small Outline IC) - 1.27mm pin pitch, relatively easy&lt;br /&gt;
* &#039;&#039;&#039;TSSOP&#039;&#039;&#039; (Thin Shrink Small Outline Package) - 0.65mm pitch, moderate difficulty&lt;br /&gt;
* &#039;&#039;&#039;QFP/TQFP&#039;&#039;&#039; (Quad Flat Pack) - 0.8mm to 0.5mm pitch, pins on all four sides&lt;br /&gt;
* &#039;&#039;&#039;QFN&#039;&#039;&#039; (Quad Flat No-leads) - Pads on bottom, requires hot air or reflow&lt;br /&gt;
* &#039;&#039;&#039;BGA&#039;&#039;&#039; (Ball Grid Array) - Solder balls on bottom, requires reflow or specialized rework&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Start with SOIC or TSSOP&#039;&#039;&#039; for learning multi-pin IC soldering.&lt;br /&gt;
&lt;br /&gt;
== Part 2: Essential SMD Tools ==&lt;br /&gt;
&lt;br /&gt;
Beyond basic through-hole tools, SMD work requires:&lt;br /&gt;
&lt;br /&gt;
=== Required Tools ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Fine-tip soldering iron&#039;&#039;&#039; - Chisel or conical tip (0.5-1.0mm)&lt;br /&gt;
* &#039;&#039;&#039;Tweezers&#039;&#039;&#039; - Fine-point or angled, non-magnetic preferred&lt;br /&gt;
* &#039;&#039;&#039;Flux pen&#039;&#039;&#039; - Essential for SMD work (no-clean or rosin flux)&lt;br /&gt;
* &#039;&#039;&#039;Magnifying glass or lamp&#039;&#039;&#039; - 2-10× magnification to see SMD components&lt;br /&gt;
* &#039;&#039;&#039;Fine solder&#039;&#039;&#039; - 0.5mm diameter (0.3mm for fine-pitch work)&lt;br /&gt;
&lt;br /&gt;
=== Highly Recommended Tools ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hot air rework station&#039;&#039;&#039; - Remove and replace SMD components ($$50-150)&lt;br /&gt;
* &#039;&#039;&#039;SMD practice board&#039;&#039;&#039; - Various package sizes for skill development ($10-20)&lt;br /&gt;
* &#039;&#039;&#039;Solder paste&#039;&#039;&#039; - Can be used with hot air instead of wire solder&lt;br /&gt;
* &#039;&#039;&#039;Anti-static mat and wrist strap&#039;&#039;&#039; - Protect sensitive ICs from ESD&lt;br /&gt;
* &#039;&#039;&#039;Kapton tape&#039;&#039;&#039; - Heat-resistant tape for masking&lt;br /&gt;
&lt;br /&gt;
=== Professional Tools (Nice to Have) ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Stereo microscope&#039;&#039;&#039; - 10-20× magnification for fine-pitch work ($100-400)&lt;br /&gt;
* &#039;&#039;&#039;PCB preheater&#039;&#039;&#039; - Preheat board to reduce thermal stress ($50-200)&lt;br /&gt;
* &#039;&#039;&#039;Chip Quik low-temp solder&#039;&#039;&#039; - Ease removal of multi-pin ICs ($15-20)&lt;br /&gt;
* &#039;&#039;&#039;Vacuum pickup tool&#039;&#039;&#039; - Place tiny SMD components ($20-50)&lt;br /&gt;
&lt;br /&gt;
== Part 3: Flux - The Secret Ingredient ==&lt;br /&gt;
&lt;br /&gt;
Flux is even more critical for SMD work than through-hole.&lt;br /&gt;
&lt;br /&gt;
=== What Flux Does ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Removes oxidation&#039;&#039;&#039; - Cleans metal surfaces for better wetting&lt;br /&gt;
* &#039;&#039;&#039;Improves heat transfer&#039;&#039;&#039; - Helps solder flow smoothly to small pads&lt;br /&gt;
* &#039;&#039;&#039;Prevents bridging&#039;&#039;&#039; - Solder flows to flux, making drag soldering possible&lt;br /&gt;
* &#039;&#039;&#039;Lowers surface tension&#039;&#039;&#039; - Allows solder to wet small SMD pads&lt;br /&gt;
&lt;br /&gt;
=== Types of Flux ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Rosin flux&#039;&#039;&#039; (R) - Natural tree resin, mildly corrosive, common in solder cores&lt;br /&gt;
* &#039;&#039;&#039;No-clean flux&#039;&#039;&#039; (NC) - Leaves minimal residue, doesn&#039;t require cleaning&lt;br /&gt;
* &#039;&#039;&#039;Water-soluble flux&#039;&#039;&#039; (OA) - Most active, requires cleaning after soldering&lt;br /&gt;
* &#039;&#039;&#039;Tacky flux&#039;&#039;&#039; - Gel consistency, holds components in place while soldering&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Recommendation&#039;&#039;&#039;: No-clean flux pen for most SMD work (easy to apply, minimal cleanup).&lt;br /&gt;
&lt;br /&gt;
=== Flux Application ===&lt;br /&gt;
&lt;br /&gt;
# Apply small amount to pads before soldering&lt;br /&gt;
# Component will &amp;quot;snap&amp;quot; into alignment when heated (flux surface tension)&lt;br /&gt;
# Excess flux will smoke during soldering (normal)&lt;br /&gt;
# Clean residue if desired (isopropyl alcohol and brush)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Key principle&#039;&#039;&#039;: When SMD soldering is difficult, add more flux!&lt;br /&gt;
&lt;br /&gt;
== Part 4: SMD Resistor and Capacitor Soldering ==&lt;br /&gt;
&lt;br /&gt;
The fundamental SMD technique applies to all two-terminal components.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Tack and Flow&amp;quot; Method ===&lt;br /&gt;
&lt;br /&gt;
This is the standard approach for 0805/0603 components:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Apply flux&#039;&#039;&#039; to both pads&lt;br /&gt;
# &#039;&#039;&#039;Tin one pad&#039;&#039;&#039; - Add small amount of solder to one pad&lt;br /&gt;
# &#039;&#039;&#039;Pick up component&#039;&#039;&#039; with tweezers (hold on sides, not ends)&lt;br /&gt;
# &#039;&#039;&#039;Position component&#039;&#039;&#039; on pads (alignment doesn&#039;t need to be perfect yet)&lt;br /&gt;
# &#039;&#039;&#039;Tack first side&#039;&#039;&#039; - Heat tinned pad, component will sink into solder&lt;br /&gt;
# &#039;&#039;&#039;Adjust alignment&#039;&#039;&#039; - Component will self-align if flux is present&lt;br /&gt;
# &#039;&#039;&#039;Solder second side&#039;&#039;&#039; - Apply iron and solder to opposite end&lt;br /&gt;
# &#039;&#039;&#039;Re-flow first side&#039;&#039;&#039; (optional) - Ensure good joint on both ends&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step: 0805 Resistor ===&lt;br /&gt;
&lt;br /&gt;
# Clean PCB pads with isopropyl alcohol&lt;br /&gt;
# Apply flux to both pads with flux pen&lt;br /&gt;
# Tin left pad: touch iron to pad, apply small amount of solder&lt;br /&gt;
# Pick up 0805 resistor with tweezers&lt;br /&gt;
# Position resistor on pads (approximately centered)&lt;br /&gt;
# Touch iron to left end of resistor while holding with tweezers&lt;br /&gt;
# Solder melts, component sinks into place&lt;br /&gt;
# Remove iron, hold steady 1-2 seconds&lt;br /&gt;
# Move iron to right end of resistor&lt;br /&gt;
# Apply solder wire to joint (iron touching both pad and component)&lt;br /&gt;
# Solder flows onto pad and component&lt;br /&gt;
# Remove iron and solder wire&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Inspection&#039;&#039;&#039;:&lt;br /&gt;
* Component aligned with pads (flux self-aligns if not forced)&lt;br /&gt;
* Solder visible on both ends (small fillet)&lt;br /&gt;
* No excess solder (shouldn&#039;t look like through-hole joint)&lt;br /&gt;
&lt;br /&gt;
=== Common SMD Mistakes ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tombstoning&#039;&#039;&#039;:&lt;br /&gt;
* Component stands on end (one side soldered before other)&lt;br /&gt;
* Prevention: Tack one side first, then solder opposite side&lt;br /&gt;
* If using hot air or reflow, ensure even heating&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Insufficient solder&#039;&#039;&#039;:&lt;br /&gt;
* Component appears to float above pad&lt;br /&gt;
* Add more solder - SMD joints are small but need wetting&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Excess solder&#039;&#039;&#039;:&lt;br /&gt;
* Large blob obscures component and pads&lt;br /&gt;
* Remove excess with solder wick&lt;br /&gt;
&lt;br /&gt;
== Part 5: Multi-Pin IC Soldering (SOIC, TSSOP) ==&lt;br /&gt;
&lt;br /&gt;
ICs with many pins use &amp;quot;drag soldering&amp;quot; technique.&lt;br /&gt;
&lt;br /&gt;
=== Drag Soldering Method ===&lt;br /&gt;
&lt;br /&gt;
Drag soldering uses flux and a flood of solder, then drags iron across pins to separate:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Apply flux generously&#039;&#039;&#039; to all IC pads (this is critical!)&lt;br /&gt;
# &#039;&#039;&#039;Align IC&#039;&#039;&#039; on pads using tweezers&lt;br /&gt;
# &#039;&#039;&#039;Tack one corner pin&#039;&#039;&#039; - Hold IC with tweezers, solder one pin to secure IC&lt;br /&gt;
# &#039;&#039;&#039;Check alignment&#039;&#039;&#039; - IC should be centered on pads&lt;br /&gt;
# &#039;&#039;&#039;Tack opposite corner&#039;&#039;&#039; - Ensure IC doesn&#039;t shift&lt;br /&gt;
# &#039;&#039;&#039;Flood one side with solder&#039;&#039;&#039; - Apply solder liberally along pins (will create bridges)&lt;br /&gt;
# &#039;&#039;&#039;Drag iron across pins&#039;&#039;&#039; - Draw iron along pins with slight pressure&lt;br /&gt;
# &#039;&#039;&#039;Solder separates&#039;&#039;&#039; - Flux causes solder to &amp;quot;ball up&amp;quot; on individual pins&lt;br /&gt;
# &#039;&#039;&#039;Repeat for each side&#039;&#039;&#039; of IC&lt;br /&gt;
# &#039;&#039;&#039;Inspect for bridges&#039;&#039;&#039; - Look carefully between pins&lt;br /&gt;
# &#039;&#039;&#039;Remove bridges&#039;&#039;&#039; with solder wick if present&lt;br /&gt;
&lt;br /&gt;
=== Why Drag Soldering Works ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Flux lowers surface tension&#039;&#039;&#039; - Solder prefers to ball up on pads rather than bridge&lt;br /&gt;
* &#039;&#039;&#039;Solder follows heat&#039;&#039;&#039; - Iron draws excess solder away from pins&lt;br /&gt;
* &#039;&#039;&#039;Much faster&#039;&#039;&#039; than soldering each pin individually&lt;br /&gt;
* &#039;&#039;&#039;Requires practice&#039;&#039;&#039; - Don&#039;t expect perfection on first attempt&lt;br /&gt;
&lt;br /&gt;
=== Pin-by-Pin Alternative ===&lt;br /&gt;
&lt;br /&gt;
For beginners, soldering each pin individually is slower but more controlled:&lt;br /&gt;
&lt;br /&gt;
# Align and tack IC (corners first)&lt;br /&gt;
# Apply flux to all pins&lt;br /&gt;
# Touch iron to first pin and pad, apply small amount of solder&lt;br /&gt;
# Move to next pin, repeat&lt;br /&gt;
# Inspect for bridges after each side&lt;br /&gt;
&lt;br /&gt;
=== Inspecting IC Solder Joints ===&lt;br /&gt;
&lt;br /&gt;
Use magnifying glass to check:&lt;br /&gt;
* All pins have solder fillet (not dry or unsoldered)&lt;br /&gt;
* No bridges between adjacent pins (continuity test with multimeter if unsure)&lt;br /&gt;
* IC is aligned with pads (no pins floating off pads)&lt;br /&gt;
&lt;br /&gt;
== Part 6: Hot Air Rework ==&lt;br /&gt;
&lt;br /&gt;
Hot air stations remove and replace SMD components with heated air.&lt;br /&gt;
&lt;br /&gt;
=== Hot Air Station Basics ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Temperature&#039;&#039;&#039; - 300-380°C for lead-free (adjust based on component size)&lt;br /&gt;
* &#039;&#039;&#039;Air flow&#039;&#039;&#039; - Low for small components (blown away by high flow), medium for ICs&lt;br /&gt;
* &#039;&#039;&#039;Nozzle&#039;&#039;&#039; - Use smallest nozzle that covers component&lt;br /&gt;
&lt;br /&gt;
=== Removing SMD Components ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Apply flux&#039;&#039;&#039; around component&lt;br /&gt;
# &#039;&#039;&#039;Set temperature&#039;&#039;&#039; - 350°C for small passives, 380°C for ICs&lt;br /&gt;
# &#039;&#039;&#039;Set air flow&#039;&#039;&#039; - Low-medium to avoid blowing away components&lt;br /&gt;
# &#039;&#039;&#039;Heat component&#039;&#039;&#039; - Hold nozzle 10-20mm above component&lt;br /&gt;
# &#039;&#039;&#039;Watch solder melt&#039;&#039;&#039; - Solder will become shiny when molten&lt;br /&gt;
# &#039;&#039;&#039;Lift with tweezers&#039;&#039;&#039; - Gently tug component; if not free, heat more&lt;br /&gt;
# &#039;&#039;&#039;Clean pads&#039;&#039;&#039; - Remove old solder with wick or iron while still hot&lt;br /&gt;
&lt;br /&gt;
=== Installing SMD Components with Hot Air ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Clean and tin pads&#039;&#039;&#039; (small amount of solder on each pad)&lt;br /&gt;
# &#039;&#039;&#039;Apply flux&#039;&#039;&#039; to pads&lt;br /&gt;
# &#039;&#039;&#039;Position component&#039;&#039;&#039; with tweezers&lt;br /&gt;
# &#039;&#039;&#039;Heat with hot air&#039;&#039;&#039; - Hold nozzle above component&lt;br /&gt;
# &#039;&#039;&#039;Solder melts&#039;&#039;&#039; - Component will self-align (flux surface tension)&lt;br /&gt;
# &#039;&#039;&#039;Remove heat&#039;&#039;&#039; when component settles into position&lt;br /&gt;
# &#039;&#039;&#039;Hold steady&#039;&#039;&#039; 2-3 seconds while cooling&lt;br /&gt;
&lt;br /&gt;
=== Hot Air Safety ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Protect adjacent components&#039;&#039;&#039; - Use Kapton tape or aluminum foil shield&lt;br /&gt;
* &#039;&#039;&#039;Don&#039;t overheat&#039;&#039;&#039; - Plastic connectors and components can melt&lt;br /&gt;
* &#039;&#039;&#039;Burns&#039;&#039;&#039; - Hot air nozzle is extremely hot; never touch during or immediately after use&lt;br /&gt;
* &#039;&#039;&#039;Airflow&#039;&#039;&#039; - Don&#039;t direct at nearby components (can blow them off board)&lt;br /&gt;
&lt;br /&gt;
== Part 7: Advanced Desoldering Techniques ==&lt;br /&gt;
&lt;br /&gt;
=== Solder Wick Mastery ===&lt;br /&gt;
&lt;br /&gt;
Solder wick (braid) removes excess solder effectively when used correctly:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Cut fresh wick&#039;&#039;&#039; - Used/saturated wick doesn&#039;t absorb well&lt;br /&gt;
# &#039;&#039;&#039;Apply flux&#039;&#039;&#039; to wick and target solder&lt;br /&gt;
# &#039;&#039;&#039;Press wick firmly&#039;&#039;&#039; onto solder with iron tip&lt;br /&gt;
# &#039;&#039;&#039;Wait for solder to melt&#039;&#039;&#039; - Wicks into braid by capillary action&lt;br /&gt;
# &#039;&#039;&#039;Remove iron and wick together&#039;&#039;&#039; - Solder solidifies in wick&lt;br /&gt;
# &#039;&#039;&#039;Repeat if needed&#039;&#039;&#039; with fresh wick section&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Advanced tip&#039;&#039;&#039;: Pre-tin the wick with solder for better heat transfer, then use to remove solder.&lt;br /&gt;
&lt;br /&gt;
=== Desoldering Pump Technique ===&lt;br /&gt;
&lt;br /&gt;
Also called &amp;quot;solder sucker&amp;quot; - mechanical vacuum device:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Heat solder joint&#039;&#039;&#039; until fully molten&lt;br /&gt;
# &#039;&#039;&#039;Cock pump&#039;&#039;&#039; spring mechanism&lt;br /&gt;
# &#039;&#039;&#039;Position tip&#039;&#039;&#039; close to molten solder (not touching iron)&lt;br /&gt;
# &#039;&#039;&#039;Press button&#039;&#039;&#039; - Creates vacuum, sucks solder into pump&lt;br /&gt;
# &#039;&#039;&#039;Clean pump chamber&#039;&#039;&#039; regularly (dump out collected solder)&lt;br /&gt;
&lt;br /&gt;
Works best for through-hole components; less effective for SMD.&lt;br /&gt;
&lt;br /&gt;
=== Removing Through-Hole ICs ===&lt;br /&gt;
&lt;br /&gt;
Multi-pin through-hole ICs require special technique:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 1: Chip Quik low-temp solder&#039;&#039;&#039;&lt;br /&gt;
# Add Chip Quik (low-melt) solder to all pins&lt;br /&gt;
# Heat all pins with iron - Chip Quik stays molten longer&lt;br /&gt;
# Gently pull IC while heating multiple pins&lt;br /&gt;
# IC releases when all pins are molten&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 2: Pin-by-pin&#039;&#039;&#039;&lt;br /&gt;
# Heat one pin, push component from other side&lt;br /&gt;
# Heat next pin, push component&lt;br /&gt;
# Alternate sides to avoid bending IC&lt;br /&gt;
# Requires patience - 20-30 pins takes time&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Method 3: Cut and remove&#039;&#039;&#039;&lt;br /&gt;
# Cut IC body with cutters (destroy IC)&lt;br /&gt;
# Remove pins individually from PCB&lt;br /&gt;
# Clean holes with desoldering pump or wick&lt;br /&gt;
# Use when IC is already damaged&lt;br /&gt;
&lt;br /&gt;
=== Removing Stubborn SMD Components ===&lt;br /&gt;
&lt;br /&gt;
Some SMD parts are difficult to remove with hot air alone:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Large thermal mass&#039;&#039;&#039; - Ground planes conduct heat away; use preheater or higher temperature&lt;br /&gt;
* &#039;&#039;&#039;Lead-free solder&#039;&#039;&#039; - Higher melting point; ensure hot air reaches 380°C&lt;br /&gt;
* &#039;&#039;&#039;Multiple rows of pins&#039;&#039;&#039; - QFP, QFN require flux and patience&lt;br /&gt;
* &#039;&#039;&#039;Adhesive&#039;&#039;&#039; - Some components glued in addition to soldering; may need force&lt;br /&gt;
&lt;br /&gt;
== Part 8: Repairing PCB Damage ==&lt;br /&gt;
&lt;br /&gt;
Mistakes and accidents cause PCB damage. Here&#039;s how to fix common issues:&lt;br /&gt;
&lt;br /&gt;
=== Lifted Pad ===&lt;br /&gt;
&lt;br /&gt;
Pad separated from PCB (adhesive failed from heat or force):&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Identify trace connection&#039;&#039;&#039; - Where does the pad connect?&lt;br /&gt;
# &#039;&#039;&#039;Scrape soldermask&#039;&#039;&#039; from trace near damaged pad&lt;br /&gt;
# &#039;&#039;&#039;Solder component directly to trace&#039;&#039;&#039; - Bypass lifted pad&lt;br /&gt;
# &#039;&#039;&#039;Reinforce with wire&#039;&#039;&#039; (if needed) - Jumper from component to nearby pad/via&lt;br /&gt;
# &#039;&#039;&#039;Test continuity&#039;&#039;&#039; - Verify connection with multimeter&lt;br /&gt;
&lt;br /&gt;
=== Broken Trace ===&lt;br /&gt;
&lt;br /&gt;
Copper trace cut or damaged:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Expose trace ends&#039;&#039;&#039; - Scrape soldermask on both sides of break&lt;br /&gt;
# &#039;&#039;&#039;Solder jumper wire&#039;&#039;&#039; across break - 30AWG wire works well&lt;br /&gt;
# &#039;&#039;&#039;Secure with glue&#039;&#039;&#039; (optional) - CA glue or epoxy to prevent stress&lt;br /&gt;
# &#039;&#039;&#039;Test continuity&#039;&#039;&#039; - Verify repair with multimeter&lt;br /&gt;
&lt;br /&gt;
=== Missing Pad ===&lt;br /&gt;
&lt;br /&gt;
Pad completely removed from PCB:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Find nearest via or pad&#039;&#039;&#039; on same net&lt;br /&gt;
# &#039;&#039;&#039;Run jumper wire&#039;&#039;&#039; from component to via/pad&lt;br /&gt;
# &#039;&#039;&#039;Secure component&#039;&#039;&#039; with CA glue (won&#039;t have mechanical strength from pad)&lt;br /&gt;
# &#039;&#039;&#039;Test connection&#039;&#039;&#039; with multimeter&lt;br /&gt;
&lt;br /&gt;
=== Bridged Pins Under IC ===&lt;br /&gt;
&lt;br /&gt;
Solder bridge you can&#039;t access:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Add flux&#039;&#039;&#039; around IC&lt;br /&gt;
# &#039;&#039;&#039;Re-flow with hot air&#039;&#039;&#039; - Heat IC until solder melts&lt;br /&gt;
# &#039;&#039;&#039;Flux should separate bridge&#039;&#039;&#039; (surface tension pulls solder to individual pins)&lt;br /&gt;
# &#039;&#039;&#039;Alternative&#039;&#039;&#039;: Remove IC, clean pads with wick, reinstall IC&lt;br /&gt;
&lt;br /&gt;
== Part 9: Practice Projects ==&lt;br /&gt;
&lt;br /&gt;
Build skills with these progressive exercises:&lt;br /&gt;
&lt;br /&gt;
=== Exercise 1: SMD Resistors (0805 → 0603) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: SMD practice board or breakout board, 0805 and 0603 resistors&lt;br /&gt;
&lt;br /&gt;
# Solder 10× 0805 resistors using tack-and-flow method&lt;br /&gt;
# Inspect each joint - proper alignment? Solder on both ends?&lt;br /&gt;
# Solder 10× 0603 resistors (smaller, requires more precision)&lt;br /&gt;
# Remove and replace 5× resistors with hot air (if available)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Consistent SMD joints, confidence with small components.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 2: SOIC IC (8-pin or 16-pin) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: SOIC practice board, 8-pin or 16-pin SOIC chip&lt;br /&gt;
&lt;br /&gt;
# Apply flux to all pads&lt;br /&gt;
# Align and tack IC (opposite corners)&lt;br /&gt;
# Drag solder one side of IC&lt;br /&gt;
# Inspect for bridges&lt;br /&gt;
# Remove bridges with solder wick if present&lt;br /&gt;
# Repeat for remaining sides&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Successful drag soldering with no bridges.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 3: SMD Motor Driver Assembly ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: TB6612FNG breakout board kit (SparkFun, Adafruit) or similar&lt;br /&gt;
&lt;br /&gt;
# Assemble complete SMD board from kit&lt;br /&gt;
# Includes various SMD component sizes and IC&lt;br /&gt;
# Demonstrates real-world application&lt;br /&gt;
# Test functionality when complete&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Fully functional assembled board.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 4: Desoldering and Rework ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: Old/broken PCB or previous practice boards&lt;br /&gt;
&lt;br /&gt;
# Remove 10× SMD components with hot air&lt;br /&gt;
# Remove 10× SMD components with iron and tweezers&lt;br /&gt;
# Remove through-hole IC with Chip Quik or pin-by-pin&lt;br /&gt;
# Clean pads with solder wick&lt;br /&gt;
# Reinstall components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Proficiency with removal and replacement.&lt;br /&gt;
&lt;br /&gt;
== Part 10: Quality Control ==&lt;br /&gt;
&lt;br /&gt;
=== Visual Inspection ===&lt;br /&gt;
&lt;br /&gt;
Inspect SMD joints under magnification:&lt;br /&gt;
* ☐ Solder visible on all component ends/pins&lt;br /&gt;
* ☐ No bridges between adjacent pins&lt;br /&gt;
* ☐ Components aligned with pads (not crooked)&lt;br /&gt;
* ☐ No excess solder obscuring component markings&lt;br /&gt;
* ☐ No missing joints (all pins soldered)&lt;br /&gt;
&lt;br /&gt;
=== Electrical Testing ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Continuity&#039;&#039;&#039; - Test connections with multimeter&lt;br /&gt;
* &#039;&#039;&#039;No shorts&#039;&#039;&#039; - Check adjacent pins for bridges&lt;br /&gt;
* &#039;&#039;&#039;Power rails&#039;&#039;&#039; - Verify no shorts between power and ground&lt;br /&gt;
* &#039;&#039;&#039;Functional test&#039;&#039;&#039; - Power up board and test operation&lt;br /&gt;
&lt;br /&gt;
=== Common SMD Defects ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Dry joint&#039;&#039;&#039; - Solder didn&#039;t wet pad or component&lt;br /&gt;
* &#039;&#039;&#039;Insufficient solder&#039;&#039;&#039; - Joint looks weak or incomplete&lt;br /&gt;
* &#039;&#039;&#039;Bridging&#039;&#039;&#039; - Adjacent pins connected by solder&lt;br /&gt;
* &#039;&#039;&#039;Tombstoning&#039;&#039;&#039; - Component standing on end&lt;br /&gt;
* &#039;&#039;&#039;Misalignment&#039;&#039;&#039; - Component not centered on pads&lt;br /&gt;
* &#039;&#039;&#039;Cold joint&#039;&#039;&#039; - Dull, grainy appearance&lt;br /&gt;
&lt;br /&gt;
== Part 11: Real-World Applications ==&lt;br /&gt;
&lt;br /&gt;
=== Motor Driver Boards ===&lt;br /&gt;
&lt;br /&gt;
Many advanced motor drivers use SMD components:&lt;br /&gt;
* TB6612FNG breakout (SparkFun)&lt;br /&gt;
* DRV8833 (Pololu, Adafruit)&lt;br /&gt;
* TMC2209 stepper drivers&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills required&#039;&#039;&#039;:&lt;br /&gt;
* 0805 resistors and capacitors&lt;br /&gt;
* SOIC or TSSOP motor driver IC&lt;br /&gt;
* Through-hole terminal blocks&lt;br /&gt;
&lt;br /&gt;
=== Sensor Modules ===&lt;br /&gt;
&lt;br /&gt;
Custom sensor breakout boards:&lt;br /&gt;
* IMU sensors (MPU6050, BNO055)&lt;br /&gt;
* Time-of-flight sensors (VL53L0X)&lt;br /&gt;
* Optical encoders&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills required&#039;&#039;&#039;:&lt;br /&gt;
* Fine-pitch SMD (0603 or smaller)&lt;br /&gt;
* I2C pull-up resistors&lt;br /&gt;
* Decoupling capacitors near IC&lt;br /&gt;
&lt;br /&gt;
=== Robot PCBs ===&lt;br /&gt;
&lt;br /&gt;
Complete robot control boards combine through-hole and SMD:&lt;br /&gt;
* Microcontroller (QFP or QFN package)&lt;br /&gt;
* Power regulation (SMD buck converters)&lt;br /&gt;
* Sensor headers (through-hole)&lt;br /&gt;
* Motor terminals (through-hole)&lt;br /&gt;
&lt;br /&gt;
== Part 12: Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: Component Won&#039;t Stay in Place ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Insufficient flux or solder on first pad&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Apply flux, re-tin pad with more solder, try again&lt;br /&gt;
&lt;br /&gt;
=== Problem: Solder Bridges Keep Forming ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Too much solder or insufficient flux&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Use less solder, apply more flux, use solder wick to remove excess&lt;br /&gt;
&lt;br /&gt;
=== Problem: Component Floats Off Pads When Heated ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Solder on both pads melts simultaneously (hot air or reflow)&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Use tack-and-flow method (iron) instead, or hold component with tweezers during reflow&lt;br /&gt;
&lt;br /&gt;
=== Problem: Can&#039;t See What I&#039;m Doing ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Components too small for unaided vision&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Use magnifying lamp (2-10×) or microscope for 0603 and smaller&lt;br /&gt;
&lt;br /&gt;
=== Problem: Lifted Pad ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Excessive heat or force during soldering/desoldering&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Solder to trace instead (see Part 8)&lt;br /&gt;
&lt;br /&gt;
=== Problem: IC Pins Not Aligned with Pads ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: IC shifted while tacking corner pins&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Re-heat corner pins, reposition IC with tweezers while molten&lt;br /&gt;
&lt;br /&gt;
== Part 13: Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Hand-solder 0805 SMD components consistently&lt;br /&gt;
* ☐ Hand-solder 0603 SMD components with magnification&lt;br /&gt;
* ☐ Use flux effectively to improve solder flow&lt;br /&gt;
* ☐ Drag solder SOIC or TSSOP ICs without bridges&lt;br /&gt;
* ☐ Remove SMD components with hot air station&lt;br /&gt;
* ☐ Install SMD components with hot air&lt;br /&gt;
* ☐ Remove excess solder with solder wick&lt;br /&gt;
* ☐ Repair lifted pads and broken traces&lt;br /&gt;
* ☐ Inspect SMD joints under magnification&lt;br /&gt;
* ☐ Test assembled boards for shorts and continuity&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready for advanced SMD assembly projects!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Advanced Projects ===&lt;br /&gt;
* Design and assemble custom sensor modules&lt;br /&gt;
* Build SMD motor driver board from scratch&lt;br /&gt;
* Rework and repair commercial electronics&lt;br /&gt;
* Assemble fine-pitch (0.5mm) QFP chips&lt;br /&gt;
&lt;br /&gt;
=== Advanced Learning ===&lt;br /&gt;
* Reflow soldering (oven or hot plate)&lt;br /&gt;
* Solder paste stencils and application&lt;br /&gt;
* BGA rework and X-ray inspection&lt;br /&gt;
* IPC-A-610 certification (industry soldering standard)&lt;br /&gt;
&lt;br /&gt;
=== BRS Applications ===&lt;br /&gt;
* Add IMU sensor breakout to SimpleBot&lt;br /&gt;
* Build custom motor driver with current sensing&lt;br /&gt;
* Design integrated robot PCB with SMD components&lt;br /&gt;
&lt;br /&gt;
== Common Intermediate Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Insufficient flux for SMD&#039;&#039;&#039; - Add more flux than you think you need&lt;br /&gt;
* &#039;&#039;&#039;Hot air too close&#039;&#039;&#039; - Hold nozzle 10-20mm above, not touching component&lt;br /&gt;
* &#039;&#039;&#039;Rushing drag soldering&#039;&#039;&#039; - Take time to apply flux generously first&lt;br /&gt;
* &#039;&#039;&#039;Wrong hot air temperature&#039;&#039;&#039; - Too low = won&#039;t melt, too high = damaged components&lt;br /&gt;
* &#039;&#039;&#039;Excess force on SMD components&#039;&#039;&#039; - Lift pads easily; use heat, not force&lt;br /&gt;
* &#039;&#039;&#039;Not checking for bridges&#039;&#039;&#039; - Always inspect multi-pin ICs under magnification&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Recommended Purchases for Intermediate Work ===&lt;br /&gt;
* &#039;&#039;&#039;Hot air station&#039;&#039;&#039; - 858D or QuickO T12 ($50-100)&lt;br /&gt;
* &#039;&#039;&#039;Fine-tip soldering iron&#039;&#039;&#039; - 0.5-1.0mm chisel or cone tip ($10-20)&lt;br /&gt;
* &#039;&#039;&#039;Flux pen&#039;&#039;&#039; - Kester 951 or MG Chemicals ($5-10)&lt;br /&gt;
* &#039;&#039;&#039;Fine tweezers&#039;&#039;&#039; - ESD-safe, fine point ($10-20)&lt;br /&gt;
* &#039;&#039;&#039;SMD practice board&#039;&#039;&#039; - Various package sizes ($10-20)&lt;br /&gt;
* &#039;&#039;&#039;Magnifying lamp&#039;&#039;&#039; - 5-10× magnification with light ($30-60)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total additional budget&#039;&#039;&#039;: $120-250 (beyond beginner tools)&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.youtube.com/watch?v=5uiroWBkdFY Pace: SMD Soldering] (video)&lt;br /&gt;
* [https://www.youtube.com/watch?v=pdGSFc7VjBE Pace: Drag Soldering] (video)&lt;br /&gt;
* [https://www.youtube.com/watch?v=nS0bEuYPJoA Pace: Hot Air Rework] (video)&lt;br /&gt;
* [https://www.sparkfun.com/tutorials/96 SparkFun: SMD Soldering Tutorial]&lt;br /&gt;
* [https://www.ipc.org/ipc-a-610 IPC-A-610] - Industry standard for solder joint quality&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Soldering]] - Full competency overview&lt;br /&gt;
* [[Soldering Guide]] - Beginner tutorial (prerequisite)&lt;br /&gt;
* [[PCB Design]] - Design boards you&#039;ll assemble with these techniques&lt;br /&gt;
* [[Electronics]] - Understanding what you&#039;re soldering and why&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Soldering]]&lt;br /&gt;
[[Category:Intermediate]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Soldering_Guide&amp;diff=77</id>
		<title>Soldering Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Soldering_Guide&amp;diff=77"/>
		<updated>2025-10-11T20:13:45Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Soldering Guide |competency=Soldering |difficulty=Beginner |time=1-2 hours (practice) + 30 minutes (theory) |prerequisites=None - complete beginner friendly |materials=Soldering iron ($20-50), lead-free solder, safety glasses, ventilation, practice kit or perfboard |next_steps=SimpleBot PCB assembly, Soldering Techniques }}  &amp;#039;&amp;#039;&amp;#039;Soldering Guide&amp;#039;&amp;#039;&amp;#039; is your introduction to the hands-on technique of joining electronic components with molten metal...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Soldering Guide&lt;br /&gt;
|competency=[[Soldering]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=1-2 hours (practice) + 30 minutes (theory)&lt;br /&gt;
|prerequisites=None - complete beginner friendly&lt;br /&gt;
|materials=Soldering iron ($20-50), lead-free solder, safety glasses, ventilation, practice kit or perfboard&lt;br /&gt;
|next_steps=[[SimpleBot]] PCB assembly, [[Soldering Techniques]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Soldering Guide&#039;&#039;&#039; is your introduction to the hands-on technique of joining electronic components with molten metal. This tutorial covers everything you need to safely and successfully solder through-hole components for [[SimpleBot]] and other BRS robots.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll be able to:&lt;br /&gt;
* Set up and safely operate a soldering iron&lt;br /&gt;
* Create reliable solder joints on through-hole components&lt;br /&gt;
* Recognize good joints vs cold joints vs bridges&lt;br /&gt;
* Solder wires to terminals and pads&lt;br /&gt;
* Troubleshoot common soldering problems&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039;. Plan to spend 1-2 hours practicing before attempting your first real PCB.&lt;br /&gt;
&lt;br /&gt;
== Part 1: Safety First ==&lt;br /&gt;
&lt;br /&gt;
Soldering involves high temperatures and fumes. Before you start:&lt;br /&gt;
&lt;br /&gt;
=== Essential Safety Rules ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Wear safety glasses&#039;&#039;&#039; - Solder can spatter, component leads fly when clipped&lt;br /&gt;
# &#039;&#039;&#039;Ventilate your workspace&#039;&#039;&#039; - Work near open window or use fume extractor&lt;br /&gt;
# &#039;&#039;&#039;Never touch the iron tip&#039;&#039;&#039; - Reaches 300-400°C (572-752°F)&lt;br /&gt;
# &#039;&#039;&#039;Use a proper iron stand&#039;&#039;&#039; - Never lay hot iron on desk&lt;br /&gt;
# &#039;&#039;&#039;Keep flammable materials away&#039;&#039;&#039; - No paper, plastic, or fabric near hot iron&lt;br /&gt;
# &#039;&#039;&#039;Wash hands after soldering&#039;&#039;&#039; - Especially important with leaded solder&lt;br /&gt;
# &#039;&#039;&#039;Never leave hot iron unattended&#039;&#039;&#039; - Turn off or unplug when leaving&lt;br /&gt;
&lt;br /&gt;
=== Understanding the Hazards ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Burns&#039;&#039;&#039; - Iron tip can cause instant, serious injury; handle only by the insulated grip&lt;br /&gt;
* &#039;&#039;&#039;Fumes&#039;&#039;&#039; - Flux produces irritating smoke containing rosin or other compounds&lt;br /&gt;
* &#039;&#039;&#039;Lead exposure&#039;&#039;&#039; - Traditional 60/40 solder contains lead; use lead-free or handle carefully&lt;br /&gt;
* &#039;&#039;&#039;Fire&#039;&#039;&#039; - Hot iron can ignite paper, plastic, sponges left in contact&lt;br /&gt;
* &#039;&#039;&#039;Eye injury&#039;&#039;&#039; - Clipped component leads can fly across room at high speed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you get burned&#039;&#039;&#039;: Cool immediately under cold running water for 10+ minutes. Seek medical attention for serious burns.&lt;br /&gt;
&lt;br /&gt;
== Part 2: Tools and Materials ==&lt;br /&gt;
&lt;br /&gt;
=== Soldering Iron Selection ===&lt;br /&gt;
&lt;br /&gt;
You need a temperature-controlled soldering iron for electronics work:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Recommended irons ($20-50)&#039;&#039;&#039;:&lt;br /&gt;
* &#039;&#039;&#039;Hakko FX-888D&#039;&#039;&#039; ($90) - Industry standard, very reliable&lt;br /&gt;
* &#039;&#039;&#039;Pinecil&#039;&#039;&#039; ($30) - Portable, USB-C powered, excellent value&lt;br /&gt;
* &#039;&#039;&#039;TS100&#039;&#039;&#039; ($50) - Portable, battery-compatible&lt;br /&gt;
* &#039;&#039;&#039;Weller WLC100&#039;&#039;&#039; ($40) - Basic analog temperature control&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Avoid&#039;&#039;&#039;:&lt;br /&gt;
* Non-temperature-controlled irons (too hot, damage components)&lt;br /&gt;
* High-wattage soldering guns (too powerful for electronics)&lt;br /&gt;
* Ultra-cheap irons under $15 (unreliable temperature, poor tips)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip selection&#039;&#039;&#039;: Start with a chisel or cone tip (1-2mm). Avoid fine needle tips for beginners.&lt;br /&gt;
&lt;br /&gt;
=== Solder Selection ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Lead-free solder&#039;&#039;&#039; (SAC305: 96.5% Sn, 3% Ag, 0.5% Cu) - Recommended, melts at 217°C&lt;br /&gt;
* &#039;&#039;&#039;Leaded solder&#039;&#039;&#039; (60/40: 60% Sn, 40% Pb) - Easier for beginners, melts at 183°C, but contains lead&lt;br /&gt;
* &#039;&#039;&#039;Diameter&#039;&#039;&#039; - 0.8mm for most electronics work (0.5mm for fine-pitch, 1.0mm for larger joints)&lt;br /&gt;
* &#039;&#039;&#039;Flux core&#039;&#039;&#039; - All electronic solder has rosin flux core (essential for good flow)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For learning&#039;&#039;&#039;: Leaded solder is easier to work with (lower temperature, better flow). Use lead-free for production projects. Wash hands after handling either type.&lt;br /&gt;
&lt;br /&gt;
=== Additional Essential Tools ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Solder stand&#039;&#039;&#039; - Holds hot iron safely&lt;br /&gt;
* &#039;&#039;&#039;Brass wool or wet sponge&#039;&#039;&#039; - Clean iron tip (brass wool better, doesn&#039;t cool tip)&lt;br /&gt;
* &#039;&#039;&#039;Safety glasses&#039;&#039;&#039; - Protect eyes from solder spatter and flying leads&lt;br /&gt;
* &#039;&#039;&#039;Wire cutters&#039;&#039;&#039; - Flush-cut type for trimming component leads&lt;br /&gt;
* &#039;&#039;&#039;Practice board&#039;&#039;&#039; - Perfboard or through-hole practice kit&lt;br /&gt;
&lt;br /&gt;
=== Helpful But Not Essential ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Helping hands&#039;&#039;&#039; - Third hand with alligator clips to hold work&lt;br /&gt;
* &#039;&#039;&#039;Magnifying glass&#039;&#039;&#039; - Inspect joints for defects&lt;br /&gt;
* &#039;&#039;&#039;Solder wick&#039;&#039;&#039; - Braided copper removes excess solder&lt;br /&gt;
* &#039;&#039;&#039;Flux pen&#039;&#039;&#039; - Extra flux improves difficult joints&lt;br /&gt;
* &#039;&#039;&#039;Desoldering pump&#039;&#039;&#039; - Sucks up molten solder for removal&lt;br /&gt;
&lt;br /&gt;
== Part 3: Iron Setup and Maintenance ==&lt;br /&gt;
&lt;br /&gt;
=== First Time Setup ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Read iron manual&#039;&#039;&#039; - Temperature settings vary by model&lt;br /&gt;
# &#039;&#039;&#039;Install tip&#039;&#039;&#039; - Most irons come with tip installed; tighten securely&lt;br /&gt;
# &#039;&#039;&#039;Set temperature&#039;&#039;&#039; - 350°C (662°F) for lead-free, 320°C (608°F) for leaded&lt;br /&gt;
# &#039;&#039;&#039;Place in stand&#039;&#039;&#039; - Secure stand location away from flammable materials&lt;br /&gt;
&lt;br /&gt;
=== Tinning the Tip (Critical Step!) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tinning&#039;&#039;&#039; means coating the tip with a thin layer of solder. This:&lt;br /&gt;
* Protects tip from oxidation&lt;br /&gt;
* Improves heat transfer to joints&lt;br /&gt;
* Extends tip lifetime&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tinning procedure:&#039;&#039;&#039;&lt;br /&gt;
# Heat iron to working temperature (2-3 minutes)&lt;br /&gt;
# Clean tip on brass wool or damp sponge&lt;br /&gt;
# Immediately apply solder to tip - should melt and coat tip surface&lt;br /&gt;
# Wipe excess on brass wool, leaving thin shiny coating&lt;br /&gt;
# Tip should be shiny silver, not black or brown&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Re-tin every 3-5 joints&#039;&#039;&#039; to maintain performance. Always tin before turning off iron.&lt;br /&gt;
&lt;br /&gt;
=== Tip Cleaning ===&lt;br /&gt;
&lt;br /&gt;
Clean tip before every joint:&lt;br /&gt;
* &#039;&#039;&#039;Brass wool&#039;&#039;&#039; (preferred) - Wipe tip, doesn&#039;t cool it down&lt;br /&gt;
* &#039;&#039;&#039;Damp sponge&#039;&#039;&#039; - Wipe tip, cools it temporarily (recovers quickly)&lt;br /&gt;
&lt;br /&gt;
Never use file, sandpaper, or abrasive - damages tip plating!&lt;br /&gt;
&lt;br /&gt;
=== Tip Maintenance ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Oxidation&#039;&#039;&#039; - Black or brown crusty coating prevents heat transfer&lt;br /&gt;
* &#039;&#039;&#039;Prevention&#039;&#039;&#039; - Keep tip tinned at all times, clean frequently&lt;br /&gt;
* &#039;&#039;&#039;Recovery&#039;&#039;&#039; - Use tip cleaner/activator (Hakko FS-100) or replace tip&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When to replace tip&#039;&#039;&#039;:&lt;br /&gt;
* Pitting or holes in plating (copper core visible)&lt;br /&gt;
* Can&#039;t maintain tinning even after cleaning&lt;br /&gt;
* Tips are consumable ($5-10) and last 6-12 months with proper care&lt;br /&gt;
&lt;br /&gt;
== Part 4: Making Your First Solder Joint ==&lt;br /&gt;
&lt;br /&gt;
=== The Basic Technique ===&lt;br /&gt;
&lt;br /&gt;
Creating a solder joint has four steps:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Heat the joint&#039;&#039;&#039; (not the solder)&lt;br /&gt;
# &#039;&#039;&#039;Apply solder to the joint&#039;&#039;&#039; (not the iron)&lt;br /&gt;
# &#039;&#039;&#039;Wait for solder to flow&#039;&#039;&#039; (1-2 seconds)&lt;br /&gt;
# &#039;&#039;&#039;Remove iron and hold steady&#039;&#039;&#039; (2-3 seconds while cooling)&lt;br /&gt;
&lt;br /&gt;
=== Step-by-Step: Through-Hole Resistor ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Setup:&#039;&#039;&#039;&lt;br /&gt;
* Insert resistor leads through perfboard holes&lt;br /&gt;
* Bend leads slightly on bottom to hold in place&lt;br /&gt;
* Position board so you can access solder side&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Soldering:&#039;&#039;&#039;&lt;br /&gt;
# Clean and tin iron tip&lt;br /&gt;
# Touch iron to both pad and component lead (contact both!)&lt;br /&gt;
# Wait 0.5-1 second for heat transfer&lt;br /&gt;
# Apply solder wire to the junction of pad and lead (not to iron tip)&lt;br /&gt;
# Solder should melt and flow smoothly around lead and onto pad&lt;br /&gt;
# Remove solder wire (joint should have small amount of solder)&lt;br /&gt;
# Remove iron (total contact time 2-3 seconds)&lt;br /&gt;
# Hold component steady for 2-3 seconds while solder solidifies&lt;br /&gt;
# Solder changes from shiny-liquid to matte-solid when cooled&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What you should see:&#039;&#039;&#039;&lt;br /&gt;
* Solder flows smoothly onto pad and up component lead&lt;br /&gt;
* Forms concave &amp;quot;fillet&amp;quot; shape (like volcano)&lt;br /&gt;
* Shiny, smooth surface after cooling&lt;br /&gt;
* No excess solder (blob) or insufficient solder (barely wetting)&lt;br /&gt;
&lt;br /&gt;
=== Common Mistakes (And How to Fix Them) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mistake 1: Cold Joint&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Appearance&#039;&#039;&#039;: Dull, grainy, crystalline surface&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Insufficient heat - solder didn&#039;t flow properly&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Re-heat joint until solder melts and flows smoothly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mistake 2: Too Much Solder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Appearance&#039;&#039;&#039;: Large blob obscuring pad and lead&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Remove excess with solder wick (see Part 7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mistake 3: Disturbed Joint&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Appearance&#039;&#039;&#039;: Cracks, irregular surface&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Component moved before solder fully solidified&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Re-heat until solder melts, hold steady while cooling&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mistake 4: Insufficient Solder&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Appearance&#039;&#039;&#039;: Solder barely touches pad or lead, no fillet&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Re-heat and add more solder&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mistake 5: Solder Won&#039;t Flow&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Dirty/oxidized surfaces or insufficient heat&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Clean surfaces, increase temperature 10-20°C, use flux&lt;br /&gt;
&lt;br /&gt;
== Part 5: Recognizing Good Solder Joints ==&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Ideal&amp;quot; Solder Joint ===&lt;br /&gt;
&lt;br /&gt;
A properly made through-hole solder joint has:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Shiny surface&#039;&#039;&#039; - Smooth, reflective (not dull or grainy)&lt;br /&gt;
# &#039;&#039;&#039;Concave fillet&#039;&#039;&#039; - Solder flows up lead in smooth curve (volcano shape)&lt;br /&gt;
# &#039;&#039;&#039;Complete wetting&#039;&#039;&#039; - Solder visibly adheres to both pad and lead&lt;br /&gt;
# &#039;&#039;&#039;Appropriate amount&#039;&#039;&#039; - Enough to form fillet, not a blob&lt;br /&gt;
# &#039;&#039;&#039;Pad fully covered&#039;&#039;&#039; - No exposed copper on pad&lt;br /&gt;
# &#039;&#039;&#039;Lead well-coated&#039;&#039;&#039; - Solder flows partway up component lead&lt;br /&gt;
&lt;br /&gt;
=== Visual Inspection Checklist ===&lt;br /&gt;
&lt;br /&gt;
Examine each joint under magnification if possible:&lt;br /&gt;
&lt;br /&gt;
☐ &#039;&#039;&#039;Shiny, not dull&#039;&#039;&#039; - Indicates proper temperature and flow&amp;lt;br&amp;gt;&lt;br /&gt;
☐ &#039;&#039;&#039;Concave fillet&#039;&#039;&#039; - Not ball-shaped or flat&amp;lt;br&amp;gt;&lt;br /&gt;
☐ &#039;&#039;&#039;No cracks&#039;&#039;&#039; - Joint wasn&#039;t disturbed while cooling&amp;lt;br&amp;gt;&lt;br /&gt;
☐ &#039;&#039;&#039;No bridges&#039;&#039;&#039; - Adjacent pads not connected by solder&amp;lt;br&amp;gt;&lt;br /&gt;
☐ &#039;&#039;&#039;Pad visible&#039;&#039;&#039; - Can see solder flowed onto pad&amp;lt;br&amp;gt;&lt;br /&gt;
☐ &#039;&#039;&#039;Lead visible&#039;&#039;&#039; - Can see solder flowed up lead&lt;br /&gt;
&lt;br /&gt;
=== Bad Joint Examples ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cold joint&#039;&#039;&#039;:&lt;br /&gt;
* Dull, grainy, crystalline appearance&lt;br /&gt;
* Solder didn&#039;t flow properly at temperature&lt;br /&gt;
* Poor electrical connection, may fail intermittently&lt;br /&gt;
* Fix: Re-heat until solder melts and flows smoothly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Insufficient solder&#039;&#039;&#039;:&lt;br /&gt;
* Pad or lead not fully wetted&lt;br /&gt;
* May look like solder &amp;quot;balled up&amp;quot; instead of flowing&lt;br /&gt;
* Poor mechanical strength&lt;br /&gt;
* Fix: Add more solder while heating&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Excess solder&#039;&#039;&#039;:&lt;br /&gt;
* Large blob, can&#039;t see pad or lead&lt;br /&gt;
* Wastes solder, may hide defects underneath&lt;br /&gt;
* Fix: Remove excess with solder wick&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solder bridge&#039;&#039;&#039;:&lt;br /&gt;
* Unwanted solder connection between adjacent pads&lt;br /&gt;
* Causes short circuit&lt;br /&gt;
* Fix: Remove with solder wick or carefully with iron&lt;br /&gt;
&lt;br /&gt;
== Part 6: Wire Soldering ==&lt;br /&gt;
&lt;br /&gt;
Robots need soldered wire connections for motors, batteries, and sensors.&lt;br /&gt;
&lt;br /&gt;
=== Soldering Stranded Wire to Terminal ===&lt;br /&gt;
&lt;br /&gt;
Stranded wire (multiple thin strands) is flexible but requires tinning:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Strip insulation&#039;&#039;&#039; - Remove 3-4mm (just enough to fit in terminal)&lt;br /&gt;
# &#039;&#039;&#039;Twist strands together&#039;&#039;&#039; - All strands aligned, no fraying&lt;br /&gt;
# &#039;&#039;&#039;Tin the wire&#039;&#039;&#039; - Heat wire end, apply solder until solder wicks into strands&lt;br /&gt;
# &#039;&#039;&#039;Position in terminal&#039;&#039;&#039; - Insert tinned wire into terminal hole or pad&lt;br /&gt;
# &#039;&#039;&#039;Solder joint&#039;&#039;&#039; - Heat terminal and wire, add solder if needed (wire may have enough)&lt;br /&gt;
# &#039;&#039;&#039;Hold steady&#039;&#039;&#039; - Wait 2-3 seconds for solder to solidify&lt;br /&gt;
# &#039;&#039;&#039;Tug test&#039;&#039;&#039; - Gently pull wire - should not come loose&lt;br /&gt;
&lt;br /&gt;
=== Why Tinning Matters ===&lt;br /&gt;
&lt;br /&gt;
Untinned stranded wire:&lt;br /&gt;
* Individual strands don&#039;t all make contact&lt;br /&gt;
* Strands can fray and short to adjacent terminals&lt;br /&gt;
* Difficult to insert into terminal holes&lt;br /&gt;
&lt;br /&gt;
Tinned stranded wire:&lt;br /&gt;
* Behaves like solid wire (all strands bonded)&lt;br /&gt;
* Easy to insert into holes&lt;br /&gt;
* All strands make electrical contact&lt;br /&gt;
&lt;br /&gt;
=== Soldering Solid Wire ===&lt;br /&gt;
&lt;br /&gt;
Solid core wire (single thick strand) doesn&#039;t require tinning:&lt;br /&gt;
# Strip 3-4mm insulation&lt;br /&gt;
# Insert wire into terminal or wrap around post&lt;br /&gt;
# Heat wire and terminal together&lt;br /&gt;
# Apply solder - flows onto wire and terminal&lt;br /&gt;
# Hold steady while cooling&lt;br /&gt;
&lt;br /&gt;
== Part 7: Desoldering Basics ==&lt;br /&gt;
&lt;br /&gt;
Mistakes happen. You need to remove solder or components sometimes.&lt;br /&gt;
&lt;br /&gt;
=== Desoldering with Solder Wick (Braid) ===&lt;br /&gt;
&lt;br /&gt;
Solder wick is braided copper wire that absorbs molten solder:&lt;br /&gt;
&lt;br /&gt;
# Place wick on top of unwanted solder&lt;br /&gt;
# Press hot iron tip onto wick (heats solder through wick)&lt;br /&gt;
# Solder melts and wicks into braid by capillary action&lt;br /&gt;
# Remove iron and wick together (solder solidifies in wick)&lt;br /&gt;
# Cut off used section of wick, repeat if needed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Apply flux to wick for better solder absorption&lt;br /&gt;
* Press firmly - good contact needed for heat transfer&lt;br /&gt;
* Fresh wick works better than saturated wick&lt;br /&gt;
&lt;br /&gt;
=== Desoldering with Solder Sucker (Pump) ===&lt;br /&gt;
&lt;br /&gt;
Solder sucker is spring-loaded vacuum pump:&lt;br /&gt;
&lt;br /&gt;
# Heat solder joint until molten&lt;br /&gt;
# Position sucker tip near molten solder&lt;br /&gt;
# Press sucker button - creates vacuum, sucks up solder&lt;br /&gt;
# Clean sucker tip before next use&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tips:&#039;&#039;&#039;&lt;br /&gt;
* Position sucker before pressing button (solder solidifies quickly)&lt;br /&gt;
* May need multiple attempts for large joints&lt;br /&gt;
* Works best on through-hole joints&lt;br /&gt;
&lt;br /&gt;
=== Removing Through-Hole Components ===&lt;br /&gt;
&lt;br /&gt;
# Heat one lead, pull component gently (don&#039;t force!)&lt;br /&gt;
# Heat other lead, pull gently&lt;br /&gt;
# Alternate heating leads until component releases&lt;br /&gt;
# Alternative: Use solder wick or sucker to remove all solder first, then pull component&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Excessive force can lift pads (damage PCB). Heat sufficiently before pulling.&lt;br /&gt;
&lt;br /&gt;
== Part 8: Practice Exercises ==&lt;br /&gt;
&lt;br /&gt;
Before attempting SimpleBot PCB assembly, practice these exercises:&lt;br /&gt;
&lt;br /&gt;
=== Exercise 1: Basic Through-Hole (20-30 joints) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: Perfboard, 10-15 resistors, solder&lt;br /&gt;
&lt;br /&gt;
# Insert resistors in perfboard (space them out)&lt;br /&gt;
# Solder one lead of each resistor&lt;br /&gt;
# Inspect each joint - shiny? Concave fillet?&lt;br /&gt;
# Solder second lead of each resistor&lt;br /&gt;
# Inspect all joints&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Consistent, shiny joints with proper fillet shape.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 2: Wire Soldering (5-10 wires) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: Stranded wire, terminal blocks or pads&lt;br /&gt;
&lt;br /&gt;
# Cut 5 wire pieces (5cm each)&lt;br /&gt;
# Strip and tin each wire&lt;br /&gt;
# Solder wires to terminals or pads&lt;br /&gt;
# Tug test each wire&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Secure wire connections that don&#039;t pull loose.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 3: Close-Pitched Joints (IC Socket) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: Perfboard, IC socket (14-pin or 16-pin)&lt;br /&gt;
&lt;br /&gt;
# Insert IC socket in perfboard&lt;br /&gt;
# Solder all pins (pay attention to spacing)&lt;br /&gt;
# Inspect for solder bridges between adjacent pins&lt;br /&gt;
# Use wick to remove any bridges&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: All pins soldered without bridges.&lt;br /&gt;
&lt;br /&gt;
=== Exercise 4: Desoldering Practice ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Materials&#039;&#039;&#039;: Previously soldered perfboard, solder wick or sucker&lt;br /&gt;
&lt;br /&gt;
# Remove 5 resistors using solder wick&lt;br /&gt;
# Remove 5 resistors using solder sucker (if available)&lt;br /&gt;
# Inspect pads - should be clean and intact&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal&#039;&#039;&#039;: Remove components without damaging pads.&lt;br /&gt;
&lt;br /&gt;
== Part 9: SimpleBot PCB Assembly ==&lt;br /&gt;
&lt;br /&gt;
You&#039;re now ready to assemble the [[SimpleBot]] PCB!&lt;br /&gt;
&lt;br /&gt;
=== Component Order (Solder Shortest First) ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Resistors&#039;&#039;&#039; - Flat against board, solder from bottom&lt;br /&gt;
# &#039;&#039;&#039;Capacitors&#039;&#039;&#039; - Watch polarity on electrolytic capacitors&lt;br /&gt;
# &#039;&#039;&#039;IC sockets&#039;&#039;&#039; - Notch indicates pin 1 direction&lt;br /&gt;
# &#039;&#039;&#039;Headers&#039;&#039;&#039; - Hold straight while soldering first pin&lt;br /&gt;
# &#039;&#039;&#039;Terminal blocks&#039;&#039;&#039; - Large joints, may need more heat&lt;br /&gt;
# &#039;&#039;&#039;Inspect&#039;&#039;&#039; - Check every joint before continuing&lt;br /&gt;
&lt;br /&gt;
=== SimpleBot-Specific Tips ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Motor terminals&#039;&#039;&#039; - Large joints require higher heat and more solder&lt;br /&gt;
* &#039;&#039;&#039;Power connector&#039;&#039;&#039; - Double-check polarity before soldering&lt;br /&gt;
* &#039;&#039;&#039;Pin headers&#039;&#039;&#039; - Tack one pin first, adjust if crooked, then solder rest&lt;br /&gt;
* &#039;&#039;&#039;IC orientation&#039;&#039;&#039; - Notch or dot indicates pin 1&lt;br /&gt;
&lt;br /&gt;
Full assembly guide: [[SimpleBot:PCB Assembly]]&lt;br /&gt;
&lt;br /&gt;
== Part 10: Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Problem: Solder Won&#039;t Melt ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Temperature too low&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Increase iron temperature 10-20°C&lt;br /&gt;
&lt;br /&gt;
=== Problem: Solder Balls Up Instead of Flowing ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Oxidized surfaces or insufficient flux&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Clean surfaces with brass wool, apply flux, increase heat&lt;br /&gt;
&lt;br /&gt;
=== Problem: Iron Tip is Black/Brown ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Oxidized tip (not tinned properly)&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Clean with brass wool, immediately tin with fresh solder&lt;br /&gt;
&lt;br /&gt;
=== Problem: Joint Looks Good But Fails Electrically ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Cold joint - solder didn&#039;t bond despite appearance&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Re-heat joint until solder melts and flows smoothly&lt;br /&gt;
&lt;br /&gt;
=== Problem: Component Gets Too Hot ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Taking too long to solder (heat soaking component)&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Work faster (2-3 seconds per joint), use higher temperature for faster heat transfer&lt;br /&gt;
&lt;br /&gt;
=== Problem: Lifted Pad ===&lt;br /&gt;
* &#039;&#039;&#039;Cause&#039;&#039;&#039;: Excessive force or heat damaged adhesive between pad and PCB&lt;br /&gt;
* &#039;&#039;&#039;Fix&#039;&#039;&#039;: Solder component lead directly to trace (requires scraping soldermask), or use jumper wire&lt;br /&gt;
&lt;br /&gt;
== Part 11: Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Set up soldering iron and set appropriate temperature&lt;br /&gt;
* ☐ Tin the iron tip before and during work&lt;br /&gt;
* ☐ Make shiny through-hole solder joints&lt;br /&gt;
* ☐ Recognize good joints vs cold joints&lt;br /&gt;
* ☐ Solder stranded wire (strip, tin, solder)&lt;br /&gt;
* ☐ Identify and remove solder bridges&lt;br /&gt;
* ☐ Remove components with solder wick or sucker&lt;br /&gt;
* ☐ Trim component leads flush with joint&lt;br /&gt;
* ☐ Inspect joints with magnification&lt;br /&gt;
* ☐ Work safely (glasses, ventilation, iron stand)&lt;br /&gt;
&lt;br /&gt;
If you can check all these boxes, you&#039;re ready to assemble [[SimpleBot]]!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Build SimpleBot ===&lt;br /&gt;
Apply your soldering skills:&lt;br /&gt;
* [[SimpleBot]] - Full robot build guide&lt;br /&gt;
* [[SimpleBot:PCB Assembly]] - Detailed soldering instructions for SimpleBot PCB&lt;br /&gt;
&lt;br /&gt;
=== Learn Advanced Techniques ===&lt;br /&gt;
* [[Soldering Techniques]] - SMD soldering, hot air rework, desoldering&lt;br /&gt;
* [[Soldering]] - Full competency overview with intermediate and advanced topics&lt;br /&gt;
&lt;br /&gt;
=== Continue Practicing ===&lt;br /&gt;
* Electronics kits from SparkFun, Adafruit, or Digikey&lt;br /&gt;
* Solder practice boards (IC trainer boards, SMD practice boards)&lt;br /&gt;
* Dead electronics for desoldering practice&lt;br /&gt;
&lt;br /&gt;
== Common Beginner Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Not tinning the tip&#039;&#039;&#039; - Single biggest cause of poor results; tin frequently!&lt;br /&gt;
* &#039;&#039;&#039;Temperature too low&#039;&#039;&#039; - Solder doesn&#039;t flow; increase 10-20°C&lt;br /&gt;
* &#039;&#039;&#039;Not cleaning tip&#039;&#039;&#039; - Wipe on brass wool before every joint&lt;br /&gt;
* &#039;&#039;&#039;Applying solder to iron instead of joint&#039;&#039;&#039; - Prevents proper wetting&lt;br /&gt;
* &#039;&#039;&#039;Pulling on component before solder solidifies&#039;&#039;&#039; - Creates disturbed joint&lt;br /&gt;
* &#039;&#039;&#039;Using too much solder&#039;&#039;&#039; - More is not better; use just enough for fillet&lt;br /&gt;
* &#039;&#039;&#039;Insufficient heat time&#039;&#039;&#039; - Solder needs time to flow; don&#039;t rush&lt;br /&gt;
* &#039;&#039;&#039;Working without ventilation&#039;&#039;&#039; - Flux fumes are irritating; open window or use fan&lt;br /&gt;
&lt;br /&gt;
== Tips for Success ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Practice first&#039;&#039;&#039; - 20-30 practice joints before real PCB&lt;br /&gt;
* &#039;&#039;&#039;Good lighting&#039;&#039;&#039; - See what you&#039;re doing (magnification helps too)&lt;br /&gt;
* &#039;&#039;&#039;Comfortable position&#039;&#039;&#039; - Steady hands require comfortable posture&lt;br /&gt;
* &#039;&#039;&#039;Take breaks&#039;&#039;&#039; - Hand fatigue leads to mistakes&lt;br /&gt;
* &#039;&#039;&#039;Inspect as you go&#039;&#039;&#039; - Catch problems early&lt;br /&gt;
* &#039;&#039;&#039;Don&#039;t rush&#039;&#039;&#039; - Speed comes with practice; focus on quality first&lt;br /&gt;
* &#039;&#039;&#039;Ask for help&#039;&#039;&#039; - Show your joints to experienced solderers for feedback&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Recommended Purchases for Beginners ===&lt;br /&gt;
* &#039;&#039;&#039;Soldering iron&#039;&#039;&#039; - Pinecil ($30) or Hakko FX-888D ($90)&lt;br /&gt;
* &#039;&#039;&#039;Solder&#039;&#039;&#039; - 0.8mm lead-free SAC305 ($10-15 for 50g)&lt;br /&gt;
* &#039;&#039;&#039;Safety glasses&#039;&#039;&#039; - Any ANSI-rated glasses ($5-10)&lt;br /&gt;
* &#039;&#039;&#039;Brass wool&#039;&#039;&#039; - Hakko 599B tip cleaner ($5)&lt;br /&gt;
* &#039;&#039;&#039;Practice kit&#039;&#039;&#039; - Through-hole soldering practice board ($10-20)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total budget&#039;&#039;&#039;: $60-150&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.sparkfun.com/tutorials/106 SparkFun: How to Solder - Through-Hole]&lt;br /&gt;
* [https://www.youtube.com/watch?v=QKbJxytERvg Pace: Basic Soldering Lesson 1] (video)&lt;br /&gt;
* [https://www.youtube.com/watch?v=vIT4ra6Mo0s EEVblog: Soldering Tutorial] (video)&lt;br /&gt;
* [https://www.ifixit.com/Guide/How+to+Solder+and+Desolder+Connections/750 iFixit: Soldering Guide]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Soldering]] - Full competency overview&lt;br /&gt;
* [[Soldering Techniques]] - Intermediate tutorial (SMD, hot air rework)&lt;br /&gt;
* [[SimpleBot]] - Apply your skills to build a robot&lt;br /&gt;
* [[Electronics]] - Understanding what you&#039;re soldering and why&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Soldering]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Soldering&amp;diff=76</id>
		<title>Soldering</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Soldering&amp;diff=76"/>
		<updated>2025-10-11T20:13:13Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=Soldering |description=The hands-on technique of joining electronic components to circuit boards |difficulty_range=Beginner to Advanced |time_to_basic=1-2 days |essential_tools=Soldering iron ($20-50), lead-free solder, safety glasses, ventilation |optional_tools=Helping hands, solder wick, flux pen, hot air station |beginner_tutorial=Soldering Guide |unlocks_basic=SimpleBot PCB assembly, basic electronics repair |unlocks_advanced=SMD assembly,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=Soldering&lt;br /&gt;
|description=The hands-on technique of joining electronic components to circuit boards&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=1-2 days&lt;br /&gt;
|essential_tools=Soldering iron ($20-50), lead-free solder, safety glasses, ventilation&lt;br /&gt;
|optional_tools=Helping hands, solder wick, flux pen, hot air station&lt;br /&gt;
|beginner_tutorial=[[Soldering Guide]]&lt;br /&gt;
|unlocks_basic=[[SimpleBot]] PCB assembly, basic electronics repair&lt;br /&gt;
|unlocks_advanced=SMD assembly, PCB rework, custom sensor modules&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Soldering&#039;&#039;&#039; is the competency of physically joining electronic components to circuit boards using molten metal. In robotics, soldering is essential for assembling PCBs, connecting sensors and motors, and creating permanent electrical connections that withstand vibration and movement.&lt;br /&gt;
&lt;br /&gt;
Soldering is distinct from [[Electronics]] (understanding circuits and components) and [[PCB Design]] (creating circuit board layouts). This competency focuses on the &#039;&#039;&#039;hands-on fabrication technique&#039;&#039;&#039;: heating the iron, forming good joints, avoiding cold solder and bridges, and safely working with molten metal.&lt;br /&gt;
&lt;br /&gt;
== Why Soldering Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
Robots need permanent electrical connections:&lt;br /&gt;
* &#039;&#039;&#039;PCB assembly&#039;&#039;&#039; - Attach components to circuit boards (SimpleBot PCB, motor driver boards)&lt;br /&gt;
* &#039;&#039;&#039;Wire connections&#039;&#039;&#039; - Secure wires to connectors and components&lt;br /&gt;
* &#039;&#039;&#039;Sensor modules&#039;&#039;&#039; - Build custom sensors and breakout boards&lt;br /&gt;
* &#039;&#039;&#039;Repair&#039;&#039;&#039; - Fix broken connections, replace damaged components&lt;br /&gt;
&lt;br /&gt;
Without soldering skills, you&#039;re limited to breadboards and pre-assembled modules. Soldering unlocks:&lt;br /&gt;
* Building robots with custom PCBs&lt;br /&gt;
* Creating robust connections that survive robot movement&lt;br /&gt;
* Repairing damaged electronics&lt;br /&gt;
* Designing and fabricating your own sensor modules&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (SimpleBot Level) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to assemble [[SimpleBot]] PCB:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Safety fundamentals&#039;&#039;&#039; - Eye protection, ventilation, burn prevention&lt;br /&gt;
* &#039;&#039;&#039;Iron temperature control&#039;&#039;&#039; - Set appropriate temperature (300-350°C for lead-free)&lt;br /&gt;
* &#039;&#039;&#039;Tinning the tip&#039;&#039;&#039; - Keep the tip coated with fresh solder&lt;br /&gt;
* &#039;&#039;&#039;Through-hole soldering&#039;&#039;&#039; - Insert component leads, solder from bottom&lt;br /&gt;
* &#039;&#039;&#039;Solder joint inspection&#039;&#039;&#039; - Recognize good joints vs cold joints vs bridges&lt;br /&gt;
* &#039;&#039;&#039;Wire soldering&#039;&#039;&#039; - Strip insulation, tin wire, solder to terminal&lt;br /&gt;
* &#039;&#039;&#039;Basic desoldering&#039;&#039;&#039; - Remove excess solder with solder sucker or wick&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[SimpleBot]] PCB assembly (resistors, capacitors, headers, motor terminals)&lt;br /&gt;
* Basic sensor module assembly&lt;br /&gt;
* Wire-to-board connections for motors and batteries&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Soldering Guide]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Assemble through-hole PCB kits&lt;br /&gt;
* Solder headers and terminals to breakout boards&lt;br /&gt;
* Create secure wire connections&lt;br /&gt;
* Troubleshoot basic soldering issues&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (SMD and Rework) ===&lt;br /&gt;
&lt;br /&gt;
Skills for advanced PCB assembly and repair:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;SMD hand soldering&#039;&#039;&#039; - 0805/0603 resistors and capacitors with iron and tweezers&lt;br /&gt;
* &#039;&#039;&#039;Hot air rework&#039;&#039;&#039; - Remove and replace SMD components with hot air&lt;br /&gt;
* &#039;&#039;&#039;Flux usage&#039;&#039;&#039; - Apply flux for better solder flow and heat transfer&lt;br /&gt;
* &#039;&#039;&#039;Desoldering techniques&#039;&#039;&#039; - Solder wick, solder sucker, hot air removal&lt;br /&gt;
* &#039;&#039;&#039;Component rework&#039;&#039;&#039; - Replace damaged ICs and connectors&lt;br /&gt;
* &#039;&#039;&#039;Drag soldering&#039;&#039;&#039; - Efficiently solder multi-pin ICs&lt;br /&gt;
* &#039;&#039;&#039;Solder paste application&#039;&#039;&#039; - Apply paste for reflow or hot air soldering&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Hand-assembly of SMD PCBs (motor drivers, sensor boards)&lt;br /&gt;
* Repair of existing electronics (broken traces, lifted pads, damaged components)&lt;br /&gt;
* Custom sensor modules with SMD components&lt;br /&gt;
* Prototype boards with mixed through-hole and SMD&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Soldering Techniques]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Hand-solder SMD components down to 0603 size&lt;br /&gt;
* Rework and repair PCBs with hot air and desoldering tools&lt;br /&gt;
* Replace damaged connectors and ICs&lt;br /&gt;
* Assemble custom sensor modules&lt;br /&gt;
&lt;br /&gt;
=== Advanced (Fine-Pitch and Production) ===&lt;br /&gt;
&lt;br /&gt;
Skills for complex assemblies and production-quality work:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Fine-pitch SMD&#039;&#039;&#039; - 0402 components, TQFP, QFN packages (0.5mm pitch or finer)&lt;br /&gt;
* &#039;&#039;&#039;Reflow soldering&#039;&#039;&#039; - Use reflow oven or hot plate for solder paste assembly&lt;br /&gt;
* &#039;&#039;&#039;BGA rework&#039;&#039;&#039; - Ball grid array component removal and replacement&lt;br /&gt;
* &#039;&#039;&#039;Microscope work&#039;&#039;&#039; - Solder under magnification for fine-pitch components&lt;br /&gt;
* &#039;&#039;&#039;Thermal management&#039;&#039;&#039; - Preheat boards, manage heat-sensitive components&lt;br /&gt;
* &#039;&#039;&#039;Quality control&#039;&#039;&#039; - Inspect joints with microscope, identify defects&lt;br /&gt;
* &#039;&#039;&#039;Production techniques&#039;&#039;&#039; - Efficient workflows, jigs, and fixtures&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Complete PCB assembly for complex robots&lt;br /&gt;
* Reflow soldering for production quantities&lt;br /&gt;
* Repair of laptop/phone electronics (fine-pitch work)&lt;br /&gt;
* Custom high-density sensor arrays&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: Advanced soldering resources (external)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Assemble any PCB design, regardless of component density&lt;br /&gt;
* Rework complex multi-layer boards&lt;br /&gt;
* Set up production soldering workflows&lt;br /&gt;
* Troubleshoot and repair professional electronics&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: SimpleBot Builder (Beginner) ===&lt;br /&gt;
# Read [[Soldering Guide]] - Learn safety, technique, and practice on scrap&lt;br /&gt;
# Practice on perfboard or practice kit (20-30 joints to build muscle memory)&lt;br /&gt;
# Assemble [[SimpleBot]] PCB - Through-hole components only&lt;br /&gt;
# Inspect joints and fix any cold solder or bridges&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can confidently assemble through-hole PCBs for robotics projects.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: SMD Assembler (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (SimpleBot Builder)&lt;br /&gt;
# Study [[Soldering Techniques]] - SMD soldering and hot air rework&lt;br /&gt;
# Practice SMD soldering on breakout boards (start with 0805, work down to 0603)&lt;br /&gt;
# Assemble an SMD motor driver or sensor board&lt;br /&gt;
# Learn desoldering with solder wick and hot air&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can hand-assemble SMD boards and perform PCB rework.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Production Assembly (Advanced) ===&lt;br /&gt;
# Complete Path 2 (SMD Assembler)&lt;br /&gt;
# Learn reflow soldering (hot plate or reflow oven)&lt;br /&gt;
# Practice fine-pitch soldering (TQFP, QFN) under microscope&lt;br /&gt;
# Set up efficient workflows with jigs and fixtures&lt;br /&gt;
# Study IPC-A-610 soldering standards&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can assemble production-quality PCBs and manage complex assemblies.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Good Solder Joint Characteristics ===&lt;br /&gt;
&lt;br /&gt;
A proper solder joint has:&lt;br /&gt;
* &#039;&#039;&#039;Shiny appearance&#039;&#039;&#039; - Smooth, reflective surface (not dull or grainy)&lt;br /&gt;
* &#039;&#039;&#039;Concave fillet&#039;&#039;&#039; - Solder flows up the lead in a smooth curve (volcano shape)&lt;br /&gt;
* &#039;&#039;&#039;Complete wetting&#039;&#039;&#039; - Solder adheres to both pad and component lead&lt;br /&gt;
* &#039;&#039;&#039;No excess solder&#039;&#039;&#039; - Just enough to form a fillet (not a blob)&lt;br /&gt;
* &#039;&#039;&#039;No cold joint&#039;&#039;&#039; - Solder flowed properly at temperature (not crystalline)&lt;br /&gt;
&lt;br /&gt;
=== Temperature Control ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Lead solder&#039;&#039;&#039; (60/40 Sn/Pb) - Melts at 183°C, work at 300-330°C&lt;br /&gt;
* &#039;&#039;&#039;Lead-free solder&#039;&#039;&#039; (SAC305, 96.5/3.0/0.5 Sn/Ag/Cu) - Melts at 217°C, work at 320-370°C&lt;br /&gt;
* &#039;&#039;&#039;Too cold&#039;&#039;&#039; - Solder doesn&#039;t flow, forms cold joints&lt;br /&gt;
* &#039;&#039;&#039;Too hot&#039;&#039;&#039; - Damages components, lifts pads, oxidizes tip faster&lt;br /&gt;
&lt;br /&gt;
=== Heat Transfer ===&lt;br /&gt;
&lt;br /&gt;
Good solder joints require heating both the pad and the component lead:&lt;br /&gt;
# Touch iron tip to pad and lead simultaneously&lt;br /&gt;
# Apply solder to the joint (not the iron tip)&lt;br /&gt;
# Solder flows toward heat - if it balls up, increase heat or clean surfaces&lt;br /&gt;
# Remove iron after solder flows smoothly around joint (1-3 seconds)&lt;br /&gt;
&lt;br /&gt;
=== Flux ===&lt;br /&gt;
&lt;br /&gt;
Flux is the &amp;quot;secret ingredient&amp;quot; that makes soldering work:&lt;br /&gt;
* &#039;&#039;&#039;Removes oxidation&#039;&#039;&#039; - Cleans metal surfaces for better wetting&lt;br /&gt;
* &#039;&#039;&#039;Improves heat transfer&#039;&#039;&#039; - Helps solder flow smoothly&lt;br /&gt;
* &#039;&#039;&#039;Prevents oxidation&#039;&#039;&#039; - Protects joint while hot&lt;br /&gt;
* &#039;&#039;&#039;Types&#039;&#039;&#039;: Rosin (mildly corrosive, common), No-clean (low residue), Water-soluble (requires cleaning)&lt;br /&gt;
&lt;br /&gt;
Most solder has a flux core, but additional flux improves results on difficult joints.&lt;br /&gt;
&lt;br /&gt;
=== Common Soldering Defects ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Cold joint&#039;&#039;&#039; - Dull, grainy appearance; solder didn&#039;t flow properly (re-heat to fix)&lt;br /&gt;
* &#039;&#039;&#039;Solder bridge&#039;&#039;&#039; - Unwanted connection between adjacent pads (remove with solder wick)&lt;br /&gt;
* &#039;&#039;&#039;Insufficient solder&#039;&#039;&#039; - Joint doesn&#039;t fully wet pad or lead (add more solder)&lt;br /&gt;
* &#039;&#039;&#039;Excess solder&#039;&#039;&#039; - Large blob that may hide defects (remove excess with wick)&lt;br /&gt;
* &#039;&#039;&#039;Lifted pad&#039;&#039;&#039; - Pad separated from PCB due to excessive heat or force (difficult repair)&lt;br /&gt;
* &#039;&#039;&#039;Tombstoning&#039;&#039;&#039; - SMD component stands on end (one side heated before the other)&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Tools (Start Here) ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Soldering iron&#039;&#039;&#039; ($20-50) - Temperature-controlled preferred (Hakko FX-888D, Pinecil, TS100)&lt;br /&gt;
* &#039;&#039;&#039;Solder&#039;&#039;&#039; ($10-15) - 0.8mm diameter lead-free (SAC305) or 60/40 leaded for practice&lt;br /&gt;
* &#039;&#039;&#039;Safety glasses&#039;&#039;&#039; ($5-10) - Protect eyes from solder spatter&lt;br /&gt;
* &#039;&#039;&#039;Solder stand&#039;&#039;&#039; ($5-10) - Safe place to rest hot iron&lt;br /&gt;
* &#039;&#039;&#039;Brass wool or sponge&#039;&#039;&#039; ($5) - Clean iron tip&lt;br /&gt;
* &#039;&#039;&#039;Wire cutters&#039;&#039;&#039; ($10-15) - Trim component leads after soldering&lt;br /&gt;
* &#039;&#039;&#039;Ventilation&#039;&#039;&#039; (free-$50) - Work near open window or use fume extractor fan&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total beginner budget&#039;&#039;&#039;: $50-100&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tools ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Helping hands&#039;&#039;&#039; ($10-30) - Third hand to hold PCBs and wires&lt;br /&gt;
* &#039;&#039;&#039;Solder wick&#039;&#039;&#039; ($5-10) - Braided copper removes excess solder&lt;br /&gt;
* &#039;&#039;&#039;Desoldering pump&#039;&#039;&#039; ($5-15) - Suck up molten solder&lt;br /&gt;
* &#039;&#039;&#039;Flux pen&#039;&#039;&#039; ($5-10) - Apply extra flux for difficult joints&lt;br /&gt;
* &#039;&#039;&#039;Tip cleaner&#039;&#039;&#039; ($5-10) - Brass wool more effective than wet sponge&lt;br /&gt;
* &#039;&#039;&#039;Magnifying lamp&#039;&#039;&#039; ($20-50) - Inspect joints and work with small components&lt;br /&gt;
* &#039;&#039;&#039;Tweezers&#039;&#039;&#039; ($5-15) - Place and hold SMD components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total intermediate budget&#039;&#039;&#039;: $50-150 (plus beginner tools)&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tools ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hot air rework station&#039;&#039;&#039; ($50-150) - Remove and replace SMD components&lt;br /&gt;
* &#039;&#039;&#039;Soldering microscope&#039;&#039;&#039; ($100-400) - 10-20× magnification for fine-pitch work&lt;br /&gt;
* &#039;&#039;&#039;Reflow oven or hot plate&#039;&#039;&#039; ($50-300) - Solder paste assembly&lt;br /&gt;
* &#039;&#039;&#039;Chip Quik or low-temp solder&#039;&#039;&#039; ($10-20) - Ease removal of multi-pin ICs&lt;br /&gt;
* &#039;&#039;&#039;PCB vise&#039;&#039;&#039; ($20-50) - Secure PCBs for rework&lt;br /&gt;
* &#039;&#039;&#039;Temperature-controlled preheater&#039;&#039;&#039; ($50-200) - Preheat boards for large components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total advanced budget&#039;&#039;&#039;: $300-1000+ (plus beginner and intermediate tools)&lt;br /&gt;
&lt;br /&gt;
== Safety Considerations ==&lt;br /&gt;
&lt;br /&gt;
Soldering involves high temperatures and fumes:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Burns&#039;&#039;&#039; - Soldering irons reach 300-400°C; tip can cause instant injury&lt;br /&gt;
* &#039;&#039;&#039;Eye protection&#039;&#039;&#039; - Solder spatter and clipped component leads can fly&lt;br /&gt;
* &#039;&#039;&#039;Fumes&#039;&#039;&#039; - Flux produces irritating smoke; work with ventilation&lt;br /&gt;
* &#039;&#039;&#039;Lead exposure&#039;&#039;&#039; - Use lead-free solder or wash hands after handling leaded solder&lt;br /&gt;
* &#039;&#039;&#039;Fire hazard&#039;&#039;&#039; - Iron can ignite paper, plastic, fabric; use metal stand&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Safety rules&#039;&#039;&#039;:&lt;br /&gt;
# Always wear safety glasses&lt;br /&gt;
# Work in ventilated area (fume extractor or open window)&lt;br /&gt;
# Never leave hot iron unattended&lt;br /&gt;
# Use soldering iron stand when not actively soldering&lt;br /&gt;
# Keep flammable materials away from work area&lt;br /&gt;
# Wash hands after soldering (especially with leaded solder)&lt;br /&gt;
&lt;br /&gt;
== Component-Specific Techniques ==&lt;br /&gt;
&lt;br /&gt;
=== Through-Hole Components (Resistors, Capacitors, Headers) ===&lt;br /&gt;
&lt;br /&gt;
# Insert component leads through holes from top side&lt;br /&gt;
# Bend leads slightly on bottom to hold component in place&lt;br /&gt;
# Solder from bottom side: heat pad and lead together, apply solder&lt;br /&gt;
# Trim excess lead flush with solder joint&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot PCB assembly uses through-hole components throughout.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Wire Soldering ===&lt;br /&gt;
&lt;br /&gt;
# Strip 2-3mm of insulation from wire&lt;br /&gt;
# Tin the wire: heat wire, apply small amount of solder&lt;br /&gt;
# Position tinned wire in terminal or pad&lt;br /&gt;
# Heat wire and terminal together, add solder if needed&lt;br /&gt;
# Hold steady until solder solidifies (1-2 seconds)&lt;br /&gt;
&lt;br /&gt;
=== SMD Resistors and Capacitors ===&lt;br /&gt;
&lt;br /&gt;
# Apply flux to pads&lt;br /&gt;
# Tin one pad with small amount of solder&lt;br /&gt;
# Place component on pads with tweezers, heat tinned pad to tack in place&lt;br /&gt;
# Solder opposite end: heat pad and component, apply solder&lt;br /&gt;
# Re-flow first side if needed to ensure good joint&lt;br /&gt;
&lt;br /&gt;
=== IC Chips (Through-Hole) ===&lt;br /&gt;
&lt;br /&gt;
# Use IC socket if possible (avoids heat damage, allows replacement)&lt;br /&gt;
# If soldering directly: insert IC, tack opposite corners first&lt;br /&gt;
# Solder all pins quickly (avoid prolonged heating)&lt;br /&gt;
# Inspect for bridges between adjacent pins&lt;br /&gt;
&lt;br /&gt;
=== IC Chips (SMD) ===&lt;br /&gt;
&lt;br /&gt;
# Align IC with pads, tack one corner pin&lt;br /&gt;
# Apply flux generously to all pins&lt;br /&gt;
# Use drag soldering: draw iron tip across pins with small amount of solder on tip&lt;br /&gt;
# Solder bridges across pins, then draw iron to separate&lt;br /&gt;
# Alternative: Solder each pin individually with fine-tip iron&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Not tinning the tip&#039;&#039;&#039; - Oxidized tip won&#039;t transfer heat; tin tip before every few joints&lt;br /&gt;
* &#039;&#039;&#039;Too much solder&#039;&#039;&#039; - Obscures defects and wastes material; use just enough to form fillet&lt;br /&gt;
* &#039;&#039;&#039;Moving joint before solidification&#039;&#039;&#039; - Creates cold joint; hold steady 1-2 seconds&lt;br /&gt;
* &#039;&#039;&#039;Heating component instead of joint&#039;&#039;&#039; - Apply heat to pad and lead, not component body&lt;br /&gt;
* &#039;&#039;&#039;Dirty or oxidized surfaces&#039;&#039;&#039; - Clean with flux or abrasive before soldering&lt;br /&gt;
* &#039;&#039;&#039;Wrong temperature&#039;&#039;&#039; - Too cold = cold joints, too hot = lifted pads and damaged components&lt;br /&gt;
* &#039;&#039;&#039;Poor ventilation&#039;&#039;&#039; - Flux fumes are irritating; always work with airflow&lt;br /&gt;
&lt;br /&gt;
== Practice Recommendations ==&lt;br /&gt;
&lt;br /&gt;
Before attempting SimpleBot PCB assembly:&lt;br /&gt;
&lt;br /&gt;
=== Beginner Practice (1-2 hours) ===&lt;br /&gt;
# Practice on perfboard or scrap PCB: solder 20-30 through-hole resistor leads&lt;br /&gt;
# Inspect each joint: shiny? Concave fillet? No cold joints?&lt;br /&gt;
# Practice wire soldering: solder stranded wire to terminal blocks&lt;br /&gt;
# Desolder practice: remove components with solder wick or sucker&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Practice (2-4 hours) ===&lt;br /&gt;
# Hand-solder 0805 SMD resistors/capacitors (practice kit or breakout board)&lt;br /&gt;
# Practice hot air rework: remove and replace SMD components&lt;br /&gt;
# Work down to 0603 components once comfortable with 0805&lt;br /&gt;
# Practice drag soldering on SOIC or TQFP chips&lt;br /&gt;
&lt;br /&gt;
=== Quality Check ===&lt;br /&gt;
Use magnifying glass to inspect joints:&lt;br /&gt;
* No cold joints (dull, grainy appearance)&lt;br /&gt;
* No bridges between adjacent pins&lt;br /&gt;
* Complete wetting on pad and lead&lt;br /&gt;
* Shiny, smooth surface&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering Guide]]&#039;&#039;&#039; (Beginner) - Start here for through-hole soldering fundamentals&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering Techniques]]&#039;&#039;&#039; (Intermediate) - SMD soldering, desoldering, rework&lt;br /&gt;
&lt;br /&gt;
=== Implementation Pages ===&lt;br /&gt;
* [[SimpleBot]] - Through-hole PCB assembly guide&lt;br /&gt;
* [[SimpleBot:PCB Assembly]] - Step-by-step SimpleBot soldering instructions&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.sparkfun.com/tutorials/106 SparkFun: How to Solder]&lt;br /&gt;
* [https://www.youtube.com/watch?v=QKbJxytERvg Pace: Basic Soldering] (video)&lt;br /&gt;
* [https://www.youtube.com/watch?v=5uiroWBkdFY Pace: SMD Soldering] (video)&lt;br /&gt;
* [https://www.ipc.org/ipc-a-610 IPC-A-610] - Industry standard for soldering quality&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Understand circuits and components before soldering them&lt;br /&gt;
* &#039;&#039;&#039;[[PCB Design]]&#039;&#039;&#039; - Design circuit boards that you&#039;ll assemble with soldering&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Mechanical assembly often requires soldered wire connections&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Print jigs and fixtures for holding PCBs during soldering&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[SimpleBot]] - Apply soldering skills to build a robot&lt;br /&gt;
* [[Capabilities]] - Hardware abilities that require soldered assemblies&lt;br /&gt;
* [[Robotics Ontology]] - How soldering fits into BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing_Basics&amp;diff=75</id>
		<title>3D Printing Basics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing_Basics&amp;diff=75"/>
		<updated>2025-10-11T20:12:53Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=3D Printing Basics |competency=3D Printing |difficulty=Beginner |time=4-6 hours (spread over multiple sessions) |prerequisites=None - complete beginner friendly |materials=FDM 3D printer, PLA filament (1kg), slicer software (free), spatula, flush cutters |next_steps=SimpleBot assembly, 3D Printing for Robotics, CAD Design }}  &amp;#039;&amp;#039;&amp;#039;3D Printing Basics&amp;#039;&amp;#039;&amp;#039; is your complete introduction to fabricating robot parts using FDM (Fused Deposition Mode...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=3D Printing Basics&lt;br /&gt;
|competency=[[3D Printing]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=4-6 hours (spread over multiple sessions)&lt;br /&gt;
|prerequisites=None - complete beginner friendly&lt;br /&gt;
|materials=FDM 3D printer, PLA filament (1kg), slicer software (free), spatula, flush cutters&lt;br /&gt;
|next_steps=[[SimpleBot]] assembly, [[3D Printing for Robotics]], [[CAD Design]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3D Printing Basics&#039;&#039;&#039; is your complete introduction to fabricating robot parts using FDM (Fused Deposition Modeling) 3D printing. This tutorial takes you from unboxing a printer to successfully printing [[SimpleBot]] components.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll be able to:&lt;br /&gt;
* Set up and calibrate your 3D printer&lt;br /&gt;
* Use slicer software to prepare models for printing&lt;br /&gt;
* Successfully print your first parts&lt;br /&gt;
* Troubleshoot common failures&lt;br /&gt;
* Print all components for SimpleBot&lt;br /&gt;
* Post-process and assemble printed parts&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;completely hands-on&#039;&#039;&#039;. You&#039;ll need a working FDM printer (recommendations below) and basic tools.&lt;br /&gt;
&lt;br /&gt;
== What You&#039;ll Need ==&lt;br /&gt;
&lt;br /&gt;
=== Required Equipment ===&lt;br /&gt;
* &#039;&#039;&#039;3D Printer&#039;&#039;&#039; - FDM printer with minimum 180×180×180mm build volume&lt;br /&gt;
** Recommended: Creality Ender 3 V2 ($200-250), Prusa Mini+ ($400), Artillery Genius ($300)&lt;br /&gt;
* &#039;&#039;&#039;PLA Filament&#039;&#039;&#039; - 1kg spool, 1.75mm diameter ($15-25)&lt;br /&gt;
** Color doesn&#039;t matter functionally, but white/black are easiest to see layer quality&lt;br /&gt;
* &#039;&#039;&#039;Slicer Software&#039;&#039;&#039; - Free software to convert models to printer instructions&lt;br /&gt;
** Recommended: PrusaSlicer (works with any printer, not just Prusa)&lt;br /&gt;
** Alternative: Cura (more beginner-friendly interface)&lt;br /&gt;
* &#039;&#039;&#039;Computer&#039;&#039;&#039; - Windows, Mac, or Linux to run slicer software&lt;br /&gt;
&lt;br /&gt;
=== Required Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Spatula or scraper&#039;&#039;&#039; ($5-10) - Remove prints from bed (often included with printer)&lt;br /&gt;
* &#039;&#039;&#039;Flush cutters&#039;&#039;&#039; ($5-10) - Remove supports and clean up prints&lt;br /&gt;
* &#039;&#039;&#039;Isopropyl alcohol&#039;&#039;&#039; 70-90% ($5) - Clean print bed&lt;br /&gt;
&lt;br /&gt;
=== Helpful But Optional ===&lt;br /&gt;
* &#039;&#039;&#039;Calipers&#039;&#039;&#039; ($15-30) - Measure prints to check accuracy&lt;br /&gt;
* &#039;&#039;&#039;Needle files&#039;&#039;&#039; ($10-20) - Clean up holes and edges&lt;br /&gt;
* &#039;&#039;&#039;Glue stick&#039;&#039;&#039; ($2) - Extra bed adhesion for difficult prints&lt;br /&gt;
* &#039;&#039;&#039;Filament storage container&#039;&#039;&#039; ($10-20) - Keep filament dry&lt;br /&gt;
&lt;br /&gt;
== Part 1: Understanding Your 3D Printer ==&lt;br /&gt;
&lt;br /&gt;
=== FDM Printer Anatomy ===&lt;br /&gt;
&lt;br /&gt;
Your printer has these key components:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Print bed&#039;&#039;&#039; (heated platform) - Where the part is built&lt;br /&gt;
** Heats to 50-100°C to prevent warping&lt;br /&gt;
** Must be level and clean for adhesion&lt;br /&gt;
* &#039;&#039;&#039;Hot end&#039;&#039;&#039; (extruder nozzle) - Melts and deposits plastic&lt;br /&gt;
** Heats to 180-220°C for PLA&lt;br /&gt;
** Nozzle is typically 0.4mm diameter&lt;br /&gt;
* &#039;&#039;&#039;Extruder&#039;&#039;&#039; (filament feeder) - Pushes filament into hot end&lt;br /&gt;
** Bowden tube (tube between feeder and hot end) or direct drive (feeder mounted on hot end)&lt;br /&gt;
* &#039;&#039;&#039;Motion system&#039;&#039;&#039; - Moves hot end in XYZ axes&lt;br /&gt;
** Belts, stepper motors, linear rails&lt;br /&gt;
* &#039;&#039;&#039;Controller board&#039;&#039;&#039; - Computer that runs the printer&lt;br /&gt;
** Reads G-code files from SD card or USB&lt;br /&gt;
* &#039;&#039;&#039;Display&#039;&#039;&#039; - Interface to control printer&lt;br /&gt;
** Start prints, adjust temperature, move axes&lt;br /&gt;
&lt;br /&gt;
=== First Time Setup (Assembly) ===&lt;br /&gt;
&lt;br /&gt;
Most budget printers require some assembly. Follow manufacturer instructions, but key steps:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Attach gantry to base&#039;&#039;&#039; - Usually pre-assembled, just bolt together&lt;br /&gt;
# &#039;&#039;&#039;Install print bed&#039;&#039;&#039; - Connect heated bed power and thermistor&lt;br /&gt;
# &#039;&#039;&#039;Run cables&#039;&#039;&#039; - Route wires neatly, use cable clips&lt;br /&gt;
# &#039;&#039;&#039;Install bowden tube&#039;&#039;&#039; - Push into fittings on extruder and hot end&lt;br /&gt;
# &#039;&#039;&#039;Verify motion&#039;&#039;&#039; - Manually move axes (power off) - should move smoothly with no binding&lt;br /&gt;
# &#039;&#039;&#039;Check wiring&#039;&#039;&#039; - Loose wires can cause fires! Verify all connections tight&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Safety check before first power-on:&#039;&#039;&#039;&lt;br /&gt;
* ☐ All screws tight (especially bed and gantry)&lt;br /&gt;
* ☐ Belts tensioned (not too loose, not too tight)&lt;br /&gt;
* ☐ Wires secured, not touching hot end or bed&lt;br /&gt;
* ☐ No shipping zip ties or packing material left on moving parts&lt;br /&gt;
&lt;br /&gt;
=== First Power On ===&lt;br /&gt;
&lt;br /&gt;
# Plug in printer and turn on power switch&lt;br /&gt;
# Display should light up with home screen&lt;br /&gt;
# &#039;&#039;&#039;DO NOT start a print yet!&#039;&#039;&#039; - Must level bed first&lt;br /&gt;
&lt;br /&gt;
Navigate the menu:&lt;br /&gt;
* Most printers use a rotary knob (turn to move, press to select)&lt;br /&gt;
* Find the temperature display - should show room temperature (~20-25°C)&lt;br /&gt;
* Find the axis movement controls - you&#039;ll need these for bed leveling&lt;br /&gt;
&lt;br /&gt;
== Part 2: Bed Leveling (Most Critical Step) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bed leveling&#039;&#039;&#039; is the single most important step for successful prints. The nozzle must be exactly the right distance from the bed across the entire surface.&lt;br /&gt;
&lt;br /&gt;
=== Why Bed Leveling Matters ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Too close&#039;&#039;&#039; - Nozzle drags through plastic, clogs, scrapes bed&lt;br /&gt;
* &#039;&#039;&#039;Too far&#039;&#039;&#039; - Plastic doesn&#039;t stick, print fails in first layer&lt;br /&gt;
* &#039;&#039;&#039;Uneven&#039;&#039;&#039; - Works on one side, fails on other side&lt;br /&gt;
&lt;br /&gt;
You must level the bed:&lt;br /&gt;
* When you first set up the printer&lt;br /&gt;
* After moving the printer&lt;br /&gt;
* Periodically (every 5-10 prints) to maintain accuracy&lt;br /&gt;
&lt;br /&gt;
=== Manual Bed Leveling Procedure ===&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need:&lt;br /&gt;
* A piece of paper (printer paper works fine)&lt;br /&gt;
* 10-15 minutes of patience&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Steps:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Home all axes&#039;&#039;&#039; - Use printer menu: Prepare → Auto Home&lt;br /&gt;
** Nozzle moves to home position (usually front-left corner)&lt;br /&gt;
# &#039;&#039;&#039;Disable steppers&#039;&#039;&#039; - Menu: Prepare → Disable Steppers&lt;br /&gt;
** Now you can manually move the hot end&lt;br /&gt;
# &#039;&#039;&#039;Heat the nozzle&#039;&#039;&#039; (optional but recommended) - Menu: Prepare → Preheat PLA&lt;br /&gt;
** Bed and nozzle expand when hot; level when hot for best accuracy&lt;br /&gt;
# &#039;&#039;&#039;Position nozzle over first corner&#039;&#039;&#039; - Manually move hot end to front-left, just above bed&lt;br /&gt;
# &#039;&#039;&#039;Adjust bed corner knob&#039;&#039;&#039; - Turn knob under bed while sliding paper between nozzle and bed&lt;br /&gt;
** &#039;&#039;&#039;Goal&#039;&#039;&#039;: Paper should slide with slight friction (like writing on paper)&lt;br /&gt;
** Too loose? Tighten knob (turn clockwise)&lt;br /&gt;
** Too tight? Loosen knob (turn counter-clockwise)&lt;br /&gt;
# &#039;&#039;&#039;Repeat for all four corners&#039;&#039;&#039; - Front-left, front-right, back-right, back-left&lt;br /&gt;
# &#039;&#039;&#039;Check center of bed&#039;&#039;&#039; - Move nozzle to center, test with paper&lt;br /&gt;
** If center is different from corners, repeat the process&lt;br /&gt;
# &#039;&#039;&#039;Iterate&#039;&#039;&#039; - Go around all corners again. Adjusting one corner affects others slightly&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Target feeling:&#039;&#039;&#039; Paper should slide with noticeable resistance but not tear. You should feel the nozzle just barely touching through the paper.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Some people describe it as &amp;quot;dragging paper over a wooden table&amp;quot; feeling.&lt;br /&gt;
&lt;br /&gt;
=== Auto Bed Leveling (If Your Printer Has It) ===&lt;br /&gt;
&lt;br /&gt;
Higher-end printers (Prusa, some Creality models) have automatic bed leveling:&lt;br /&gt;
&lt;br /&gt;
# Attach probe or ensure sensor is working&lt;br /&gt;
# Menu: Prepare → Auto Bed Leveling or similar&lt;br /&gt;
# Printer probes multiple points on bed&lt;br /&gt;
# Creates a mesh to compensate for unevenness&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Even with auto bed leveling, you still need to set the initial Z-offset (nozzle-to-bed distance).&lt;br /&gt;
&lt;br /&gt;
== Part 3: Loading Filament ==&lt;br /&gt;
&lt;br /&gt;
=== Preparing Filament ===&lt;br /&gt;
&lt;br /&gt;
# Remove filament from sealed bag (if new)&lt;br /&gt;
# Inspect filament end - should be cleanly cut (if not, use flush cutters to cut at angle)&lt;br /&gt;
# Note the diameter: 1.75mm (most common) or 2.85mm (some printers)&lt;br /&gt;
&lt;br /&gt;
=== Loading Procedure ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Heat the nozzle&#039;&#039;&#039; - Menu: Prepare → Preheat PLA (nozzle to ~200°C)&lt;br /&gt;
# &#039;&#039;&#039;Wait for temperature&#039;&#039;&#039; - Display shows current and target temp&lt;br /&gt;
# &#039;&#039;&#039;Release extruder tension&#039;&#039;&#039; - Squeeze lever or loosen spring on extruder&lt;br /&gt;
# &#039;&#039;&#039;Insert filament&#039;&#039;&#039; - Push filament into extruder hole&lt;br /&gt;
** For Bowden tube systems: Push until it comes out the hot end (may take 30-50cm)&lt;br /&gt;
** For direct drive: Push until it comes out the nozzle (just a few cm)&lt;br /&gt;
# &#039;&#039;&#039;Extrude some plastic&#039;&#039;&#039; - Menu: Prepare → Move Axis → Extruder → Move 10mm&lt;br /&gt;
** Plastic should flow freely from nozzle&lt;br /&gt;
** If not, increase temperature by 5-10°C and try again&lt;br /&gt;
# &#039;&#039;&#039;Check extrusion&#039;&#039;&#039; - Plastic should come out smooth and consistent, not bubbly or clumpy&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Have paper towel ready to wipe excess plastic from nozzle.&lt;br /&gt;
&lt;br /&gt;
=== Unloading Filament ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Heat nozzle&#039;&#039;&#039; to printing temperature (~200°C for PLA)&lt;br /&gt;
# &#039;&#039;&#039;Retract filament&#039;&#039;&#039; - Menu: Prepare → Move Axis → Extruder → Move -10mm&lt;br /&gt;
** Or squeeze extruder lever and pull filament out manually&lt;br /&gt;
# &#039;&#039;&#039;Store filament&#039;&#039;&#039; - Wind onto spool, secure end with clip or tape&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why store properly?&#039;&#039;&#039; PLA absorbs moisture from air, which causes print quality issues (bubbling, poor layer adhesion).&lt;br /&gt;
&lt;br /&gt;
== Part 4: Your First Print - Calibration Cube ==&lt;br /&gt;
&lt;br /&gt;
=== Getting the STL File ===&lt;br /&gt;
&lt;br /&gt;
A calibration cube is a simple 20mm × 20mm × 20mm cube used to test printer accuracy.&lt;br /&gt;
&lt;br /&gt;
# Search online: &amp;quot;20mm calibration cube STL&amp;quot;&lt;br /&gt;
# Download from Thingiverse, Printables, or similar site&lt;br /&gt;
# Save to your computer (file will be named something like `calibration_cube.stl`)&lt;br /&gt;
&lt;br /&gt;
=== Introduction to Slicer Software ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Slicer software&#039;&#039;&#039; converts 3D models (STL files) into instructions (G-code) for your printer.&lt;br /&gt;
&lt;br /&gt;
# Download and install PrusaSlicer: https://www.prusa3d.com/prusaslicer/&lt;br /&gt;
# Launch PrusaSlicer&lt;br /&gt;
# First-time setup wizard:&lt;br /&gt;
** Select your printer manufacturer (or Generic for non-listed printers)&lt;br /&gt;
** Select your printer model (if listed) or closest match&lt;br /&gt;
** Select filament type: PLA&lt;br /&gt;
** Complete wizard&lt;br /&gt;
&lt;br /&gt;
=== Importing and Slicing the Cube ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Import STL&#039;&#039;&#039; - File → Import → Import STL/OBJ, select calibration cube&lt;br /&gt;
# &#039;&#039;&#039;Position model&#039;&#039;&#039; - Should automatically be on center of bed&lt;br /&gt;
** If not: Right-click model → Center&lt;br /&gt;
# &#039;&#039;&#039;Check scale&#039;&#039;&#039; - Model should be 20mm × 20mm × 20mm (verify in right panel)&lt;br /&gt;
# &#039;&#039;&#039;Configure print settings&#039;&#039;&#039; (right panel):&lt;br /&gt;
** &#039;&#039;&#039;Layer height&#039;&#039;&#039;: 0.2mm (good balance of speed and quality)&lt;br /&gt;
** &#039;&#039;&#039;Infill&#039;&#039;&#039;: 20% (sufficient for test)&lt;br /&gt;
** &#039;&#039;&#039;Supports&#039;&#039;&#039;: None (cube doesn&#039;t need them)&lt;br /&gt;
** &#039;&#039;&#039;Brim&#039;&#039;&#039;: Yes (helps adhesion for first print)&lt;br /&gt;
# &#039;&#039;&#039;Slice&#039;&#039;&#039; - Click &amp;quot;Slice now&amp;quot; button (bottom right)&lt;br /&gt;
# &#039;&#039;&#039;Review preview&#039;&#039;&#039;:&lt;br /&gt;
** Click &amp;quot;Preview&amp;quot; button (bottom right)&lt;br /&gt;
** Use slider to see layer by layer&lt;br /&gt;
** Check that first layer looks good (should be solid, covering bed area)&lt;br /&gt;
# &#039;&#039;&#039;Export G-code&#039;&#039;&#039; - Click &amp;quot;Export G-code&amp;quot; button&lt;br /&gt;
** Save to SD card or USB drive&lt;br /&gt;
&lt;br /&gt;
=== Print Settings Explained ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Layer height&#039;&#039;&#039; (0.2mm) - Thickness of each layer&lt;br /&gt;
** Smaller = smoother, slower (0.1mm for high detail)&lt;br /&gt;
** Larger = faster, rougher (0.3mm for draft prints)&lt;br /&gt;
* &#039;&#039;&#039;Infill&#039;&#039;&#039; (20%) - Internal structure density&lt;br /&gt;
** Higher = stronger, heavier, slower (30-50% for structural parts)&lt;br /&gt;
** Lower = lighter, faster (10-15% for non-structural parts)&lt;br /&gt;
* &#039;&#039;&#039;Perimeters&#039;&#039;&#039; (2-3) - Number of outer wall layers&lt;br /&gt;
** More = stronger, better surface finish&lt;br /&gt;
* &#039;&#039;&#039;Brim&#039;&#039;&#039; - Extra layer around base (helps adhesion, easy to remove)&lt;br /&gt;
* &#039;&#039;&#039;Raft&#039;&#039;&#039; - Platform under entire part (use for difficult adhesion, wastes material)&lt;br /&gt;
* &#039;&#039;&#039;Supports&#039;&#039;&#039; - Temporary structures to hold overhangs (remove after printing)&lt;br /&gt;
&lt;br /&gt;
=== Starting the Print ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Insert SD card&#039;&#039;&#039; into printer&lt;br /&gt;
# &#039;&#039;&#039;Clean the bed&#039;&#039;&#039; - Wipe with isopropyl alcohol, let dry&lt;br /&gt;
# &#039;&#039;&#039;Verify bed level&#039;&#039;&#039; - Do a final check with paper if uncertain&lt;br /&gt;
# &#039;&#039;&#039;Start print&#039;&#039;&#039; - Menu: Print from SD → select G-code file&lt;br /&gt;
# &#039;&#039;&#039;Watch the first layer&#039;&#039;&#039; - This is critical!&lt;br /&gt;
&lt;br /&gt;
=== Watching the First Layer ===&lt;br /&gt;
&lt;br /&gt;
Stand and watch the entire first layer print. This determines success:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good first layer:&#039;&#039;&#039;&lt;br /&gt;
* Plastic is squished slightly onto bed (not round, slightly flat)&lt;br /&gt;
* Lines are touching each other with no gaps&lt;br /&gt;
* Plastic is not being pushed around by nozzle&lt;br /&gt;
* Print is adhering firmly to bed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bad first layer (stop and restart):&#039;&#039;&#039;&lt;br /&gt;
* Lines are round (nozzle too high - adjust bed lower)&lt;br /&gt;
* Nozzle drags through plastic (too low - raise bed)&lt;br /&gt;
* Gaps between lines (too high)&lt;br /&gt;
* Plastic not sticking to bed (bed too cold, dirty, or not level)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If first layer fails:&#039;&#039;&#039; Stop the print, adjust bed leveling, clean bed, try again.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If first layer succeeds:&#039;&#039;&#039; You can leave it to print! Check back periodically.&lt;br /&gt;
&lt;br /&gt;
=== Print Complete ===&lt;br /&gt;
&lt;br /&gt;
When print finishes:&lt;br /&gt;
# &#039;&#039;&#039;Let bed cool&#039;&#039;&#039; - Print will often pop off on its own as bed cools&lt;br /&gt;
# &#039;&#039;&#039;Gently flex bed&#039;&#039;&#039; (if removable spring steel sheet) - Print pops off&lt;br /&gt;
# &#039;&#039;&#039;Use spatula&#039;&#039;&#039; - Slide under edge of print, pry gently&lt;br /&gt;
# &#039;&#039;&#039;Remove brim&#039;&#039;&#039; - Use flush cutters or hands to remove brim material&lt;br /&gt;
&lt;br /&gt;
Inspect your cube:&lt;br /&gt;
* Measure with calipers: Should be close to 20mm × 20mm × 20mm (±0.2mm is good)&lt;br /&gt;
* Check corners: Should be square and sharp&lt;br /&gt;
* Check walls: Should be solid and smooth&lt;br /&gt;
&lt;br /&gt;
Congratulations on your first successful print!&lt;br /&gt;
&lt;br /&gt;
== Part 5: Troubleshooting Common First Print Problems ==&lt;br /&gt;
&lt;br /&gt;
=== Print Not Sticking to Bed ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Causes and solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Bed not level&#039;&#039;&#039; - Re-level bed, nozzle should be slightly closer&lt;br /&gt;
* &#039;&#039;&#039;Bed too cold&#039;&#039;&#039; - Increase bed temperature by 5-10°C (try 65°C for PLA)&lt;br /&gt;
* &#039;&#039;&#039;Bed dirty&#039;&#039;&#039; - Clean with isopropyl alcohol&lt;br /&gt;
* &#039;&#039;&#039;Nozzle too far&#039;&#039;&#039; - Lower bed (turn corner knobs clockwise)&lt;br /&gt;
* &#039;&#039;&#039;First layer too fast&#039;&#039;&#039; - Slow down first layer speed in slicer (50% of normal)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extra help:&#039;&#039;&#039; Apply glue stick to bed for difficult adhesion.&lt;br /&gt;
&lt;br /&gt;
=== Lines Not Touching (Gaps in First Layer) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cause:&#039;&#039;&#039; Nozzle too far from bed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution:&#039;&#039;&#039; Adjust bed level - turn corner knobs clockwise to bring bed closer to nozzle.&lt;br /&gt;
&lt;br /&gt;
=== Nozzle Dragging/Scraping ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cause:&#039;&#039;&#039; Nozzle too close to bed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solution:&#039;&#039;&#039; Adjust bed level - turn corner knobs counter-clockwise to lower bed away from nozzle.&lt;br /&gt;
&lt;br /&gt;
=== Print Warping (Corners Lifting) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Causes and solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Bed too cold&#039;&#039;&#039; - Increase bed temperature&lt;br /&gt;
* &#039;&#039;&#039;Rapid cooling&#039;&#039;&#039; - Close windows, avoid drafts&lt;br /&gt;
* &#039;&#039;&#039;Poor adhesion&#039;&#039;&#039; - Clean bed, use brim or raft&lt;br /&gt;
* &#039;&#039;&#039;Part geometry&#039;&#039;&#039; - Large flat parts warp more (add brim or mouse ears at corners)&lt;br /&gt;
&lt;br /&gt;
=== Stringing (Thin Strings Between Parts) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Causes and solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Nozzle too hot&#039;&#039;&#039; - Reduce temperature by 5°C&lt;br /&gt;
* &#039;&#039;&#039;Retraction too low&#039;&#039;&#039; - Increase retraction distance in slicer (5-6mm for Bowden)&lt;br /&gt;
* &#039;&#039;&#039;Print too slow&#039;&#039;&#039; - Increase print speed slightly&lt;br /&gt;
&lt;br /&gt;
=== Layer Shifting (Print Offset Mid-Print) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Causes and solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Belts too loose&#039;&#039;&#039; - Tighten belts (should twang like guitar string when plucked)&lt;br /&gt;
* &#039;&#039;&#039;Speed too high&#039;&#039;&#039; - Reduce print speed&lt;br /&gt;
* &#039;&#039;&#039;Mechanical binding&#039;&#039;&#039; - Check that axes move freely, lubricate if needed&lt;br /&gt;
&lt;br /&gt;
=== Under-Extrusion (Gaps in Walls) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Causes and solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Nozzle partially clogged&#039;&#039;&#039; - Perform cold pull cleaning&lt;br /&gt;
* &#039;&#039;&#039;Temperature too low&#039;&#039;&#039; - Increase by 5-10°C&lt;br /&gt;
* &#039;&#039;&#039;Filament diameter wrong&#039;&#039;&#039; - Verify slicer is set to 1.75mm (or 2.85mm if that&#039;s what you have)&lt;br /&gt;
* &#039;&#039;&#039;Extruder gear slipping&#039;&#039;&#039; - Tighten extruder tension spring&lt;br /&gt;
&lt;br /&gt;
== Part 6: Printing SimpleBot Components ==&lt;br /&gt;
&lt;br /&gt;
Now that you&#039;ve successfully printed a calibration cube, you&#039;re ready for real robot parts!&lt;br /&gt;
&lt;br /&gt;
=== Downloading SimpleBot STL Files ===&lt;br /&gt;
&lt;br /&gt;
# Navigate to SimpleBot repository (linked from [[SimpleBot]] wiki page)&lt;br /&gt;
# Go to the `stl/` or `3d_models/` directory&lt;br /&gt;
# Download all STL files:&lt;br /&gt;
** Chassis base and top&lt;br /&gt;
** Motor mounts (left and right)&lt;br /&gt;
** Wheel hubs (2×)&lt;br /&gt;
** Sensor bracket&lt;br /&gt;
** Battery holder&lt;br /&gt;
** Any other structural components&lt;br /&gt;
&lt;br /&gt;
=== Print Order Recommendation ===&lt;br /&gt;
&lt;br /&gt;
Start with smallest parts first to gain confidence:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Sensor bracket&#039;&#039;&#039; (~1 hour) - Small, simple, good practice&lt;br /&gt;
# &#039;&#039;&#039;Wheel hubs&#039;&#039;&#039; (30-45 min each) - Small, verify fit with motor shaft&lt;br /&gt;
# &#039;&#039;&#039;Motor mounts&#039;&#039;&#039; (~2 hours each) - Test holes fit motors correctly&lt;br /&gt;
# &#039;&#039;&#039;Chassis base&#039;&#039;&#039; (~4-6 hours) - Large, important part&lt;br /&gt;
# &#039;&#039;&#039;Chassis top&#039;&#039;&#039; (~3-5 hours) - Can print while assembling other parts&lt;br /&gt;
&lt;br /&gt;
=== Slicer Settings for SimpleBot Parts ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General settings:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Layer height&#039;&#039;&#039;: 0.2mm (good balance)&lt;br /&gt;
* &#039;&#039;&#039;Infill&#039;&#039;&#039;: 20% (sufficient for most parts)&lt;br /&gt;
* &#039;&#039;&#039;Perimeters&#039;&#039;&#039;: 3 (strong outer walls)&lt;br /&gt;
* &#039;&#039;&#039;Supports&#039;&#039;&#039;: Usually not needed (parts designed to print without supports)&lt;br /&gt;
* &#039;&#039;&#039;Brim&#039;&#039;&#039;: Use for large parts (chassis) to prevent warping&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Part-specific notes:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Chassis&#039;&#039;&#039; - Large flat part, definitely use brim&lt;br /&gt;
* &#039;&#039;&#039;Motor mounts&#039;&#039;&#039; - Check hole sizes (may need to adjust scale if motors don&#039;t fit)&lt;br /&gt;
* &#039;&#039;&#039;Wheel hubs&#039;&#039;&#039; - Verify fit on motor shaft (may need light sanding)&lt;br /&gt;
* &#039;&#039;&#039;Sensor bracket&#039;&#039;&#039; - Ensure mounting holes align with sensors&lt;br /&gt;
&lt;br /&gt;
=== Print Time Estimates ===&lt;br /&gt;
&lt;br /&gt;
Total print time for all SimpleBot parts: &#039;&#039;&#039;15-20 hours&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Sensor bracket: 1 hour&lt;br /&gt;
* Wheel hubs (2×): 1.5 hours&lt;br /&gt;
* Motor mounts (2×): 4 hours&lt;br /&gt;
* Chassis base: 5 hours&lt;br /&gt;
* Chassis top: 4 hours&lt;br /&gt;
* Misc brackets: 2 hours&lt;br /&gt;
&lt;br /&gt;
You can print multiple small parts simultaneously to save time.&lt;br /&gt;
&lt;br /&gt;
=== Quality Check After Printing ===&lt;br /&gt;
&lt;br /&gt;
For each part:&lt;br /&gt;
* ☐ Verify dimensions with calipers (compare to CAD file or assembly guide)&lt;br /&gt;
* ☐ Check mounting holes - screws should fit (M3 typically)&lt;br /&gt;
* ☐ Test fit with hardware - motors, sensors, PCB&lt;br /&gt;
* ☐ Remove supports (if any) and clean up edges&lt;br /&gt;
* ☐ Light sanding if parts don&#039;t fit together smoothly&lt;br /&gt;
&lt;br /&gt;
== Part 7: Post-Processing Robot Parts ==&lt;br /&gt;
&lt;br /&gt;
=== Removing Supports ===&lt;br /&gt;
&lt;br /&gt;
If you printed parts with supports:&lt;br /&gt;
# Use flush cutters to clip large support structures&lt;br /&gt;
# Break away remaining supports by hand&lt;br /&gt;
# Use needle file or sandpaper to smooth support scars&lt;br /&gt;
# Check that surfaces are flat where parts mate&lt;br /&gt;
&lt;br /&gt;
=== Cleaning Up Holes ===&lt;br /&gt;
&lt;br /&gt;
Printed holes are often slightly undersized:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Clearance holes (screws pass through)&#039;&#039;&#039;:&lt;br /&gt;
** Use drill bit slightly larger than screw diameter&lt;br /&gt;
** Drill by hand (twist drill bit with fingers) or with drill&lt;br /&gt;
** Test fit frequently - don&#039;t remove too much material&lt;br /&gt;
* &#039;&#039;&#039;Press-fit holes (bearings, nuts)&#039;&#039;&#039;:&lt;br /&gt;
** May need light sanding with sandpaper wrapped around dowel&lt;br /&gt;
** Test fit frequently - goal is snug fit&lt;br /&gt;
* &#039;&#039;&#039;Threaded holes&#039;&#039;&#039;:&lt;br /&gt;
** Drill/print undersized (M3 screw needs 2.5mm hole)&lt;br /&gt;
** Use tap to cut threads&lt;br /&gt;
** Or just drive screw directly into plastic (works for low-stress applications)&lt;br /&gt;
&lt;br /&gt;
=== Fitting Parts Together ===&lt;br /&gt;
&lt;br /&gt;
Test assembly before final build:&lt;br /&gt;
# Dry-fit all parts (no glue, no screws)&lt;br /&gt;
# Identify any interference or misalignment&lt;br /&gt;
# Sand or file problem areas&lt;br /&gt;
# Re-test until smooth assembly&lt;br /&gt;
&lt;br /&gt;
=== Optional Finishing ===&lt;br /&gt;
&lt;br /&gt;
For a polished look:&lt;br /&gt;
* &#039;&#039;&#039;Sanding&#039;&#039;&#039; - Progressive grits (120 → 220 → 400) for smooth surface&lt;br /&gt;
* &#039;&#039;&#039;Primer and paint&#039;&#039;&#039; - Automotive filler primer hides layer lines&lt;br /&gt;
* &#039;&#039;&#039;Clear coat&#039;&#039;&#039; - Protects finish and adds shine&lt;br /&gt;
&lt;br /&gt;
Not necessary for functional robot parts, but makes them look professional.&lt;br /&gt;
&lt;br /&gt;
== Part 8: Assembling SimpleBot with Printed Parts ==&lt;br /&gt;
&lt;br /&gt;
Once all parts are printed and cleaned up:&lt;br /&gt;
&lt;br /&gt;
# Follow [[SimpleBot]] assembly guide&lt;br /&gt;
# Key steps:&lt;br /&gt;
** Mount motors into motor mounts using M3 screws&lt;br /&gt;
** Attach wheel hubs to motor shafts (may need small set screws)&lt;br /&gt;
** Mount PCB and electronics to chassis base&lt;br /&gt;
** Attach sensor bracket at front of chassis&lt;br /&gt;
** Mount line sensors to bracket&lt;br /&gt;
** Connect wiring according to schematic&lt;br /&gt;
** Attach chassis top&lt;br /&gt;
** Insert batteries&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Take photos during assembly to help with troubleshooting later.&lt;br /&gt;
&lt;br /&gt;
== Part 9: Maintenance and Care ==&lt;br /&gt;
&lt;br /&gt;
=== Printer Maintenance ===&lt;br /&gt;
&lt;br /&gt;
After every print:&lt;br /&gt;
* Remove print from bed&lt;br /&gt;
* Clean bed with isopropyl alcohol&lt;br /&gt;
* Inspect nozzle for plastic buildup (wipe with paper towel when hot)&lt;br /&gt;
&lt;br /&gt;
Weekly (if printing frequently):&lt;br /&gt;
* Check belt tension&lt;br /&gt;
* Lubricate linear rods/rails with machine oil&lt;br /&gt;
* Check all screws for tightness (vibration loosens them)&lt;br /&gt;
&lt;br /&gt;
Monthly:&lt;br /&gt;
* Re-level bed&lt;br /&gt;
* Check extruder gear for wear&lt;br /&gt;
* Clean fans and heat sinks&lt;br /&gt;
&lt;br /&gt;
=== Filament Storage ===&lt;br /&gt;
&lt;br /&gt;
PLA absorbs moisture from air, which causes:&lt;br /&gt;
* Bubbling during extrusion&lt;br /&gt;
* Poor layer adhesion&lt;br /&gt;
* Brittle prints&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Storage solution:&#039;&#039;&#039;&lt;br /&gt;
* Keep filament in sealed container with silica gel desiccant&lt;br /&gt;
* Some hobbyists use vacuum-sealed bags&lt;br /&gt;
* If filament gets wet, dry in oven at 40-50°C for 4-6 hours (or use filament dryer)&lt;br /&gt;
&lt;br /&gt;
=== Replacing Nozzles ===&lt;br /&gt;
&lt;br /&gt;
Nozzles wear out after 100-500 hours of printing:&lt;br /&gt;
* Abrasive filaments (carbon fiber, wood fill) wear fastest&lt;br /&gt;
* Symptoms: Under-extrusion, inconsistent extrusion&lt;br /&gt;
* Replacement: Heat to 200°C, unscrew old nozzle, screw in new one&lt;br /&gt;
&lt;br /&gt;
Keep spare 0.4mm nozzles on hand ($1-2 each in bulk).&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Continue Your 3D Printing Journey ===&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing for Robotics]]&#039;&#039;&#039; (Intermediate) - Learn to design custom parts for FDM printing&lt;br /&gt;
* &#039;&#039;&#039;[[CAD Design]]&#039;&#039;&#039; (Intermediate) - Create your own robot parts from scratch&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; (Competency Overview) - Explore intermediate and advanced techniques&lt;br /&gt;
&lt;br /&gt;
=== Build With Your New Skill ===&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot]]&#039;&#039;&#039; - Complete your robot assembly&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot:Line Following Implementation]]&#039;&#039;&#039; - Get SimpleBot following lines&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot:Dead Reckoning Implementation]]&#039;&#039;&#039; - Implement odometry navigation&lt;br /&gt;
&lt;br /&gt;
=== Expand Your Capabilities ===&lt;br /&gt;
* Print custom sensor mounts for new capabilities&lt;br /&gt;
* Design brackets for additional electronics&lt;br /&gt;
* Create custom wheels for different surfaces&lt;br /&gt;
* Build entirely new robot chassis designs&lt;br /&gt;
&lt;br /&gt;
== Common Beginner Questions ==&lt;br /&gt;
&lt;br /&gt;
=== Q: How do I know if my printer is working correctly? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Print a calibration cube and measure it. If dimensions are within 0.2mm of 20mm × 20mm × 20mm, your printer is well-calibrated.&lt;br /&gt;
&lt;br /&gt;
=== Q: My print failed. What do I do? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Identify the failure mode:&lt;br /&gt;
* Failed first layer → Bed leveling issue&lt;br /&gt;
* Warped corners → Bed temperature or adhesion issue&lt;br /&gt;
* Spaghetti mess → Lost adhesion mid-print, clean bed and re-level&lt;br /&gt;
* Layer shifting → Belt tension or mechanical issue&lt;br /&gt;
* Under-extrusion → Temperature, clog, or extruder issue&lt;br /&gt;
&lt;br /&gt;
=== Q: How long does filament last? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; 1kg of PLA prints approximately:&lt;br /&gt;
* 50-100 calibration cubes&lt;br /&gt;
* 3-4 complete SimpleBot chassis sets&lt;br /&gt;
* 10-20 smaller parts (brackets, mounts)&lt;br /&gt;
&lt;br /&gt;
=== Q: Can I leave prints running overnight? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Generally yes, but:&lt;br /&gt;
* Watch the first layer before leaving&lt;br /&gt;
* Ensure printer is on stable surface, away from flammable materials&lt;br /&gt;
* Some hobbyists use fire-resistant enclosures for peace of mind&lt;br /&gt;
* Consider cheap WiFi camera to monitor remotely&lt;br /&gt;
&lt;br /&gt;
=== Q: What if screws/motors don&#039;t fit printed parts? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Common issue due to printer tolerances:&lt;br /&gt;
* Holes too small → Drill them slightly larger&lt;br /&gt;
* Holes too large → Print at 101-102% scale, or use larger screws&lt;br /&gt;
* Shaft loose → Wrap with tape or print at 99% scale&lt;br /&gt;
&lt;br /&gt;
=== Q: Do I need supports for SimpleBot parts? ===&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; SimpleBot parts are designed to print without supports when properly oriented. If your slicer suggests supports, check the part orientation in the slicer.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Resources ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Teaching Tech Calibration&#039;&#039;&#039;: https://teachingtechyt.github.io/calibration.html&lt;br /&gt;
* &#039;&#039;&#039;Simplify3D Print Quality Guide&#039;&#039;&#039;: https://www.simplify3d.com/support/print-quality-troubleshooting/&lt;br /&gt;
* &#039;&#039;&#039;Reddit r/FixMyPrint&#039;&#039;&#039;: Community help for print issues&lt;br /&gt;
* &#039;&#039;&#039;3D Printing Discord servers&#039;&#039;&#039;: Real-time help from experienced users&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[3D Printing]] - Full competency overview&lt;br /&gt;
* [[SimpleBot]] - Build your first robot with printed parts&lt;br /&gt;
* [[3D Printing for Robotics]] - Next tutorial in the learning path&lt;br /&gt;
* [[CAD Design]] - Design your own parts to print&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:3D Printing]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing&amp;diff=74</id>
		<title>3D Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=3D_Printing&amp;diff=74"/>
		<updated>2025-10-11T20:12:29Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=3D Printing |description=Creating mechanical parts from plastic filament using FDM printing |difficulty_range=Beginner to Advanced |time_to_basic=1-2 weeks |essential_tools=FDM 3D printer ($200-400), PLA filament, slicer software |optional_tools=Calipers, flush cutters, deburring tool, adhesives |beginner_tutorial=3D Printing Basics |unlocks_basic=Custom chassis, sensor mounts, brackets, wheels |unlocks_advanced=Complex assemblies, living hinges, p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=3D Printing&lt;br /&gt;
|description=Creating mechanical parts from plastic filament using FDM printing&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=1-2 weeks&lt;br /&gt;
|essential_tools=FDM 3D printer ($200-400), PLA filament, slicer software&lt;br /&gt;
|optional_tools=Calipers, flush cutters, deburring tool, adhesives&lt;br /&gt;
|beginner_tutorial=[[3D Printing Basics]]&lt;br /&gt;
|unlocks_basic=Custom chassis, sensor mounts, brackets, wheels&lt;br /&gt;
|unlocks_advanced=Complex assemblies, living hinges, parametric designs, embedded hardware&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3D Printing&#039;&#039;&#039; is the competency of fabricating mechanical parts from digital designs using additive manufacturing. In robotics, 3D printing is the most accessible and affordable way to create custom chassis, brackets, sensor mounts, wheels, and structural components.&lt;br /&gt;
&lt;br /&gt;
This competency focuses specifically on &#039;&#039;&#039;FDM (Fused Deposition Modeling)&#039;&#039;&#039; printing - the cheapest and most common technology for hobbyist robotics. It&#039;s about the &#039;&#039;&#039;hands-on technique&#039;&#039;&#039; of turning digital CAD files into physical parts that work on real robots.&lt;br /&gt;
&lt;br /&gt;
3D Printing is distinct from [[CAD Design]] (creating the digital models) and [[Mechanics]] (understanding mechanical principles). This competency focuses on the &#039;&#039;&#039;fabrication process itself&#039;&#039;&#039;: preparing models for printing, selecting settings, troubleshooting failures, and finishing parts.&lt;br /&gt;
&lt;br /&gt;
== Why 3D Printing Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
3D printing revolutionized hobbyist robotics by eliminating barriers to custom mechanical design:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Affordability&#039;&#039;&#039; - Print custom parts for pennies instead of machining for dollars&lt;br /&gt;
* &#039;&#039;&#039;Rapid iteration&#039;&#039;&#039; - Redesign and reprint in hours, not weeks&lt;br /&gt;
* &#039;&#039;&#039;Complex geometry&#039;&#039;&#039; - Create shapes impossible to machine or cut&lt;br /&gt;
* &#039;&#039;&#039;No tooling&#039;&#039;&#039; - No need for mills, lathes, or specialized equipment&lt;br /&gt;
* &#039;&#039;&#039;On-demand manufacturing&#039;&#039;&#039; - Print what you need, when you need it&lt;br /&gt;
&lt;br /&gt;
Before accessible 3D printing, hobbyists were limited to:&lt;br /&gt;
* Off-the-shelf kits with fixed designs&lt;br /&gt;
* Simple laser-cut acrylic plates&lt;br /&gt;
* Hand-cutting/drilling materials with limited precision&lt;br /&gt;
* Expensive machine shop services&lt;br /&gt;
&lt;br /&gt;
Now, anyone with a $200-400 printer can create professional-quality robot parts at home.&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (SimpleBot Level) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to print and assemble [[SimpleBot]] parts:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Operating a printer&#039;&#039;&#039; - Bed leveling, loading filament, starting prints&lt;br /&gt;
* &#039;&#039;&#039;Using slicer software&#039;&#039;&#039; - Import STL, basic settings, generate G-code&lt;br /&gt;
* &#039;&#039;&#039;Print preparation&#039;&#039;&#039; - Bed adhesion, first layer success&lt;br /&gt;
* &#039;&#039;&#039;Basic troubleshooting&#039;&#039;&#039; - Warping, layer adhesion, stringing&lt;br /&gt;
* &#039;&#039;&#039;Post-processing&#039;&#039;&#039; - Removing supports, cleaning up prints, basic finishing&lt;br /&gt;
* &#039;&#039;&#039;Assembly&#039;&#039;&#039; - Inserting hardware (screws, nuts, bearings) into printed parts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Print SimpleBot chassis from provided STL files&lt;br /&gt;
* Print sensor brackets and motor mounts&lt;br /&gt;
* Print wheels and structural components&lt;br /&gt;
* Assemble printed parts into working robots&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[3D Printing Basics]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Print designs created by others (download STL files)&lt;br /&gt;
* Successfully produce functional parts for your robot&lt;br /&gt;
* Troubleshoot common print failures&lt;br /&gt;
* Assemble printed parts with hardware&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (Custom Robot Parts) ===&lt;br /&gt;
&lt;br /&gt;
Skills for designing and printing custom robot parts:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Design for FDM&#039;&#039;&#039; - Layer orientation, overhangs, support requirements&lt;br /&gt;
* &#039;&#039;&#039;Tolerances and fit&#039;&#039;&#039; - Designing holes, slots, and assemblies that fit together&lt;br /&gt;
* &#039;&#039;&#039;Print orientation&#039;&#039;&#039; - Choosing optimal orientation for strength and printability&lt;br /&gt;
* &#039;&#039;&#039;Support strategies&#039;&#039;&#039; - When to use supports, how to minimize them&lt;br /&gt;
* &#039;&#039;&#039;Advanced slicing&#039;&#039;&#039; - Variable layer height, infill patterns, perimeters&lt;br /&gt;
* &#039;&#039;&#039;Material selection&#039;&#039;&#039; - PLA vs PETG vs TPU for different applications&lt;br /&gt;
* &#039;&#039;&#039;Embedded hardware&#039;&#039;&#039; - Designing parts with captive nuts, heat-set inserts, bearings&lt;br /&gt;
* &#039;&#039;&#039;Iterative design&#039;&#039;&#039; - Measuring, adjusting, reprinting efficiently&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Design custom chassis for your robot concept&lt;br /&gt;
* Create mounting brackets for non-standard sensors&lt;br /&gt;
* Design wheel hubs, motor mounts, and gearing&lt;br /&gt;
* Print functional assemblies (hinges, latches, sliding parts)&lt;br /&gt;
* Adapt designs for different motors/sensors/components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[3D Printing for Robotics]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design parts from scratch that print successfully&lt;br /&gt;
* Modify existing designs to fit your needs&lt;br /&gt;
* Choose optimal print settings for different applications&lt;br /&gt;
* Design multi-part assemblies that fit together&lt;br /&gt;
* Troubleshoot dimensional accuracy issues&lt;br /&gt;
&lt;br /&gt;
=== Advanced (Complex Mechanical Systems) ===&lt;br /&gt;
&lt;br /&gt;
Skills for professional-grade printed mechanisms:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Parametric design&#039;&#039;&#039; - Use variables to create adjustable designs&lt;br /&gt;
* &#039;&#039;&#039;Living hinges&#039;&#039;&#039; - Print flexible joints in rigid materials&lt;br /&gt;
* &#039;&#039;&#039;Gear design&#039;&#039;&#039; - Print functional gears, belts, pulleys&lt;br /&gt;
* &#039;&#039;&#039;Multi-material printing&#039;&#039;&#039; - Combining rigid and flexible materials&lt;br /&gt;
* &#039;&#039;&#039;Thread design&#039;&#039;&#039; - Print functional threads for screws and bolts&lt;br /&gt;
* &#039;&#039;&#039;Strength optimization&#039;&#039;&#039; - Anisotropy, layer lines, infill strategies for load-bearing parts&lt;br /&gt;
* &#039;&#039;&#039;Tolerance stacks&#039;&#039;&#039; - Managing precision in complex assemblies&lt;br /&gt;
* &#039;&#039;&#039;Material properties&#039;&#039;&#039; - Engineering plastics (nylon, polycarbonate, carbon fiber composites)&lt;br /&gt;
* &#039;&#039;&#039;Surface finishing&#039;&#039;&#039; - Vapor smoothing, sanding, painting, coating&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* Gripper mechanisms with printed flexures&lt;br /&gt;
* Custom gearboxes and drivetrains&lt;br /&gt;
* Ball bearing races and sliding mechanisms&lt;br /&gt;
* Snap-fit enclosures and latches&lt;br /&gt;
* Load-bearing structural components&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Advanced FDM Techniques]] (stub)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design complex mechanisms entirely in plastic&lt;br /&gt;
* Replace machined metal parts with optimized prints&lt;br /&gt;
* Create production-quality assemblies&lt;br /&gt;
* Push the limits of FDM technology&lt;br /&gt;
* Teach others 3D printing for robotics&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: SimpleBot Builder (Beginner) ===&lt;br /&gt;
# Get a working FDM printer (Creality Ender 3, Prusa Mini, or similar)&lt;br /&gt;
# Complete [[3D Printing Basics]] - First successful print&lt;br /&gt;
# Download SimpleBot STL files from the repository&lt;br /&gt;
# Print all SimpleBot parts (chassis, motor mounts, wheels, brackets)&lt;br /&gt;
# Assemble [[SimpleBot]] using your printed parts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can print robot parts designed by others and assemble them into working robots.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Custom Parts Designer (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (SimpleBot Builder)&lt;br /&gt;
# Learn basic [[CAD Design]] (FreeCAD, Fusion 360, or Onshape)&lt;br /&gt;
# Study [[3D Printing for Robotics]] - Design principles for FDM&lt;br /&gt;
# Design a custom sensor mount for SimpleBot&lt;br /&gt;
# Iterate on the design (measure, adjust, reprint)&lt;br /&gt;
# Document your design as an implementation page&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design custom parts that integrate with existing robots.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Mechanism Designer (Advanced) ===&lt;br /&gt;
# Complete Path 2 (Custom Parts Designer)&lt;br /&gt;
# Design a complete custom robot chassis from scratch&lt;br /&gt;
# Incorporate complex features (living hinges, embedded nuts, snap fits)&lt;br /&gt;
# Design multi-part assemblies (gripper, articulated arm, gearbox)&lt;br /&gt;
# Test and iterate on mechanical performance&lt;br /&gt;
# Share your design with the community&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design complete robots and complex mechanisms using 3D printing.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== FDM Process Basics ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fused Deposition Modeling&#039;&#039;&#039; works by:&lt;br /&gt;
# &#039;&#039;&#039;Heating&#039;&#039;&#039; plastic filament (typically 190-220°C for PLA)&lt;br /&gt;
# &#039;&#039;&#039;Extruding&#039;&#039;&#039; melted plastic through a nozzle (typically 0.4mm)&lt;br /&gt;
# &#039;&#039;&#039;Depositing&#039;&#039;&#039; plastic in layers (typically 0.1-0.3mm thick)&lt;br /&gt;
# &#039;&#039;&#039;Building up&#039;&#039;&#039; layers to create 3D objects&lt;br /&gt;
&lt;br /&gt;
Key parameters:&lt;br /&gt;
* &#039;&#039;&#039;Layer height&#039;&#039;&#039; - Thinner = smoother, slower; thicker = faster, rougher&lt;br /&gt;
* &#039;&#039;&#039;Nozzle temperature&#039;&#039;&#039; - Too hot = stringing; too cold = poor adhesion&lt;br /&gt;
* &#039;&#039;&#039;Bed temperature&#039;&#039;&#039; - Prevents warping (60°C for PLA, 80°C for PETG)&lt;br /&gt;
* &#039;&#039;&#039;Print speed&#039;&#039;&#039; - Faster = more failures; slower = higher quality&lt;br /&gt;
&lt;br /&gt;
=== Material Selection for Robotics ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PLA (Polylactic Acid)&#039;&#039;&#039; - Best for beginners&lt;br /&gt;
** Easy to print, low warping, no fumes&lt;br /&gt;
** Rigid but brittle&lt;br /&gt;
** Good for chassis, brackets, non-load-bearing parts&lt;br /&gt;
** &#039;&#039;&#039;Weakness&#039;&#039;&#039;: Low temperature resistance (softens &amp;gt;60°C)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PETG (Polyethylene Terephthalate Glycol)&#039;&#039;&#039; - Durable upgrade&lt;br /&gt;
** Slightly harder to print than PLA&lt;br /&gt;
** Flexible and impact-resistant&lt;br /&gt;
** Good for wheels, motor mounts, stressed parts&lt;br /&gt;
** &#039;&#039;&#039;Weakness&#039;&#039;&#039;: Prone to stringing&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;TPU (Thermoplastic Polyurethane)&#039;&#039;&#039; - Flexible rubber-like&lt;br /&gt;
** Difficult to print (requires direct drive or slow speeds)&lt;br /&gt;
** Excellent for tires, grips, shock absorption&lt;br /&gt;
** &#039;&#039;&#039;Weakness&#039;&#039;&#039;: Cannot be load-bearing&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For SimpleBot&#039;&#039;&#039;: PLA is sufficient for all parts. Upgrade to PETG for motor mounts and wheels if you want better durability.&lt;br /&gt;
&lt;br /&gt;
=== Layer Orientation and Strength ===&lt;br /&gt;
&lt;br /&gt;
FDM parts are &#039;&#039;&#039;anisotropic&#039;&#039;&#039; - strength depends on orientation:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Strongest&#039;&#039;&#039;: Load parallel to layers&lt;br /&gt;
* &#039;&#039;&#039;Weakest&#039;&#039;&#039;: Load perpendicular to layers (layers can separate)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;: A motor mount bracket should be oriented so forces push along layers, not pulling layers apart.&lt;br /&gt;
&lt;br /&gt;
This is critical for robotics - a poorly oriented print can fail under load even with 100% infill.&lt;br /&gt;
&lt;br /&gt;
=== Overhangs and Supports ===&lt;br /&gt;
&lt;br /&gt;
FDM cannot print in mid-air. &#039;&#039;&#039;Overhangs&#039;&#039;&#039; are angles that extend beyond the previous layer:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;45° overhang&#039;&#039;&#039; - Usually prints fine without support&lt;br /&gt;
* &#039;&#039;&#039;45-70° overhang&#039;&#039;&#039; - May need support depending on geometry&lt;br /&gt;
* &#039;&#039;&#039;&amp;gt;70° overhang&#039;&#039;&#039; - Definitely needs support&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Bridging&#039;&#039;&#039; - Horizontal spans between two points (printer can do short bridges &amp;lt;20mm)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Supports&#039;&#039;&#039; are temporary structures that hold up overhangs during printing. They must be removed after printing, leaving marks on the surface.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Design strategy&#039;&#039;&#039;: Orient parts to minimize supports (faster, cleaner, stronger).&lt;br /&gt;
&lt;br /&gt;
=== Tolerances and Fit ===&lt;br /&gt;
&lt;br /&gt;
Printed parts have dimensional variation:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Typical accuracy&#039;&#039;&#039;: ±0.2mm (but varies by printer, material, settings)&lt;br /&gt;
* &#039;&#039;&#039;Holes print smaller&#039;&#039;&#039; - Add 0.2-0.3mm to hole diameters&lt;br /&gt;
* &#039;&#039;&#039;Shafts print larger&#039;&#039;&#039; - Subtract 0.2-0.3mm from shaft diameters&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Clearance fits&#039;&#039;&#039; for robotics:&lt;br /&gt;
* &#039;&#039;&#039;Press fit&#039;&#039;&#039; - 0.0mm clearance (part pressed in, stays tight)&lt;br /&gt;
* &#039;&#039;&#039;Slip fit&#039;&#039;&#039; - 0.2mm clearance (parts slide together with friction)&lt;br /&gt;
* &#039;&#039;&#039;Free fit&#039;&#039;&#039; - 0.5mm clearance (parts move freely, some wobble)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;: For an M3 screw (3.0mm nominal):&lt;br /&gt;
* &#039;&#039;&#039;Threaded hole&#039;&#039;&#039; - print 2.5mm, tap with M3 tap&lt;br /&gt;
* &#039;&#039;&#039;Clearance hole&#039;&#039;&#039; - print 3.3-3.5mm (screw passes through freely)&lt;br /&gt;
&lt;br /&gt;
== Print Preparation and Settings ==&lt;br /&gt;
&lt;br /&gt;
=== Slicing Software ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Slicers&#039;&#039;&#039; convert STL files to G-code (printer instructions):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PrusaSlicer&#039;&#039;&#039; (free, open-source, excellent defaults)&lt;br /&gt;
* &#039;&#039;&#039;Cura&#039;&#039;&#039; (free, user-friendly, widely used)&lt;br /&gt;
* &#039;&#039;&#039;Simplify3D&#039;&#039;&#039; (paid, advanced features)&lt;br /&gt;
&lt;br /&gt;
All slicers allow you to adjust:&lt;br /&gt;
* Layer height, infill density, perimeters&lt;br /&gt;
* Support generation and placement&lt;br /&gt;
* Print speed, temperature, retraction&lt;br /&gt;
* Bed adhesion (brim, raft, skirt)&lt;br /&gt;
&lt;br /&gt;
=== Critical First Layer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;first layer&#039;&#039;&#039; determines success or failure:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Bed leveling&#039;&#039;&#039; - Nozzle must be exactly the right distance from bed&lt;br /&gt;
** Too close = nozzle drags, clogs&lt;br /&gt;
** Too far = poor adhesion, warping&lt;br /&gt;
* &#039;&#039;&#039;Bed adhesion&#039;&#039;&#039; - Clean bed, appropriate temperature&lt;br /&gt;
* &#039;&#039;&#039;First layer speed&#039;&#039;&#039; - Slower than normal (50% of print speed)&lt;br /&gt;
* &#039;&#039;&#039;First layer height&#039;&#039;&#039; - Slightly thicker than other layers (0.2mm is common)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip&#039;&#039;&#039;: Watch the entire first layer. If it&#039;s not perfect, stop and restart.&lt;br /&gt;
&lt;br /&gt;
=== Support Settings ===&lt;br /&gt;
&lt;br /&gt;
When supports are needed:&lt;br /&gt;
* &#039;&#039;&#039;Support type&#039;&#039;&#039; - Grid, lines, or tree supports&lt;br /&gt;
* &#039;&#039;&#039;Support density&#039;&#039;&#039; - 10-20% typical (more = harder to remove)&lt;br /&gt;
* &#039;&#039;&#039;Support Z-distance&#039;&#039;&#039; - Gap between support and part (0.2mm typical)&lt;br /&gt;
* &#039;&#039;&#039;Support interface&#039;&#039;&#039; - Dense layer between support and part (easier removal, better surface)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip&#039;&#039;&#039;: Use support blockers/enforcers to add supports only where needed.&lt;br /&gt;
&lt;br /&gt;
=== Infill Strategies ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Infill&#039;&#039;&#039; is the internal structure (not visible on outside):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Infill density&#039;&#039;&#039; - 10-20% for most robotics parts (saves time and material)&lt;br /&gt;
* &#039;&#039;&#039;Infill pattern&#039;&#039;&#039; - Grid, gyroid, honeycomb (gyroid is strong and fast)&lt;br /&gt;
* &#039;&#039;&#039;Perimeters&#039;&#039;&#039; - 3-4 walls typical (outside strength comes from perimeters, not infill)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For structural parts&#039;&#039;&#039;: 30-50% infill + 4 perimeters is stronger than 100% infill + 2 perimeters.&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Skipping bed leveling&#039;&#039;&#039; - Single most common cause of failure. Level the bed every time.&lt;br /&gt;
* &#039;&#039;&#039;Ignoring first layer problems&#039;&#039;&#039; - A bad first layer never gets better. Stop and restart.&lt;br /&gt;
* &#039;&#039;&#039;Wrong temperature&#039;&#039;&#039; - Too cold = poor adhesion between layers (weak parts). Too hot = stringing, oozing.&lt;br /&gt;
* &#039;&#039;&#039;Insufficient perimeters&#039;&#039;&#039; - Thin walls with high infill are weaker than thick walls with low infill.&lt;br /&gt;
* &#039;&#039;&#039;Poor orientation&#039;&#039;&#039; - Printing with load perpendicular to layers = weak parts that snap.&lt;br /&gt;
* &#039;&#039;&#039;Overusing supports&#039;&#039;&#039; - Supports waste time and material. Reorient parts to avoid them when possible.&lt;br /&gt;
* &#039;&#039;&#039;Ignoring tolerances&#039;&#039;&#039; - Holes too small, shafts too big. Always test fit and adjust.&lt;br /&gt;
* &#039;&#039;&#039;Wet filament&#039;&#039;&#039; - PLA absorbs moisture from air, causes bubbling and poor prints. Store in dry boxes.&lt;br /&gt;
&lt;br /&gt;
== Post-Processing Techniques ==&lt;br /&gt;
&lt;br /&gt;
=== Support Removal ===&lt;br /&gt;
* Use flush cutters to clip away supports&lt;br /&gt;
* Pliers for larger support structures&lt;br /&gt;
* Deburring tool or knife for cleaning up nubs&lt;br /&gt;
* Sandpaper for smoothing support scars&lt;br /&gt;
&lt;br /&gt;
=== Hardware Insertion ===&lt;br /&gt;
* &#039;&#039;&#039;Heat-set inserts&#039;&#039;&#039; - Brass threaded inserts melted into plastic (strong, reusable threads)&lt;br /&gt;
* &#039;&#039;&#039;Captive nuts&#039;&#039;&#039; - Design hexagonal pockets for nuts to drop into&lt;br /&gt;
* &#039;&#039;&#039;Press-fit bearings&#039;&#039;&#039; - Print undersized holes, press bearings in for tight fit&lt;br /&gt;
* &#039;&#039;&#039;Tapping threads&#039;&#039;&#039; - Drill/print undersized hole, cut threads with tap&lt;br /&gt;
&lt;br /&gt;
=== Finishing ===&lt;br /&gt;
* &#039;&#039;&#039;Sanding&#039;&#039;&#039; - Progressive grits (80 → 220 → 400) for smooth surface&lt;br /&gt;
* &#039;&#039;&#039;Acetone vapor&#039;&#039;&#039; - ABS only (PLA doesn&#039;t respond)&lt;br /&gt;
* &#039;&#039;&#039;Primer + paint&#039;&#039;&#039; - Automotive primer fills layer lines&lt;br /&gt;
* &#039;&#039;&#039;Clear coat&#039;&#039;&#039; - Protects paint, adds gloss&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Tools (Start Here) ===&lt;br /&gt;
* &#039;&#039;&#039;FDM 3D Printer&#039;&#039;&#039; ($200-400) - Creality Ender 3, Prusa Mini, Artillery Sidewinder&lt;br /&gt;
* &#039;&#039;&#039;PLA filament&#039;&#039;&#039; ($15-25/kg) - White, black, or colorful&lt;br /&gt;
* &#039;&#039;&#039;Slicer software&#039;&#039;&#039; (free) - PrusaSlicer or Cura&lt;br /&gt;
* &#039;&#039;&#039;Flush cutters&#039;&#039;&#039; ($5-10) - Remove supports and clean up prints&lt;br /&gt;
* &#039;&#039;&#039;Spatula/scraper&#039;&#039;&#039; ($5-10) - Remove prints from bed&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Calipers&#039;&#039;&#039; ($15-30) - Measure parts and check tolerances&lt;br /&gt;
* &#039;&#039;&#039;Deburring tool&#039;&#039;&#039; ($5-10) - Clean up edges and holes&lt;br /&gt;
* &#039;&#039;&#039;Needle files&#039;&#039;&#039; ($10-20) - Fine-tune printed holes and slots&lt;br /&gt;
* &#039;&#039;&#039;Isopropyl alcohol&#039;&#039;&#039; ($5-10) - Clean print bed for adhesion&lt;br /&gt;
* &#039;&#039;&#039;Extra nozzles&#039;&#039;&#039; ($10-20) - 0.4mm spares, plus 0.6mm for faster prints&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Heat-set insert tips&#039;&#039;&#039; ($20-40) - For soldering iron&lt;br /&gt;
* &#039;&#039;&#039;Filament dryer&#039;&#039;&#039; ($30-60) - Keep filament moisture-free&lt;br /&gt;
* &#039;&#039;&#039;Different materials&#039;&#039;&#039; ($20-30/kg) - PETG, TPU for specialized parts&lt;br /&gt;
* &#039;&#039;&#039;Spare parts kit&#039;&#039;&#039; ($20-40) - Nozzles, hot end parts, belts, fans&lt;br /&gt;
&lt;br /&gt;
== Printer Recommendations for Robotics ==&lt;br /&gt;
&lt;br /&gt;
=== Budget Entry ($200-300) ===&lt;br /&gt;
* &#039;&#039;&#039;Creality Ender 3 V2&#039;&#039;&#039; - Most popular beginner printer, huge community&lt;br /&gt;
* &#039;&#039;&#039;Artillery Genius&#039;&#039;&#039; - Quieter, faster out-of-box experience&lt;br /&gt;
&lt;br /&gt;
=== Mid-Range ($400-600) ===&lt;br /&gt;
* &#039;&#039;&#039;Prusa Mini+&#039;&#039;&#039; - Excellent reliability, open-source, great support&lt;br /&gt;
* &#039;&#039;&#039;Creality CR-10 Smart&#039;&#039;&#039; - Larger build volume (300×300mm)&lt;br /&gt;
&lt;br /&gt;
=== Premium ($800-1200) ===&lt;br /&gt;
* &#039;&#039;&#039;Prusa i3 MK4&#039;&#039;&#039; - Best-in-class, auto bed leveling, filament sensor&lt;br /&gt;
* &#039;&#039;&#039;Bambu Lab P1S&#039;&#039;&#039; - Extremely fast, enclosed, multi-material capable&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For SimpleBot&#039;&#039;&#039;: Any printer with 180×180×180mm build volume works. Ender 3 is excellent value.&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing Basics]]&#039;&#039;&#039; (Beginner) - Your first print to assembled robot&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing for Robotics]]&#039;&#039;&#039; (Intermediate) - Design principles for functional parts&lt;br /&gt;
* &#039;&#039;&#039;[[CAD Design]]&#039;&#039;&#039; (Intermediate) - Create your own designs&lt;br /&gt;
&lt;br /&gt;
=== Robot Pages ===&lt;br /&gt;
* [[SimpleBot]] - All parts are 3D printed (download STLs from repository)&lt;br /&gt;
* [[SimpleBot:Chassis Design]] - Design decisions for SimpleBot chassis&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://www.prusa3d.com/learn/ Prusa Learning] - Comprehensive 3D printing guides&lt;br /&gt;
* [https://www.youtube.com/c/MakersMuseOriginals Maker&#039;s Muse] - YouTube channel on 3D printing&lt;br /&gt;
* [https://teachingtechyt.github.io/calibration.html Teaching Tech Calibration] - Printer calibration guide&lt;br /&gt;
* [https://www.youtube.com/c/CNCKitchen CNC Kitchen] - Engineering analysis of 3D printed parts&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[CAD Design]]&#039;&#039;&#039; - Create the digital models to print (prerequisite for custom designs)&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Understand forces, motion, and structural principles&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039; - Design parts that house and protect electronics&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Insert heat-set inserts with soldering iron&lt;br /&gt;
* &#039;&#039;&#039;[[Assembly]]&#039;&#039;&#039; - Put printed parts together with hardware&lt;br /&gt;
&lt;br /&gt;
== How 3D Printing Enables Capabilities ==&lt;br /&gt;
&lt;br /&gt;
3D printing doesn&#039;t directly create [[Capabilities]] (which require sensors or actuators), but it &#039;&#039;&#039;enables&#039;&#039;&#039; capabilities by providing the mechanical structure:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Chassis&#039;&#039;&#039; - Provides rigid structure for mounting electronics and motors&lt;br /&gt;
* &#039;&#039;&#039;Sensor mounts&#039;&#039;&#039; - Position [[Capability:Line Sensing]], [[Capability:Ultrasonic Sensing]], etc. at correct angles and heights&lt;br /&gt;
* &#039;&#039;&#039;Motor mounts&#039;&#039;&#039; - Secure motors for [[Capability:Differential Drive]], [[Capability:Omni Drive]]&lt;br /&gt;
* &#039;&#039;&#039;Wheel hubs&#039;&#039;&#039; - Connect wheels to motor shafts (custom diameters for different odometry needs)&lt;br /&gt;
* &#039;&#039;&#039;Brackets and standoffs&#039;&#039;&#039; - Organize electronics, prevent shorts, provide cable management&lt;br /&gt;
* &#039;&#039;&#039;Enclosures&#039;&#039;&#039; - Protect electronics from impacts and debris&lt;br /&gt;
&lt;br /&gt;
Every capability needs mechanical support - 3D printing makes that support custom-fittable to your exact hardware.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[SimpleBot]] - A robot designed around 3D printed parts&lt;br /&gt;
* [[CAD Design]] - Create models to print&lt;br /&gt;
* [[Robotics Ontology]] - How fabrication fits into the BRS knowledge structure&lt;br /&gt;
* [[Capabilities]] - What 3D printed parts enable&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Electronics_Fundamentals&amp;diff=72</id>
		<title>Electronics Fundamentals</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Electronics_Fundamentals&amp;diff=72"/>
		<updated>2025-10-11T19:50:51Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Tutorial |name=Electronics Fundamentals |competency=Electronics |difficulty=Beginner |time=2-4 hours (split across multiple sessions) |prerequisites=None - complete beginner friendly |materials=Multimeter ($15-30), breadboard, LED, resistor (220Ω), 9V battery or power supply |next_steps=SimpleBot assembly, Motor Control Basics, Sensor Interfacing }}  &amp;#039;&amp;#039;&amp;#039;Electronics Fundamentals&amp;#039;&amp;#039;&amp;#039; is your introduction to understanding circuits, components, and electron...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tutorial&lt;br /&gt;
|name=Electronics Fundamentals&lt;br /&gt;
|competency=[[Electronics]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=2-4 hours (split across multiple sessions)&lt;br /&gt;
|prerequisites=None - complete beginner friendly&lt;br /&gt;
|materials=Multimeter ($15-30), breadboard, LED, resistor (220Ω), 9V battery or power supply&lt;br /&gt;
|next_steps=[[SimpleBot]] assembly, [[Motor Control Basics]], [[Sensor Interfacing]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Electronics Fundamentals&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
By the end of this tutorial, you&#039;ll understand:&lt;br /&gt;
* How to read schematics&lt;br /&gt;
* What voltage, current, and resistance mean&lt;br /&gt;
* How to use a multimeter&lt;br /&gt;
* How digital and analog signals work&lt;br /&gt;
* How to prototype circuits on a breadboard&lt;br /&gt;
&lt;br /&gt;
This tutorial is &#039;&#039;&#039;hands-on&#039;&#039;&#039;. You&#039;ll need a multimeter and a few basic components to follow along.&lt;br /&gt;
&lt;br /&gt;
== Part 1: Understanding Voltage, Current, and Resistance ==&lt;br /&gt;
&lt;br /&gt;
=== The Water Analogy ===&lt;br /&gt;
&lt;br /&gt;
Electricity is invisible, so we use analogies to understand it. The water pipe analogy is the most common:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Voltage (V)&#039;&#039;&#039; - Water pressure in the pipes&lt;br /&gt;
** Higher voltage = more &amp;quot;push&amp;quot; on electrons&lt;br /&gt;
** Measured in volts (V)&lt;br /&gt;
** Example: A 9V battery pushes harder than a 3V battery&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Current (I)&#039;&#039;&#039; - Flow rate of water through the pipe&lt;br /&gt;
** Higher current = more electrons flowing per second&lt;br /&gt;
** Measured in amperes or amps (A)&lt;br /&gt;
** Example: An LED draws 20mA (0.02A), a motor draws 200mA (0.2A)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resistance (R)&#039;&#039;&#039; - Size of the pipe (restriction to flow)&lt;br /&gt;
** Higher resistance = harder for current to flow&lt;br /&gt;
** Measured in ohms (Ω)&lt;br /&gt;
** Example: A resistor limits current flow&lt;br /&gt;
&lt;br /&gt;
=== Ohm&#039;s Law: The Fundamental Equation ===&lt;br /&gt;
&lt;br /&gt;
The relationship between voltage, current, and resistance is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V = I \times R&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples:&#039;&#039;&#039;&lt;br /&gt;
* If voltage = 9V and resistance = 450Ω, then current = 9V / 450Ω = 0.02A = 20mA&lt;br /&gt;
* If current = 0.5A and resistance = 10Ω, then voltage = 0.5A × 10Ω = 5V&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters for robotics:&#039;&#039;&#039;&lt;br /&gt;
* LEDs need current-limiting resistors (too much current burns them out)&lt;br /&gt;
* Motors draw variable current depending on load&lt;br /&gt;
* You need to calculate wire thickness based on current&lt;br /&gt;
&lt;br /&gt;
=== Power: Energy Consumption ===&lt;br /&gt;
&lt;br /&gt;
Power is how much energy is consumed per second:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = V \times I&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Examples:&#039;&#039;&#039;&lt;br /&gt;
* If voltage = 5V and current = 0.1A, then power = 5V × 0.1A = 0.5W&lt;br /&gt;
* A 9V battery powering a 200mA motor consumes 9V × 0.2A = 1.8W&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters for robotics:&#039;&#039;&#039;&lt;br /&gt;
* Battery life depends on power consumption&lt;br /&gt;
* Components have maximum power ratings (exceed them and they overheat)&lt;br /&gt;
* More power = shorter battery life or bigger batteries needed&lt;br /&gt;
&lt;br /&gt;
== Part 2: Using a Multimeter ==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;multimeter&#039;&#039;&#039; is your most important electronics tool. It measures voltage, current, resistance, and continuity.&lt;br /&gt;
&lt;br /&gt;
=== Multimeter Basics ===&lt;br /&gt;
&lt;br /&gt;
Most multimeters have these modes:&lt;br /&gt;
* &#039;&#039;&#039;V⎓&#039;&#039;&#039; or &#039;&#039;&#039;DCV&#039;&#039;&#039; - DC voltage (what robots use)&lt;br /&gt;
* &#039;&#039;&#039;V~&#039;&#039;&#039; or &#039;&#039;&#039;ACV&#039;&#039;&#039; - AC voltage (wall power - not used in robotics)&lt;br /&gt;
* &#039;&#039;&#039;A⎓&#039;&#039;&#039; or &#039;&#039;&#039;DCA&#039;&#039;&#039; - DC current&lt;br /&gt;
* &#039;&#039;&#039;Ω&#039;&#039;&#039; - Resistance&lt;br /&gt;
* &#039;&#039;&#039;Diode symbol&#039;&#039;&#039; or &#039;&#039;&#039;Continuity&#039;&#039;&#039; - Beeps when circuit is complete&lt;br /&gt;
&lt;br /&gt;
=== Measuring Voltage ===&lt;br /&gt;
&lt;br /&gt;
Voltage is measured &#039;&#039;&#039;in parallel&#039;&#039;&#039; (multimeter probes touch two points in the circuit):&lt;br /&gt;
&lt;br /&gt;
# Set multimeter to DC voltage mode (20V range for 9V battery)&lt;br /&gt;
# Touch red probe to positive (+) terminal&lt;br /&gt;
# Touch black probe to negative (-) terminal&lt;br /&gt;
# Read the voltage on display&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exercise:&#039;&#039;&#039; Measure a 9V battery. It should read 9V (or slightly higher if fresh, slightly lower if used).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common mistake:&#039;&#039;&#039; Probes reversed? You&#039;ll see a negative voltage (-9V). No damage, just flip the probes.&lt;br /&gt;
&lt;br /&gt;
=== Measuring Resistance ===&lt;br /&gt;
&lt;br /&gt;
Resistance is measured &#039;&#039;&#039;with power OFF&#039;&#039;&#039; (multimeter sends its own small current):&lt;br /&gt;
&lt;br /&gt;
# Set multimeter to resistance mode (2kΩ range for 220Ω resistor)&lt;br /&gt;
# Touch probes to both ends of resistor (polarity doesn&#039;t matter)&lt;br /&gt;
# Read the resistance on display&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exercise:&#039;&#039;&#039; Measure a 220Ω resistor. You should read approximately 220Ω (resistors have tolerance, typically ±5%).&lt;br /&gt;
&lt;br /&gt;
=== Measuring Continuity ===&lt;br /&gt;
&lt;br /&gt;
Continuity mode checks if there&#039;s a complete circuit (useful for finding broken wires):&lt;br /&gt;
&lt;br /&gt;
# Set multimeter to continuity mode (diode symbol or speaker icon)&lt;br /&gt;
# Touch probes to two points in the circuit&lt;br /&gt;
# If it beeps, there&#039;s a complete circuit (low resistance path)&lt;br /&gt;
# If silent, the circuit is open (broken wire or no connection)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exercise:&#039;&#039;&#039; Touch the probes together - it should beep. Separate them - it should be silent.&lt;br /&gt;
&lt;br /&gt;
=== Measuring Current ===&lt;br /&gt;
&lt;br /&gt;
Current is measured &#039;&#039;&#039;in series&#039;&#039;&#039; (multimeter becomes part of the circuit). &#039;&#039;&#039;Warning:&#039;&#039;&#039; Most multimeters have a fuse that blows if you exceed the current limit!&lt;br /&gt;
&lt;br /&gt;
# Set multimeter to DC current mode (200mA range for LED)&lt;br /&gt;
# &#039;&#039;&#039;Break the circuit&#039;&#039;&#039; and insert multimeter in series&lt;br /&gt;
# Current flows through the multimeter&lt;br /&gt;
# Read the current on display&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For beginners:&#039;&#039;&#039; Skip current measurement until you&#039;re comfortable with voltage and resistance. It&#039;s easy to blow the fuse.&lt;br /&gt;
&lt;br /&gt;
== Part 3: Reading Resistor Color Codes ==&lt;br /&gt;
&lt;br /&gt;
Resistors use colored bands to indicate resistance value:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Band 1 !! Band 2 !! Band 3 (Multiplier) !! Band 4 (Tolerance)&lt;br /&gt;
|-&lt;br /&gt;
| First digit || Second digit || Number of zeros || Accuracy&lt;br /&gt;
|-&lt;br /&gt;
| Red = 2 || Red = 2 || Red = ×100 || Gold = ±5%&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; | &#039;&#039;&#039;Result: 22 × 100 = 2200Ω = 2.2kΩ, ±5%&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Color code:&#039;&#039;&#039;&lt;br /&gt;
* Black = 0, Brown = 1, Red = 2, Orange = 3, Yellow = 4&lt;br /&gt;
* Green = 5, Blue = 6, Violet = 7, Gray = 8, White = 9&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Common resistor values in robotics:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;220Ω&#039;&#039;&#039; (red-red-brown) - LED current limiting&lt;br /&gt;
* &#039;&#039;&#039;1kΩ&#039;&#039;&#039; (brown-black-red) - Pull-up/pull-down resistors&lt;br /&gt;
* &#039;&#039;&#039;10kΩ&#039;&#039;&#039; (brown-black-orange) - General-purpose pull-up/pull-down&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Use your multimeter to verify resistor values if you can&#039;t read the bands!&lt;br /&gt;
&lt;br /&gt;
== Part 4: Breadboards and Prototyping ==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;breadboard&#039;&#039;&#039; lets you build circuits without soldering. It has internal connections:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Horizontal rows&#039;&#039;&#039; (in the middle) - 5 holes connected together&lt;br /&gt;
* &#039;&#039;&#039;Vertical rails&#039;&#039;&#039; (on the sides) - Entire column connected (for power and ground)&lt;br /&gt;
&lt;br /&gt;
=== Breadboard Anatomy ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    + Rail (Red)     [Connected vertically]&lt;br /&gt;
    - Rail (Blue)    [Connected vertically]&lt;br /&gt;
    ====================================&lt;br /&gt;
    Row 1: a b c d e   f g h i j  [a-b-c-d-e connected, f-g-h-i-j connected]&lt;br /&gt;
    Row 2: a b c d e   f g h i j&lt;br /&gt;
    ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building Your First Circuit: LED + Resistor ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Goal:&#039;&#039;&#039; Light an LED using a 9V battery and resistor.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why the resistor?&#039;&#039;&#039; LEDs need about 20mA of current. Without a resistor, they draw too much current and burn out. The resistor &amp;quot;limits&amp;quot; the current to a safe level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Calculating resistor value:&#039;&#039;&#039;&lt;br /&gt;
* LED needs 20mA (0.02A) at 2V forward voltage&lt;br /&gt;
* Battery provides 9V&lt;br /&gt;
* Voltage across resistor = 9V - 2V = 7V&lt;br /&gt;
* Ohm&#039;s Law: R = V / I = 7V / 0.02A = 350Ω&lt;br /&gt;
* Use 220Ω or 470Ω resistor (standard values close to 350Ω)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wiring:&#039;&#039;&#039;&lt;br /&gt;
# Insert 9V battery clip into breadboard (+red to + rail, -black to - rail)&lt;br /&gt;
# Insert resistor from + rail to row 1&lt;br /&gt;
# Insert LED long leg (anode, +) into row 1, short leg (cathode, -) to - rail&lt;br /&gt;
# LED should light up!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Troubleshooting:&#039;&#039;&#039;&lt;br /&gt;
* LED not lighting? Check polarity (long leg = +, short leg = -)&lt;br /&gt;
* LED very dim? Battery might be dead&lt;br /&gt;
* LED too bright/hot? Resistor value too small&lt;br /&gt;
&lt;br /&gt;
== Part 5: Digital Signals (HIGH and LOW) ==&lt;br /&gt;
&lt;br /&gt;
Robots use &#039;&#039;&#039;digital signals&#039;&#039;&#039; - voltage is either HIGH or LOW:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;HIGH&#039;&#039;&#039; (logic 1) - Voltage is at the supply level (3.3V or 5V)&lt;br /&gt;
* &#039;&#039;&#039;LOW&#039;&#039;&#039; (logic 0) - Voltage is at ground (0V)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; A microcontroller GPIO pin can be set HIGH (3.3V) or LOW (0V) to turn an LED on or off.&lt;br /&gt;
&lt;br /&gt;
=== Pull-up and Pull-down Resistors ===&lt;br /&gt;
&lt;br /&gt;
Digital inputs need to be either HIGH or LOW - never &#039;&#039;&#039;floating&#039;&#039;&#039; (undefined). Pull-up/pull-down resistors set the default state:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Pull-up resistor&#039;&#039;&#039; - Connects input to HIGH voltage (default HIGH, button press = LOW)&lt;br /&gt;
* &#039;&#039;&#039;Pull-down resistor&#039;&#039;&#039; - Connects input to LOW voltage (default LOW, button press = HIGH)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters for robots:&#039;&#039;&#039;&lt;br /&gt;
* [[Infrared Line Detector]] sensors use pull-up resistors (output LOW when line detected)&lt;br /&gt;
* Button inputs need pull-up or pull-down resistors to avoid erratic behavior&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Typical value:&#039;&#039;&#039; 10kΩ (not too strong to waste power, not too weak to be unreliable)&lt;br /&gt;
&lt;br /&gt;
=== Active HIGH vs Active LOW ===&lt;br /&gt;
&lt;br /&gt;
Components can be triggered by HIGH or LOW signals:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Active HIGH&#039;&#039;&#039; - HIGH signal activates the component (LED turns on when pin is HIGH)&lt;br /&gt;
* &#039;&#039;&#039;Active LOW&#039;&#039;&#039; - LOW signal activates the component (LED turns on when pin is LOW)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; SimpleBot&#039;s [[Infrared Line Detector]] sensors are &#039;&#039;&#039;active LOW&#039;&#039;&#039;:&lt;br /&gt;
* Output HIGH (3.3V) when no line detected (white surface)&lt;br /&gt;
* Output LOW (0V) when line detected (black tape)&lt;br /&gt;
&lt;br /&gt;
This is important when writing software - you need to know which logic level means &amp;quot;detected&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== Part 6: Analog Signals (Variable Voltage) ==&lt;br /&gt;
&lt;br /&gt;
Not all signals are digital (HIGH/LOW). &#039;&#039;&#039;Analog signals&#039;&#039;&#039; have variable voltage:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Temperature sensor&#039;&#039;&#039; - Voltage increases with temperature&lt;br /&gt;
* &#039;&#039;&#039;Potentiometer&#039;&#039;&#039; (dial) - Voltage varies from 0V to supply voltage&lt;br /&gt;
* &#039;&#039;&#039;Photoresistor&#039;&#039;&#039; - Resistance changes with light level&lt;br /&gt;
&lt;br /&gt;
=== Analog-to-Digital Conversion (ADC) ===&lt;br /&gt;
&lt;br /&gt;
Microcontrollers use &#039;&#039;&#039;ADC&#039;&#039;&#039; to convert analog voltage to a number:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;10-bit ADC&#039;&#039;&#039; (Raspberry Pi Pico) - 1024 possible values (0-1023)&lt;br /&gt;
* &#039;&#039;&#039;12-bit ADC&#039;&#039;&#039; (ESP32) - 4096 possible values (0-4095)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; If ADC reads 512 on a 10-bit ADC with 3.3V reference:&lt;br /&gt;
* 512 / 1024 = 0.5 (50% of maximum)&lt;br /&gt;
* Voltage = 0.5 × 3.3V = 1.65V&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters for robots:&#039;&#039;&#039;&lt;br /&gt;
* [[Capability:Optical Odometry]] uses photoresistors (analog signal indicates wheel position)&lt;br /&gt;
* Battery voltage monitoring uses ADC to measure remaining charge&lt;br /&gt;
&lt;br /&gt;
== Part 7: PWM (Pulse Width Modulation) ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PWM&#039;&#039;&#039; is a way to simulate analog voltage using rapid digital pulses:&lt;br /&gt;
&lt;br /&gt;
* HIGH for 50% of the time, LOW for 50% = equivalent to half voltage&lt;br /&gt;
* HIGH for 75% of the time, LOW for 25% = equivalent to 75% voltage&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Duty cycle&#039;&#039;&#039; = percentage of time signal is HIGH&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why this matters for robots:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Motor speed control&#039;&#039;&#039; - 50% duty cycle = half speed, 100% = full speed&lt;br /&gt;
* &#039;&#039;&#039;LED brightness&#039;&#039;&#039; - 25% duty cycle = dim, 100% = full brightness&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Frequency:&#039;&#039;&#039; PWM typically runs at 1kHz - 20kHz (too fast to see flickering)&lt;br /&gt;
&lt;br /&gt;
== Part 8: Reading Schematics ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Schematics&#039;&#039;&#039; are circuit diagrams using standard symbols:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Component !! Symbol Description&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Resistor&#039;&#039;&#039; || Zigzag line (US) or rectangle (European)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;LED&#039;&#039;&#039; || Triangle with arrows pointing out&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Battery&#039;&#039;&#039; || Long line (+) and short line (-)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Ground&#039;&#039;&#039; || Three horizontal lines or triangle pointing down&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Switch&#039;&#039;&#039; || Gap with movable connector&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Motor&#039;&#039;&#039; || Circle with M inside&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;IC (chip)&#039;&#039;&#039; || Rectangle with pin numbers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example schematic: LED circuit&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+9V ----[220Ω]----[LED]---- GND&lt;br /&gt;
&lt;br /&gt;
Legend: [220Ω] = resistor, [LED] = LED, GND = ground&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reading tips:&#039;&#039;&#039;&lt;br /&gt;
* Trace the path from + to - (current flows from positive to negative)&lt;br /&gt;
* Components in &#039;&#039;&#039;series&#039;&#039;&#039; (one after another) share the same current&lt;br /&gt;
* Components in &#039;&#039;&#039;parallel&#039;&#039;&#039; (side-by-side) share the same voltage&lt;br /&gt;
* Ground symbol (⏚) means 0V reference point&lt;br /&gt;
&lt;br /&gt;
== Part 9: Practical Skills Checklist ==&lt;br /&gt;
&lt;br /&gt;
By now, you should be able to:&lt;br /&gt;
&lt;br /&gt;
* ☐ Explain voltage, current, resistance, and power&lt;br /&gt;
* ☐ Use Ohm&#039;s Law to calculate voltage, current, or resistance&lt;br /&gt;
* ☐ Measure voltage with a multimeter&lt;br /&gt;
* ☐ Measure resistance with a multimeter&lt;br /&gt;
* ☐ Check continuity with a multimeter&lt;br /&gt;
* ☐ Read resistor color codes (or use multimeter to verify)&lt;br /&gt;
* ☐ Build a simple LED circuit on a breadboard&lt;br /&gt;
* ☐ Understand digital signals (HIGH/LOW)&lt;br /&gt;
* ☐ Explain what pull-up/pull-down resistors do&lt;br /&gt;
* ☐ Understand what PWM is and why it&#039;s used&lt;br /&gt;
* ☐ Read simple schematics&lt;br /&gt;
&lt;br /&gt;
If you can check most of these boxes, you&#039;re ready to build [[SimpleBot]]!&lt;br /&gt;
&lt;br /&gt;
== Next Steps ==&lt;br /&gt;
&lt;br /&gt;
=== Build SimpleBot ===&lt;br /&gt;
You now have the foundational knowledge to understand SimpleBot&#039;s electronics:&lt;br /&gt;
* [[SimpleBot]] - Full robot build guide&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - Sensor wiring and code&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Encoder wiring and code&lt;br /&gt;
&lt;br /&gt;
=== Learn More Electronics ===&lt;br /&gt;
* [[Motor Control Basics]] - PWM, H-bridges, motor drivers&lt;br /&gt;
* [[Sensor Interfacing]] - I2C, SPI, analog sensors&lt;br /&gt;
* [[Electronics]] - Full competency overview with intermediate and advanced topics&lt;br /&gt;
&lt;br /&gt;
=== Hands-on Practice ===&lt;br /&gt;
* Buy an electronics kit ($20-40) with assorted components&lt;br /&gt;
* Build classic circuits: blinking LED, button-controlled LED, photoresistor nightlight&lt;br /&gt;
* Use a breadboard to prototype before soldering&lt;br /&gt;
&lt;br /&gt;
== Common Beginner Mistakes ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using voltage mode to measure current&#039;&#039;&#039; - This shorts the circuit and can blow the multimeter fuse or damage components&lt;br /&gt;
* &#039;&#039;&#039;Measuring resistance with power ON&#039;&#039;&#039; - Gives incorrect readings and can damage the multimeter&lt;br /&gt;
* &#039;&#039;&#039;Forgetting current-limiting resistors for LEDs&#039;&#039;&#039; - LEDs burn out instantly&lt;br /&gt;
* &#039;&#039;&#039;Reversing polarity&#039;&#039;&#039; - Some components (LEDs, electrolytic capacitors, ICs) are polarity-sensitive and can be damaged&lt;br /&gt;
* &#039;&#039;&#039;Confusing mA and A&#039;&#039;&#039; - 200mA = 0.2A, not 200A! (Off by 1000×)&lt;br /&gt;
* &#039;&#039;&#039;Breadboard wiring errors&#039;&#039;&#039; - Double-check that components are in the same row to be connected&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting Tips ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Circuit not working?&#039;&#039;&#039; Check continuity with multimeter (is everything connected?)&lt;br /&gt;
* &#039;&#039;&#039;Component hot?&#039;&#039;&#039; It&#039;s drawing too much current - check for short circuits or wrong resistor values&lt;br /&gt;
* &#039;&#039;&#039;Inconsistent behavior?&#039;&#039;&#039; Check for floating inputs (add pull-up/pull-down resistors)&lt;br /&gt;
* &#039;&#039;&#039;Multimeter shows 0V everywhere?&#039;&#039;&#039; Battery is dead or not connected&lt;br /&gt;
* &#039;&#039;&#039;Can&#039;t read resistor colors?&#039;&#039;&#039; Use multimeter to measure resistance directly&lt;br /&gt;
&lt;br /&gt;
== Tools and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== Recommended First Purchases ===&lt;br /&gt;
* &#039;&#039;&#039;Multimeter&#039;&#039;&#039; - $15-30 (any basic model works, look for DC voltage, resistance, continuity)&lt;br /&gt;
* &#039;&#039;&#039;Breadboard&#039;&#039;&#039; - $5-10 (get a full-size 830-point breadboard)&lt;br /&gt;
* &#039;&#039;&#039;Jumper wire kit&#039;&#039;&#039; - $5-10 (includes various lengths)&lt;br /&gt;
* &#039;&#039;&#039;Electronics component kit&#039;&#039;&#039; - $20-40 (resistors, LEDs, capacitors, transistors)&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/voltage-current-resistance-and-ohms-law SparkFun: Ohm&#039;s Law]&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/how-to-use-a-multimeter SparkFun: How to Use a Multimeter]&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard SparkFun: How to Use a Breadboard]&lt;br /&gt;
* [https://www.allaboutcircuits.com/textbook/ All About Circuits] - Free electronics textbook&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Electronics]] - Full competency overview&lt;br /&gt;
* [[SimpleBot]] - Apply your knowledge to build a robot&lt;br /&gt;
* [[Motor Control Basics]] - Next tutorial in the electronics learning path&lt;br /&gt;
* [[Sensor Interfacing]] - Intermediate electronics tutorial&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Electronics]]&lt;br /&gt;
[[Category:Beginner]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Electronics&amp;diff=71</id>
		<title>Electronics</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Electronics&amp;diff=71"/>
		<updated>2025-10-11T19:50:37Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;{{Competency |name=Electronics |description=Understanding the exchange of signals and power between mechanical components and software instructions |difficulty_range=Beginner to Advanced |time_to_basic=2-4 weeks |essential_tools=Multimeter, breadboard, jumper wires, wire strippers |optional_tools=Oscilloscope, logic analyzer, power supply, component kit |beginner_tutorial=Electronics Fundamentals |unlocks_basic=Capability:Line Sensing, Capability:Differential D...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Competency&lt;br /&gt;
|name=Electronics&lt;br /&gt;
|description=Understanding the exchange of signals and power between mechanical components and software instructions&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=2-4 weeks&lt;br /&gt;
|essential_tools=Multimeter, breadboard, jumper wires, wire strippers&lt;br /&gt;
|optional_tools=Oscilloscope, logic analyzer, power supply, component kit&lt;br /&gt;
|beginner_tutorial=[[Electronics Fundamentals]]&lt;br /&gt;
|unlocks_basic=[[Capability:Line Sensing]], [[Capability:Differential Drive]]&lt;br /&gt;
|unlocks_advanced=[[Capability:IMU Sensing]], [[Capability:Camera Vision]], [[Capability:LIDAR Sensing]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Electronics&#039;&#039;&#039; is the competency of understanding circuits, components, sensors, and actuators. In robotics, electronics is the bridge between the physical world ([[Mechanics]]) and the digital world ([[Software]]). It encompasses reading schematics, selecting components, understanding power distribution, and interfacing sensors and actuators with microcontrollers.&lt;br /&gt;
&lt;br /&gt;
Electronics is distinct from [[Soldering]] (the hands-on technique of joining components) and [[PCB Design]] (creating custom circuit boards). This competency focuses on &#039;&#039;&#039;understanding&#039;&#039;&#039; electronic systems: how they work, how to analyze them, and how to design them.&lt;br /&gt;
&lt;br /&gt;
== Why Electronics Matters for Robotics ==&lt;br /&gt;
&lt;br /&gt;
Electronics is the nervous system of a robot:&lt;br /&gt;
* &#039;&#039;&#039;Sensors&#039;&#039;&#039; convert physical phenomena (light, distance, motion) into electrical signals&lt;br /&gt;
* &#039;&#039;&#039;Microcontrollers&#039;&#039;&#039; process those signals and make decisions&lt;br /&gt;
* &#039;&#039;&#039;Actuators&#039;&#039;&#039; convert electrical signals back into physical motion&lt;br /&gt;
* &#039;&#039;&#039;Power systems&#039;&#039;&#039; distribute energy throughout the robot&lt;br /&gt;
&lt;br /&gt;
Without electronics knowledge, you&#039;re limited to pre-built modules and can&#039;t troubleshoot problems, expand capabilities, or design custom solutions.&lt;br /&gt;
&lt;br /&gt;
== Skill Progression ==&lt;br /&gt;
&lt;br /&gt;
=== Beginner (SimpleBot Level) ===&lt;br /&gt;
&lt;br /&gt;
Skills you need to build and understand [[SimpleBot]]:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Reading schematics&#039;&#039;&#039; - Understand circuit diagrams, recognize symbols&lt;br /&gt;
* &#039;&#039;&#039;Component identification&#039;&#039;&#039; - Resistors, capacitors, diodes, transistors, ICs&lt;br /&gt;
* &#039;&#039;&#039;Using a multimeter&#039;&#039;&#039; - Measure voltage, current, resistance, continuity&lt;br /&gt;
* &#039;&#039;&#039;Breadboarding&#039;&#039;&#039; - Prototype circuits without soldering&lt;br /&gt;
* &#039;&#039;&#039;Power concepts&#039;&#039;&#039; - Voltage, current, power, batteries, regulators&lt;br /&gt;
* &#039;&#039;&#039;Digital I/O&#039;&#039;&#039; - HIGH/LOW signals, pull-up/pull-down resistors, active HIGH/LOW&lt;br /&gt;
* &#039;&#039;&#039;PWM basics&#039;&#039;&#039; - Pulse-width modulation for motor speed control&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Line Sensing]] (IR reflectance sensors)&lt;br /&gt;
* [[Capability:Differential Drive]] (DC motors + H-bridge)&lt;br /&gt;
* [[Capability:Optical Odometry]] (LED + photoresistor encoders)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Electronics Fundamentals]], [[Motor Control Basics]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Build SimpleBot from a kit or pre-selected components&lt;br /&gt;
* Understand how sensors and motors work&lt;br /&gt;
* Troubleshoot basic wiring issues&lt;br /&gt;
* Use pre-built breakout boards and modules&lt;br /&gt;
&lt;br /&gt;
=== Intermediate (Expanding Capabilities) ===&lt;br /&gt;
&lt;br /&gt;
Skills for adding new sensors and capabilities to your robot:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Component selection&#039;&#039;&#039; - Read datasheets, understand specifications, choose parts&lt;br /&gt;
* &#039;&#039;&#039;Communication protocols&#039;&#039;&#039; - I2C, SPI, UART/serial&lt;br /&gt;
* &#039;&#039;&#039;Analog sensors&#039;&#039;&#039; - ADC (analog-to-digital conversion), voltage dividers, reference voltages&lt;br /&gt;
* &#039;&#039;&#039;Logic levels&#039;&#039;&#039; - 3.3V vs 5V, level shifters, voltage translation&lt;br /&gt;
* &#039;&#039;&#039;Circuit design&#039;&#039;&#039; - Design sensor circuits, filtering, signal conditioning&lt;br /&gt;
* &#039;&#039;&#039;Interrupts&#039;&#039;&#039; - Hardware interrupts for encoders and timing-critical sensors&lt;br /&gt;
* &#039;&#039;&#039;Power distribution&#039;&#039;&#039; - Multiple voltage rails, current requirements, wire gauge selection&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:IMU Sensing]] (I2C accelerometer/gyroscope modules)&lt;br /&gt;
* [[Capability:Encoder Sensing]] (interrupt-driven quadrature encoders)&lt;br /&gt;
* [[Capability:Time-of-Flight Sensing]] (I2C distance sensors)&lt;br /&gt;
* [[Capability:Ultrasonic Sensing]] (trigger/echo timing)&lt;br /&gt;
* [[Capability:Bump Sensing]] (switch debouncing)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[Sensor Interfacing]], [[Motor Control Basics]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Select and integrate new sensors into your robot&lt;br /&gt;
* Design custom sensor circuits&lt;br /&gt;
* Interface 5V and 3.3V components safely&lt;br /&gt;
* Debug communication issues with I2C and SPI&lt;br /&gt;
* Calculate power requirements for your robot&lt;br /&gt;
&lt;br /&gt;
=== Advanced (Custom Designs) ===&lt;br /&gt;
&lt;br /&gt;
Skills for designing robots from scratch:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PCB layout and design&#039;&#039;&#039; - Design custom boards (see [[PCB Design]])&lt;br /&gt;
* &#039;&#039;&#039;Power supply design&#039;&#039;&#039; - Buck/boost converters, LDOs, power sequencing&lt;br /&gt;
* &#039;&#039;&#039;Signal integrity&#039;&#039;&#039; - Noise reduction, grounding, decoupling capacitors&lt;br /&gt;
* &#039;&#039;&#039;High-speed communication&#039;&#039;&#039; - SPI timing, I2C clock stretching, UART baud rates&lt;br /&gt;
* &#039;&#039;&#039;Motor driver selection&#039;&#039;&#039; - H-bridge specifications, current sensing, thermal management&lt;br /&gt;
* &#039;&#039;&#039;EMI/EMC considerations&#039;&#039;&#039; - Electromagnetic interference, shielding, filtering&lt;br /&gt;
* &#039;&#039;&#039;Analog circuit design&#039;&#039;&#039; - Op-amps, filters, amplifiers for custom sensors&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Unlocks&#039;&#039;&#039;:&lt;br /&gt;
* [[Capability:Camera Vision]] (high-speed data transfer, power management)&lt;br /&gt;
* [[Capability:LIDAR Sensing]] (motor control, high-bandwidth serial)&lt;br /&gt;
* [[Capability:Servo Control]] (PWM generation, power distribution)&lt;br /&gt;
* Custom PCB designs for integrated robots&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tutorials&#039;&#039;&#039;: [[KiCad Tutorial]], [[PCB Design]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;At this level you can&#039;&#039;&#039;:&lt;br /&gt;
* Design custom PCBs for your robots&lt;br /&gt;
* Select and integrate motor drivers and power systems&lt;br /&gt;
* Design custom sensor circuits and signal conditioning&lt;br /&gt;
* Troubleshoot complex electrical issues&lt;br /&gt;
* Optimize power efficiency and thermal performance&lt;br /&gt;
&lt;br /&gt;
== Learning Paths ==&lt;br /&gt;
&lt;br /&gt;
=== Path 1: SimpleBot Builder (Beginner) ===&lt;br /&gt;
# Start with [[Electronics Fundamentals]] - Learn to read schematics and use a multimeter&lt;br /&gt;
# Build [[SimpleBot]] - Hands-on experience with sensors, motors, and microcontrollers&lt;br /&gt;
# Complete [[Motor Control Basics]] - Understand PWM and H-bridges&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can build SimpleBot and understand how it works electrically.&lt;br /&gt;
&lt;br /&gt;
=== Path 2: Capability Expander (Intermediate) ===&lt;br /&gt;
# Complete Path 1 (SimpleBot Builder)&lt;br /&gt;
# Study [[Sensor Interfacing]] - Learn I2C, SPI, and analog sensors&lt;br /&gt;
# Add a new sensor to SimpleBot (IMU, distance sensor, or encoders)&lt;br /&gt;
# Document your work as an Implementation page&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can expand SimpleBot with new capabilities and troubleshoot sensor issues.&lt;br /&gt;
&lt;br /&gt;
=== Path 3: Robot Designer (Advanced) ===&lt;br /&gt;
# Complete Path 2 (Capability Expander)&lt;br /&gt;
# Learn [[PCB Design]] and [[KiCad Tutorial]]&lt;br /&gt;
# Design a custom PCB for your robot&lt;br /&gt;
# Order boards and assemble them&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Result&#039;&#039;&#039;: You can design robots from scratch with custom electronics.&lt;br /&gt;
&lt;br /&gt;
== Essential Concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Voltage, Current, and Power ===&lt;br /&gt;
* &#039;&#039;&#039;Voltage&#039;&#039;&#039; (V) - Electrical &amp;quot;pressure&amp;quot; that pushes electrons&lt;br /&gt;
* &#039;&#039;&#039;Current&#039;&#039;&#039; (A) - Flow rate of electrons&lt;br /&gt;
* &#039;&#039;&#039;Power&#039;&#039;&#039; (W) - Energy consumption rate: P = V × I&lt;br /&gt;
* &#039;&#039;&#039;Ohm&#039;s Law&#039;&#039;&#039; - V = I × R (voltage = current × resistance)&lt;br /&gt;
&lt;br /&gt;
=== Digital Signals ===&lt;br /&gt;
* &#039;&#039;&#039;Logic levels&#039;&#039;&#039; - HIGH (typically 3.3V or 5V) and LOW (0V)&lt;br /&gt;
* &#039;&#039;&#039;Pull-up/pull-down resistors&#039;&#039;&#039; - Set default state when input is floating&lt;br /&gt;
* &#039;&#039;&#039;Active HIGH vs Active LOW&#039;&#039;&#039; - Does HIGH or LOW trigger the action?&lt;br /&gt;
&lt;br /&gt;
=== Analog Signals ===&lt;br /&gt;
* &#039;&#039;&#039;ADC&#039;&#039;&#039; (Analog-to-Digital Converter) - Convert continuous voltage to discrete number&lt;br /&gt;
* &#039;&#039;&#039;Resolution&#039;&#039;&#039; - 10-bit ADC = 1024 possible values (0-1023)&lt;br /&gt;
* &#039;&#039;&#039;Reference voltage&#039;&#039;&#039; - Maximum voltage the ADC can read&lt;br /&gt;
&lt;br /&gt;
=== Communication Protocols ===&lt;br /&gt;
* &#039;&#039;&#039;I2C&#039;&#039;&#039; - Two-wire bus, multiple devices, addresses&lt;br /&gt;
* &#039;&#039;&#039;SPI&#039;&#039;&#039; - Four-wire, high-speed, chip-select per device&lt;br /&gt;
* &#039;&#039;&#039;UART/Serial&#039;&#039;&#039; - Two-wire, point-to-point, baud rate&lt;br /&gt;
&lt;br /&gt;
=== Power Systems ===&lt;br /&gt;
* &#039;&#039;&#039;Voltage regulators&#039;&#039;&#039; - Convert one voltage to another (buck, boost, LDO)&lt;br /&gt;
* &#039;&#039;&#039;Decoupling capacitors&#039;&#039;&#039; - Filter noise near ICs&lt;br /&gt;
* &#039;&#039;&#039;Wire gauge&#039;&#039;&#039; - Thicker wire for higher current&lt;br /&gt;
&lt;br /&gt;
== Tools and Equipment ==&lt;br /&gt;
&lt;br /&gt;
=== Essential Tools (Start Here) ===&lt;br /&gt;
* &#039;&#039;&#039;Multimeter&#039;&#039;&#039; ($15-30) - Measure voltage, current, resistance, continuity&lt;br /&gt;
* &#039;&#039;&#039;Breadboard&#039;&#039;&#039; ($5-10) - Prototype circuits without soldering&lt;br /&gt;
* &#039;&#039;&#039;Jumper wires&#039;&#039;&#039; ($5-10) - Connect components on breadboard&lt;br /&gt;
* &#039;&#039;&#039;Wire strippers&#039;&#039;&#039; ($10-20) - Remove insulation from wires&lt;br /&gt;
* &#039;&#039;&#039;Component kit&#039;&#039;&#039; ($20-40) - Assorted resistors, capacitors, LEDs, transistors&lt;br /&gt;
&lt;br /&gt;
=== Intermediate Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Power supply&#039;&#039;&#039; ($30-80) - Variable voltage and current limiting&lt;br /&gt;
* &#039;&#039;&#039;Logic analyzer&#039;&#039;&#039; ($10-60) - Debug I2C, SPI, UART communication&lt;br /&gt;
* &#039;&#039;&#039;Helping hands&#039;&#039;&#039; ($10-20) - Hold components while working&lt;br /&gt;
&lt;br /&gt;
=== Advanced Tools ===&lt;br /&gt;
* &#039;&#039;&#039;Oscilloscope&#039;&#039;&#039; ($100-400) - Visualize signals and timing&lt;br /&gt;
* &#039;&#039;&#039;Function generator&#039;&#039;&#039; ($50-200) - Generate test signals&lt;br /&gt;
* &#039;&#039;&#039;Hot air station&#039;&#039;&#039; ($50-150) - SMD component rework&lt;br /&gt;
&lt;br /&gt;
== Common Pitfalls ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Mixing 5V and 3.3V logic&#039;&#039;&#039; - Can damage 3.3V microcontrollers! Use level shifters&lt;br /&gt;
* &#039;&#039;&#039;Floating inputs&#039;&#039;&#039; - Digital inputs without pull-up/pull-down resistors can cause erratic behavior&lt;br /&gt;
* &#039;&#039;&#039;Insufficient decoupling&#039;&#039;&#039; - Every IC needs a 0.1µF capacitor near its power pins&lt;br /&gt;
* &#039;&#039;&#039;Underpowered supplies&#039;&#039;&#039; - Motors draw large current spikes; use appropriate power sources&lt;br /&gt;
* &#039;&#039;&#039;Reversed polarity&#039;&#039;&#039; - Always double-check battery/power connections before powering on&lt;br /&gt;
* &#039;&#039;&#039;Overlooking current limits&#039;&#039;&#039; - Exceeding GPIO current limits can damage microcontrollers&lt;br /&gt;
&lt;br /&gt;
== Tutorials and Resources ==&lt;br /&gt;
&lt;br /&gt;
=== BRS Tutorials ===&lt;br /&gt;
* &#039;&#039;&#039;[[Electronics Fundamentals]]&#039;&#039;&#039; (Beginner) - Start here if you&#039;re new to electronics&lt;br /&gt;
* &#039;&#039;&#039;[[Motor Control Basics]]&#039;&#039;&#039; (Beginner) - PWM, H-bridges, speed control&lt;br /&gt;
* &#039;&#039;&#039;[[Sensor Interfacing]]&#039;&#039;&#039; (Intermediate) - I2C, SPI, analog sensors&lt;br /&gt;
&lt;br /&gt;
=== Component Pages ===&lt;br /&gt;
* [[Raspberry Pi Pico]] - Microcontroller specifications and GPIO&lt;br /&gt;
* [[TB6612FNG]] - Motor driver IC details&lt;br /&gt;
* [[Infrared Line Detector]] - Line sensor module explanation&lt;br /&gt;
* [[MP1584]] - Buck converter for power regulation&lt;br /&gt;
&lt;br /&gt;
=== External Resources ===&lt;br /&gt;
* [https://learn.sparkfun.com/tutorials SparkFun Electronics Tutorials]&lt;br /&gt;
* [https://www.allaboutcircuits.com/ All About Circuits] - Comprehensive electronics theory&lt;br /&gt;
* [https://www.eevblog.com/ EEVblog] - Electronics engineering video blog&lt;br /&gt;
&lt;br /&gt;
== Related Competencies ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039; - Join components to create circuits (hands-on fabrication)&lt;br /&gt;
* &#039;&#039;&#039;[[PCB Design]]&#039;&#039;&#039; - Design custom circuit boards (advanced electronics)&lt;br /&gt;
* &#039;&#039;&#039;[[Software]]&#039;&#039;&#039; - Program microcontrollers to control electronics&lt;br /&gt;
* &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039; - Understand the physical systems that electronics control&lt;br /&gt;
* &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039; - Create chassis and mounts for electronic components&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities]] - Hardware abilities that electronics enable&lt;br /&gt;
* [[SimpleBot]] - Apply electronics knowledge to build a robot&lt;br /&gt;
* [[Robotics Ontology]] - How electronics fits into the BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Competencies]]&lt;br /&gt;
[[Category:Skills]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Template:Tutorial&amp;diff=70</id>
		<title>Template:Tutorial</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Template:Tutorial&amp;diff=70"/>
		<updated>2025-10-11T19:49:53Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; This template creates an info box for tutorial pages.  == Usage == &amp;lt;pre&amp;gt; {{Tutorial |name=Soldering Guide |competency=Soldering |difficulty=Beginner |time=1-2 hours |prerequisites=None |materials=Soldering iron, solder, practice kit |next_steps=SimpleBot assembly, Soldering Techniques }} &amp;lt;/pre&amp;gt;  == Parameters == * &amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039; - Name of the tutorial * &amp;#039;&amp;#039;&amp;#039;competency&amp;#039;&amp;#039;&amp;#039; - Parent competency (linked) * &amp;#039;&amp;#039;&amp;#039;difficulty&amp;#039;&amp;#039;&amp;#039; - Beginner, Intermediate, or Advan...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This template creates an info box for tutorial pages.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Tutorial&lt;br /&gt;
|name=Soldering Guide&lt;br /&gt;
|competency=[[Soldering]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|time=1-2 hours&lt;br /&gt;
|prerequisites=None&lt;br /&gt;
|materials=Soldering iron, solder, practice kit&lt;br /&gt;
|next_steps=[[SimpleBot]] assembly, [[Soldering Techniques]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - Name of the tutorial&lt;br /&gt;
* &#039;&#039;&#039;competency&#039;&#039;&#039; - Parent competency (linked)&lt;br /&gt;
* &#039;&#039;&#039;difficulty&#039;&#039;&#039; - Beginner, Intermediate, or Advanced&lt;br /&gt;
* &#039;&#039;&#039;time&#039;&#039;&#039; - Estimated completion time&lt;br /&gt;
* &#039;&#039;&#039;prerequisites&#039;&#039;&#039; - Required prior knowledge/skills&lt;br /&gt;
* &#039;&#039;&#039;materials&#039;&#039;&#039; - Tools and materials needed&lt;br /&gt;
* &#039;&#039;&#039;next_steps&#039;&#039;&#039; - What to do after completing this tutorial&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: right; margin-left: 15px; width: 320px; border: 2px solid #2196F3; background-color: #f0f8ff;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-size: 120%; background-color: #2196F3; color: white;&amp;quot; | {{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 40%; background-color: #e3f2fd;&amp;quot; | Competency&lt;br /&gt;
| {{{competency}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e3f2fd;&amp;quot; | Difficulty&lt;br /&gt;
| {{{difficulty}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e3f2fd;&amp;quot; | Time Required&lt;br /&gt;
| {{{time}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e3f2fd;&amp;quot; | Prerequisites&lt;br /&gt;
| {{{prerequisites}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e3f2fd;&amp;quot; | Materials Needed&lt;br /&gt;
| {{{materials}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e3f2fd;&amp;quot; | Next Steps&lt;br /&gt;
| {{{next_steps}}}&lt;br /&gt;
|}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Template:Competency&amp;diff=69</id>
		<title>Template:Competency</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Template:Competency&amp;diff=69"/>
		<updated>2025-10-11T19:49:16Z</updated>

		<summary type="html">&lt;p&gt;John: Created page with &amp;quot;&amp;lt;noinclude&amp;gt; This template creates an info box for competency pages.  == Usage == &amp;lt;pre&amp;gt; {{Competency |name=Electronics |description=Understanding circuits, components, and electronic systems |difficulty_range=Beginner to Advanced |time_to_basic=2-4 weeks |essential_tools=Multimeter, breadboard, wire strippers |optional_tools=Oscilloscope, logic analyzer |beginner_tutorial=Electronics Fundamentals |unlocks_basic=Capability:Line Sensing, Capability:Differential Dr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This template creates an info box for competency pages.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Competency&lt;br /&gt;
|name=Electronics&lt;br /&gt;
|description=Understanding circuits, components, and electronic systems&lt;br /&gt;
|difficulty_range=Beginner to Advanced&lt;br /&gt;
|time_to_basic=2-4 weeks&lt;br /&gt;
|essential_tools=Multimeter, breadboard, wire strippers&lt;br /&gt;
|optional_tools=Oscilloscope, logic analyzer&lt;br /&gt;
|beginner_tutorial=[[Electronics Fundamentals]]&lt;br /&gt;
|unlocks_basic=[[Capability:Line Sensing]], [[Capability:Differential Drive]]&lt;br /&gt;
|unlocks_advanced=[[Capability:IMU Sensing]], [[Capability:Camera Vision]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - Name of the competency&lt;br /&gt;
* &#039;&#039;&#039;description&#039;&#039;&#039; - One-sentence description&lt;br /&gt;
* &#039;&#039;&#039;difficulty_range&#039;&#039;&#039; - Skill range (e.g., &amp;quot;Beginner to Advanced&amp;quot;)&lt;br /&gt;
* &#039;&#039;&#039;time_to_basic&#039;&#039;&#039; - Time to reach basic proficiency&lt;br /&gt;
* &#039;&#039;&#039;essential_tools&#039;&#039;&#039; - Minimum required tools&lt;br /&gt;
* &#039;&#039;&#039;optional_tools&#039;&#039;&#039; - Nice-to-have tools&lt;br /&gt;
* &#039;&#039;&#039;beginner_tutorial&#039;&#039;&#039; - Link to get-started tutorial&lt;br /&gt;
* &#039;&#039;&#039;unlocks_basic&#039;&#039;&#039; - Beginner-level capabilities unlocked&lt;br /&gt;
* &#039;&#039;&#039;unlocks_advanced&#039;&#039;&#039; - Advanced capabilities unlocked&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: right; margin-left: 15px; width: 350px; border: 2px solid #4CAF50; background-color: #f9fff9;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-size: 120%; background-color: #4CAF50; color: white;&amp;quot; | {{{name}}}&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-style: italic; padding: 10px;&amp;quot; | {{{description}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 40%; background-color: #e8f5e9;&amp;quot; | Difficulty Range&lt;br /&gt;
| {{{difficulty_range}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Time to Basic&lt;br /&gt;
| {{{time_to_basic}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Essential Tools&lt;br /&gt;
| {{{essential_tools}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Optional Tools&lt;br /&gt;
| {{{optional_tools|&#039;&#039;None&#039;&#039;}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Get Started&lt;br /&gt;
| {{{beginner_tutorial}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Unlocks (Basic)&lt;br /&gt;
| {{{unlocks_basic}}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background-color: #e8f5e9;&amp;quot; | Unlocks (Advanced)&lt;br /&gt;
| {{{unlocks_advanced|&#039;&#039;Various advanced capabilities&#039;&#039;}}}&lt;br /&gt;
|}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Main_Page&amp;diff=68</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Main_Page&amp;diff=68"/>
		<updated>2025-10-11T17:31:32Z</updated>

		<summary type="html">&lt;p&gt;John: /* About */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{| style=&amp;quot;width: 100%; background-color: #f0f0f0; border: 1px solid #aaa; padding: 20px; margin-bottom: 20px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: center; font-size: 150%; font-weight: bold;&amp;quot; | Welcome to the Bespoke Robot Society&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: center; font-size: 110%; padding-top: 10px;&amp;quot; | Building robots that work. Open source. Low cost. For everyone.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Our Mission ==&lt;br /&gt;
&lt;br /&gt;
Our mission is to &#039;&#039;&#039;lower the barrier to robotics&#039;&#039;&#039;: to create a world where building a robot to execute real-world tasks in your home or workplace is as simple as assembling a PC today. The plans and software for these robots &#039;&#039;&#039;must&#039;&#039;&#039; be open-source, or automation of daily tasks will be locked behind a paywall.&lt;br /&gt;
&lt;br /&gt;
At the Bespoke Robot Society, we believe you should build your own robot that is exactly what you want it to be. But that&#039;s far too difficult today for beginners, and starting from scratch leaves far too much to be done. So &#039;&#039;&#039;start with one of our designs&#039;&#039;&#039;, duplicate it exactly or use it as the starting point to your own designs. &#039;&#039;&#039;That&#039;s the power of open source.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We are at the beginning of our journey. Join us.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Featured Robot: SimpleBot ==&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%; border: 2px solid #4CAF50; background-color: #f9fff9; padding: 15px; margin: 20px 0;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 300px; vertical-align: top; padding-right: 20px;&amp;quot; |&lt;br /&gt;
[[File:simplebot.jpeg|300px|link=SimpleBot]]&lt;br /&gt;
| style=&amp;quot;vertical-align: top;&amp;quot; |&lt;br /&gt;
=== [[SimpleBot]] - Your First Robot ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SimpleBot&#039;&#039;&#039; is BRS&#039;s original robot design: a low-cost, educational differential drive robot that demonstrates core robotics concepts without compromising on capability.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What it does:&#039;&#039;&#039;&lt;br /&gt;
* Line following with infrared sensors&lt;br /&gt;
* Optical odometry (measures distance traveled)&lt;br /&gt;
* Motor control with PWM speed adjustment&lt;br /&gt;
* Ready for expansion (IMU, radio, additional sensors)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What you&#039;ll learn:&#039;&#039;&#039;&lt;br /&gt;
* 3D printing for robot chassis&lt;br /&gt;
* Through-hole soldering (optional PCB kit)&lt;br /&gt;
* MicroPython programming&lt;br /&gt;
* Motor control and sensor interfacing&lt;br /&gt;
* Dead reckoning and navigation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cost: Under $20&#039;&#039;&#039; (including batteries)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;[[SimpleBot|→ Build SimpleBot]]&#039;&#039;&#039; | &#039;&#039;&#039;[https://github.com/Bespoke-Robot-Society/simplebot GitHub Repository]&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Core Competencies ==&lt;br /&gt;
&lt;br /&gt;
The Society organizes robotics knowledge into &#039;&#039;&#039;Core Competencies&#039;&#039;&#039; - the individual skills required to go from a pile of parts to a robot completing a task. Our goal is to provide step-by-step instructions for each skill, or open-source methods to outsource that task.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 20%; background-color: #e6f3ff;&amp;quot; | Competency&lt;br /&gt;
! style=&amp;quot;width: 60%; background-color: #e6f3ff;&amp;quot; | Description&lt;br /&gt;
! style=&amp;quot;width: 20%; background-color: #e6f3ff;&amp;quot; | Get Started&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[3D Printing]]&#039;&#039;&#039;&lt;br /&gt;
| Design and manufacture custom plastic parts for robot chassis and mounting systems&lt;br /&gt;
| [[3D Printing Basics]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Electronics]]&#039;&#039;&#039;&lt;br /&gt;
| Understand circuits, components, sensors, and actuators; design and assemble electronic systems&lt;br /&gt;
| [[Electronics Fundamentals]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Soldering]]&#039;&#039;&#039;&lt;br /&gt;
| Join electronic components to create functional circuits; through-hole and surface-mount techniques&lt;br /&gt;
| [[Soldering Guide]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[PCB Design]]&#039;&#039;&#039;&lt;br /&gt;
| Design custom printed circuit boards to integrate electronics into compact, reliable packages&lt;br /&gt;
| [[KiCad Tutorial]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Software]]&#039;&#039;&#039;&lt;br /&gt;
| Program microcontrollers and single-board computers to control robot behavior&lt;br /&gt;
| [[MicroPython Basics]]&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Mechanics]]&#039;&#039;&#039;&lt;br /&gt;
| Apply mechanical engineering principles to robot motion, structure, and tool interfaces&lt;br /&gt;
| [[Mechanical Design]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Wiki Structure ==&lt;br /&gt;
&lt;br /&gt;
=== Robots ===&lt;br /&gt;
Complete robot designs with full documentation, code, and CAD files:&lt;br /&gt;
* &#039;&#039;&#039;[[SimpleBot]]&#039;&#039;&#039; - Differential drive robot with line following and odometry&lt;br /&gt;
* More robots coming soon...&lt;br /&gt;
&lt;br /&gt;
=== Components ===&lt;br /&gt;
Detailed references for electronic components, sensors, and modules:&lt;br /&gt;
* &#039;&#039;&#039;Microcontrollers&#039;&#039;&#039;: [[Raspberry Pi Pico]], [[ESP32]], [[Arduino]]&lt;br /&gt;
* &#039;&#039;&#039;Motor Drivers&#039;&#039;&#039;: [[TB6612FNG]], [[L298N]]&lt;br /&gt;
* &#039;&#039;&#039;Sensors&#039;&#039;&#039;: [[Infrared Line Detector]], [[MPU6050]]&lt;br /&gt;
* &#039;&#039;&#039;Power&#039;&#039;&#039;: [[MP1584]], [[Battery Management]]&lt;br /&gt;
&lt;br /&gt;
=== Skills &amp;amp; Tutorials ===&lt;br /&gt;
Step-by-step guides for building and programming robots:&lt;br /&gt;
* [[3D Printing for Robotics]]&lt;br /&gt;
* [[Soldering Techniques]]&lt;br /&gt;
* [[MicroPython Programming]]&lt;br /&gt;
* [[Motor Control Basics]]&lt;br /&gt;
* [[Sensor Interfacing]]&lt;br /&gt;
&lt;br /&gt;
=== Build Logs ===&lt;br /&gt;
Community members document their robot builds:&lt;br /&gt;
* [[Build Logs:Overview|View All Build Logs]]&lt;br /&gt;
* [[Build Logs:SimpleBot|SimpleBot Builds]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Recent Updates ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2025-10:&#039;&#039;&#039; SimpleBot CAD v1.0 released with improved sensor mounting and modular chassis design&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2025-10:&#039;&#039;&#039; SimpleBot review units shipped - first robots in the hands of testers&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2025-01:&#039;&#039;&#039; SimpleBot PCB design finalized (through-hole version for easy assembly)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2024-09:&#039;&#039;&#039; SimpleBot prototype tested - successful line following and odometry demonstrations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Get Involved ==&lt;br /&gt;
&lt;br /&gt;
The Bespoke Robot Society is a collaborative effort. Here&#039;s how you can participate:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Discord]]&#039;&#039;&#039; - Real-time chat, questions, and project discussions&lt;br /&gt;
* &#039;&#039;&#039;[[GitHub|GitHub Organization]]&#039;&#039;&#039; - Contribute code, CAD files, and documentation&lt;br /&gt;
* &#039;&#039;&#039;[[Mailing List]]&#039;&#039;&#039; - Monthly updates and announcements&lt;br /&gt;
* &#039;&#039;&#039;[[Contributing|Contribute to the Wiki]]&#039;&#039;&#039; - Share your knowledge and document your builds&lt;br /&gt;
&lt;br /&gt;
=== Membership ===&lt;br /&gt;
&lt;br /&gt;
BRS has no dues, no formal membership requirements, and no gatekeeping. If you&#039;re building robots and contributing to the community, you&#039;re a member. See [[Bespoke_Robot_Society:About#Structure_of_Membership|membership structure]] for informal titles based on contribution level.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== About ==&lt;br /&gt;
&lt;br /&gt;
Learn more about the Bespoke Robot Society:&lt;br /&gt;
* [[Bespoke_Robot_Society:About|Mission Statement and Structure]]&lt;br /&gt;
* [[Bespoke_Robot_Society:Battlebots_Are_Not_Robots|Philosophy: Battlebots Are Not Robots]]&lt;br /&gt;
* [[Bespoke_Robot_Society:Beyond_Toys|Philosophy: Beyond Toys]]&lt;br /&gt;
* [[Bespoke_Robot_Society:Cheap_Stuff_Works|Philosophy: Cheap Stuff Works]]&lt;br /&gt;
* [[Bespoke_Robot_Society:Toddler_Testing|Philosophy: Toddler Testing]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center; font-size: 90%; color: #666; margin-top: 40px;&amp;quot;&amp;gt;&lt;br /&gt;
This wiki is maintained by the Bespoke Robot Society community.&amp;lt;br&amp;gt;&lt;br /&gt;
All robot designs, code, and documentation are open source.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Bespoke_Robot_Society:About|Learn more about BRS]] | [https://github.com/Bespoke-Robot-Society GitHub] | [[Contact]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Main]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=67</id>
		<title>Bespoke Robot Society:Beyond Toys</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=67"/>
		<updated>2025-10-11T17:30:25Z</updated>

		<summary type="html">&lt;p&gt;John: /* Work vs Play */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Beyond Toys =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number two, exploring the distinction between toys and robots, and how we can use toys as a starting point without making them dead ends.&lt;br /&gt;
&lt;br /&gt;
== The Question ==&lt;br /&gt;
&lt;br /&gt;
How do we distinguish between a robot and a toy? Especially when the robots are mostly being advertised toward or made accessible to children, there&#039;s actually going to have a lot of overlap with a toy.&lt;br /&gt;
&lt;br /&gt;
But we want to move &#039;&#039;&#039;beyond toys&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Work vs Play ==&lt;br /&gt;
&lt;br /&gt;
While exploration is a great form of play, not every toy enables you to learn something from it. Not every toy is extensible. A lot of toys just make some kind of amusement available, but they don&#039;t make the mechanics of the toy itself available. A lot of toys cover up their internals as a means of safety or protecting intellectual property.&lt;br /&gt;
&lt;br /&gt;
Both of those causes are not applicable to Bespoke Robot Society&#039;s robots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are for play. Robots are for work.&#039;&#039;&#039; And sometimes the work we want to do is learning and teaching.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke_Robot_Society:Battlebots_Are_Not_Robots|BattleBots Are Not Robots]] for more on what makes something a real robot versus a remote-control toy.&lt;br /&gt;
&lt;br /&gt;
== Toys vs Tools ==&lt;br /&gt;
&lt;br /&gt;
Toys, like many beginner robotics kits, are designed with limited complexity and predefined goals—like following a line, bumping into walls. If all the thing does is that single task that it&#039;s built for, it could technically be a robot, but you&#039;re still probably looking at a toy.&lt;br /&gt;
&lt;br /&gt;
A true robot, on the other hand, is a &#039;&#039;&#039;tool designed to interact with an environment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Forward-Looking Robots ==&lt;br /&gt;
&lt;br /&gt;
I want to have a forward-looking definition of robot in Bespoke Robot Society.&lt;br /&gt;
&lt;br /&gt;
The old definition of robot would be those giant arms that assemble cars. They move very precisely, they have a lot of strength, they are enormously stiff, and you cannot go near them while they&#039;re in motion for your own safety. They&#039;re uncompromising. They are executing and repeating some motion a lot. Many of these robots may not have real feedback loops in the sense that they aren&#039;t really able to detect if their task is going well or not. They may require a human operator to observe and hit the e-stop when they do something faulty.&lt;br /&gt;
&lt;br /&gt;
But a &#039;&#039;&#039;forward-looking definition of robot is about autonomy&#039;&#039;&#039;. It&#039;s about reacting to your environment without planning it out perfectly ahead of time.&lt;br /&gt;
&lt;br /&gt;
What I mean by that is: if we have goals and we have capabilities and we have sensors, but we don&#039;t necessarily know everything about the environment—people could walk by, you don&#039;t need to bump into them, the terrain may have changed, stuff could move—we want to use our sensors and figure that out dynamically. &#039;&#039;&#039;That&#039;s a real robot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Problem with Staying a Toy ==&lt;br /&gt;
&lt;br /&gt;
Specifically, to advance away from a toy: a non-toy robot enables you to &#039;&#039;&#039;understand the problem it tries to solve&#039;&#039;&#039; and &#039;&#039;&#039;understand the limitations of the environment it can work in&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Then if you get a new constraint, a new difficulty added to that environment, or you want to move the robot to a new environment, if you understand how the robot works and how it relies on those environmental limitations, you can enhance the elements of the robot that don&#039;t suit the changes to the environment and you&#039;ll be able to create that new functionality yourself.&lt;br /&gt;
&lt;br /&gt;
That&#039;s really the goal: enabling real-world use cases. What we mean is, you think of something that your robot might be able to do, and now you need to:&lt;br /&gt;
# Understand the limitations it&#039;s currently built around&lt;br /&gt;
# Have some resources about how to go beyond those current limitations and make the robot more robust, or robust against different hazards&lt;br /&gt;
&lt;br /&gt;
Staying in the toy phase has an allure of &#039;&#039;&#039;false mastery&#039;&#039;&#039;. It&#039;s like playing with a toy that you understand fully. You might understand &#039;&#039;what&#039;&#039;, but not &#039;&#039;why&#039;&#039;. You may fully know how to operate, but you don&#039;t know how to extend. You may get proficiency as a user, but you will not become a creator.&lt;br /&gt;
&lt;br /&gt;
That&#039;s one of the main problems with toys: even when Bespoke Robot Society robots make good toys, I don&#039;t want them to remain toys or be limited by the definition of toy.&lt;br /&gt;
&lt;br /&gt;
== Tech Trees ==&lt;br /&gt;
&lt;br /&gt;
One of the ways I want to address this is with &#039;&#039;&#039;tech trees&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Bespoke Robot Society&#039;s $20 robot like [[SimpleBot]] might come in a kit with every single part. The PCB is already made, and you have no real requirements put upon you besides using a Phillips head screwdriver. Now you can hit go, and you can see the robot do the task it was immediately built for.&lt;br /&gt;
&lt;br /&gt;
That&#039;s great because we want people to feel the confidence, we want them to get the rapid feedback of being able to play. We want them to have a working thing quickly, not a pile of parts or an endless project.&lt;br /&gt;
&lt;br /&gt;
But where do you go from there?&lt;br /&gt;
&lt;br /&gt;
== From Kit to Custom ==&lt;br /&gt;
&lt;br /&gt;
You could mod your robot, you could add new parts, you could repeat the robot but from a lower level of pre-completion.&lt;br /&gt;
&lt;br /&gt;
Maybe you get another kit which does not include any 3D-printed parts. You go to the library and you 3D-print the parts that you need. Now you get to pick the colors, you might have to deal with a print failure, you have to think about the filaments you&#039;re going to use.&lt;br /&gt;
&lt;br /&gt;
Or maybe instead of a pre-built PCB, you can solder together a kit. It&#039;s the same circuit that you&#039;re familiar with, but it&#039;s just through-hole soldering. Or maybe you want to learn the surface-mount version of that board, so you go and get the smaller SMD components.&lt;br /&gt;
&lt;br /&gt;
Now we start to establish that equivalence: the prefab one is a factory-made SMD board, but the one you put together yourself is a through-hole board. But all the components are equivalent, the behavior is equivalent.&lt;br /&gt;
&lt;br /&gt;
Or we go all the way for artisanal, and we get a protoboard and we hand-wire it. Again, it could be equivalent, but now you&#039;re looking at something that&#039;s not just a circuit board—it is a &#039;&#039;&#039;steampunk work of art&#039;&#039;&#039;. It is a retro-aesthetic design choice, not just a part that completes the requirements or does the behavior. It&#039;s an expression of your mastery that you&#039;ve gone forward to do that.&lt;br /&gt;
&lt;br /&gt;
Same thing with the software. If you have a robot that does some task, you can improve it just by changing the software. The same hardware everyone has—whether it&#039;s surface-mount, through-hole, self-made, completely custom—if it meets the standard, if it does the same task, we can share that same software. Now you&#039;re not just learning about how to change things, you&#039;re also &#039;&#039;&#039;collaborating with other folks&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This relates directly to [[Bespoke_Robot_Society:Give_Them_Away_For_Free|giving robots away for free]]—when the designs are open and shared, everyone benefits from improvements.&lt;br /&gt;
&lt;br /&gt;
== The Starting Point ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s this huge tech tree, and we want everyone to be able to hop on and get the lay of the land by using pre-built robots, kits that are mostly assembled, things like that. But we also want you to be able to use your perspective of having that working robot to see all the different paths you could go down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are a starting point&#039;&#039;&#039;—we want you to turn it on and play immediately. But toys cannot be the end, and so many toys are dead ends as technology.&lt;br /&gt;
&lt;br /&gt;
I want you to take a toy and break it and fix it. I want you to learn something from it, and I want you to think of what it can&#039;t do right now but could if you just had X, Y, or Z.&lt;br /&gt;
&lt;br /&gt;
That&#039;s why I hope that Bespoke Robot Society will deliver robots that are not just toys. They should withstand [[Bespoke Robot Society:Toddler Testing|toddler testing]] and enable real learning and extension.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=66</id>
		<title>Bespoke Robot Society:Beyond Toys</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=66"/>
		<updated>2025-10-11T17:30:14Z</updated>

		<summary type="html">&lt;p&gt;John: /* Work vs Play */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Beyond Toys =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number two, exploring the distinction between toys and robots, and how we can use toys as a starting point without making them dead ends.&lt;br /&gt;
&lt;br /&gt;
== The Question ==&lt;br /&gt;
&lt;br /&gt;
How do we distinguish between a robot and a toy? Especially when the robots are mostly being advertised toward or made accessible to children, there&#039;s actually going to have a lot of overlap with a toy.&lt;br /&gt;
&lt;br /&gt;
But we want to move &#039;&#039;&#039;beyond toys&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Work vs Play ==&lt;br /&gt;
&lt;br /&gt;
While exploration is a great form of play, not every toy enables you to learn something from it. Not every toy is extensible. A lot of toys just make some kind of amusement available, but they don&#039;t make the mechanics of the toy itself available. A lot of toys cover up their internals as a means of safety or protecting intellectual property.&lt;br /&gt;
&lt;br /&gt;
Both of those causes are not applicable to Bespoke Robot Society&#039;s robots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are for play. Robots are for work.&#039;&#039;&#039; And sometimes the work we want to do is learning and teaching.&lt;br /&gt;
&lt;br /&gt;
See also: [[BBespoke_Robot_Society:Battlebots_Are_Not_Robots|BattleBots Are Not Robots]] for more on what makes something a real robot versus a remote-control toy.&lt;br /&gt;
&lt;br /&gt;
== Toys vs Tools ==&lt;br /&gt;
&lt;br /&gt;
Toys, like many beginner robotics kits, are designed with limited complexity and predefined goals—like following a line, bumping into walls. If all the thing does is that single task that it&#039;s built for, it could technically be a robot, but you&#039;re still probably looking at a toy.&lt;br /&gt;
&lt;br /&gt;
A true robot, on the other hand, is a &#039;&#039;&#039;tool designed to interact with an environment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Forward-Looking Robots ==&lt;br /&gt;
&lt;br /&gt;
I want to have a forward-looking definition of robot in Bespoke Robot Society.&lt;br /&gt;
&lt;br /&gt;
The old definition of robot would be those giant arms that assemble cars. They move very precisely, they have a lot of strength, they are enormously stiff, and you cannot go near them while they&#039;re in motion for your own safety. They&#039;re uncompromising. They are executing and repeating some motion a lot. Many of these robots may not have real feedback loops in the sense that they aren&#039;t really able to detect if their task is going well or not. They may require a human operator to observe and hit the e-stop when they do something faulty.&lt;br /&gt;
&lt;br /&gt;
But a &#039;&#039;&#039;forward-looking definition of robot is about autonomy&#039;&#039;&#039;. It&#039;s about reacting to your environment without planning it out perfectly ahead of time.&lt;br /&gt;
&lt;br /&gt;
What I mean by that is: if we have goals and we have capabilities and we have sensors, but we don&#039;t necessarily know everything about the environment—people could walk by, you don&#039;t need to bump into them, the terrain may have changed, stuff could move—we want to use our sensors and figure that out dynamically. &#039;&#039;&#039;That&#039;s a real robot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Problem with Staying a Toy ==&lt;br /&gt;
&lt;br /&gt;
Specifically, to advance away from a toy: a non-toy robot enables you to &#039;&#039;&#039;understand the problem it tries to solve&#039;&#039;&#039; and &#039;&#039;&#039;understand the limitations of the environment it can work in&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Then if you get a new constraint, a new difficulty added to that environment, or you want to move the robot to a new environment, if you understand how the robot works and how it relies on those environmental limitations, you can enhance the elements of the robot that don&#039;t suit the changes to the environment and you&#039;ll be able to create that new functionality yourself.&lt;br /&gt;
&lt;br /&gt;
That&#039;s really the goal: enabling real-world use cases. What we mean is, you think of something that your robot might be able to do, and now you need to:&lt;br /&gt;
# Understand the limitations it&#039;s currently built around&lt;br /&gt;
# Have some resources about how to go beyond those current limitations and make the robot more robust, or robust against different hazards&lt;br /&gt;
&lt;br /&gt;
Staying in the toy phase has an allure of &#039;&#039;&#039;false mastery&#039;&#039;&#039;. It&#039;s like playing with a toy that you understand fully. You might understand &#039;&#039;what&#039;&#039;, but not &#039;&#039;why&#039;&#039;. You may fully know how to operate, but you don&#039;t know how to extend. You may get proficiency as a user, but you will not become a creator.&lt;br /&gt;
&lt;br /&gt;
That&#039;s one of the main problems with toys: even when Bespoke Robot Society robots make good toys, I don&#039;t want them to remain toys or be limited by the definition of toy.&lt;br /&gt;
&lt;br /&gt;
== Tech Trees ==&lt;br /&gt;
&lt;br /&gt;
One of the ways I want to address this is with &#039;&#039;&#039;tech trees&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Bespoke Robot Society&#039;s $20 robot like [[SimpleBot]] might come in a kit with every single part. The PCB is already made, and you have no real requirements put upon you besides using a Phillips head screwdriver. Now you can hit go, and you can see the robot do the task it was immediately built for.&lt;br /&gt;
&lt;br /&gt;
That&#039;s great because we want people to feel the confidence, we want them to get the rapid feedback of being able to play. We want them to have a working thing quickly, not a pile of parts or an endless project.&lt;br /&gt;
&lt;br /&gt;
But where do you go from there?&lt;br /&gt;
&lt;br /&gt;
== From Kit to Custom ==&lt;br /&gt;
&lt;br /&gt;
You could mod your robot, you could add new parts, you could repeat the robot but from a lower level of pre-completion.&lt;br /&gt;
&lt;br /&gt;
Maybe you get another kit which does not include any 3D-printed parts. You go to the library and you 3D-print the parts that you need. Now you get to pick the colors, you might have to deal with a print failure, you have to think about the filaments you&#039;re going to use.&lt;br /&gt;
&lt;br /&gt;
Or maybe instead of a pre-built PCB, you can solder together a kit. It&#039;s the same circuit that you&#039;re familiar with, but it&#039;s just through-hole soldering. Or maybe you want to learn the surface-mount version of that board, so you go and get the smaller SMD components.&lt;br /&gt;
&lt;br /&gt;
Now we start to establish that equivalence: the prefab one is a factory-made SMD board, but the one you put together yourself is a through-hole board. But all the components are equivalent, the behavior is equivalent.&lt;br /&gt;
&lt;br /&gt;
Or we go all the way for artisanal, and we get a protoboard and we hand-wire it. Again, it could be equivalent, but now you&#039;re looking at something that&#039;s not just a circuit board—it is a &#039;&#039;&#039;steampunk work of art&#039;&#039;&#039;. It is a retro-aesthetic design choice, not just a part that completes the requirements or does the behavior. It&#039;s an expression of your mastery that you&#039;ve gone forward to do that.&lt;br /&gt;
&lt;br /&gt;
Same thing with the software. If you have a robot that does some task, you can improve it just by changing the software. The same hardware everyone has—whether it&#039;s surface-mount, through-hole, self-made, completely custom—if it meets the standard, if it does the same task, we can share that same software. Now you&#039;re not just learning about how to change things, you&#039;re also &#039;&#039;&#039;collaborating with other folks&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This relates directly to [[Bespoke_Robot_Society:Give_Them_Away_For_Free|giving robots away for free]]—when the designs are open and shared, everyone benefits from improvements.&lt;br /&gt;
&lt;br /&gt;
== The Starting Point ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s this huge tech tree, and we want everyone to be able to hop on and get the lay of the land by using pre-built robots, kits that are mostly assembled, things like that. But we also want you to be able to use your perspective of having that working robot to see all the different paths you could go down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are a starting point&#039;&#039;&#039;—we want you to turn it on and play immediately. But toys cannot be the end, and so many toys are dead ends as technology.&lt;br /&gt;
&lt;br /&gt;
I want you to take a toy and break it and fix it. I want you to learn something from it, and I want you to think of what it can&#039;t do right now but could if you just had X, Y, or Z.&lt;br /&gt;
&lt;br /&gt;
That&#039;s why I hope that Bespoke Robot Society will deliver robots that are not just toys. They should withstand [[Bespoke Robot Society:Toddler Testing|toddler testing]] and enable real learning and extension.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=65</id>
		<title>Bespoke Robot Society:Beyond Toys</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=65"/>
		<updated>2025-10-11T17:29:55Z</updated>

		<summary type="html">&lt;p&gt;John: /* From Kit to Custom */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Beyond Toys =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number two, exploring the distinction between toys and robots, and how we can use toys as a starting point without making them dead ends.&lt;br /&gt;
&lt;br /&gt;
== The Question ==&lt;br /&gt;
&lt;br /&gt;
How do we distinguish between a robot and a toy? Especially when the robots are mostly being advertised toward or made accessible to children, there&#039;s actually going to have a lot of overlap with a toy.&lt;br /&gt;
&lt;br /&gt;
But we want to move &#039;&#039;&#039;beyond toys&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Work vs Play ==&lt;br /&gt;
&lt;br /&gt;
While exploration is a great form of play, not every toy enables you to learn something from it. Not every toy is extensible. A lot of toys just make some kind of amusement available, but they don&#039;t make the mechanics of the toy itself available. A lot of toys cover up their internals as a means of safety or protecting intellectual property.&lt;br /&gt;
&lt;br /&gt;
Both of those causes are not applicable to Bespoke Robot Society&#039;s robots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are for play. Robots are for work.&#039;&#039;&#039; And sometimes the work we want to do is learning and teaching.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke Robot Society:BattleBots Are Not Robots|BattleBots Are Not Robots]] for more on what makes something a real robot versus a remote-control toy.&lt;br /&gt;
&lt;br /&gt;
== Toys vs Tools ==&lt;br /&gt;
&lt;br /&gt;
Toys, like many beginner robotics kits, are designed with limited complexity and predefined goals—like following a line, bumping into walls. If all the thing does is that single task that it&#039;s built for, it could technically be a robot, but you&#039;re still probably looking at a toy.&lt;br /&gt;
&lt;br /&gt;
A true robot, on the other hand, is a &#039;&#039;&#039;tool designed to interact with an environment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Forward-Looking Robots ==&lt;br /&gt;
&lt;br /&gt;
I want to have a forward-looking definition of robot in Bespoke Robot Society.&lt;br /&gt;
&lt;br /&gt;
The old definition of robot would be those giant arms that assemble cars. They move very precisely, they have a lot of strength, they are enormously stiff, and you cannot go near them while they&#039;re in motion for your own safety. They&#039;re uncompromising. They are executing and repeating some motion a lot. Many of these robots may not have real feedback loops in the sense that they aren&#039;t really able to detect if their task is going well or not. They may require a human operator to observe and hit the e-stop when they do something faulty.&lt;br /&gt;
&lt;br /&gt;
But a &#039;&#039;&#039;forward-looking definition of robot is about autonomy&#039;&#039;&#039;. It&#039;s about reacting to your environment without planning it out perfectly ahead of time.&lt;br /&gt;
&lt;br /&gt;
What I mean by that is: if we have goals and we have capabilities and we have sensors, but we don&#039;t necessarily know everything about the environment—people could walk by, you don&#039;t need to bump into them, the terrain may have changed, stuff could move—we want to use our sensors and figure that out dynamically. &#039;&#039;&#039;That&#039;s a real robot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Problem with Staying a Toy ==&lt;br /&gt;
&lt;br /&gt;
Specifically, to advance away from a toy: a non-toy robot enables you to &#039;&#039;&#039;understand the problem it tries to solve&#039;&#039;&#039; and &#039;&#039;&#039;understand the limitations of the environment it can work in&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Then if you get a new constraint, a new difficulty added to that environment, or you want to move the robot to a new environment, if you understand how the robot works and how it relies on those environmental limitations, you can enhance the elements of the robot that don&#039;t suit the changes to the environment and you&#039;ll be able to create that new functionality yourself.&lt;br /&gt;
&lt;br /&gt;
That&#039;s really the goal: enabling real-world use cases. What we mean is, you think of something that your robot might be able to do, and now you need to:&lt;br /&gt;
# Understand the limitations it&#039;s currently built around&lt;br /&gt;
# Have some resources about how to go beyond those current limitations and make the robot more robust, or robust against different hazards&lt;br /&gt;
&lt;br /&gt;
Staying in the toy phase has an allure of &#039;&#039;&#039;false mastery&#039;&#039;&#039;. It&#039;s like playing with a toy that you understand fully. You might understand &#039;&#039;what&#039;&#039;, but not &#039;&#039;why&#039;&#039;. You may fully know how to operate, but you don&#039;t know how to extend. You may get proficiency as a user, but you will not become a creator.&lt;br /&gt;
&lt;br /&gt;
That&#039;s one of the main problems with toys: even when Bespoke Robot Society robots make good toys, I don&#039;t want them to remain toys or be limited by the definition of toy.&lt;br /&gt;
&lt;br /&gt;
== Tech Trees ==&lt;br /&gt;
&lt;br /&gt;
One of the ways I want to address this is with &#039;&#039;&#039;tech trees&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Bespoke Robot Society&#039;s $20 robot like [[SimpleBot]] might come in a kit with every single part. The PCB is already made, and you have no real requirements put upon you besides using a Phillips head screwdriver. Now you can hit go, and you can see the robot do the task it was immediately built for.&lt;br /&gt;
&lt;br /&gt;
That&#039;s great because we want people to feel the confidence, we want them to get the rapid feedback of being able to play. We want them to have a working thing quickly, not a pile of parts or an endless project.&lt;br /&gt;
&lt;br /&gt;
But where do you go from there?&lt;br /&gt;
&lt;br /&gt;
== From Kit to Custom ==&lt;br /&gt;
&lt;br /&gt;
You could mod your robot, you could add new parts, you could repeat the robot but from a lower level of pre-completion.&lt;br /&gt;
&lt;br /&gt;
Maybe you get another kit which does not include any 3D-printed parts. You go to the library and you 3D-print the parts that you need. Now you get to pick the colors, you might have to deal with a print failure, you have to think about the filaments you&#039;re going to use.&lt;br /&gt;
&lt;br /&gt;
Or maybe instead of a pre-built PCB, you can solder together a kit. It&#039;s the same circuit that you&#039;re familiar with, but it&#039;s just through-hole soldering. Or maybe you want to learn the surface-mount version of that board, so you go and get the smaller SMD components.&lt;br /&gt;
&lt;br /&gt;
Now we start to establish that equivalence: the prefab one is a factory-made SMD board, but the one you put together yourself is a through-hole board. But all the components are equivalent, the behavior is equivalent.&lt;br /&gt;
&lt;br /&gt;
Or we go all the way for artisanal, and we get a protoboard and we hand-wire it. Again, it could be equivalent, but now you&#039;re looking at something that&#039;s not just a circuit board—it is a &#039;&#039;&#039;steampunk work of art&#039;&#039;&#039;. It is a retro-aesthetic design choice, not just a part that completes the requirements or does the behavior. It&#039;s an expression of your mastery that you&#039;ve gone forward to do that.&lt;br /&gt;
&lt;br /&gt;
Same thing with the software. If you have a robot that does some task, you can improve it just by changing the software. The same hardware everyone has—whether it&#039;s surface-mount, through-hole, self-made, completely custom—if it meets the standard, if it does the same task, we can share that same software. Now you&#039;re not just learning about how to change things, you&#039;re also &#039;&#039;&#039;collaborating with other folks&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This relates directly to [[Bespoke_Robot_Society:Give_Them_Away_For_Free|giving robots away for free]]—when the designs are open and shared, everyone benefits from improvements.&lt;br /&gt;
&lt;br /&gt;
== The Starting Point ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s this huge tech tree, and we want everyone to be able to hop on and get the lay of the land by using pre-built robots, kits that are mostly assembled, things like that. But we also want you to be able to use your perspective of having that working robot to see all the different paths you could go down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are a starting point&#039;&#039;&#039;—we want you to turn it on and play immediately. But toys cannot be the end, and so many toys are dead ends as technology.&lt;br /&gt;
&lt;br /&gt;
I want you to take a toy and break it and fix it. I want you to learn something from it, and I want you to think of what it can&#039;t do right now but could if you just had X, Y, or Z.&lt;br /&gt;
&lt;br /&gt;
That&#039;s why I hope that Bespoke Robot Society will deliver robots that are not just toys. They should withstand [[Bespoke Robot Society:Toddler Testing|toddler testing]] and enable real learning and extension.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=64</id>
		<title>Bespoke Robot Society:Give Them Away For Free</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=64"/>
		<updated>2025-10-11T17:28:40Z</updated>

		<summary type="html">&lt;p&gt;John: /* Why Free Is Better */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Give Them Away for Free =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number five, about the power of open source and why giving robots away creates more value than selling them.&lt;br /&gt;
&lt;br /&gt;
== The Model ==&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know that the robots can &#039;&#039;literally&#039;&#039; be given away for free. My plan for [[SimpleBot]] is actually to sell it for a price that includes enough profit in the sale price to purchase one additional robot and donate it to a school or kids&#039; group.&lt;br /&gt;
&lt;br /&gt;
Like, the $30 price tag might include a whole second robot&#039;s components for charity. One person pays for a robot, another group gets a free robot.&lt;br /&gt;
&lt;br /&gt;
== What Is Free? ==&lt;br /&gt;
&lt;br /&gt;
This is part of the power of &#039;&#039;&#039;open source&#039;&#039;&#039;. There&#039;s zero licensing cost to each robot. The blueprints, the code, the designs—everything is just on the internet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;I am giving away the robot for free if you define the robot to be all the information you need to make one.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, that doesn&#039;t include the physical parts like microcontrollers. If you&#039;ve got a 3D printer, I can&#039;t give you your own filament. But the idea is that the robot itself is just something that if you were able to get hold of the parts to make it, then you can have it. That&#039;s as simple as it gets.&lt;br /&gt;
&lt;br /&gt;
This philosophy connects with [[Bespoke Robot Society:Beyond Toys|the tech tree concept]]—at any level of the tree, from pre-assembled kit to custom build, the knowledge is free.&lt;br /&gt;
&lt;br /&gt;
== Zero Licensing Cost ==&lt;br /&gt;
&lt;br /&gt;
I really don&#039;t think that robots should be gatekept. I really don&#039;t want to see any licensing costs—not just for the use of the robot, but for the tools to make it.&lt;br /&gt;
&lt;br /&gt;
I don&#039;t want to rely on a student or hobbyist license. I don&#039;t want a one-year trial. I want to make this robot out of tools that are &#039;&#039;&#039;free for everyone, everywhere, for all time, under all situations&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
That means if you have no resources except the library computer, you have the same capabilities that I have to extend and learn from the robot.&lt;br /&gt;
&lt;br /&gt;
== Free Tools Only ==&lt;br /&gt;
&lt;br /&gt;
Every part of the robot&#039;s design should be made with free tools:&lt;br /&gt;
* &#039;&#039;&#039;CAD&#039;&#039;&#039;: FreeCAD (not Fusion 360)&lt;br /&gt;
* &#039;&#039;&#039;PCB design&#039;&#039;&#039;: KiCad (not Eagle)&lt;br /&gt;
* &#039;&#039;&#039;Software&#039;&#039;&#039;: Works on any platform&lt;br /&gt;
* &#039;&#039;&#039;Operating system&#039;&#039;&#039;: Linux-based workflow&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to design and make all these robots from Linux, so that somebody who does not have a Windows computer—if you&#039;re stuck on Windows 7 or Windows 10 and Microsoft just gives you hell for trying to operate your old computer on the internet these days—just go to Linux. It&#039;s still going to be able to do every single task of this robotic design workflow.&lt;br /&gt;
&lt;br /&gt;
== The Feedback Loop ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m hoping that I can prove this point, but my theory is that &#039;&#039;&#039;if you give, you actually get more back in return&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the feedback loop:&lt;br /&gt;
# I&#039;m going to give away these robots&lt;br /&gt;
# I&#039;m going to put the designs out for free&lt;br /&gt;
# I&#039;m going to mail them to people that ask for them&lt;br /&gt;
# I&#039;m going to send them to testers and say &amp;quot;Hey, how many kids do you have?&amp;quot; and give them that many robot boxes&lt;br /&gt;
&lt;br /&gt;
Everyone is going to send back:&lt;br /&gt;
* Feedback&lt;br /&gt;
* Complaints&lt;br /&gt;
* Ideas&lt;br /&gt;
* Photos of what they did with it&lt;br /&gt;
&lt;br /&gt;
If I find the right people to receive them, they&#039;re also going to send back:&lt;br /&gt;
* &#039;&#039;&#039;Patches&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Pull requests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Different software&#039;&#039;&#039; that can go on the wiki as more examples&lt;br /&gt;
&lt;br /&gt;
Everything that these people give back, they are repaying me for the free robot I&#039;ve given them, and they are giving it to everybody else that has received a free robot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My free robots I give away are getting more valuable and more feature-rich the more free robots I give away.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Real-world testing, like [[Bespoke Robot Society:Toddler Testing|toddler testing]], comes from this model—people actually using the robots and reporting back what works and what breaks.&lt;br /&gt;
&lt;br /&gt;
== Why Free Is Better ==&lt;br /&gt;
&lt;br /&gt;
As a BRS member, you can just hand out:&lt;br /&gt;
* CAD files&lt;br /&gt;
* 3D printer files&lt;br /&gt;
* Circuit diagrams&lt;br /&gt;
* Schematics&lt;br /&gt;
* The link to the wiki&lt;br /&gt;
* Kits and guides&lt;br /&gt;
&lt;br /&gt;
Anything that allows you to learn how to robot, build your robot, operate the robot—the knowledge, at least, is completely free.&lt;br /&gt;
&lt;br /&gt;
Why is free better than expensive? Seems almost like a silly question, but we need to acknowledge that a high-price robot kit is really common. The cost itself is a limitation which reduces who can participate in the innovation cycle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When you give away robots for free, you get more helpers.&#039;&#039;&#039; A free robot, by definition, just has more people that could help with the project than a hundred-dollar kit or something behind a paywall or a paid class requirement. All that stuff restricts the group of collaborators you can have.&lt;br /&gt;
&lt;br /&gt;
I need collaborators to succeed, so I&#039;m going to make everything I can absolutely free. You can make it free too. You can make whatever you want free.&lt;br /&gt;
&lt;br /&gt;
What I&#039;m hoping you&#039;ll see is: you as a robot builder are benefiting from the free robot that I&#039;m giving you. If you add anything to it, I want you to make that free as well. I can&#039;t force you—I think you could always keep it secret—but I&#039;m hoping you will also make it public and make it cost zero dollars for everyone else.&lt;br /&gt;
&lt;br /&gt;
That&#039;s the idea. See also [[Bespoke_Robot_Society:Battlebots_Are_Not_Robots|why BRS focuses on useful, educational robots]] rather than expensive competition machines.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Open Source]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=63</id>
		<title>Bespoke Robot Society:Toddler Testing</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=63"/>
		<updated>2025-10-11T17:28:04Z</updated>

		<summary type="html">&lt;p&gt;John: /* Why Toddler-Friendly Robots Matter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Toddler Testing =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number four, about why testing your robots in the real world—with actual toddlers—makes them better.&lt;br /&gt;
&lt;br /&gt;
== The Real World Includes Toddlers ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s very important to test your robots in the real world. And guess what? &#039;&#039;&#039;The real world includes toddlers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A lot of robotic projects fail because they encounter an edge case that was never tested for during development. Why not encourage testing with the metaphor of a toddler who will break anything they can, however they can?&lt;br /&gt;
&lt;br /&gt;
== Edge Cases in Human Form ==&lt;br /&gt;
&lt;br /&gt;
Toddlers do not share your preconceptions of the happy path of how to use your robot. They will:&lt;br /&gt;
* Poke and prod it&lt;br /&gt;
* Attempt to dismantle it&lt;br /&gt;
* Smash it&lt;br /&gt;
* Toss it&lt;br /&gt;
* Drop it&lt;br /&gt;
&lt;br /&gt;
They are edge cases in human form—unpredictable, creative, and relentless in their exploration.&lt;br /&gt;
&lt;br /&gt;
This relates to [[Bespoke Robot Society:Beyond Toys|moving beyond toys]]—real robots need to handle unexpected interactions, not just the controlled scenarios we design for.&lt;br /&gt;
&lt;br /&gt;
== Why Toddler-Friendly Robots Matter ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s another aspect of this, which is that I actually &#039;&#039;do&#039;&#039; want robots that toddlers can play with. I want toddlers to be exposed to these things and start to understand:&lt;br /&gt;
* &amp;quot;Oh, hey, look—this is a thing that&#039;s exhibiting behavior&amp;quot;&lt;br /&gt;
* &amp;quot;It has parts that I can remove&amp;quot;&lt;br /&gt;
* &amp;quot;I can add the parts back on&amp;quot;&lt;br /&gt;
* Maybe even start to imagine how to change the behavior&lt;br /&gt;
&lt;br /&gt;
How could I interact with this robot? I&#039;m going to block its path. I&#039;m going to draw a fork in the lines. Just whatever it takes to get kids thinking about &#039;&#039;&#039;systems&#039;&#039;&#039; and &#039;&#039;&#039;interactivity&#039;&#039;&#039; and &#039;&#039;&#039;cause and effect&#039;&#039;&#039; is a good thing.&lt;br /&gt;
&lt;br /&gt;
Cheap robots that validate their exploration without risking a lot of money are a great tool for that. This supports the philosophy of [[Bespoke_Robot_Society:Give_Them_Away_For_Free|making robots accessible to everyone]].&lt;br /&gt;
&lt;br /&gt;
== What Toddler Testing Improves ==&lt;br /&gt;
&lt;br /&gt;
=== Durability ===&lt;br /&gt;
&lt;br /&gt;
This happened to me while I was revising [[SimpleBot]]. The toddler got hold of the bot and dropped it off a table. One of the motor mounts snapped. I didn&#039;t freak out—I just went back to CAD and made that part twice as beefy.&lt;br /&gt;
&lt;br /&gt;
It was not a big drop, maybe a couple of feet, but it&#039;s the sort of thing that could feasibly happen in a school or something. Having that toddler test—you know what, you&#039;re going to need to make this part a bit thicker—that is a valid test.&lt;br /&gt;
&lt;br /&gt;
=== Simplicity ===&lt;br /&gt;
&lt;br /&gt;
If your parts are kind of fragile, or have sensitive gears, or fine parts that can be bent out of shape, &#039;&#039;&#039;a toddler will find those and bend them&#039;&#039;&#039;. They will cause that fragile part to stop working.&lt;br /&gt;
&lt;br /&gt;
If your robot can continue to function after being handled by a toddler, that&#039;s a good design. The principles that make robots [[Bespoke Robot Society:BattleBots Are Not Robots|actually useful]] also make them robust.&lt;br /&gt;
&lt;br /&gt;
== A Story from Airman Leadership School ==&lt;br /&gt;
&lt;br /&gt;
This was probably going on closer to two decades ago now. I had built a little Arduino robot. Back in those days, the Arduino was powered by a 9-volt battery and the motors by four double-As.&lt;br /&gt;
&lt;br /&gt;
I&#039;m just showing my classmates what I&#039;m working on recently. I put the robot down and flip the switch, and it starts driving ahead. You know, it&#039;s the military—everyone thinks they&#039;re cute. Some guy stands up, goes in front of it, and puts his boot in the way.&lt;br /&gt;
&lt;br /&gt;
The distance sensor on the front of it got up within a couple inches of his boot, started turning clockwise, and then kept going forward around his foot.&lt;br /&gt;
&lt;br /&gt;
In that moment everyone was just like &amp;quot;ooh.&amp;quot; I don&#039;t think that back in those days, when Arduino was kind of a new thing going around, anyone expected it to have that reactivity. They just did not remotely expect it to do that. The guy just expected it to run into his boot and not have any reaction to him being there.&lt;br /&gt;
&lt;br /&gt;
If we can do that same level of &#039;&#039;&#039;autonomy&#039;&#039;&#039;—that your toddler picks up and moves the robot, and when it gets set back down it continues its task—that&#039;s going to make it more robust to other, more realistic disruptions too.&lt;br /&gt;
&lt;br /&gt;
== Simulation vs Reality ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simulation is good. But toddlers are real.&#039;&#039;&#039; That&#039;s the idea here.&lt;br /&gt;
&lt;br /&gt;
Real-world conditions change. You need to have not just random noise from your simulation, but actual random events from things your robot has to deal with.&lt;br /&gt;
&lt;br /&gt;
Be robust. Let a toddler try your stuff. If your robot survives a toddler, it will survive anything.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Testing]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=62</id>
		<title>Bespoke Robot Society:Toddler Testing</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=62"/>
		<updated>2025-10-11T17:27:35Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Toddler Testing =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number four, about why testing your robots in the real world—with actual toddlers—makes them better.&lt;br /&gt;
&lt;br /&gt;
== The Real World Includes Toddlers ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s very important to test your robots in the real world. And guess what? &#039;&#039;&#039;The real world includes toddlers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A lot of robotic projects fail because they encounter an edge case that was never tested for during development. Why not encourage testing with the metaphor of a toddler who will break anything they can, however they can?&lt;br /&gt;
&lt;br /&gt;
== Edge Cases in Human Form ==&lt;br /&gt;
&lt;br /&gt;
Toddlers do not share your preconceptions of the happy path of how to use your robot. They will:&lt;br /&gt;
* Poke and prod it&lt;br /&gt;
* Attempt to dismantle it&lt;br /&gt;
* Smash it&lt;br /&gt;
* Toss it&lt;br /&gt;
* Drop it&lt;br /&gt;
&lt;br /&gt;
They are edge cases in human form—unpredictable, creative, and relentless in their exploration.&lt;br /&gt;
&lt;br /&gt;
This relates to [[Bespoke Robot Society:Beyond Toys|moving beyond toys]]—real robots need to handle unexpected interactions, not just the controlled scenarios we design for.&lt;br /&gt;
&lt;br /&gt;
== Why Toddler-Friendly Robots Matter ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s another aspect of this, which is that I actually &#039;&#039;do&#039;&#039; want robots that toddlers can play with. I want toddlers to be exposed to these things and start to understand:&lt;br /&gt;
* &amp;quot;Oh, hey, look—this is a thing that&#039;s exhibiting behavior&amp;quot;&lt;br /&gt;
* &amp;quot;It has parts that I can remove&amp;quot;&lt;br /&gt;
* &amp;quot;I can add the parts back on&amp;quot;&lt;br /&gt;
* Maybe even start to imagine how to change the behavior&lt;br /&gt;
&lt;br /&gt;
How could I interact with this robot? I&#039;m going to block its path. I&#039;m going to draw a fork in the lines. Just whatever it takes to get kids thinking about &#039;&#039;&#039;systems&#039;&#039;&#039; and &#039;&#039;&#039;interactivity&#039;&#039;&#039; and &#039;&#039;&#039;cause and effect&#039;&#039;&#039; is a good thing.&lt;br /&gt;
&lt;br /&gt;
Cheap robots that validate their exploration without risking a lot of money are a great tool for that. This supports the philosophy of [[Bespoke Robot Society:Give Them Away for Free|making robots accessible to everyone]].&lt;br /&gt;
&lt;br /&gt;
== What Toddler Testing Improves ==&lt;br /&gt;
&lt;br /&gt;
=== Durability ===&lt;br /&gt;
&lt;br /&gt;
This happened to me while I was revising [[SimpleBot]]. The toddler got hold of the bot and dropped it off a table. One of the motor mounts snapped. I didn&#039;t freak out—I just went back to CAD and made that part twice as beefy.&lt;br /&gt;
&lt;br /&gt;
It was not a big drop, maybe a couple of feet, but it&#039;s the sort of thing that could feasibly happen in a school or something. Having that toddler test—you know what, you&#039;re going to need to make this part a bit thicker—that is a valid test.&lt;br /&gt;
&lt;br /&gt;
=== Simplicity ===&lt;br /&gt;
&lt;br /&gt;
If your parts are kind of fragile, or have sensitive gears, or fine parts that can be bent out of shape, &#039;&#039;&#039;a toddler will find those and bend them&#039;&#039;&#039;. They will cause that fragile part to stop working.&lt;br /&gt;
&lt;br /&gt;
If your robot can continue to function after being handled by a toddler, that&#039;s a good design. The principles that make robots [[Bespoke Robot Society:BattleBots Are Not Robots|actually useful]] also make them robust.&lt;br /&gt;
&lt;br /&gt;
== A Story from Airman Leadership School ==&lt;br /&gt;
&lt;br /&gt;
This was probably going on closer to two decades ago now. I had built a little Arduino robot. Back in those days, the Arduino was powered by a 9-volt battery and the motors by four double-As.&lt;br /&gt;
&lt;br /&gt;
I&#039;m just showing my classmates what I&#039;m working on recently. I put the robot down and flip the switch, and it starts driving ahead. You know, it&#039;s the military—everyone thinks they&#039;re cute. Some guy stands up, goes in front of it, and puts his boot in the way.&lt;br /&gt;
&lt;br /&gt;
The distance sensor on the front of it got up within a couple inches of his boot, started turning clockwise, and then kept going forward around his foot.&lt;br /&gt;
&lt;br /&gt;
In that moment everyone was just like &amp;quot;ooh.&amp;quot; I don&#039;t think that back in those days, when Arduino was kind of a new thing going around, anyone expected it to have that reactivity. They just did not remotely expect it to do that. The guy just expected it to run into his boot and not have any reaction to him being there.&lt;br /&gt;
&lt;br /&gt;
If we can do that same level of &#039;&#039;&#039;autonomy&#039;&#039;&#039;—that your toddler picks up and moves the robot, and when it gets set back down it continues its task—that&#039;s going to make it more robust to other, more realistic disruptions too.&lt;br /&gt;
&lt;br /&gt;
== Simulation vs Reality ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simulation is good. But toddlers are real.&#039;&#039;&#039; That&#039;s the idea here.&lt;br /&gt;
&lt;br /&gt;
Real-world conditions change. You need to have not just random noise from your simulation, but actual random events from things your robot has to deal with.&lt;br /&gt;
&lt;br /&gt;
Be robust. Let a toddler try your stuff. If your robot survives a toddler, it will survive anything.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Testing]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Battlebots_Are_Not_Robots&amp;diff=61</id>
		<title>Bespoke Robot Society:Battlebots Are Not Robots</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Battlebots_Are_Not_Robots&amp;diff=61"/>
		<updated>2025-10-11T17:27:23Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= BattleBots Are Not Robots =&lt;br /&gt;
&lt;br /&gt;
This is the first BRS rant, addressing a fundamental misconception about what constitutes a robot.&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Everyone hears the word &amp;quot;robot&amp;quot; and they immediately jump to &amp;quot;oh, let&#039;s make a BattleBot.&amp;quot; This popular show has been in the zeitgeist for possibly decades now—I think it&#039;s still going on. I face this problem constantly: you say &amp;quot;I&#039;m building a robot,&amp;quot; and everyone&#039;s like &amp;quot;oh, I&#039;ve heard of BattleBots, I know all about those.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is such a poisonous understanding of what a robot is.&lt;br /&gt;
&lt;br /&gt;
== What Is a Robot? ==&lt;br /&gt;
&lt;br /&gt;
So first of all, what&#039;s the definition of a robot?&lt;br /&gt;
&lt;br /&gt;
A robot is something that has a &#039;&#039;&#039;control loop&#039;&#039;&#039; behind it. It&#039;s software reading data from sensors, making decisions, and taking actions. It&#039;s about:&lt;br /&gt;
* &#039;&#039;&#039;Navigating&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Perceiving&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Manipulating the world&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Why BattleBots Aren&#039;t Robots ==&lt;br /&gt;
&lt;br /&gt;
A BattleBot is not a robot. A BattleBot is just remote control. The BattleBot itself is only a radio receiver and a bunch of actuators. &#039;&#039;&#039;It&#039;s a puppet.&#039;&#039;&#039; There&#039;s no robotics to it because it&#039;s not using any sensors, it&#039;s not deciding what to do—that&#039;s just a person driving it. Not even a robot. The &amp;quot;bot&amp;quot; part of it is just a lie. It&#039;s just battle.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke Robot Society:Beyond Toys|Beyond Toys]] for more on the distinction between robots and remote-control toys.&lt;br /&gt;
&lt;br /&gt;
== What Robotics Is Really About ==&lt;br /&gt;
&lt;br /&gt;
Philosophically, what is a BattleBot in comparison to the field of robotics? It doesn&#039;t automate anything. It doesn&#039;t solve a problem. It doesn&#039;t make your life easier or better. It doesn&#039;t enable some process that wasn&#039;t possible on human labor alone.&lt;br /&gt;
&lt;br /&gt;
It&#039;s only &#039;&#039;&#039;destruction entertainment&#039;&#039;&#039;. They&#039;re completely aware of this, by the way they market it and design the show. This is no different from a destruction derby or those mud pits where they crash cars into each other. There&#039;s nothing robotic about the entertainment value of that show.&lt;br /&gt;
&lt;br /&gt;
Actual robotics is about:&lt;br /&gt;
* &#039;&#039;&#039;Problem solving&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Innovation&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Reducing cost&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Accuracy, repetition, and perfection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not about just smashing things by remote control. I think BattleBots has completely associated the wrong ideas with &amp;quot;robot&amp;quot; in people&#039;s minds.&lt;br /&gt;
&lt;br /&gt;
== The BRS Alternative ==&lt;br /&gt;
&lt;br /&gt;
BRS&#039;s mission, specifically, is supposed to get away from the BattleBot thing. BattleBots are remote control [[Bespoke Robot Society:Beyond Toys|toys]]. I want all of Bespoke Robot Society&#039;s robots to &#039;&#039;&#039;serve an actual purpose&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now, the purpose might just be that you don&#039;t know that much about robots and you want to fix that in a hands-on way. That&#039;s a problem that a BRS robot design could solve. I&#039;m completely happy with that being the problem. But smashing up another robot? Not really an interesting problem I want to solve with BRS robots.&lt;br /&gt;
&lt;br /&gt;
== Autonomy on a Budget ==&lt;br /&gt;
&lt;br /&gt;
The very first Bespoke Robot Society robot—[[SimpleBot]]—&#039;&#039;&#039;already has more sensors than the most sophisticated BattleBots&#039;&#039;&#039;, and it&#039;s only got line sensors.&lt;br /&gt;
&lt;br /&gt;
A BRS robot is about demonstrating that loop even under $20:&lt;br /&gt;
# &#039;&#039;&#039;Have sensors&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Make a decision based on those sensors&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Actuate in the world&#039;&#039;&#039;—use some kind of manipulator&lt;br /&gt;
&lt;br /&gt;
SimpleBot already has all those elements:&lt;br /&gt;
* It detects lines on the ground&lt;br /&gt;
* It has programmed logic to respond to those lines&lt;br /&gt;
* It changes its behavior in the world&lt;br /&gt;
&lt;br /&gt;
This is actual robotics, not just remote-control toys. See [[Bespoke Robot Society:Toddler Testing|Toddler Testing]] for how we validate that these robots work in the real world.&lt;br /&gt;
&lt;br /&gt;
== Battle Without Destruction ==&lt;br /&gt;
&lt;br /&gt;
Now, will we play war games? Sure. One of my prototypes here, the Tiny Tank 2, has a pan-tilt camera, a front-facing camera, and a LiDAR sensor. The intended use case for that robot is backyard-scale autonomous navigation and remote operation—either two-person (one driver, one gunner) or one of those roles, or both of those roles being served by AI—to interact with each other on the battlefield of my grassy yard.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use IR blasters pointed at each other, detecting being hit, detecting that there&#039;s a signal coming at you. That&#039;s a way to have some of the tactical excitement of a BattleBot without being focused on destruction. And it&#039;s also using it as an entry point to artificial intelligence and autonomy of the robot—whether that robot is literally learning by playing against us, or we custom-write software as an additional challenge for us, the designers, to try to write software ourselves that solves the problem rather than just remote-controlling it and solving the problem one time.&lt;br /&gt;
&lt;br /&gt;
You want to write software that solves it every time. Those are the sorts of things I think actually embody the spirit of robotics—the direction I want to take Bespoke Robot Society in.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=60</id>
		<title>Bespoke Robot Society:Beyond Toys</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=60"/>
		<updated>2025-10-11T17:26:36Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Beyond Toys =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number two, exploring the distinction between toys and robots, and how we can use toys as a starting point without making them dead ends.&lt;br /&gt;
&lt;br /&gt;
== The Question ==&lt;br /&gt;
&lt;br /&gt;
How do we distinguish between a robot and a toy? Especially when the robots are mostly being advertised toward or made accessible to children, there&#039;s actually going to have a lot of overlap with a toy.&lt;br /&gt;
&lt;br /&gt;
But we want to move &#039;&#039;&#039;beyond toys&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Work vs Play ==&lt;br /&gt;
&lt;br /&gt;
While exploration is a great form of play, not every toy enables you to learn something from it. Not every toy is extensible. A lot of toys just make some kind of amusement available, but they don&#039;t make the mechanics of the toy itself available. A lot of toys cover up their internals as a means of safety or protecting intellectual property.&lt;br /&gt;
&lt;br /&gt;
Both of those causes are not applicable to Bespoke Robot Society&#039;s robots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are for play. Robots are for work.&#039;&#039;&#039; And sometimes the work we want to do is learning and teaching.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke Robot Society:BattleBots Are Not Robots|BattleBots Are Not Robots]] for more on what makes something a real robot versus a remote-control toy.&lt;br /&gt;
&lt;br /&gt;
== Toys vs Tools ==&lt;br /&gt;
&lt;br /&gt;
Toys, like many beginner robotics kits, are designed with limited complexity and predefined goals—like following a line, bumping into walls. If all the thing does is that single task that it&#039;s built for, it could technically be a robot, but you&#039;re still probably looking at a toy.&lt;br /&gt;
&lt;br /&gt;
A true robot, on the other hand, is a &#039;&#039;&#039;tool designed to interact with an environment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Forward-Looking Robots ==&lt;br /&gt;
&lt;br /&gt;
I want to have a forward-looking definition of robot in Bespoke Robot Society.&lt;br /&gt;
&lt;br /&gt;
The old definition of robot would be those giant arms that assemble cars. They move very precisely, they have a lot of strength, they are enormously stiff, and you cannot go near them while they&#039;re in motion for your own safety. They&#039;re uncompromising. They are executing and repeating some motion a lot. Many of these robots may not have real feedback loops in the sense that they aren&#039;t really able to detect if their task is going well or not. They may require a human operator to observe and hit the e-stop when they do something faulty.&lt;br /&gt;
&lt;br /&gt;
But a &#039;&#039;&#039;forward-looking definition of robot is about autonomy&#039;&#039;&#039;. It&#039;s about reacting to your environment without planning it out perfectly ahead of time.&lt;br /&gt;
&lt;br /&gt;
What I mean by that is: if we have goals and we have capabilities and we have sensors, but we don&#039;t necessarily know everything about the environment—people could walk by, you don&#039;t need to bump into them, the terrain may have changed, stuff could move—we want to use our sensors and figure that out dynamically. &#039;&#039;&#039;That&#039;s a real robot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Problem with Staying a Toy ==&lt;br /&gt;
&lt;br /&gt;
Specifically, to advance away from a toy: a non-toy robot enables you to &#039;&#039;&#039;understand the problem it tries to solve&#039;&#039;&#039; and &#039;&#039;&#039;understand the limitations of the environment it can work in&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Then if you get a new constraint, a new difficulty added to that environment, or you want to move the robot to a new environment, if you understand how the robot works and how it relies on those environmental limitations, you can enhance the elements of the robot that don&#039;t suit the changes to the environment and you&#039;ll be able to create that new functionality yourself.&lt;br /&gt;
&lt;br /&gt;
That&#039;s really the goal: enabling real-world use cases. What we mean is, you think of something that your robot might be able to do, and now you need to:&lt;br /&gt;
# Understand the limitations it&#039;s currently built around&lt;br /&gt;
# Have some resources about how to go beyond those current limitations and make the robot more robust, or robust against different hazards&lt;br /&gt;
&lt;br /&gt;
Staying in the toy phase has an allure of &#039;&#039;&#039;false mastery&#039;&#039;&#039;. It&#039;s like playing with a toy that you understand fully. You might understand &#039;&#039;what&#039;&#039;, but not &#039;&#039;why&#039;&#039;. You may fully know how to operate, but you don&#039;t know how to extend. You may get proficiency as a user, but you will not become a creator.&lt;br /&gt;
&lt;br /&gt;
That&#039;s one of the main problems with toys: even when Bespoke Robot Society robots make good toys, I don&#039;t want them to remain toys or be limited by the definition of toy.&lt;br /&gt;
&lt;br /&gt;
== Tech Trees ==&lt;br /&gt;
&lt;br /&gt;
One of the ways I want to address this is with &#039;&#039;&#039;tech trees&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Bespoke Robot Society&#039;s $20 robot like [[SimpleBot]] might come in a kit with every single part. The PCB is already made, and you have no real requirements put upon you besides using a Phillips head screwdriver. Now you can hit go, and you can see the robot do the task it was immediately built for.&lt;br /&gt;
&lt;br /&gt;
That&#039;s great because we want people to feel the confidence, we want them to get the rapid feedback of being able to play. We want them to have a working thing quickly, not a pile of parts or an endless project.&lt;br /&gt;
&lt;br /&gt;
But where do you go from there?&lt;br /&gt;
&lt;br /&gt;
== From Kit to Custom ==&lt;br /&gt;
&lt;br /&gt;
You could mod your robot, you could add new parts, you could repeat the robot but from a lower level of pre-completion.&lt;br /&gt;
&lt;br /&gt;
Maybe you get another kit which does not include any 3D-printed parts. You go to the library and you 3D-print the parts that you need. Now you get to pick the colors, you might have to deal with a print failure, you have to think about the filaments you&#039;re going to use.&lt;br /&gt;
&lt;br /&gt;
Or maybe instead of a pre-built PCB, you can solder together a kit. It&#039;s the same circuit that you&#039;re familiar with, but it&#039;s just through-hole soldering. Or maybe you want to learn the surface-mount version of that board, so you go and get the smaller SMD components.&lt;br /&gt;
&lt;br /&gt;
Now we start to establish that equivalence: the prefab one is a factory-made SMD board, but the one you put together yourself is a through-hole board. But all the components are equivalent, the behavior is equivalent.&lt;br /&gt;
&lt;br /&gt;
Or we go all the way for artisanal, and we get a protoboard and we hand-wire it. Again, it could be equivalent, but now you&#039;re looking at something that&#039;s not just a circuit board—it is a &#039;&#039;&#039;steampunk work of art&#039;&#039;&#039;. It is a retro-aesthetic design choice, not just a part that completes the requirements or does the behavior. It&#039;s an expression of your mastery that you&#039;ve gone forward to do that.&lt;br /&gt;
&lt;br /&gt;
Same thing with the software. If you have a robot that does some task, you can improve it just by changing the software. The same hardware everyone has—whether it&#039;s surface-mount, through-hole, self-made, completely custom—if it meets the standard, if it does the same task, we can share that same software. Now you&#039;re not just learning about how to change things, you&#039;re also &#039;&#039;&#039;collaborating with other folks&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This relates directly to [[Bespoke Robot Society:Give Them Away for Free|giving robots away for free]]—when the designs are open and shared, everyone benefits from improvements.&lt;br /&gt;
&lt;br /&gt;
== The Starting Point ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s this huge tech tree, and we want everyone to be able to hop on and get the lay of the land by using pre-built robots, kits that are mostly assembled, things like that. But we also want you to be able to use your perspective of having that working robot to see all the different paths you could go down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are a starting point&#039;&#039;&#039;—we want you to turn it on and play immediately. But toys cannot be the end, and so many toys are dead ends as technology.&lt;br /&gt;
&lt;br /&gt;
I want you to take a toy and break it and fix it. I want you to learn something from it, and I want you to think of what it can&#039;t do right now but could if you just had X, Y, or Z.&lt;br /&gt;
&lt;br /&gt;
That&#039;s why I hope that Bespoke Robot Society will deliver robots that are not just toys. They should withstand [[Bespoke Robot Society:Toddler Testing|toddler testing]] and enable real learning and extension.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=59</id>
		<title>Bespoke Robot Society:Give Them Away For Free</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=59"/>
		<updated>2025-10-11T17:26:22Z</updated>

		<summary type="html">&lt;p&gt;John: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Give Them Away for Free =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number five, about the power of open source and why giving robots away creates more value than selling them.&lt;br /&gt;
&lt;br /&gt;
== The Model ==&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know that the robots can &#039;&#039;literally&#039;&#039; be given away for free. My plan for [[SimpleBot]] is actually to sell it for a price that includes enough profit in the sale price to purchase one additional robot and donate it to a school or kids&#039; group.&lt;br /&gt;
&lt;br /&gt;
Like, the $30 price tag might include a whole second robot&#039;s components for charity. One person pays for a robot, another group gets a free robot.&lt;br /&gt;
&lt;br /&gt;
== What Is Free? ==&lt;br /&gt;
&lt;br /&gt;
This is part of the power of &#039;&#039;&#039;open source&#039;&#039;&#039;. There&#039;s zero licensing cost to each robot. The blueprints, the code, the designs—everything is just on the internet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;I am giving away the robot for free if you define the robot to be all the information you need to make one.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, that doesn&#039;t include the physical parts like microcontrollers. If you&#039;ve got a 3D printer, I can&#039;t give you your own filament. But the idea is that the robot itself is just something that if you were able to get hold of the parts to make it, then you can have it. That&#039;s as simple as it gets.&lt;br /&gt;
&lt;br /&gt;
This philosophy connects with [[Bespoke Robot Society:Beyond Toys|the tech tree concept]]—at any level of the tree, from pre-assembled kit to custom build, the knowledge is free.&lt;br /&gt;
&lt;br /&gt;
== Zero Licensing Cost ==&lt;br /&gt;
&lt;br /&gt;
I really don&#039;t think that robots should be gatekept. I really don&#039;t want to see any licensing costs—not just for the use of the robot, but for the tools to make it.&lt;br /&gt;
&lt;br /&gt;
I don&#039;t want to rely on a student or hobbyist license. I don&#039;t want a one-year trial. I want to make this robot out of tools that are &#039;&#039;&#039;free for everyone, everywhere, for all time, under all situations&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
That means if you have no resources except the library computer, you have the same capabilities that I have to extend and learn from the robot.&lt;br /&gt;
&lt;br /&gt;
== Free Tools Only ==&lt;br /&gt;
&lt;br /&gt;
Every part of the robot&#039;s design should be made with free tools:&lt;br /&gt;
* &#039;&#039;&#039;CAD&#039;&#039;&#039;: FreeCAD (not Fusion 360)&lt;br /&gt;
* &#039;&#039;&#039;PCB design&#039;&#039;&#039;: KiCad (not Eagle)&lt;br /&gt;
* &#039;&#039;&#039;Software&#039;&#039;&#039;: Works on any platform&lt;br /&gt;
* &#039;&#039;&#039;Operating system&#039;&#039;&#039;: Linux-based workflow&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to design and make all these robots from Linux, so that somebody who does not have a Windows computer—if you&#039;re stuck on Windows 7 or Windows 10 and Microsoft just gives you hell for trying to operate your old computer on the internet these days—just go to Linux. It&#039;s still going to be able to do every single task of this robotic design workflow.&lt;br /&gt;
&lt;br /&gt;
== The Feedback Loop ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m hoping that I can prove this point, but my theory is that &#039;&#039;&#039;if you give, you actually get more back in return&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the feedback loop:&lt;br /&gt;
# I&#039;m going to give away these robots&lt;br /&gt;
# I&#039;m going to put the designs out for free&lt;br /&gt;
# I&#039;m going to mail them to people that ask for them&lt;br /&gt;
# I&#039;m going to send them to testers and say &amp;quot;Hey, how many kids do you have?&amp;quot; and give them that many robot boxes&lt;br /&gt;
&lt;br /&gt;
Everyone is going to send back:&lt;br /&gt;
* Feedback&lt;br /&gt;
* Complaints&lt;br /&gt;
* Ideas&lt;br /&gt;
* Photos of what they did with it&lt;br /&gt;
&lt;br /&gt;
If I find the right people to receive them, they&#039;re also going to send back:&lt;br /&gt;
* &#039;&#039;&#039;Patches&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Pull requests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Different software&#039;&#039;&#039; that can go on the wiki as more examples&lt;br /&gt;
&lt;br /&gt;
Everything that these people give back, they are repaying me for the free robot I&#039;ve given them, and they are giving it to everybody else that has received a free robot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My free robots I give away are getting more valuable and more feature-rich the more free robots I give away.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Real-world testing, like [[Bespoke Robot Society:Toddler Testing|toddler testing]], comes from this model—people actually using the robots and reporting back what works and what breaks.&lt;br /&gt;
&lt;br /&gt;
== Why Free Is Better ==&lt;br /&gt;
&lt;br /&gt;
As a BRS member, you can just hand out:&lt;br /&gt;
* CAD files&lt;br /&gt;
* 3D printer files&lt;br /&gt;
* Circuit diagrams&lt;br /&gt;
* Schematics&lt;br /&gt;
* The link to the wiki&lt;br /&gt;
* Kits and guides&lt;br /&gt;
&lt;br /&gt;
Anything that allows you to learn how to robot, build your robot, operate the robot—the knowledge, at least, is completely free.&lt;br /&gt;
&lt;br /&gt;
Why is free better than expensive? Seems almost like a silly question, but we need to acknowledge that a high-price robot kit is really common. The cost itself is a limitation which reduces who can participate in the innovation cycle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When you give away robots for free, you get more helpers.&#039;&#039;&#039; A free robot, by definition, just has more people that could help with the project than a hundred-dollar kit or something behind a paywall or a paid class requirement. All that stuff restricts the group of collaborators you can have.&lt;br /&gt;
&lt;br /&gt;
I need collaborators to succeed, so I&#039;m going to make everything I can absolutely free. You can make it free too. You can make whatever you want free.&lt;br /&gt;
&lt;br /&gt;
What I&#039;m hoping you&#039;ll see is: you as a robot builder are benefiting from the free robot that I&#039;m giving you. If you add anything to it, I want you to make that free as well. I can&#039;t force you—I think you could always keep it secret—but I&#039;m hoping you will also make it public and make it cost zero dollars for everyone else.&lt;br /&gt;
&lt;br /&gt;
That&#039;s the idea. See also [[Bespoke Robot Society:BattleBots Are Not Robots|why BRS focuses on useful, educational robots]] rather than expensive competition machines.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Open Source]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=58</id>
		<title>Bespoke Robot Society:Give Them Away For Free</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Give_Them_Away_For_Free&amp;diff=58"/>
		<updated>2025-10-11T17:25:55Z</updated>

		<summary type="html">&lt;p&gt;John: LLM cleaned up audio transcript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Give Them Away for Free =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number five, about the power of open source and why giving robots away creates more value than selling them.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
# [[#The_Model|The Model]]&lt;br /&gt;
# [[#What_Is_Free?|What Is Free?]]&lt;br /&gt;
# [[#Zero_Licensing_Cost|Zero Licensing Cost]]&lt;br /&gt;
# [[#Free_Tools_Only|Free Tools Only]]&lt;br /&gt;
# [[#The_Feedback_Loop|The Feedback Loop]]&lt;br /&gt;
# [[#Why_Free_Is_Better|Why Free Is Better]]&lt;br /&gt;
&lt;br /&gt;
== The Model ==&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know that the robots can &#039;&#039;literally&#039;&#039; be given away for free. My plan for [[SimpleBot]] is actually to sell it for a price that includes enough profit in the sale price to purchase one additional robot and donate it to a school or kids&#039; group.&lt;br /&gt;
&lt;br /&gt;
Like, the $30 price tag might include a whole second robot&#039;s components for charity. One person pays for a robot, another group gets a free robot.&lt;br /&gt;
&lt;br /&gt;
== What Is Free? ==&lt;br /&gt;
&lt;br /&gt;
This is part of the power of &#039;&#039;&#039;open source&#039;&#039;&#039;. There&#039;s zero licensing cost to each robot. The blueprints, the code, the designs—everything is just on the internet.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;I am giving away the robot for free if you define the robot to be all the information you need to make one.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, that doesn&#039;t include the physical parts like microcontrollers. If you&#039;ve got a 3D printer, I can&#039;t give you your own filament. But the idea is that the robot itself is just something that if you were able to get hold of the parts to make it, then you can have it. That&#039;s as simple as it gets.&lt;br /&gt;
&lt;br /&gt;
This philosophy connects with [[Bespoke Robot Society:Beyond Toys|the tech tree concept]]—at any level of the tree, from pre-assembled kit to custom build, the knowledge is free.&lt;br /&gt;
&lt;br /&gt;
== Zero Licensing Cost ==&lt;br /&gt;
&lt;br /&gt;
I really don&#039;t think that robots should be gatekept. I really don&#039;t want to see any licensing costs—not just for the use of the robot, but for the tools to make it.&lt;br /&gt;
&lt;br /&gt;
I don&#039;t want to rely on a student or hobbyist license. I don&#039;t want a one-year trial. I want to make this robot out of tools that are &#039;&#039;&#039;free for everyone, everywhere, for all time, under all situations&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
That means if you have no resources except the library computer, you have the same capabilities that I have to extend and learn from the robot.&lt;br /&gt;
&lt;br /&gt;
== Free Tools Only ==&lt;br /&gt;
&lt;br /&gt;
Every part of the robot&#039;s design should be made with free tools:&lt;br /&gt;
* &#039;&#039;&#039;CAD&#039;&#039;&#039;: FreeCAD (not Fusion 360)&lt;br /&gt;
* &#039;&#039;&#039;PCB design&#039;&#039;&#039;: KiCad (not Eagle)&lt;br /&gt;
* &#039;&#039;&#039;Software&#039;&#039;&#039;: Works on any platform&lt;br /&gt;
* &#039;&#039;&#039;Operating system&#039;&#039;&#039;: Linux-based workflow&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to design and make all these robots from Linux, so that somebody who does not have a Windows computer—if you&#039;re stuck on Windows 7 or Windows 10 and Microsoft just gives you hell for trying to operate your old computer on the internet these days—just go to Linux. It&#039;s still going to be able to do every single task of this robotic design workflow.&lt;br /&gt;
&lt;br /&gt;
== The Feedback Loop ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m hoping that I can prove this point, but my theory is that &#039;&#039;&#039;if you give, you actually get more back in return&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the feedback loop:&lt;br /&gt;
# I&#039;m going to give away these robots&lt;br /&gt;
# I&#039;m going to put the designs out for free&lt;br /&gt;
# I&#039;m going to mail them to people that ask for them&lt;br /&gt;
# I&#039;m going to send them to testers and say &amp;quot;Hey, how many kids do you have?&amp;quot; and give them that many robot boxes&lt;br /&gt;
&lt;br /&gt;
Everyone is going to send back:&lt;br /&gt;
* Feedback&lt;br /&gt;
* Complaints&lt;br /&gt;
* Ideas&lt;br /&gt;
* Photos of what they did with it&lt;br /&gt;
&lt;br /&gt;
If I find the right people to receive them, they&#039;re also going to send back:&lt;br /&gt;
* &#039;&#039;&#039;Patches&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Pull requests&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Different software&#039;&#039;&#039; that can go on the wiki as more examples&lt;br /&gt;
&lt;br /&gt;
Everything that these people give back, they are repaying me for the free robot I&#039;ve given them, and they are giving it to everybody else that has received a free robot.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;My free robots I give away are getting more valuable and more feature-rich the more free robots I give away.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Real-world testing, like [[Bespoke Robot Society:Toddler Testing|toddler testing]], comes from this model—people actually using the robots and reporting back what works and what breaks.&lt;br /&gt;
&lt;br /&gt;
== Why Free Is Better ==&lt;br /&gt;
&lt;br /&gt;
As a BRS member, you can just hand out:&lt;br /&gt;
* CAD files&lt;br /&gt;
* 3D printer files&lt;br /&gt;
* Circuit diagrams&lt;br /&gt;
* Schematics&lt;br /&gt;
* The link to the wiki&lt;br /&gt;
* Kits and guides&lt;br /&gt;
&lt;br /&gt;
Anything that allows you to learn how to robot, build your robot, operate the robot—the knowledge, at least, is completely free.&lt;br /&gt;
&lt;br /&gt;
Why is free better than expensive? Seems almost like a silly question, but we need to acknowledge that a high-price robot kit is really common. The cost itself is a limitation which reduces who can participate in the innovation cycle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When you give away robots for free, you get more helpers.&#039;&#039;&#039; A free robot, by definition, just has more people that could help with the project than a hundred-dollar kit or something behind a paywall or a paid class requirement. All that stuff restricts the group of collaborators you can have.&lt;br /&gt;
&lt;br /&gt;
I need collaborators to succeed, so I&#039;m going to make everything I can absolutely free. You can make it free too. You can make whatever you want free.&lt;br /&gt;
&lt;br /&gt;
What I&#039;m hoping you&#039;ll see is: you as a robot builder are benefiting from the free robot that I&#039;m giving you. If you add anything to it, I want you to make that free as well. I can&#039;t force you—I think you could always keep it secret—but I&#039;m hoping you will also make it public and make it cost zero dollars for everyone else.&lt;br /&gt;
&lt;br /&gt;
That&#039;s the idea. See also [[Bespoke Robot Society:BattleBots Are Not Robots|why BRS focuses on useful, educational robots]] rather than expensive competition machines.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Open Source]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=57</id>
		<title>Bespoke Robot Society:Toddler Testing</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Toddler_Testing&amp;diff=57"/>
		<updated>2025-10-11T17:25:41Z</updated>

		<summary type="html">&lt;p&gt;John: LLM cleaned up audio transcript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Toddler Testing =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number four, about why testing your robots in the real world—with actual toddlers—makes them better.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
# [[#The_Real_World_Includes_Toddlers|The Real World Includes Toddlers]]&lt;br /&gt;
# [[#Edge_Cases_in_Human_Form|Edge Cases in Human Form]]&lt;br /&gt;
# [[#Why_Toddler-Friendly_Robots_Matter|Why Toddler-Friendly Robots Matter]]&lt;br /&gt;
# [[#What_Toddler_Testing_Improves|What Toddler Testing Improves]]&lt;br /&gt;
# [[#A_Story_from_Airman_Leadership_School|A Story from Airman Leadership School]]&lt;br /&gt;
# [[#Simulation_vs_Reality|Simulation vs Reality]]&lt;br /&gt;
&lt;br /&gt;
== The Real World Includes Toddlers ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s very important to test your robots in the real world. And guess what? &#039;&#039;&#039;The real world includes toddlers.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A lot of robotic projects fail because they encounter an edge case that was never tested for during development. Why not encourage testing with the metaphor of a toddler who will break anything they can, however they can?&lt;br /&gt;
&lt;br /&gt;
== Edge Cases in Human Form ==&lt;br /&gt;
&lt;br /&gt;
Toddlers do not share your preconceptions of the happy path of how to use your robot. They will:&lt;br /&gt;
* Poke and prod it&lt;br /&gt;
* Attempt to dismantle it&lt;br /&gt;
* Smash it&lt;br /&gt;
* Toss it&lt;br /&gt;
* Drop it&lt;br /&gt;
&lt;br /&gt;
They are edge cases in human form—unpredictable, creative, and relentless in their exploration.&lt;br /&gt;
&lt;br /&gt;
This relates to [[Bespoke Robot Society:Beyond Toys|moving beyond toys]]—real robots need to handle unexpected interactions, not just the controlled scenarios we design for.&lt;br /&gt;
&lt;br /&gt;
== Why Toddler-Friendly Robots Matter ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s another aspect of this, which is that I actually &#039;&#039;do&#039;&#039; want robots that toddlers can play with. I want toddlers to be exposed to these things and start to understand:&lt;br /&gt;
* &amp;quot;Oh, hey, look—this is a thing that&#039;s exhibiting behavior&amp;quot;&lt;br /&gt;
* &amp;quot;It has parts that I can remove&amp;quot;&lt;br /&gt;
* &amp;quot;I can add the parts back on&amp;quot;&lt;br /&gt;
* Maybe even start to imagine how to change the behavior&lt;br /&gt;
&lt;br /&gt;
How could I interact with this robot? I&#039;m going to block its path. I&#039;m going to draw a fork in the lines. Just whatever it takes to get kids thinking about &#039;&#039;&#039;systems&#039;&#039;&#039; and &#039;&#039;&#039;interactivity&#039;&#039;&#039; and &#039;&#039;&#039;cause and effect&#039;&#039;&#039; is a good thing.&lt;br /&gt;
&lt;br /&gt;
Cheap robots that validate their exploration without risking a lot of money are a great tool for that. This supports the philosophy of [[Bespoke Robot Society:Give Them Away for Free|making robots accessible to everyone]].&lt;br /&gt;
&lt;br /&gt;
== What Toddler Testing Improves ==&lt;br /&gt;
&lt;br /&gt;
=== Durability ===&lt;br /&gt;
&lt;br /&gt;
This happened to me while I was revising [[SimpleBot]]. The toddler got hold of the bot and dropped it off a table. One of the motor mounts snapped. I didn&#039;t freak out—I just went back to CAD and made that part twice as beefy.&lt;br /&gt;
&lt;br /&gt;
It was not a big drop, maybe a couple of feet, but it&#039;s the sort of thing that could feasibly happen in a school or something. Having that toddler test—you know what, you&#039;re going to need to make this part a bit thicker—that is a valid test.&lt;br /&gt;
&lt;br /&gt;
=== Simplicity ===&lt;br /&gt;
&lt;br /&gt;
If your parts are kind of fragile, or have sensitive gears, or fine parts that can be bent out of shape, &#039;&#039;&#039;a toddler will find those and bend them&#039;&#039;&#039;. They will cause that fragile part to stop working.&lt;br /&gt;
&lt;br /&gt;
If your robot can continue to function after being handled by a toddler, that&#039;s a good design. The principles that make robots [[Bespoke Robot Society:BattleBots Are Not Robots|actually useful]] also make them robust.&lt;br /&gt;
&lt;br /&gt;
== A Story from Airman Leadership School ==&lt;br /&gt;
&lt;br /&gt;
This was probably going on closer to two decades ago now. I had built a little Arduino robot. Back in those days, the Arduino was powered by a 9-volt battery and the motors by four double-As.&lt;br /&gt;
&lt;br /&gt;
I&#039;m just showing my classmates what I&#039;m working on recently. I put the robot down and flip the switch, and it starts driving ahead. You know, it&#039;s the military—everyone thinks they&#039;re cute. Some guy stands up, goes in front of it, and puts his boot in the way.&lt;br /&gt;
&lt;br /&gt;
The distance sensor on the front of it got up within a couple inches of his boot, started turning clockwise, and then kept going forward around his foot.&lt;br /&gt;
&lt;br /&gt;
In that moment everyone was just like &amp;quot;ooh.&amp;quot; I don&#039;t think that back in those days, when Arduino was kind of a new thing going around, anyone expected it to have that reactivity. They just did not remotely expect it to do that. The guy just expected it to run into his boot and not have any reaction to him being there.&lt;br /&gt;
&lt;br /&gt;
If we can do that same level of &#039;&#039;&#039;autonomy&#039;&#039;&#039;—that your toddler picks up and moves the robot, and when it gets set back down it continues its task—that&#039;s going to make it more robust to other, more realistic disruptions too.&lt;br /&gt;
&lt;br /&gt;
== Simulation vs Reality ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Simulation is good. But toddlers are real.&#039;&#039;&#039; That&#039;s the idea here.&lt;br /&gt;
&lt;br /&gt;
Real-world conditions change. You need to have not just random noise from your simulation, but actual random events from things your robot has to deal with.&lt;br /&gt;
&lt;br /&gt;
Be robust. Let a toddler try your stuff. If your robot survives a toddler, it will survive anything.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Testing]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=56</id>
		<title>Bespoke Robot Society:Beyond Toys</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Beyond_Toys&amp;diff=56"/>
		<updated>2025-10-11T17:25:30Z</updated>

		<summary type="html">&lt;p&gt;John: LLM cleaned up audio transcript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Beyond Toys =&lt;br /&gt;
&lt;br /&gt;
This is BRS rant number two, exploring the distinction between toys and robots, and how we can use toys as a starting point without making them dead ends.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
# [[#The_Question|The Question]]&lt;br /&gt;
# [[#Work_vs_Play|Work vs Play]]&lt;br /&gt;
# [[#Toys_vs_Tools|Toys vs Tools]]&lt;br /&gt;
# [[#Forward-Looking_Robots|Forward-Looking Robots]]&lt;br /&gt;
# [[#The_Problem_with_Staying_a_Toy|The Problem with Staying a Toy]]&lt;br /&gt;
# [[#Tech_Trees|Tech Trees]]&lt;br /&gt;
# [[#From_Kit_to_Custom|From Kit to Custom]]&lt;br /&gt;
# [[#The_Starting_Point|The Starting Point]]&lt;br /&gt;
&lt;br /&gt;
== The Question ==&lt;br /&gt;
&lt;br /&gt;
How do we distinguish between a robot and a toy? Especially when the robots are mostly being advertised toward or made accessible to children, there&#039;s actually going to have a lot of overlap with a toy.&lt;br /&gt;
&lt;br /&gt;
But we want to move &#039;&#039;&#039;beyond toys&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Work vs Play ==&lt;br /&gt;
&lt;br /&gt;
While exploration is a great form of play, not every toy enables you to learn something from it. Not every toy is extensible. A lot of toys just make some kind of amusement available, but they don&#039;t make the mechanics of the toy itself available. A lot of toys cover up their internals as a means of safety or protecting intellectual property.&lt;br /&gt;
&lt;br /&gt;
Both of those causes are not applicable to Bespoke Robot Society&#039;s robots.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are for play. Robots are for work.&#039;&#039;&#039; And sometimes the work we want to do is learning and teaching.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke Robot Society:BattleBots Are Not Robots|BattleBots Are Not Robots]] for more on what makes something a real robot versus a remote-control toy.&lt;br /&gt;
&lt;br /&gt;
== Toys vs Tools ==&lt;br /&gt;
&lt;br /&gt;
Toys, like many beginner robotics kits, are designed with limited complexity and predefined goals—like following a line, bumping into walls. If all the thing does is that single task that it&#039;s built for, it could technically be a robot, but you&#039;re still probably looking at a toy.&lt;br /&gt;
&lt;br /&gt;
A true robot, on the other hand, is a &#039;&#039;&#039;tool designed to interact with an environment&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Forward-Looking Robots ==&lt;br /&gt;
&lt;br /&gt;
I want to have a forward-looking definition of robot in Bespoke Robot Society.&lt;br /&gt;
&lt;br /&gt;
The old definition of robot would be those giant arms that assemble cars. They move very precisely, they have a lot of strength, they are enormously stiff, and you cannot go near them while they&#039;re in motion for your own safety. They&#039;re uncompromising. They are executing and repeating some motion a lot. Many of these robots may not have real feedback loops in the sense that they aren&#039;t really able to detect if their task is going well or not. They may require a human operator to observe and hit the e-stop when they do something faulty.&lt;br /&gt;
&lt;br /&gt;
But a &#039;&#039;&#039;forward-looking definition of robot is about autonomy&#039;&#039;&#039;. It&#039;s about reacting to your environment without planning it out perfectly ahead of time.&lt;br /&gt;
&lt;br /&gt;
What I mean by that is: if we have goals and we have capabilities and we have sensors, but we don&#039;t necessarily know everything about the environment—people could walk by, you don&#039;t need to bump into them, the terrain may have changed, stuff could move—we want to use our sensors and figure that out dynamically. &#039;&#039;&#039;That&#039;s a real robot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Problem with Staying a Toy ==&lt;br /&gt;
&lt;br /&gt;
Specifically, to advance away from a toy: a non-toy robot enables you to &#039;&#039;&#039;understand the problem it tries to solve&#039;&#039;&#039; and &#039;&#039;&#039;understand the limitations of the environment it can work in&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Then if you get a new constraint, a new difficulty added to that environment, or you want to move the robot to a new environment, if you understand how the robot works and how it relies on those environmental limitations, you can enhance the elements of the robot that don&#039;t suit the changes to the environment and you&#039;ll be able to create that new functionality yourself.&lt;br /&gt;
&lt;br /&gt;
That&#039;s really the goal: enabling real-world use cases. What we mean is, you think of something that your robot might be able to do, and now you need to:&lt;br /&gt;
# Understand the limitations it&#039;s currently built around&lt;br /&gt;
# Have some resources about how to go beyond those current limitations and make the robot more robust, or robust against different hazards&lt;br /&gt;
&lt;br /&gt;
Staying in the toy phase has an allure of &#039;&#039;&#039;false mastery&#039;&#039;&#039;. It&#039;s like playing with a toy that you understand fully. You might understand &#039;&#039;what&#039;&#039;, but not &#039;&#039;why&#039;&#039;. You may fully know how to operate, but you don&#039;t know how to extend. You may get proficiency as a user, but you will not become a creator.&lt;br /&gt;
&lt;br /&gt;
That&#039;s one of the main problems with toys: even when Bespoke Robot Society robots make good toys, I don&#039;t want them to remain toys or be limited by the definition of toy.&lt;br /&gt;
&lt;br /&gt;
== Tech Trees ==&lt;br /&gt;
&lt;br /&gt;
One of the ways I want to address this is with &#039;&#039;&#039;tech trees&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Bespoke Robot Society&#039;s $20 robot like [[SimpleBot]] might come in a kit with every single part. The PCB is already made, and you have no real requirements put upon you besides using a Phillips head screwdriver. Now you can hit go, and you can see the robot do the task it was immediately built for.&lt;br /&gt;
&lt;br /&gt;
That&#039;s great because we want people to feel the confidence, we want them to get the rapid feedback of being able to play. We want them to have a working thing quickly, not a pile of parts or an endless project.&lt;br /&gt;
&lt;br /&gt;
But where do you go from there?&lt;br /&gt;
&lt;br /&gt;
== From Kit to Custom ==&lt;br /&gt;
&lt;br /&gt;
You could mod your robot, you could add new parts, you could repeat the robot but from a lower level of pre-completion.&lt;br /&gt;
&lt;br /&gt;
Maybe you get another kit which does not include any 3D-printed parts. You go to the library and you 3D-print the parts that you need. Now you get to pick the colors, you might have to deal with a print failure, you have to think about the filaments you&#039;re going to use.&lt;br /&gt;
&lt;br /&gt;
Or maybe instead of a pre-built PCB, you can solder together a kit. It&#039;s the same circuit that you&#039;re familiar with, but it&#039;s just through-hole soldering. Or maybe you want to learn the surface-mount version of that board, so you go and get the smaller SMD components.&lt;br /&gt;
&lt;br /&gt;
Now we start to establish that equivalence: the prefab one is a factory-made SMD board, but the one you put together yourself is a through-hole board. But all the components are equivalent, the behavior is equivalent.&lt;br /&gt;
&lt;br /&gt;
Or we go all the way for artisanal, and we get a protoboard and we hand-wire it. Again, it could be equivalent, but now you&#039;re looking at something that&#039;s not just a circuit board—it is a &#039;&#039;&#039;steampunk work of art&#039;&#039;&#039;. It is a retro-aesthetic design choice, not just a part that completes the requirements or does the behavior. It&#039;s an expression of your mastery that you&#039;ve gone forward to do that.&lt;br /&gt;
&lt;br /&gt;
Same thing with the software. If you have a robot that does some task, you can improve it just by changing the software. The same hardware everyone has—whether it&#039;s surface-mount, through-hole, self-made, completely custom—if it meets the standard, if it does the same task, we can share that same software. Now you&#039;re not just learning about how to change things, you&#039;re also &#039;&#039;&#039;collaborating with other folks&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This relates directly to [[Bespoke Robot Society:Give Them Away for Free|giving robots away for free]]—when the designs are open and shared, everyone benefits from improvements.&lt;br /&gt;
&lt;br /&gt;
== The Starting Point ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s this huge tech tree, and we want everyone to be able to hop on and get the lay of the land by using pre-built robots, kits that are mostly assembled, things like that. But we also want you to be able to use your perspective of having that working robot to see all the different paths you could go down.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toys are a starting point&#039;&#039;&#039;—we want you to turn it on and play immediately. But toys cannot be the end, and so many toys are dead ends as technology.&lt;br /&gt;
&lt;br /&gt;
I want you to take a toy and break it and fix it. I want you to learn something from it, and I want you to think of what it can&#039;t do right now but could if you just had X, Y, or Z.&lt;br /&gt;
&lt;br /&gt;
That&#039;s why I hope that Bespoke Robot Society will deliver robots that are not just toys. They should withstand [[Bespoke Robot Society:Toddler Testing|toddler testing]] and enable real learning and extension.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Battlebots_Are_Not_Robots&amp;diff=55</id>
		<title>Bespoke Robot Society:Battlebots Are Not Robots</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Bespoke_Robot_Society:Battlebots_Are_Not_Robots&amp;diff=55"/>
		<updated>2025-10-11T17:25:14Z</updated>

		<summary type="html">&lt;p&gt;John: LLM cleaned up audio transcript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= BattleBots Are Not Robots =&lt;br /&gt;
&lt;br /&gt;
This is the first BRS rant, addressing a fundamental misconception about what constitutes a robot.&lt;br /&gt;
&lt;br /&gt;
== Table of Contents ==&lt;br /&gt;
# [[#The_Problem|The Problem]]&lt;br /&gt;
# [[#What_Is_a_Robot?|What Is a Robot?]]&lt;br /&gt;
# [[#Why_BattleBots_Aren&#039;t_Robots|Why BattleBots Aren&#039;t Robots]]&lt;br /&gt;
# [[#What_Robotics_Is_Really_About|What Robotics Is Really About]]&lt;br /&gt;
# [[#The_BRS_Alternative|The BRS Alternative]]&lt;br /&gt;
# [[#Autonomy_on_a_Budget|Autonomy on a Budget]]&lt;br /&gt;
# [[#Battle_Without_Destruction|Battle Without Destruction]]&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
Everyone hears the word &amp;quot;robot&amp;quot; and they immediately jump to &amp;quot;oh, let&#039;s make a BattleBot.&amp;quot; This popular show has been in the zeitgeist for possibly decades now—I think it&#039;s still going on. I face this problem constantly: you say &amp;quot;I&#039;m building a robot,&amp;quot; and everyone&#039;s like &amp;quot;oh, I&#039;ve heard of BattleBots, I know all about those.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is such a poisonous understanding of what a robot is.&lt;br /&gt;
&lt;br /&gt;
== What Is a Robot? ==&lt;br /&gt;
&lt;br /&gt;
So first of all, what&#039;s the definition of a robot?&lt;br /&gt;
&lt;br /&gt;
A robot is something that has a &#039;&#039;&#039;control loop&#039;&#039;&#039; behind it. It&#039;s software reading data from sensors, making decisions, and taking actions. It&#039;s about:&lt;br /&gt;
* &#039;&#039;&#039;Navigating&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Perceiving&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Manipulating the world&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Why BattleBots Aren&#039;t Robots ==&lt;br /&gt;
&lt;br /&gt;
A BattleBot is not a robot. A BattleBot is just remote control. The BattleBot itself is only a radio receiver and a bunch of actuators. &#039;&#039;&#039;It&#039;s a puppet.&#039;&#039;&#039; There&#039;s no robotics to it because it&#039;s not using any sensors, it&#039;s not deciding what to do—that&#039;s just a person driving it. Not even a robot. The &amp;quot;bot&amp;quot; part of it is just a lie. It&#039;s just battle.&lt;br /&gt;
&lt;br /&gt;
See also: [[Bespoke Robot Society:Beyond Toys|Beyond Toys]] for more on the distinction between robots and remote-control toys.&lt;br /&gt;
&lt;br /&gt;
== What Robotics Is Really About ==&lt;br /&gt;
&lt;br /&gt;
Philosophically, what is a BattleBot in comparison to the field of robotics? It doesn&#039;t automate anything. It doesn&#039;t solve a problem. It doesn&#039;t make your life easier or better. It doesn&#039;t enable some process that wasn&#039;t possible on human labor alone.&lt;br /&gt;
&lt;br /&gt;
It&#039;s only &#039;&#039;&#039;destruction entertainment&#039;&#039;&#039;. They&#039;re completely aware of this, by the way they market it and design the show. This is no different from a destruction derby or those mud pits where they crash cars into each other. There&#039;s nothing robotic about the entertainment value of that show.&lt;br /&gt;
&lt;br /&gt;
Actual robotics is about:&lt;br /&gt;
* &#039;&#039;&#039;Problem solving&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Innovation&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Reducing cost&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Accuracy, repetition, and perfection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not about just smashing things by remote control. I think BattleBots has completely associated the wrong ideas with &amp;quot;robot&amp;quot; in people&#039;s minds.&lt;br /&gt;
&lt;br /&gt;
== The BRS Alternative ==&lt;br /&gt;
&lt;br /&gt;
BRS&#039;s mission, specifically, is supposed to get away from the BattleBot thing. BattleBots are remote control [[Bespoke Robot Society:Beyond Toys|toys]]. I want all of Bespoke Robot Society&#039;s robots to &#039;&#039;&#039;serve an actual purpose&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Now, the purpose might just be that you don&#039;t know that much about robots and you want to fix that in a hands-on way. That&#039;s a problem that a BRS robot design could solve. I&#039;m completely happy with that being the problem. But smashing up another robot? Not really an interesting problem I want to solve with BRS robots.&lt;br /&gt;
&lt;br /&gt;
== Autonomy on a Budget ==&lt;br /&gt;
&lt;br /&gt;
The very first Bespoke Robot Society robot—[[SimpleBot]]—&#039;&#039;&#039;already has more sensors than the most sophisticated BattleBots&#039;&#039;&#039;, and it&#039;s only got line sensors.&lt;br /&gt;
&lt;br /&gt;
A BRS robot is about demonstrating that loop even under $20:&lt;br /&gt;
# &#039;&#039;&#039;Have sensors&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Make a decision based on those sensors&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Actuate in the world&#039;&#039;&#039;—use some kind of manipulator&lt;br /&gt;
&lt;br /&gt;
SimpleBot already has all those elements:&lt;br /&gt;
* It detects lines on the ground&lt;br /&gt;
* It has programmed logic to respond to those lines&lt;br /&gt;
* It changes its behavior in the world&lt;br /&gt;
&lt;br /&gt;
This is actual robotics, not just remote-control toys. See [[Bespoke Robot Society:Toddler Testing|Toddler Testing]] for how we validate that these robots work in the real world.&lt;br /&gt;
&lt;br /&gt;
== Battle Without Destruction ==&lt;br /&gt;
&lt;br /&gt;
Now, will we play war games? Sure. One of my prototypes here, the Tiny Tank 2, has a pan-tilt camera, a front-facing camera, and a LiDAR sensor. The intended use case for that robot is backyard-scale autonomous navigation and remote operation—either two-person (one driver, one gunner) or one of those roles, or both of those roles being served by AI—to interact with each other on the battlefield of my grassy yard.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use IR blasters pointed at each other, detecting being hit, detecting that there&#039;s a signal coming at you. That&#039;s a way to have some of the tactical excitement of a BattleBot without being focused on destruction. And it&#039;s also using it as an entry point to artificial intelligence and autonomy of the robot—whether that robot is literally learning by playing against us, or we custom-write software as an additional challenge for us, the designers, to try to write software ourselves that solves the problem rather than just remote-controlling it and solving the problem one time.&lt;br /&gt;
&lt;br /&gt;
You want to write software that solves it every time. Those are the sorts of things I think actually embody the spirit of robotics—the direction I want to take Bespoke Robot Society in.&lt;br /&gt;
&lt;br /&gt;
[[Category:Bespoke Robot Society]]&lt;br /&gt;
[[Category:Philosophy]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Template:Pico&amp;diff=54</id>
		<title>Template:Pico</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Template:Pico&amp;diff=54"/>
		<updated>2025-10-11T16:54:01Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{MCU&lt;br /&gt;
| name = Raspberry Pi Pico&lt;br /&gt;
| manufacturer = Raspberry Pi Ltd&lt;br /&gt;
| cpu = Dual-core ARM Cortex-M0+&lt;br /&gt;
| cpu_speed = 133 MHz&lt;br /&gt;
| cores = 2&lt;br /&gt;
| ram = 264 KB&lt;br /&gt;
| flash = 2 MB&lt;br /&gt;
| gpio = 26 (3 ADC)&lt;br /&gt;
| voltage = 1.8–5.5V&lt;br /&gt;
| cost = $4 USD&lt;br /&gt;
| datasheet = [https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf Datasheet]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
This template provides a compact info box for the Raspberry Pi Pico that can be included in any page.&lt;br /&gt;
&lt;br /&gt;
=== Syntax ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Pico}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will display the full MCU info box with all Raspberry Pi Pico specifications.&lt;br /&gt;
&lt;br /&gt;
For detailed information, see the [[Raspberry Pi Pico]] article.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Template:SBC&amp;diff=53</id>
		<title>Template:SBC</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Template:SBC&amp;diff=53"/>
		<updated>2025-10-11T16:53:47Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;infobox&amp;quot; style=&amp;quot;width: 300px; float: right; clear: right; margin: 0 0 1em 1em; border: 1px solid #aaa; background-color: #f9f9f9; font-size: 90%; line-height: 1.4em;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-size: 125%; font-weight: bold; background-color: #ccffcc;&amp;quot; | {{{name|{{PAGENAME}}}}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{image|}}}|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot; {{!}} [[File:{{{image}}}{{!}}250px]]&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; | &#039;&#039;&#039;Manufacturer&#039;&#039;&#039;&lt;br /&gt;
| {{{manufacturer|—}}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{cpu|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;CPU&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{cpu}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{cpu_speed|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Clock Speed&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{cpu_speed}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{cores|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Cores&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{cores}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{ram|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;RAM&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{ram}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{storage|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Storage&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{storage}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{os|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Operating System&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{os}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{gpio|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;GPIO Pins&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{gpio}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{connectivity|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Connectivity&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{connectivity}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{cost|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Typical Cost&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{cost}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
[[Category:SBC]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Template:Robot&amp;diff=52</id>
		<title>Template:Robot</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Template:Robot&amp;diff=52"/>
		<updated>2025-10-11T16:53:16Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;infobox&amp;quot; style=&amp;quot;width: 300px; float: right; clear: right; margin: 0 0 1em 1em; border: 1px solid #aaa; background-color: #f9f9f9; font-size: 90%; line-height: 1.4em;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-size: 125%; font-weight: bold; background-color: #ddd;&amp;quot; | {{{name|{{PAGENAME}}}}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{image|}}}|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot; {{!}} [[File:{{{image}}}{{!}}300px]]&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{caption|}}}|&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center; font-size: 90%; font-style: italic;&amp;quot; {{!}} {{{caption}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; | &#039;&#039;&#039;Use Case&#039;&#039;&#039;&lt;br /&gt;
| {{{use_case|General purpose robot}}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{microcontroller|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Microcontroller&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{microcontroller}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{sensors|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Sensors&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{sensors}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{power|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Power&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{power}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{pcb|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;PCB&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{pcb}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{cost|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Est. Cost&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{cost}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
{{#if:{{{repository|}}}|&lt;br /&gt;
! style=&amp;quot;text-align: right; padding-right: 0.5em;&amp;quot; {{!}} &#039;&#039;&#039;Repository&#039;&#039;&#039;&lt;br /&gt;
{{!}} {{{repository}}}&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
[[Category:Robot]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behavior:SLAM&amp;diff=51</id>
		<title>Behavior:SLAM</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behavior:SLAM&amp;diff=51"/>
		<updated>2025-10-11T16:50:46Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Behavior&lt;br /&gt;
| name = SLAM&lt;br /&gt;
| requires = [[Capability:LIDAR Sensing]] or [[Capability:Camera Vision]], [[Capability:Optical Odometry]], [[Capability:Differential Drive]]&lt;br /&gt;
| enables = [[Activity:Room Mapping]], [[Activity:Maze Optimization]], autonomous navigation&lt;br /&gt;
| difficulty = Advanced&lt;br /&gt;
| status = &#039;&#039;&#039;Stub&#039;&#039;&#039; - Algorithm not yet implemented&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SLAM&#039;&#039;&#039; is a behavior (algorithm) that simultaneously builds a map of an environment while tracking the robot&#039;s position within it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a stub page.&#039;&#039;&#039; This behavior is not yet implemented in any BRS robot. This page exists to:&lt;br /&gt;
* Document the algorithmic concept&lt;br /&gt;
* Invite community members to implement it&lt;br /&gt;
* Provide a starting point for algorithm design&lt;br /&gt;
&lt;br /&gt;
== Required Capabilities ==&lt;br /&gt;
&lt;br /&gt;
This behavior requires:&lt;br /&gt;
&lt;br /&gt;
* [[Capability:LIDAR Sensing]]&lt;br /&gt;
* [[Capability:Camera Vision]]&lt;br /&gt;
* [[Capability:Optical Odometry]]&lt;br /&gt;
* [[Capability:Differential Drive]]&lt;br /&gt;
&lt;br /&gt;
== Enables Activities ==&lt;br /&gt;
&lt;br /&gt;
Implementing this behavior enables:&lt;br /&gt;
&lt;br /&gt;
* [[Activity:Room Mapping]]&lt;br /&gt;
* [[Activity:Maze Optimization]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Outline ==&lt;br /&gt;
&lt;br /&gt;
SLAM is computationally intensive and typically uses established algorithms:&lt;br /&gt;
&lt;br /&gt;
**2D LIDAR SLAM**:&lt;br /&gt;
* Gmapping&lt;br /&gt;
* Hector SLAM&lt;br /&gt;
* Cartographer&lt;br /&gt;
&lt;br /&gt;
**Visual SLAM**:&lt;br /&gt;
* ORB-SLAM&lt;br /&gt;
* LSD-SLAM&lt;br /&gt;
&lt;br /&gt;
General approach:&lt;br /&gt;
# Capture sensor data (LIDAR scan or camera image)&lt;br /&gt;
# Extract features/landmarks&lt;br /&gt;
# Match to previously seen features&lt;br /&gt;
# Estimate robot motion (odometry + sensor matching)&lt;br /&gt;
# Update map with new observations&lt;br /&gt;
# Correct for loop closure (detecting return to known location)&lt;br /&gt;
&lt;br /&gt;
== Pseudocode ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Simplified SLAM Concept (not implementable as-is)&lt;br /&gt;
map = initialize_empty_map()&lt;br /&gt;
robot_pose = (0, 0, 0)  # x, y, theta&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    sensor_data = capture_lidar_scan()&lt;br /&gt;
    odometry_delta = read_odometry()&lt;br /&gt;
&lt;br /&gt;
    # Predict new pose from odometry&lt;br /&gt;
    predicted_pose = robot_pose + odometry_delta&lt;br /&gt;
&lt;br /&gt;
    # Match sensor data to map&lt;br /&gt;
    matched_features = feature_matching(sensor_data, map)&lt;br /&gt;
&lt;br /&gt;
    # Correct pose estimate based on matches&lt;br /&gt;
    corrected_pose = optimize_pose(predicted_pose, matched_features)&lt;br /&gt;
&lt;br /&gt;
    # Update map with new observations&lt;br /&gt;
    update_map(map, corrected_pose, sensor_data)&lt;br /&gt;
&lt;br /&gt;
    robot_pose = corrected_pose&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Challenges ==&lt;br /&gt;
&lt;br /&gt;
* **Computational cost**: Requires significant processing power (use ROS on Raspberry Pi)&lt;br /&gt;
* **Loop closure**: Detecting when robot returns to known location&lt;br /&gt;
* **Data association**: Matching current observations to previous ones&lt;br /&gt;
* **Scale**: Large maps require sophisticated data structures&lt;br /&gt;
* **Recommended**: Use existing SLAM libraries (ROS navigation stack) rather than implementing from scratch&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Want to implement this behavior? Here&#039;s how:&lt;br /&gt;
&lt;br /&gt;
# Study the algorithm outline above&lt;br /&gt;
# Implement in your language of choice (MicroPython, C++, Arduino)&lt;br /&gt;
# Test on a robot with the required capabilities&lt;br /&gt;
# Create an Implementation page (e.g., &amp;lt;code&amp;gt;[[YourRobot:SLAM Implementation]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Update this page with algorithm refinements&lt;br /&gt;
# Share working code on GitHub&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Behaviors]] - All behaviors&lt;br /&gt;
* [[Capabilities]] - Hardware required&lt;br /&gt;
* [[Activities]] - What this enables&lt;br /&gt;
* [[Robotics Ontology]] - How behaviors fit into BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Behavior]]&lt;br /&gt;
[[Category:Advanced Behavior]]&lt;br /&gt;
[[Category:Stub]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Wall_Following&amp;diff=50</id>
		<title>Behavior:Wall Following</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Wall_Following&amp;diff=50"/>
		<updated>2025-10-11T16:48:27Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Behavior&lt;br /&gt;
| name = Wall Following&lt;br /&gt;
| requires = [[Capability:Time-of-Flight Sensing]] or [[Capability:Ultrasonic Sensing]], [[Capability:Differential Drive]]&lt;br /&gt;
| enables = [[Activity:Maze Solving]]&lt;br /&gt;
| difficulty = Beginner&lt;br /&gt;
| status = &#039;&#039;&#039;Stub&#039;&#039;&#039; - Algorithm not yet implemented&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Wall Following&#039;&#039;&#039; is a behavior (algorithm) that maintains a constant distance from a wall while moving parallel to it.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a stub page.&#039;&#039;&#039; This behavior is not yet implemented in any BRS robot. This page exists to:&lt;br /&gt;
* Document the algorithmic concept&lt;br /&gt;
* Invite community members to implement it&lt;br /&gt;
* Provide a starting point for algorithm design&lt;br /&gt;
&lt;br /&gt;
== Required Capabilities ==&lt;br /&gt;
&lt;br /&gt;
This behavior requires:&lt;br /&gt;
&lt;br /&gt;
* [[Capability:Time-of-Flight Sensing]]&lt;br /&gt;
* [[Capability:Ultrasonic Sensing]]&lt;br /&gt;
* [[Capability:Differential Drive]]&lt;br /&gt;
&lt;br /&gt;
== Enables Activities ==&lt;br /&gt;
&lt;br /&gt;
Implementing this behavior enables:&lt;br /&gt;
&lt;br /&gt;
* [[Activity:Maze Solving]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Outline ==&lt;br /&gt;
&lt;br /&gt;
Wall following uses distance sensing and proportional control:&lt;br /&gt;
&lt;br /&gt;
# Measure distance to wall&lt;br /&gt;
# If distance &amp;lt; target: turn away from wall&lt;br /&gt;
# If distance &amp;gt; target: turn toward wall&lt;br /&gt;
# Drive forward&lt;br /&gt;
&lt;br /&gt;
For maze solving, consistently follow left or right wall until exit is reached.&lt;br /&gt;
&lt;br /&gt;
== Pseudocode ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Wall Following&lt;br /&gt;
TARGET_DISTANCE = 20  # cm&lt;br /&gt;
&lt;br /&gt;
while True:&lt;br /&gt;
    distance_to_wall = read_distance_sensor()&lt;br /&gt;
    error = distance_to_wall - TARGET_DISTANCE&lt;br /&gt;
&lt;br /&gt;
    turn_adjustment = error * gain  # Proportional control&lt;br /&gt;
&lt;br /&gt;
    left_speed = BASE_SPEED + turn_adjustment&lt;br /&gt;
    right_speed = BASE_SPEED - turn_adjustment&lt;br /&gt;
&lt;br /&gt;
    set_motors(left_speed, right_speed)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Challenges ==&lt;br /&gt;
&lt;br /&gt;
* **Corners**: Detecting and handling inside/outside corners&lt;br /&gt;
* **Gaps**: What to do when wall disappears (doorways, openings)&lt;br /&gt;
* **Obstacles**: Handling objects protruding from wall&lt;br /&gt;
* **Sensor placement**: Angled sensors vs perpendicular sensors&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Want to implement this behavior? Here&#039;s how:&lt;br /&gt;
&lt;br /&gt;
# Study the algorithm outline above&lt;br /&gt;
# Implement in your language of choice (MicroPython, C++, Arduino)&lt;br /&gt;
# Test on a robot with the required capabilities&lt;br /&gt;
# Create an Implementation page (e.g., &amp;lt;code&amp;gt;[[YourRobot:Wall Following Implementation]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Update this page with algorithm refinements&lt;br /&gt;
# Share working code on GitHub&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Behaviors]] - All behaviors&lt;br /&gt;
* [[Capabilities]] - Hardware required&lt;br /&gt;
* [[Activities]] - What this enables&lt;br /&gt;
* [[Robotics Ontology]] - How behaviors fit into BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Behavior]]&lt;br /&gt;
[[Category:Beginner Behavior]]&lt;br /&gt;
[[Category:Stub]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behavior:PID_Control&amp;diff=49</id>
		<title>Behavior:PID Control</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behavior:PID_Control&amp;diff=49"/>
		<updated>2025-10-11T16:48:13Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Behavior&lt;br /&gt;
| name = PID Control&lt;br /&gt;
| requires = Any sensing capability that provides error measurement&lt;br /&gt;
| enables = [[Activity:Line Following]] (smooth), precise position control, speed control&lt;br /&gt;
| difficulty = Intermediate&lt;br /&gt;
| status = &#039;&#039;&#039;Stub&#039;&#039;&#039; - Algorithm not yet implemented&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PID Control&#039;&#039;&#039; is a behavior (algorithm) that uses proportional, integral, and derivative terms to minimize error in control systems.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is a stub page.&#039;&#039;&#039; This behavior is not yet implemented in any BRS robot. This page exists to:&lt;br /&gt;
* Document the algorithmic concept&lt;br /&gt;
* Invite community members to implement it&lt;br /&gt;
* Provide a starting point for algorithm design&lt;br /&gt;
&lt;br /&gt;
== Required Capabilities ==&lt;br /&gt;
&lt;br /&gt;
This behavior requires:&lt;br /&gt;
&lt;br /&gt;
* [[Capability:Line Sensing]]&lt;br /&gt;
* [[Capability:Optical Odometry]]&lt;br /&gt;
&lt;br /&gt;
== Enables Activities ==&lt;br /&gt;
&lt;br /&gt;
Implementing this behavior enables:&lt;br /&gt;
&lt;br /&gt;
* [[Activity:Line Following]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Outline ==&lt;br /&gt;
&lt;br /&gt;
PID control is a feedback loop that continuously calculates an error value and applies a correction:&lt;br /&gt;
&lt;br /&gt;
* **P (Proportional)**: Correction proportional to current error&lt;br /&gt;
* **I (Integral)**: Correction based on accumulated past errors&lt;br /&gt;
* **D (Derivative)**: Correction based on rate of error change&lt;br /&gt;
&lt;br /&gt;
The output is: &amp;lt;code&amp;gt;output = Kp × error + Ki × ∫error·dt + Kd × d(error)/dt&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pseudocode ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# PID Controller&lt;br /&gt;
error = setpoint - measured_value&lt;br /&gt;
integral = integral + error * dt&lt;br /&gt;
derivative = (error - previous_error) / dt&lt;br /&gt;
&lt;br /&gt;
output = Kp * error + Ki * integral + Kd * derivative&lt;br /&gt;
&lt;br /&gt;
previous_error = error&lt;br /&gt;
apply_output(output)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation Challenges ==&lt;br /&gt;
&lt;br /&gt;
* **Tuning**: Finding optimal Kp, Ki, Kd values requires experimentation&lt;br /&gt;
* **Integral windup**: Integral term can accumulate excessively&lt;br /&gt;
* **Derivative noise**: Derivative is sensitive to sensor noise&lt;br /&gt;
* **Sampling rate**: PID requires consistent timing for accurate integral/derivative&lt;br /&gt;
&lt;br /&gt;
== Contributing ==&lt;br /&gt;
&lt;br /&gt;
Want to implement this behavior? Here&#039;s how:&lt;br /&gt;
&lt;br /&gt;
# Study the algorithm outline above&lt;br /&gt;
# Implement in your language of choice (MicroPython, C++, Arduino)&lt;br /&gt;
# Test on a robot with the required capabilities&lt;br /&gt;
# Create an Implementation page (e.g., &amp;lt;code&amp;gt;[[YourRobot:PID Control Implementation]]&amp;lt;/code&amp;gt;)&lt;br /&gt;
# Update this page with algorithm refinements&lt;br /&gt;
# Share working code on GitHub&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Behaviors]] - All behaviors&lt;br /&gt;
* [[Capabilities]] - Hardware required&lt;br /&gt;
* [[Activities]] - What this enables&lt;br /&gt;
* [[Robotics Ontology]] - How behaviors fit into BRS knowledge structure&lt;br /&gt;
&lt;br /&gt;
[[Category:Behavior]]&lt;br /&gt;
[[Category:Intermediate Behavior]]&lt;br /&gt;
[[Category:Stub]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Dead_Reckoning&amp;diff=48</id>
		<title>Behavior:Dead Reckoning</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Dead_Reckoning&amp;diff=48"/>
		<updated>2025-10-11T16:47:59Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Behavior&lt;br /&gt;
|name=Dead Reckoning&lt;br /&gt;
|requires=[[Capability:Optical Odometry]] or [[Capability:IMU Sensing]], [[Capability:Differential Drive]]&lt;br /&gt;
|enables=[[Activity:Dead Reckoning Navigation]]&lt;br /&gt;
|difficulty=Beginner to Intermediate&lt;br /&gt;
|implementations=[[SimpleBot:Dead Reckoning Implementation]]&lt;br /&gt;
|status=Fully Documented&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dead reckoning&#039;&#039;&#039; is a navigation technique where a robot estimates its current position by tracking all motion from a known starting position. The term comes from maritime navigation (&amp;quot;deduced reckoning&amp;quot;) and involves continuously calculating position based on direction and distance traveled, without external reference points.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Dead reckoning works by:&lt;br /&gt;
# Starting from a known position (typically x=0, y=0, heading=0)&lt;br /&gt;
# Measuring all motion (linear and angular)&lt;br /&gt;
# Continuously updating the estimated position based on motion measurements&lt;br /&gt;
# Maintaining a pose estimate (x position, y position, heading angle θ)&lt;br /&gt;
&lt;br /&gt;
Unlike GPS or beacon-based navigation, dead reckoning is completely self-contained and works in any environment. However, small measurement errors accumulate over time, causing position estimates to drift from the true position.&lt;br /&gt;
&lt;br /&gt;
== Odometry-Based Dead Reckoning ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Odometry-based dead reckoning&#039;&#039;&#039; uses wheel encoder measurements to track motion. This is the most common approach for ground robots and is the method used by SimpleBot.&lt;br /&gt;
&lt;br /&gt;
=== Principle of Operation ===&lt;br /&gt;
&lt;br /&gt;
For a differential drive robot:&lt;br /&gt;
# Count encoder pulses from left and right wheels independently&lt;br /&gt;
# Calculate distance traveled by each wheel using known wheel circumference and encoder resolution&lt;br /&gt;
# Determine robot motion based on wheel motion differences:&lt;br /&gt;
#* &#039;&#039;&#039;Equal wheel distances&#039;&#039;&#039; → Robot moves straight&lt;br /&gt;
#* &#039;&#039;&#039;Different wheel distances&#039;&#039;&#039; → Robot follows a curved path (arc)&lt;br /&gt;
# Update robot pose (x, y, θ) based on calculated motion&lt;br /&gt;
&lt;br /&gt;
=== Mathematical Foundation ===&lt;br /&gt;
&lt;br /&gt;
The basic calculations for odometry-based dead reckoning:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 1: Calculate wheel distances&#039;&#039;&#039;&lt;br /&gt;
 distance_left = left_pulses × distance_per_pulse&lt;br /&gt;
 distance_right = right_pulses × distance_per_pulse&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
 distance_per_pulse = (wheel_circumference) / (pulses_per_revolution)&lt;br /&gt;
 wheel_circumference = π × wheel_diameter&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 2: Calculate motion parameters&#039;&#039;&#039;&lt;br /&gt;
 distance_traveled = (distance_left + distance_right) / 2&lt;br /&gt;
 angle_turned = (distance_right - distance_left) / wheel_separation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Step 3: Update pose&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For straight motion (distance_left ≈ distance_right):&lt;br /&gt;
 x_new = x_old + distance_traveled × cos(θ_old)&lt;br /&gt;
 y_new = y_old + distance_traveled × sin(θ_old)&lt;br /&gt;
 θ_new = θ_old&lt;br /&gt;
&lt;br /&gt;
For curved motion (general case):&lt;br /&gt;
 θ_new = θ_old + angle_turned&lt;br /&gt;
 x_new = x_old + distance_traveled × cos(θ_old + angle_turned/2)&lt;br /&gt;
 y_new = y_old + distance_traveled × sin(θ_old + angle_turned/2)&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initialize robot pose&lt;br /&gt;
pose_x = 0.0&lt;br /&gt;
pose_y = 0.0&lt;br /&gt;
pose_theta = 0.0&lt;br /&gt;
&lt;br /&gt;
# Robot physical parameters&lt;br /&gt;
WHEEL_DIAMETER = 0.065  # meters&lt;br /&gt;
WHEEL_SEPARATION = 0.15  # meters&lt;br /&gt;
PULSES_PER_REV = 20&lt;br /&gt;
&lt;br /&gt;
# Calculate distance per pulse&lt;br /&gt;
WHEEL_CIRCUMFERENCE = math.pi * WHEEL_DIAMETER&lt;br /&gt;
DISTANCE_PER_PULSE = WHEEL_CIRCUMFERENCE / PULSES_PER_REV&lt;br /&gt;
&lt;br /&gt;
def update_odometry(left_pulses, right_pulses):&lt;br /&gt;
    global pose_x, pose_y, pose_theta&lt;br /&gt;
&lt;br /&gt;
    # Calculate distances traveled by each wheel&lt;br /&gt;
    dist_left = left_pulses * DISTANCE_PER_PULSE&lt;br /&gt;
    dist_right = right_pulses * DISTANCE_PER_PULSE&lt;br /&gt;
&lt;br /&gt;
    # Calculate center distance and rotation&lt;br /&gt;
    dist_center = (dist_left + dist_right) / 2.0&lt;br /&gt;
    delta_theta = (dist_right - dist_left) / WHEEL_SEPARATION&lt;br /&gt;
&lt;br /&gt;
    # Update pose using midpoint method&lt;br /&gt;
    if abs(delta_theta) &amp;lt; 0.001:  # Straight motion&lt;br /&gt;
        pose_x += dist_center * math.cos(pose_theta)&lt;br /&gt;
        pose_y += dist_center * math.sin(pose_theta)&lt;br /&gt;
    else:  # Curved motion&lt;br /&gt;
        # Use heading at midpoint of arc&lt;br /&gt;
        mid_theta = pose_theta + delta_theta / 2.0&lt;br /&gt;
        pose_x += dist_center * math.cos(mid_theta)&lt;br /&gt;
        pose_y += dist_center * math.sin(mid_theta)&lt;br /&gt;
        pose_theta += delta_theta&lt;br /&gt;
&lt;br /&gt;
    # Normalize angle to [-π, π]&lt;br /&gt;
    pose_theta = math.atan2(math.sin(pose_theta), math.cos(pose_theta))&lt;br /&gt;
&lt;br /&gt;
    return (pose_x, pose_y, pose_theta)&lt;br /&gt;
&lt;br /&gt;
# Main loop&lt;br /&gt;
while robot_running:&lt;br /&gt;
    # Read encoder increments since last update&lt;br /&gt;
    left_pulses = read_left_encoder_delta()&lt;br /&gt;
    right_pulses = read_right_encoder_delta()&lt;br /&gt;
&lt;br /&gt;
    # Update position estimate&lt;br /&gt;
    position = update_odometry(left_pulses, right_pulses)&lt;br /&gt;
&lt;br /&gt;
    # Use position for navigation decisions&lt;br /&gt;
    navigate_using_position(position)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Odometry Error Sources ===&lt;br /&gt;
&lt;br /&gt;
Common error sources in odometry-based dead reckoning:&lt;br /&gt;
* &#039;&#039;&#039;Wheel slippage&#039;&#039;&#039;: Wheels slip on smooth surfaces or during rapid acceleration&lt;br /&gt;
* &#039;&#039;&#039;Uneven wheel diameters&#039;&#039;&#039;: Manufacturing variations or uneven wear&lt;br /&gt;
* &#039;&#039;&#039;Mechanical play&#039;&#039;&#039;: Backlash in gears and drivetrain&lt;br /&gt;
* &#039;&#039;&#039;Encoder resolution&#039;&#039;&#039;: Limited pulse count causes quantization errors&lt;br /&gt;
* &#039;&#039;&#039;Surface irregularities&#039;&#039;&#039;: Bumps, cracks, and slopes affect wheel rotation&lt;br /&gt;
* &#039;&#039;&#039;Wheel alignment&#039;&#039;&#039;: Misaligned wheels cause systematic drift&lt;br /&gt;
&lt;br /&gt;
== IMU-Based Dead Reckoning ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMU-based dead reckoning&#039;&#039;&#039; uses inertial measurement unit sensors (accelerometers and gyroscopes) to track motion. This approach is more complex than odometry and requires sophisticated sensor fusion.&lt;br /&gt;
&lt;br /&gt;
=== Principle of Operation ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Measure acceleration&#039;&#039;&#039; using 3-axis accelerometer&lt;br /&gt;
# &#039;&#039;&#039;Remove gravity component&#039;&#039;&#039; from acceleration readings&lt;br /&gt;
# &#039;&#039;&#039;Integrate acceleration&#039;&#039;&#039; to obtain velocity&lt;br /&gt;
# &#039;&#039;&#039;Integrate velocity&#039;&#039;&#039; to obtain position&lt;br /&gt;
# &#039;&#039;&#039;Measure angular velocity&#039;&#039;&#039; using 3-axis gyroscope&lt;br /&gt;
# &#039;&#039;&#039;Integrate gyroscope readings&#039;&#039;&#039; to obtain heading angle&lt;br /&gt;
# &#039;&#039;&#039;Apply sensor fusion&#039;&#039;&#039; to combine all measurements and reduce drift&lt;br /&gt;
&lt;br /&gt;
=== Mathematical Foundation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For position (simplified 2D case):&#039;&#039;&#039;&lt;br /&gt;
 # Measure acceleration in body frame&lt;br /&gt;
 accel_body = read_accelerometer()&lt;br /&gt;
&lt;br /&gt;
 # Rotate to world frame using current heading&lt;br /&gt;
 accel_world_x = accel_body_x × cos(θ) - accel_body_y × sin(θ)&lt;br /&gt;
 accel_world_y = accel_body_x × sin(θ) + accel_body_y × cos(θ)&lt;br /&gt;
&lt;br /&gt;
 # Remove gravity (9.81 m/s² in z-axis)&lt;br /&gt;
 accel_world_z = accel_body_z - 9.81&lt;br /&gt;
&lt;br /&gt;
 # Integrate to get velocity&lt;br /&gt;
 velocity_x = velocity_x_prev + accel_world_x × dt&lt;br /&gt;
 velocity_y = velocity_y_prev + accel_world_y × dt&lt;br /&gt;
&lt;br /&gt;
 # Integrate to get position&lt;br /&gt;
 position_x = position_x_prev + velocity_x × dt&lt;br /&gt;
 position_y = position_y_prev + velocity_y × dt&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For heading:&#039;&#039;&#039;&lt;br /&gt;
 # Measure angular velocity&lt;br /&gt;
 gyro_z = read_gyroscope_z()&lt;br /&gt;
&lt;br /&gt;
 # Integrate to get heading&lt;br /&gt;
 θ = θ_prev + gyro_z × dt&lt;br /&gt;
&lt;br /&gt;
=== Pseudocode Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initialize state&lt;br /&gt;
position = [0.0, 0.0, 0.0]  # x, y, z&lt;br /&gt;
velocity = [0.0, 0.0, 0.0]&lt;br /&gt;
theta = 0.0  # heading angle&lt;br /&gt;
prev_time = time.now()&lt;br /&gt;
&lt;br /&gt;
# IMU calibration offsets (determined during calibration)&lt;br /&gt;
ACCEL_BIAS = [0.05, -0.03, 0.02]  # m/s²&lt;br /&gt;
GYRO_BIAS = [0.01, 0.02, -0.01]   # rad/s&lt;br /&gt;
GRAVITY = 9.81  # m/s²&lt;br /&gt;
&lt;br /&gt;
def rotation_matrix_2d(angle):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Create 2D rotation matrix&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return [[math.cos(angle), -math.sin(angle)],&lt;br /&gt;
            [math.sin(angle),  math.cos(angle)]]&lt;br /&gt;
&lt;br /&gt;
def update_imu_dead_reckoning():&lt;br /&gt;
    global position, velocity, theta, prev_time&lt;br /&gt;
&lt;br /&gt;
    # Calculate time step&lt;br /&gt;
    current_time = time.now()&lt;br /&gt;
    dt = current_time - prev_time&lt;br /&gt;
    prev_time = current_time&lt;br /&gt;
&lt;br /&gt;
    # Read IMU sensors&lt;br /&gt;
    accel_body = read_accelerometer()  # [ax, ay, az] in body frame&lt;br /&gt;
    gyro_body = read_gyroscope()       # [gx, gy, gz] in body frame&lt;br /&gt;
&lt;br /&gt;
    # Apply calibration corrections&lt;br /&gt;
    accel_body = [accel_body[i] - ACCEL_BIAS[i] for i in range(3)]&lt;br /&gt;
    gyro_body = [gyro_body[i] - GYRO_BIAS[i] for i in range(3)]&lt;br /&gt;
&lt;br /&gt;
    # Update heading from gyroscope&lt;br /&gt;
    theta += gyro_body[2] * dt  # z-axis gyro&lt;br /&gt;
&lt;br /&gt;
    # Rotate acceleration to world frame&lt;br /&gt;
    rot_mat = rotation_matrix_2d(theta)&lt;br /&gt;
    accel_world_x = rot_mat[0][0] * accel_body[0] + rot_mat[0][1] * accel_body[1]&lt;br /&gt;
    accel_world_y = rot_mat[1][0] * accel_body[0] + rot_mat[1][1] * accel_body[1]&lt;br /&gt;
    accel_world_z = accel_body[2]&lt;br /&gt;
&lt;br /&gt;
    # Remove gravity from z-axis&lt;br /&gt;
    accel_world_z -= GRAVITY&lt;br /&gt;
&lt;br /&gt;
    # Integrate acceleration to velocity&lt;br /&gt;
    velocity[0] += accel_world_x * dt&lt;br /&gt;
    velocity[1] += accel_world_y * dt&lt;br /&gt;
    velocity[2] += accel_world_z * dt&lt;br /&gt;
&lt;br /&gt;
    # Integrate velocity to position&lt;br /&gt;
    position[0] += velocity[0] * dt&lt;br /&gt;
    position[1] += velocity[1] * dt&lt;br /&gt;
    position[2] += velocity[2] * dt&lt;br /&gt;
&lt;br /&gt;
    return (position, velocity, theta)&lt;br /&gt;
&lt;br /&gt;
# Main loop&lt;br /&gt;
while robot_running:&lt;br /&gt;
    pose = update_imu_dead_reckoning()&lt;br /&gt;
&lt;br /&gt;
    # Use position for navigation&lt;br /&gt;
    navigate_using_position(pose)&lt;br /&gt;
&lt;br /&gt;
    # Sleep to maintain consistent update rate&lt;br /&gt;
    time.sleep(0.01)  # 100 Hz update rate&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IMU Error Sources ===&lt;br /&gt;
&lt;br /&gt;
IMU-based dead reckoning faces significant challenges:&lt;br /&gt;
* &#039;&#039;&#039;Gyroscope drift&#039;&#039;&#039;: Bias errors accumulate rapidly when integrated&lt;br /&gt;
* &#039;&#039;&#039;Accelerometer bias&#039;&#039;&#039;: Small constant errors become large position errors after double integration&lt;br /&gt;
* &#039;&#039;&#039;Sensor noise&#039;&#039;&#039;: Random noise accumulates through integration&lt;br /&gt;
* &#039;&#039;&#039;Gravity vector estimation&#039;&#039;&#039;: Errors in removing gravity cause acceleration measurement errors&lt;br /&gt;
* &#039;&#039;&#039;Temperature effects&#039;&#039;&#039;: Sensor characteristics change with temperature&lt;br /&gt;
* &#039;&#039;&#039;Vibration&#039;&#039;&#039;: High-frequency vibration can bias accelerometer readings&lt;br /&gt;
&lt;br /&gt;
IMU-only dead reckoning typically exhibits much higher drift rates than odometry-based systems. Most practical systems combine IMU data with other sensors (sensor fusion).&lt;br /&gt;
&lt;br /&gt;
== Error Accumulation ==&lt;br /&gt;
&lt;br /&gt;
All dead reckoning systems suffer from &#039;&#039;&#039;unbounded error growth&#039;&#039;&#039; because small measurement errors are integrated over time:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Odometry drift&#039;&#039;&#039;: Typically 5-10% of distance traveled under good conditions&lt;br /&gt;
** Example: After driving 10 meters, position error might be 0.5-1.0 meters&lt;br /&gt;
** Error grows approximately linearly with distance&lt;br /&gt;
** Systematic errors (like unequal wheel diameters) cause circular drift patterns&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;IMU drift&#039;&#039;&#039;: Much worse due to double integration of accelerometer noise&lt;br /&gt;
** Position error grows quadratically with time&lt;br /&gt;
** Without corrections, IMU-only systems become unusable within seconds&lt;br /&gt;
** Gyro drift causes heading errors that compound position errors&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Combined effects&#039;&#039;&#039;: Heading errors particularly problematic&lt;br /&gt;
** A 1-degree heading error causes 1.7% lateral drift&lt;br /&gt;
** After driving 10 meters with 1° heading error, lateral position error is 0.17 meters&lt;br /&gt;
&lt;br /&gt;
== Coordinate Systems ==&lt;br /&gt;
&lt;br /&gt;
Dead reckoning requires careful management of coordinate frames:&lt;br /&gt;
&lt;br /&gt;
=== Robot Frame (Body Frame) ===&lt;br /&gt;
* Origin at robot center&lt;br /&gt;
* X-axis points forward&lt;br /&gt;
* Y-axis points left&lt;br /&gt;
* Rotates with the robot&lt;br /&gt;
&lt;br /&gt;
=== World Frame (Global Frame) ===&lt;br /&gt;
* Fixed reference frame&lt;br /&gt;
* Origin at starting position&lt;br /&gt;
* X and Y axes aligned with environment&lt;br /&gt;
* Does not move&lt;br /&gt;
&lt;br /&gt;
=== Pose Representation ===&lt;br /&gt;
&lt;br /&gt;
Robot pose in world frame: &#039;&#039;&#039;(x, y, θ)&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;x&#039;&#039;&#039;: Position along world X-axis&lt;br /&gt;
* &#039;&#039;&#039;y&#039;&#039;&#039;: Position along world Y-axis&lt;br /&gt;
* &#039;&#039;&#039;θ&#039;&#039;&#039;: Heading angle (orientation) relative to world X-axis&lt;br /&gt;
&lt;br /&gt;
=== Coordinate Transformation ===&lt;br /&gt;
&lt;br /&gt;
To transform a point from robot frame to world frame:&lt;br /&gt;
&lt;br /&gt;
 x_world = x_robot × cos(θ) - y_robot × sin(θ) + pose_x&lt;br /&gt;
 y_world = x_robot × sin(θ) + y_robot × cos(θ) + pose_y&lt;br /&gt;
&lt;br /&gt;
Using rotation matrix form:&lt;br /&gt;
 [x_world]   [cos(θ)  -sin(θ)] [x_robot]   [pose_x]&lt;br /&gt;
 [y_world] = [sin(θ)   cos(θ)] [y_robot] + [pose_y]&lt;br /&gt;
&lt;br /&gt;
== Improving Accuracy ==&lt;br /&gt;
&lt;br /&gt;
Several techniques can reduce dead reckoning errors:&lt;br /&gt;
&lt;br /&gt;
=== Sensor Fusion ===&lt;br /&gt;
Combine multiple sensor types to leverage their complementary characteristics:&lt;br /&gt;
* &#039;&#039;&#039;Odometry + IMU&#039;&#039;&#039;: Odometry for position, IMU for rapid orientation updates&lt;br /&gt;
* &#039;&#039;&#039;Complementary filtering&#039;&#039;&#039;: Use IMU for short-term (fast response), odometry for long-term (low drift)&lt;br /&gt;
* &#039;&#039;&#039;Kalman filtering&#039;&#039;&#039;: Optimal fusion of multiple noisy sensors&lt;br /&gt;
&lt;br /&gt;
=== External Reference Points ===&lt;br /&gt;
Reset or correct position estimates when passing known landmarks:&lt;br /&gt;
* &#039;&#039;&#039;Beacon detection&#039;&#039;&#039;: Reset position when detecting a marker at known location&lt;br /&gt;
* &#039;&#039;&#039;Wall following&#039;&#039;&#039;: Use distance sensors to maintain known offset from wall&lt;br /&gt;
* &#039;&#039;&#039;Line detection&#039;&#039;&#039;: Reset position when crossing known lines or boundaries&lt;br /&gt;
* &#039;&#039;&#039;Visual landmarks&#039;&#039;&#039;: Use camera to identify known features&lt;br /&gt;
&lt;br /&gt;
=== Calibration ===&lt;br /&gt;
Reduce systematic errors through careful calibration:&lt;br /&gt;
* &#039;&#039;&#039;Wheel diameter&#039;&#039;&#039;: Measure actual effective diameter under load&lt;br /&gt;
* &#039;&#039;&#039;Wheel separation&#039;&#039;&#039;: Measure actual track width between wheel contact points&lt;br /&gt;
* &#039;&#039;&#039;Encoder resolution&#039;&#039;&#039;: Verify actual pulses per revolution&lt;br /&gt;
* &#039;&#039;&#039;IMU bias&#039;&#039;&#039;: Measure sensor offsets while stationary&lt;br /&gt;
&lt;br /&gt;
=== Closed-Loop Verification ===&lt;br /&gt;
Test dead reckoning accuracy by:&lt;br /&gt;
* Driving a closed path (square, circle) and measuring final position error&lt;br /&gt;
* Comparing estimated position to known checkpoints&lt;br /&gt;
* Recording error statistics over multiple runs&lt;br /&gt;
* Adjusting calibration parameters to minimize systematic errors&lt;br /&gt;
&lt;br /&gt;
=== Advanced Techniques ===&lt;br /&gt;
* &#039;&#039;&#039;Kalman filters&#039;&#039;&#039;: Optimal state estimation with uncertainty quantification&lt;br /&gt;
* &#039;&#039;&#039;Particle filters&#039;&#039;&#039;: Handle non-Gaussian errors and multiple hypotheses&lt;br /&gt;
* &#039;&#039;&#039;Extended Kalman Filter (EKF)&#039;&#039;&#039;: Handle non-linear motion models&lt;br /&gt;
* &#039;&#039;&#039;Unscented Kalman Filter (UKF)&#039;&#039;&#039;: Better handling of severe non-linearities&lt;br /&gt;
&lt;br /&gt;
== SimpleBot Implementation ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot implements odometry-based dead reckoning using optical wheel encoders:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Sensor type&#039;&#039;&#039;: Optical encoders on each wheel&lt;br /&gt;
* &#039;&#039;&#039;Pulse counting&#039;&#039;&#039;: Interrupt-driven pulse accumulation&lt;br /&gt;
* &#039;&#039;&#039;Update rate&#039;&#039;&#039;: Real-time position calculation on each encoder pulse&lt;br /&gt;
* &#039;&#039;&#039;Drivetrain&#039;&#039;&#039;: Differential drive with two independent motors&lt;br /&gt;
* &#039;&#039;&#039;Capabilities&#039;&#039;&#039;:&lt;br /&gt;
** Track current (x, y, θ) pose continuously&lt;br /&gt;
** Execute motion patterns (squares, circles, arbitrary paths)&lt;br /&gt;
** Return to starting position via reverse path&lt;br /&gt;
** Report position estimates for navigation decisions&lt;br /&gt;
&lt;br /&gt;
See [[SimpleBot:Dead Reckoning Implementation]] for complete implementation details including:&lt;br /&gt;
* Hardware setup (encoder mounting and wiring)&lt;br /&gt;
* Interrupt service routines for pulse counting&lt;br /&gt;
* Position calculation algorithms&lt;br /&gt;
* Calibration procedures&lt;br /&gt;
* Example programs and test patterns&lt;br /&gt;
&lt;br /&gt;
== Practical Challenges ==&lt;br /&gt;
&lt;br /&gt;
=== Challenge 1: Drive and Return ===&lt;br /&gt;
&#039;&#039;&#039;Objective&#039;&#039;&#039;: Test basic dead reckoning accuracy&lt;br /&gt;
&lt;br /&gt;
# Program robot to drive a pattern (square, circle, or arbitrary path)&lt;br /&gt;
# Record the motion commands&lt;br /&gt;
# Execute the reverse motion sequence to return to start&lt;br /&gt;
# Measure final position error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Success criteria&#039;&#039;&#039;:&lt;br /&gt;
* Position error &amp;lt; 5% of total distance traveled&lt;br /&gt;
* Heading error &amp;lt; 5 degrees&lt;br /&gt;
&lt;br /&gt;
=== Challenge 2: Right Triangle Test ===&lt;br /&gt;
&#039;&#039;&#039;Objective&#039;&#039;&#039;: Test position accuracy across different motion types&lt;br /&gt;
&lt;br /&gt;
# Drive forward distance D&lt;br /&gt;
# Turn 90 degrees right&lt;br /&gt;
# Drive forward distance D (now at far corner of square)&lt;br /&gt;
# Calculate and turn toward starting position&lt;br /&gt;
# Drive directly back to start (hypotenuse of right triangle)&lt;br /&gt;
# Measure final position error&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Success criteria&#039;&#039;&#039;:&lt;br /&gt;
* Return to within 10 cm of starting position&lt;br /&gt;
* Demonstrates both distance and angle accuracy&lt;br /&gt;
&lt;br /&gt;
This challenge tests:&lt;br /&gt;
* Forward distance measurement accuracy&lt;br /&gt;
* Turn angle accuracy&lt;br /&gt;
* Integration of distance and angle to calculate return path&lt;br /&gt;
* Cumulative error over multi-segment path&lt;br /&gt;
&lt;br /&gt;
=== Challenge 3: Long Distance Drift ===&lt;br /&gt;
&#039;&#039;&#039;Objective&#039;&#039;&#039;: Characterize error growth over distance&lt;br /&gt;
&lt;br /&gt;
# Drive straight for increasing distances: 1m, 2m, 5m, 10m&lt;br /&gt;
# At each distance, measure lateral drift and distance error&lt;br /&gt;
# Calculate drift as percentage of distance traveled&lt;br /&gt;
# Plot error versus distance to characterize error growth&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capability:Optical Odometry]] - Wheel encoder hardware and pulse counting&lt;br /&gt;
* [[Capability:IMU Sensing]] - Inertial measurement unit sensors&lt;br /&gt;
* [[Capability:Differential Drive]] - Two-wheeled drivetrain fundamentals&lt;br /&gt;
* [[Activity:Dead Reckoning Navigation]] - Using dead reckoning for autonomous navigation&lt;br /&gt;
* [[SimpleBot:Dead Reckoning Implementation]] - Complete implementation on SimpleBot&lt;br /&gt;
* [[Behavior:Wall Following]] - Navigation behavior that can correct dead reckoning drift&lt;br /&gt;
&lt;br /&gt;
[[Category:Behavior]]&lt;br /&gt;
[[Category:Beginner Behavior]]&lt;br /&gt;
[[Category:Intermediate Behavior]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Line_Following&amp;diff=47</id>
		<title>Behavior:Line Following</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behavior:Line_Following&amp;diff=47"/>
		<updated>2025-10-11T16:47:35Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Behavior&lt;br /&gt;
|name=Line Following&lt;br /&gt;
|requires=[[Capability:Line Sensing]], [[Capability:Differential Drive]]&lt;br /&gt;
|enables=[[Activity:Line Following]]&lt;br /&gt;
|difficulty=Beginner&lt;br /&gt;
|implementations=[[SimpleBot:Line Following Implementation]]&lt;br /&gt;
|status=Fully Documented&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Line Following&#039;&#039;&#039; is a fundamental robotic behavior that enables a robot to autonomously track and follow a visible line on the ground. This behavior interprets data from line sensors (typically infrared reflectance sensors) to continuously adjust the robot&#039;s steering and maintain alignment with the line path.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
Line-following behavior is one of the most common introductory robotics tasks, yet it scales from simple bang-bang control to sophisticated PID-based systems. The core principle remains constant: detect position relative to the line, and adjust motor speeds to correct any deviation.&lt;br /&gt;
&lt;br /&gt;
The behavior operates in a continuous sense-think-act loop:&lt;br /&gt;
# &#039;&#039;&#039;Sense&#039;&#039;&#039;: Read reflectance values from line sensors&lt;br /&gt;
# &#039;&#039;&#039;Think&#039;&#039;&#039;: Determine position relative to the line (on line, left of line, right of line, or lost)&lt;br /&gt;
# &#039;&#039;&#039;Act&#039;&#039;&#039;: Adjust motor speeds to steer back toward the line&lt;br /&gt;
&lt;br /&gt;
Line-following is typically used with high-contrast lines (black tape on white surface or vice versa), though the algorithms can be adapted for other visual markers.&lt;br /&gt;
&lt;br /&gt;
== Algorithm Variants by Sensor Count ==&lt;br /&gt;
&lt;br /&gt;
The complexity and performance of line-following behavior depends heavily on the number of sensors used. Each configuration has distinct trade-offs.&lt;br /&gt;
&lt;br /&gt;
=== One-Sensor Algorithm ===&lt;br /&gt;
&lt;br /&gt;
The simplest line-following approach uses a single sensor positioned at the robot&#039;s front center.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Algorithm:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loop forever:&lt;br /&gt;
    if sensor detects line:&lt;br /&gt;
        drive forward&lt;br /&gt;
    else:&lt;br /&gt;
        rotate in place (searching)&lt;br /&gt;
        wait until line is found again&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudocode:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
while true:&lt;br /&gt;
    if read_sensor() == LINE_DETECTED:&lt;br /&gt;
        set_motors(FORWARD_SPEED, FORWARD_SPEED)&lt;br /&gt;
    else:&lt;br /&gt;
        // Lost the line - search by rotating&lt;br /&gt;
        set_motors(TURN_SPEED, -TURN_SPEED)  // Spin in place&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pros:&#039;&#039;&#039;&lt;br /&gt;
* Simplest hardware and code&lt;br /&gt;
* Minimal cost&lt;br /&gt;
* Good for teaching basic concepts&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cons:&#039;&#039;&#039;&lt;br /&gt;
* Jerky, inefficient motion (constant stop-and-turn)&lt;br /&gt;
* Cannot anticipate curves&lt;br /&gt;
* Very slow on anything but straight lines&lt;br /&gt;
* No way to determine which direction to correct&lt;br /&gt;
&lt;br /&gt;
=== Two-Sensor Algorithm ===&lt;br /&gt;
&lt;br /&gt;
Using two sensors positioned on either side of the line enables the robot to detect which direction it&#039;s drifting and make appropriate corrections. &#039;&#039;&#039;This is the approach used by SimpleBot.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Algorithm:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loop forever:&lt;br /&gt;
    read left_sensor and right_sensor&lt;br /&gt;
&lt;br /&gt;
    if both sensors on white (off line):&lt;br /&gt;
        drive straight - robot is centered on line&lt;br /&gt;
&lt;br /&gt;
    else if left_sensor on line (black):&lt;br /&gt;
        turn right - robot is drifting left&lt;br /&gt;
&lt;br /&gt;
    else if right_sensor on line (black):&lt;br /&gt;
        turn left - robot is drifting right&lt;br /&gt;
&lt;br /&gt;
    else if both sensors on line (black):&lt;br /&gt;
        intersection or completely lost&lt;br /&gt;
        execute special handling&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudocode:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const BASE_SPEED = 150&lt;br /&gt;
const TURN_SPEED = 100&lt;br /&gt;
&lt;br /&gt;
while true:&lt;br /&gt;
    left = read_left_sensor()&lt;br /&gt;
    right = read_right_sensor()&lt;br /&gt;
&lt;br /&gt;
    if left == WHITE and right == WHITE:&lt;br /&gt;
        // Centered on line - drive straight&lt;br /&gt;
        set_motors(BASE_SPEED, BASE_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else if left == BLACK and right == WHITE:&lt;br /&gt;
        // Drifting left - turn right&lt;br /&gt;
        set_motors(BASE_SPEED, TURN_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else if left == WHITE and right == BLACK:&lt;br /&gt;
        // Drifting right - turn left&lt;br /&gt;
        set_motors(TURN_SPEED, BASE_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else if left == BLACK and right == BLACK:&lt;br /&gt;
        // Both on line - intersection or lost&lt;br /&gt;
        // Option 1: Stop and signal&lt;br /&gt;
        set_motors(0, 0)&lt;br /&gt;
        // Option 2: Drive straight through&lt;br /&gt;
        set_motors(BASE_SPEED, BASE_SPEED)&lt;br /&gt;
        // Option 3: Execute turn decision&lt;br /&gt;
        make_intersection_decision()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pros:&#039;&#039;&#039;&lt;br /&gt;
* Simple to understand and implement&lt;br /&gt;
* Directional correction (knows which way to turn)&lt;br /&gt;
* Smooth following on gentle curves&lt;br /&gt;
* Can detect intersections&lt;br /&gt;
* Good cost-to-performance ratio&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cons:&#039;&#039;&#039;&lt;br /&gt;
* Fixed correction amount (not proportional)&lt;br /&gt;
* Struggles with sharp curves&lt;br /&gt;
* Sensor spacing critical to performance&lt;br /&gt;
* Line width must match sensor spacing&lt;br /&gt;
&lt;br /&gt;
=== Three-Sensor Algorithm ===&lt;br /&gt;
&lt;br /&gt;
Three sensors (left, center, right) provide better tracking by distinguishing between centered, slightly off, and significantly off positions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Algorithm:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loop forever:&lt;br /&gt;
    read left_sensor, center_sensor, right_sensor&lt;br /&gt;
&lt;br /&gt;
    if center_sensor on line:&lt;br /&gt;
        drive fast and straight - perfectly centered&lt;br /&gt;
&lt;br /&gt;
    else if left_sensor on line:&lt;br /&gt;
        gentle turn right&lt;br /&gt;
&lt;br /&gt;
    else if right_sensor on line:&lt;br /&gt;
        gentle turn left&lt;br /&gt;
&lt;br /&gt;
    else if no sensors on line:&lt;br /&gt;
        execute lost-line recovery&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudocode:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const FAST_SPEED = 200&lt;br /&gt;
const NORMAL_SPEED = 150&lt;br /&gt;
const SLOW_SPEED = 100&lt;br /&gt;
&lt;br /&gt;
while true:&lt;br /&gt;
    left = read_left_sensor()&lt;br /&gt;
    center = read_center_sensor()&lt;br /&gt;
    right = read_right_sensor()&lt;br /&gt;
&lt;br /&gt;
    if center == BLACK:&lt;br /&gt;
        // Perfectly centered - drive fast&lt;br /&gt;
        set_motors(FAST_SPEED, FAST_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else if left == BLACK:&lt;br /&gt;
        // Slightly left - gentle right turn&lt;br /&gt;
        set_motors(NORMAL_SPEED, SLOW_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else if right == BLACK:&lt;br /&gt;
        // Slightly right - gentle left turn&lt;br /&gt;
        set_motors(SLOW_SPEED, NORMAL_SPEED)&lt;br /&gt;
&lt;br /&gt;
    else:&lt;br /&gt;
        // Lost line - slow search&lt;br /&gt;
        set_motors(SLOW_SPEED, -SLOW_SPEED)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pros:&#039;&#039;&#039;&lt;br /&gt;
* Better detection of centered position&lt;br /&gt;
* Can optimize speed (drive faster when centered)&lt;br /&gt;
* More graceful corrections&lt;br /&gt;
* Better lost-line detection&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cons:&#039;&#039;&#039;&lt;br /&gt;
* More hardware complexity&lt;br /&gt;
* Still uses discrete corrections&lt;br /&gt;
* Cannot handle very sharp curves without slowing significantly&lt;br /&gt;
&lt;br /&gt;
=== Multi-Sensor Array (5-8 Sensors) ===&lt;br /&gt;
&lt;br /&gt;
High-performance line following uses an array of sensors to calculate a continuous &amp;quot;line position&amp;quot; value, enabling proportional control.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Algorithm:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loop forever:&lt;br /&gt;
    read all sensors (s0, s1, s2, s3, s4, s5, s6, s7)&lt;br /&gt;
&lt;br /&gt;
    calculate line_position using weighted average:&lt;br /&gt;
        line_position = sum(sensor_value[i] * position_weight[i]) / sum(sensor_value[i])&lt;br /&gt;
&lt;br /&gt;
    calculate error = line_position - desired_position (0 = center)&lt;br /&gt;
&lt;br /&gt;
    apply PID control:&lt;br /&gt;
        correction = Kp * error + Ki * integral_error + Kd * derivative_error&lt;br /&gt;
&lt;br /&gt;
    adjust motors:&lt;br /&gt;
        left_motor = BASE_SPEED + correction&lt;br /&gt;
        right_motor = BASE_SPEED - correction&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pseudocode:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
const BASE_SPEED = 180&lt;br /&gt;
const Kp = 0.8  // Proportional gain&lt;br /&gt;
const Ki = 0.01 // Integral gain&lt;br /&gt;
const Kd = 2.0  // Derivative gain&lt;br /&gt;
&lt;br /&gt;
integral_error = 0&lt;br /&gt;
last_error = 0&lt;br /&gt;
&lt;br /&gt;
while true:&lt;br /&gt;
    // Read sensor array (0 = white, 1000 = black)&lt;br /&gt;
    sensors = [read_sensor(0), read_sensor(1), ..., read_sensor(7)]&lt;br /&gt;
&lt;br /&gt;
    // Calculate weighted line position (-3.5 to +3.5 for 8 sensors)&lt;br /&gt;
    weighted_sum = 0&lt;br /&gt;
    total_activation = 0&lt;br /&gt;
&lt;br /&gt;
    for i in 0 to 7:&lt;br /&gt;
        weight = i - 3.5  // Position weights: -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5&lt;br /&gt;
        weighted_sum += sensors[i] * weight&lt;br /&gt;
        total_activation += sensors[i]&lt;br /&gt;
&lt;br /&gt;
    if total_activation &amp;gt; 0:&lt;br /&gt;
        line_position = weighted_sum / total_activation&lt;br /&gt;
    else:&lt;br /&gt;
        // Lost line - use last known position&lt;br /&gt;
        line_position = last_line_position&lt;br /&gt;
&lt;br /&gt;
    // PID control&lt;br /&gt;
    error = line_position  // Target is 0 (center)&lt;br /&gt;
    integral_error += error&lt;br /&gt;
    derivative_error = error - last_error&lt;br /&gt;
&lt;br /&gt;
    correction = Kp * error + Ki * integral_error + Kd * derivative_error&lt;br /&gt;
&lt;br /&gt;
    // Apply correction&lt;br /&gt;
    left_speed = BASE_SPEED + correction&lt;br /&gt;
    right_speed = BASE_SPEED - correction&lt;br /&gt;
&lt;br /&gt;
    set_motors(left_speed, right_speed)&lt;br /&gt;
&lt;br /&gt;
    last_error = error&lt;br /&gt;
    last_line_position = line_position&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pros:&#039;&#039;&#039;&lt;br /&gt;
* Smooth, precise tracking&lt;br /&gt;
* Proportional corrections (gentle curves vs. sharp turns)&lt;br /&gt;
* High speed capability&lt;br /&gt;
* Excellent on complex paths&lt;br /&gt;
* Can implement look-ahead strategies&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cons:&#039;&#039;&#039;&lt;br /&gt;
* Significant hardware cost&lt;br /&gt;
* Complex algorithm and tuning&lt;br /&gt;
* Requires PID understanding&lt;br /&gt;
* Overkill for simple tasks&lt;br /&gt;
&lt;br /&gt;
== Tuning Parameters ==&lt;br /&gt;
&lt;br /&gt;
Successful line-following requires careful tuning of several parameters:&lt;br /&gt;
&lt;br /&gt;
=== Base Speed ===&lt;br /&gt;
The forward speed when driving straight or making corrections.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Too slow&#039;&#039;&#039;: Robot is stable but inefficient; wastes time&lt;br /&gt;
* &#039;&#039;&#039;Too fast&#039;&#039;&#039;: Robot overshoots corrections and oscillates&lt;br /&gt;
* &#039;&#039;&#039;Optimal&#039;&#039;&#039;: As fast as possible while maintaining stable tracking&lt;br /&gt;
&lt;br /&gt;
Start with low speeds (50-100 motor units) and gradually increase until oscillation appears, then reduce by 20%.&lt;br /&gt;
&lt;br /&gt;
=== Turn Aggression ===&lt;br /&gt;
How sharply the robot corrects when off-line.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Too gentle&#039;&#039;&#039;: Robot drifts off line before correction takes effect&lt;br /&gt;
* &#039;&#039;&#039;Too aggressive&#039;&#039;&#039;: Robot oscillates or zigzags&lt;br /&gt;
* &#039;&#039;&#039;Optimal&#039;&#039;&#039;: Smooth sinusoidal path that stays on line&lt;br /&gt;
&lt;br /&gt;
For differential corrections, the turn speed should be 50-70% of base speed.&lt;br /&gt;
&lt;br /&gt;
=== Sensor Spacing ===&lt;br /&gt;
Physical distance between sensors affects behavior.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Narrow spacing&#039;&#039;&#039;: More sensitive to small deviations; better on gentle curves; struggles on sharp turns&lt;br /&gt;
* &#039;&#039;&#039;Wide spacing&#039;&#039;&#039;: Less sensitive; handles sharp turns; may miss gentle curves&lt;br /&gt;
* &#039;&#039;&#039;Optimal&#039;&#039;&#039;: Spacing slightly wider than line width&lt;br /&gt;
&lt;br /&gt;
For a 20mm wide line, sensors should be 25-30mm apart.&lt;br /&gt;
&lt;br /&gt;
=== Sensor Threshold ===&lt;br /&gt;
The reflectance value that distinguishes line from background.&lt;br /&gt;
&lt;br /&gt;
* Calibrate in actual operating environment&lt;br /&gt;
* Use midpoint between average white and average black readings&lt;br /&gt;
* Implement hysteresis to prevent flickering at boundary&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Calibration procedure&lt;br /&gt;
white_value = read_sensor_on_white_surface()&lt;br /&gt;
black_value = read_sensor_on_black_line()&lt;br /&gt;
threshold = (white_value + black_value) / 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Challenges and Solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Lost Line ===&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Robot loses the line completely (all sensors read white or all read black).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Memory-based recovery&#039;&#039;&#039;: Remember last known direction and turn that way&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if line_lost():&lt;br /&gt;
    if last_correction == TURNING_LEFT:&lt;br /&gt;
        set_motors(-SEARCH_SPEED, SEARCH_SPEED)  // Continue left&lt;br /&gt;
    else:&lt;br /&gt;
        set_motors(SEARCH_SPEED, -SEARCH_SPEED)  // Continue right&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Spiral search&#039;&#039;&#039;: Gradually expand search radius&lt;br /&gt;
* &#039;&#039;&#039;Timeout and stop&#039;&#039;&#039;: If line not found within N seconds, halt and signal error&lt;br /&gt;
&lt;br /&gt;
=== Sharp Turns ===&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Robot cannot turn sharply enough to stay on line.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Detect sharp turn&#039;&#039;&#039;: Multiple consecutive corrections in same direction&lt;br /&gt;
* &#039;&#039;&#039;Reduce speed&#039;&#039;&#039;: Slow down when sharp turn detected&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
consecutive_turns_right += 1&lt;br /&gt;
if consecutive_turns_right &amp;gt; 5:&lt;br /&gt;
    base_speed = SLOW_SPEED  // Sharp curve detected&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Aggressive correction&#039;&#039;&#039;: Increase turn speed or even stop one wheel&lt;br /&gt;
&lt;br /&gt;
=== Intersections ===&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Multiple possible paths (T-junction, cross, etc.).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Detection&#039;&#039;&#039;: Both sensors (or multiple sensors) detect line simultaneously&lt;br /&gt;
* &#039;&#039;&#039;Pre-programmed decisions&#039;&#039;&#039;: Follow sequence of turns (left, right, straight, right...)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
intersection_sequence = [LEFT, STRAIGHT, RIGHT, LEFT]&lt;br /&gt;
current_intersection = 0&lt;br /&gt;
&lt;br /&gt;
if detect_intersection():&lt;br /&gt;
    execute_turn(intersection_sequence[current_intersection])&lt;br /&gt;
    current_intersection += 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Marker-based navigation&#039;&#039;&#039;: Use additional sensors to detect colored markers&lt;br /&gt;
* &#039;&#039;&#039;Default behavior&#039;&#039;&#039;: Always go straight through intersections&lt;br /&gt;
&lt;br /&gt;
=== Line Width Variations ===&lt;br /&gt;
&#039;&#039;&#039;Problem:&#039;&#039;&#039; Line width changes along path.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solutions:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Calibration&#039;&#039;&#039;: Test on actual track&lt;br /&gt;
* &#039;&#039;&#039;Adaptive thresholds&#039;&#039;&#039;: Continuously recalibrate based on recent readings&lt;br /&gt;
* &#039;&#039;&#039;Edge detection&#039;&#039;&#039;: Track line edge rather than center (more consistent)&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
&lt;br /&gt;
=== PID Control ===&lt;br /&gt;
Proportional-Integral-Derivative control provides smooth, optimized tracking:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Proportional (P)&#039;&#039;&#039;: Correction proportional to current error (distance from line)&lt;br /&gt;
* &#039;&#039;&#039;Integral (I)&#039;&#039;&#039;: Corrects for persistent bias (e.g., one motor slightly faster)&lt;br /&gt;
* &#039;&#039;&#039;Derivative (D)&#039;&#039;&#039;: Dampens oscillation by responding to rate of change&lt;br /&gt;
&lt;br /&gt;
Start with P-only control (set I and D to zero), then add D to reduce oscillation, and finally add small I if steady-state error exists.&lt;br /&gt;
&lt;br /&gt;
=== Look-Ahead ===&lt;br /&gt;
With sensor arrays, use forward sensors to anticipate curves:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if sensors[0] or sensors[1] active:&lt;br /&gt;
    // Sharp left turn coming&lt;br /&gt;
    reduce_speed()&lt;br /&gt;
    increase_left_correction()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Intersection Navigation ===&lt;br /&gt;
Sophisticated intersection handling:&lt;br /&gt;
&lt;br /&gt;
* Count intersections to determine position on known map&lt;br /&gt;
* Use timing to ensure robot fully enters intersection before turning&lt;br /&gt;
* Implement &amp;quot;intersection memory&amp;quot; to avoid counting same intersection twice&lt;br /&gt;
&lt;br /&gt;
=== Path Memory ===&lt;br /&gt;
Record successful paths and replay:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Record mode&lt;br /&gt;
path = []&lt;br /&gt;
while running:&lt;br /&gt;
    sensor_state = read_sensors()&lt;br /&gt;
    motor_command = calculate_correction(sensor_state)&lt;br /&gt;
    path.append(motor_command)&lt;br /&gt;
    execute(motor_command)&lt;br /&gt;
&lt;br /&gt;
// Replay mode&lt;br /&gt;
for command in path:&lt;br /&gt;
    execute(command)&lt;br /&gt;
    delay(LOOP_TIME)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SimpleBot Implementation ==&lt;br /&gt;
&lt;br /&gt;
SimpleBot uses the &#039;&#039;&#039;two-sensor algorithm&#039;&#039;&#039; with basic bang-bang control. The sensors are positioned 25mm apart, straddling a 20mm wide black line on a white surface.&lt;br /&gt;
&lt;br /&gt;
The implementation uses:&lt;br /&gt;
* Reflectance sensors with analog output&lt;br /&gt;
* Threshold-based line detection&lt;br /&gt;
* Four-state control logic (straight, left, right, lost)&lt;br /&gt;
* Simple lost-line recovery (continue last turn direction)&lt;br /&gt;
&lt;br /&gt;
For complete implementation details including circuit diagrams, calibration procedures, and code, see [[SimpleBot:Line Following Implementation]].&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Capability:Line Sensing]] - Hardware and sensor technology&lt;br /&gt;
* [[Capability:Differential Drive]] - Motor control fundamentals&lt;br /&gt;
* [[Activity:Line Following]] - Using line following for navigation tasks&lt;br /&gt;
* [[SimpleBot:Line Following Implementation]] - Complete working example&lt;br /&gt;
* [[Behavior:PID Control]] - Advanced smooth control technique&lt;br /&gt;
&lt;br /&gt;
[[Category:Behavior]]&lt;br /&gt;
[[Category:Beginner Behavior]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=Behaviors&amp;diff=46</id>
		<title>Behaviors</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=Behaviors&amp;diff=46"/>
		<updated>2025-10-11T16:47:13Z</updated>

		<summary type="html">&lt;p&gt;John: Claude edited based on my notes, prompt, and SimpleBot code repository&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Behaviors: How Robots Think and Act =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Behaviors&#039;&#039;&#039; are algorithms and software patterns that connect sensing to action. They represent the &amp;quot;how&amp;quot; of robotics - the intelligence that transforms sensor data into purposeful movement.&lt;br /&gt;
&lt;br /&gt;
For an introduction to how Behaviors fit into the BRS knowledge structure, see [[Robotics Ontology]].&lt;br /&gt;
&lt;br /&gt;
== What Makes a Behavior? ==&lt;br /&gt;
&lt;br /&gt;
A Behavior has these characteristics:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Algorithm-based&#039;&#039;&#039;: It&#039;s a defined process or decision-making pattern&lt;br /&gt;
* &#039;&#039;&#039;Language-agnostic&#039;&#039;&#039;: Can be implemented in any programming language&lt;br /&gt;
* &#039;&#039;&#039;Sensor-agnostic&#039;&#039;&#039;: Works with different hardware providing the same capability&lt;br /&gt;
* &#039;&#039;&#039;Reusable&#039;&#039;&#039;: The same behavior can be used in multiple activities&lt;br /&gt;
* &#039;&#039;&#039;Testable&#039;&#039;&#039;: You can verify if the behavior works correctly&lt;br /&gt;
&lt;br /&gt;
Behaviors are different from &#039;&#039;&#039;Activities&#039;&#039;&#039; (which are user-facing tasks) and &#039;&#039;&#039;Capabilities&#039;&#039;&#039; (which are hardware). A Behavior defines &amp;quot;how&amp;quot; a robot thinks, not &amp;quot;what&amp;quot; it accomplishes or &amp;quot;what hardware&amp;quot; it uses.&lt;br /&gt;
&lt;br /&gt;
== Current Behaviors ==&lt;br /&gt;
&lt;br /&gt;
These behaviors have full documentation with tested implementations on [[SimpleBot]]:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Behavior !! Type !! Required Capabilities !! Used In !! Status&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Behavior:Line Following]]&#039;&#039;&#039; || Navigation || [[Capability:Line Sensing|Line Sensing]], [[Capability:Differential Drive|Differential Drive]] || [[Activity:Line Following]] || &#039;&#039;&#039;Fully Documented&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;[[Behavior:Dead Reckoning]]&#039;&#039;&#039; || Navigation || [[Capability:Optical Odometry|Odometry]], [[Capability:Differential Drive|Differential Drive]] || [[Activity:Dead Reckoning Navigation]] || &#039;&#039;&#039;Fully Documented&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Future Behaviors (Stubs) ==&lt;br /&gt;
&lt;br /&gt;
These behaviors are &#039;&#039;&#039;not yet implemented&#039;&#039;&#039; in any BRS robot. They represent opportunities for community contribution! Implement these algorithms and document them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Behavior !! Type !! Required Capabilities !! Enables Activities !! Status&lt;br /&gt;
|-&lt;br /&gt;
| [[Behavior:PID Control]] || Control || Sensors + Actuators || Precise motion, line following improvements || &#039;&#039;&#039;Stub&#039;&#039;&#039; - Waiting for implementation&lt;br /&gt;
|-&lt;br /&gt;
| [[Behavior:Wall Following]] || Navigation || Distance Sensing, Movement || Maze solving, room navigation || &#039;&#039;&#039;Stub&#039;&#039;&#039; - Waiting for implementation&lt;br /&gt;
|-&lt;br /&gt;
| [[Behavior:Pathfinding]] || Planning || Mapping, Movement || Optimal navigation, maze optimization || &#039;&#039;&#039;Stub&#039;&#039;&#039; - Advanced algorithm&lt;br /&gt;
|-&lt;br /&gt;
| [[Behavior:SLAM]] || Mapping || LIDAR/Distance, Odometry || Room mapping, autonomous navigation || &#039;&#039;&#039;Stub&#039;&#039;&#039; - Advanced algorithm&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Behaviors by Type ==&lt;br /&gt;
&lt;br /&gt;
=== Navigation Behaviors ===&lt;br /&gt;
* [[Behavior:Line Following]] (documented) - Follow visual guides&lt;br /&gt;
* [[Behavior:Dead Reckoning]] (documented) - Navigate using motion measurement&lt;br /&gt;
* [[Behavior:Wall Following]] (stub) - Follow walls and obstacles&lt;br /&gt;
&lt;br /&gt;
=== Control Behaviors ===&lt;br /&gt;
* [[Behavior:PID Control]] (stub) - Proportional-Integral-Derivative feedback control&lt;br /&gt;
&lt;br /&gt;
=== Planning Behaviors ===&lt;br /&gt;
* [[Behavior:Pathfinding]] (stub) - Calculate optimal routes&lt;br /&gt;
&lt;br /&gt;
=== Mapping Behaviors ===&lt;br /&gt;
* [[Behavior:SLAM]] (stub) - Simultaneous Localization and Mapping&lt;br /&gt;
&lt;br /&gt;
== How Behaviors Connect Capabilities to Activities ==&lt;br /&gt;
&lt;br /&gt;
Behaviors are the bridge between what your robot &#039;&#039;&#039;can&#039;&#039;&#039; do (capabilities) and what it &#039;&#039;&#039;should&#039;&#039;&#039; do (activities). Here&#039;s how they connect:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 100%;&amp;quot;&lt;br /&gt;
! Activity !! Behavior !! Required Capabilities !! Status&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity:Line Following]] || [[Behavior:Line Following]] || Line Sensing + Differential Drive || &#039;&#039;&#039;Implemented&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity:Dead Reckoning Navigation]] || [[Behavior:Dead Reckoning]] || Optical Odometry + Differential Drive || &#039;&#039;&#039;Implemented&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity:Maze Solving]] || [[Behavior:Wall Following]] + Navigation || Distance/Bump Sensing + Movement || Stub&lt;br /&gt;
|-&lt;br /&gt;
| [[Activity:Room Mapping]] || [[Behavior:SLAM]] || LIDAR + Odometry + Movement || Stub&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Algorithm Variations ==&lt;br /&gt;
&lt;br /&gt;
Many behaviors have multiple algorithm variants. For example, [[Behavior:Line Following]] includes:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;One-sensor algorithm&#039;&#039;&#039; - Rotate until line found, drive forward, repeat (simple but choppy)&lt;br /&gt;
* &#039;&#039;&#039;Two-sensor algorithm&#039;&#039;&#039; - Turn toward whichever sensor detects the line (smooth beginner approach)&lt;br /&gt;
* &#039;&#039;&#039;Multi-sensor array with PID&#039;&#039;&#039; - Proportional control for smooth, fast tracking (advanced)&lt;br /&gt;
&lt;br /&gt;
Good behavior documentation should:&lt;br /&gt;
* Describe multiple approaches (from simple to advanced)&lt;br /&gt;
* Explain trade-offs (speed vs complexity, smoothness vs code simplicity)&lt;br /&gt;
* Provide pseudocode for each variant&lt;br /&gt;
* Show when to use each variant&lt;br /&gt;
&lt;br /&gt;
== How to Use Behavior Pages ==&lt;br /&gt;
&lt;br /&gt;
Each Behavior page provides:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Overview&#039;&#039;&#039; - What the behavior does and why it matters&lt;br /&gt;
# &#039;&#039;&#039;Algorithm description&#039;&#039;&#039; - Step-by-step logic in plain language&lt;br /&gt;
# &#039;&#039;&#039;Pseudocode&#039;&#039;&#039; - Language-agnostic code structure&lt;br /&gt;
# &#039;&#039;&#039;Variants&#039;&#039;&#039; - Different approaches (simple, intermediate, advanced)&lt;br /&gt;
# &#039;&#039;&#039;Tuning parameters&#039;&#039;&#039; - Variables you can adjust (speed, thresholds, gains)&lt;br /&gt;
# &#039;&#039;&#039;Required capabilities&#039;&#039;&#039; - What hardware is needed&lt;br /&gt;
# &#039;&#039;&#039;Activities enabled&#039;&#039;&#039; - What this behavior allows robots to do&lt;br /&gt;
# &#039;&#039;&#039;Implementation links&#039;&#039;&#039; - Robot-specific code examples&lt;br /&gt;
&lt;br /&gt;
== Implementing Behaviors on Your Robot ==&lt;br /&gt;
&lt;br /&gt;
Want to implement a behavior on your robot?&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Read the behavior page&#039;&#039;&#039; - Understand the algorithm&lt;br /&gt;
# &#039;&#039;&#039;Verify capabilities&#039;&#039;&#039; - Ensure your robot has required sensors/actuators&lt;br /&gt;
# &#039;&#039;&#039;Choose a variant&#039;&#039;&#039; - Pick an algorithm complexity that fits your needs&lt;br /&gt;
# &#039;&#039;&#039;Study the pseudocode&#039;&#039;&#039; - Understand the logic flow&lt;br /&gt;
# &#039;&#039;&#039;Write code for your platform&#039;&#039;&#039; - Translate to Python, C++, Arduino, etc.&lt;br /&gt;
# &#039;&#039;&#039;Test incrementally&#039;&#039;&#039; - Start simple, verify each step works&lt;br /&gt;
# &#039;&#039;&#039;Tune parameters&#039;&#039;&#039; - Adjust speeds, thresholds, timing&lt;br /&gt;
# &#039;&#039;&#039;Document it!&#039;&#039;&#039; - Create an implementation page for your robot&lt;br /&gt;
# &#039;&#039;&#039;Share your results&#039;&#039;&#039; - Help others learn from your experience&lt;br /&gt;
&lt;br /&gt;
== Pseudocode Standards ==&lt;br /&gt;
&lt;br /&gt;
BRS behavior documentation uses consistent pseudocode conventions:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Indentation&#039;&#039;&#039; shows control flow (loops, conditionals)&lt;br /&gt;
* &#039;&#039;&#039;CAPS_WITH_UNDERSCORES&#039;&#039;&#039; for configuration constants&lt;br /&gt;
* &#039;&#039;&#039;camelCase&#039;&#039;&#039; for variables&lt;br /&gt;
* &#039;&#039;&#039;Comments&#039;&#039;&#039; explain the &amp;quot;why&amp;quot;, not just the &amp;quot;what&amp;quot;&lt;br /&gt;
* &#039;&#039;&#039;Functions&#039;&#039;&#039; are named with action verbs (driveForward, readSensor)&lt;br /&gt;
&lt;br /&gt;
This makes pseudocode easy to translate to any real programming language.&lt;br /&gt;
&lt;br /&gt;
== Contributing New Behaviors ==&lt;br /&gt;
&lt;br /&gt;
Want to add a new behavior?&lt;br /&gt;
&lt;br /&gt;
Consider:&lt;br /&gt;
# &#039;&#039;&#039;Is it distinct?&#039;&#039;&#039; - Different from existing behaviors?&lt;br /&gt;
# &#039;&#039;&#039;Is it reusable?&#039;&#039;&#039; - Can it enable multiple activities?&lt;br /&gt;
# &#039;&#039;&#039;Is it well-understood?&#039;&#039;&#039; - Can you explain the algorithm clearly?&lt;br /&gt;
# &#039;&#039;&#039;Can you provide variants?&#039;&#039;&#039; - Simple and advanced approaches?&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
# Create a Behavior page using [[Template:Behavior]]&lt;br /&gt;
# Describe the algorithm in plain language&lt;br /&gt;
# Provide clear pseudocode&lt;br /&gt;
# Explain tuning parameters and trade-offs&lt;br /&gt;
# Show which capabilities it requires&lt;br /&gt;
# List activities it enables&lt;br /&gt;
# Implement it on your robot&lt;br /&gt;
# Create implementation documentation with real code&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Robotics Ontology]] - How Behaviors fit into the BRS knowledge structure&lt;br /&gt;
* [[Activities]] - What behaviors enable robots to accomplish&lt;br /&gt;
* [[Capabilities]] - Hardware that behaviors require&lt;br /&gt;
* [[SimpleBot]] - BRS&#039;s first robot, demonstrating two behaviors&lt;br /&gt;
&lt;br /&gt;
[[Category:Behaviors]]&lt;br /&gt;
[[Category:Ontology]]&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
	<entry>
		<id>https://wiki.bespokerobotsociety.org/index.php?title=File:Simplebot.jpeg&amp;diff=45</id>
		<title>File:Simplebot.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.bespokerobotsociety.org/index.php?title=File:Simplebot.jpeg&amp;diff=45"/>
		<updated>2025-10-11T16:46:12Z</updated>

		<summary type="html">&lt;p&gt;John: An early prototype of Simplebot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
An early prototype of Simplebot.&lt;/div&gt;</summary>
		<author><name>John</name></author>
	</entry>
</feed>