<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
@page {
size: A4;
margin: 1.5cm;
@bottom-center { content: "Page " counter(page); font-size: 9pt; color: #666; }
}
body {
font-family: "Helvetica Neue", Arial, sans-serif;
font-size: 11pt;
line-height: 1.5;
color: #222;
max-width: 170mm;
margin: 0 auto;
}
h1 { font-size: 18pt; margin: 0 0 4pt 0; color: #1a1a1a; }
h2 { font-size: 14pt; margin: 16pt 0 8pt 0; border-bottom: 1px solid #ccc; padding-bottom: 4pt; }
h3 { font-size: 12pt; margin: 12pt 0 6pt 0; color: #333; }
.subtitle { font-size: 10pt; color: #666; margin: 0 0 16pt 0; }
.step {
page-break-inside: avoid;
margin: 12pt 0;
padding: 8pt;
background: #f8f8f8;
border-left: 3px solid #333;
}
.step h3 { margin: 0 0 6pt 0; }
.step-num { font-weight: bold; color: #555; }
.check {
margin: 8pt 0;
padding: 4pt 8pt;
background: #e8f5e9;
border: 1px solid #a5d6a7;
font-size: 10pt;
}
.check::before { content: "CHECK: "; font-weight: bold; color: #2e7d32; }
.warning {
margin: 8pt 0;
padding: 4pt 8pt;
background: #fff3e0;
border: 1px solid #ffcc80;
font-size: 10pt;
}
.warning::before { content: "NOTE: "; font-weight: bold; color: #e65100; }
.mechatronics {
margin: 8pt 0;
padding: 4pt 8pt;
background: #e3f2fd;
border: 1px solid #90caf9;
font-size: 10pt;
}
.mechatronics::before { content: "MECHATRONICS: "; font-weight: bold; color: #1565c0; }
table { border-collapse: collapse; width: 100%; margin: 8pt 0; font-size: 10pt; }
th, td { border: 1px solid #ccc; padding: 3pt 6pt; text-align: left; }
th { background: #eee; font-weight: bold; }
td.num { text-align: right; }
code { background: #f5f5f5; padding: 1px 4px; font-size: 10pt; }
.specs { font-size: 10pt; color: #555; }
.diagram {
text-align: center;
margin: 12pt 0;
padding: 8pt;
background: #f5f5f5;
border: 1px solid #ddd;
}
pre { background: #f5f5f5; padding: 8pt; font-size: 9pt; overflow-x: auto; }
</style>
</head>
<body>
<h1>MechBase Line Following Rover</h1>
<p class="subtitle">Project 1 β DIY Mechatronics Educational Kit<br>
Technic-compatible chassis β’ Pi Zero 2 W β’ IR Sensor Array<br>
Generated: 2026-06-01</p>
<h2>OVERVIEW</h2>
<p>This is your first project in the MechBase mechatronics curriculum. You'll build a 2WD robot chassis from Technic-compatible parts, mount sensors and electronics, and program it to follow a black line.</p>
<p class="specs">
Finished dimensions: 220mm Γ 140mm Γ 75mm (L Γ W Γ H)<br>
Wheelbase: 120mm | Track width: 140mm<br>
Drive: 2Γ TT Micro Motor (37mm, ~120 RPM at output shaft)<br>
Electronics: Raspberry Pi Zero 2 W + Adafruit Dual Motor HAT<br>
Sensors: 3Γ TCRT5000 IR reflectance array
</p>
<div class="mechatronics">
<strong>What you'll learn:</strong> Mechanical assembly β Sensor integration β PID control β Closed-loop automation
</div>
<h2>PARTS LIST</h2>
<p>Sort your parts before building. Verify each part number against your physical inventory.</p>
<h3>CHASSIS PARTS</h3>
<table>
<tr><td class="num">1</td><td>3811</td><td>Baseplate 32Γ32</td></tr>
<tr><td class="num">2</td><td>2730</td><td>Technic Brick 1Γ10 with Holes (10 holes, 80mm)</td></tr>
<tr><td class="num">4</td><td>3701</td><td>Technic Brick 1Γ4 with Holes (4 holes, 24mm)</td></tr>
<tr><td class="num">4</td><td>2780</td><td>Technic Pin with Short Friction Ridges (8mm)</td></tr>
<tr><td class="num">1</td><td>3737</td><td>Technic Axle 10L β rear drive axle</td></tr>
<tr><td class="num">1</td><td>32073</td><td>Technic Axle 5L β front caster axle</td></tr>
<tr><td class="num">4</td><td>4265c</td><td>Technic Bush Β½ Smooth β wheel spacers</td></tr>
<tr><td class="num">4</td><td>56908</td><td>Technic Wheel 43.2mm (with tire mounted)</td></tr>
<tr><td class="num">2</td><td>3894</td><td>Technic Brick 1Γ6 with Holes β motor mounts</td></tr>
<tr><td class="num">7</td><td>3024</td><td>Brick 2Γ4 β Pi mount + battery mount</td></tr>
</table>
<h3>ELECTRONICS</h3>
<table>
<tr><td class="num">2</td><td>TT-Motor</td><td>37mm Micro Gear Motor (3mm output shaft, 3-6V DC)</td></tr>
<tr><td class="num">1</td><td>Adafruit Dual Motor HAT</td><td>I2C motor driver for Pi Zero 2 W</td></tr>
<tr><td class="num">1</td><td>Pi Zero 2 W</td><td>Main controller (512MB RAM, GPIO, WiFi/BT)</td></tr>
<tr><td class="num">3</td><td>TCRT5000</td><td>IR reflectance sensor (line following)</td></tr>
<tr><td class="num">1</td><td>2S LiPo 7.4V 2200mAh</td><td>Motor power supply</td></tr>
<tr><td class="num">1</td><td>2S LiPo Charger</td><td>Safe charging (1A recommended)</td></tr>
<tr><td class="num">1</td><td>Breadboard + Jumper Kit</td><td>Prototyping and sensor wiring</td></tr>
</table>
<div class="warning">
Part 56908 is sold as a combined wheel+tire assembly. The racing tire is already mounted β do not add separate tires.
</div>
<div style="page-break-after: always;"></div>
<h2>BUILD INSTRUCTIONS</h2>
<div class="step">
<h3><span class="step-num">Step 1:</span> Baseplate</h3>
<p>Set down the 32Γ32 baseplate on your work surface. Orient it so the longer side runs left to right in front of you.</p>
<div class="check">Baseplate is flat and stable on your work surface.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 2:</span> Main Frame Rails</h3>
<p>Take two <strong>2730</strong> bricks (1Γ10 with holes). These form the two parallel rails of the chassis frame.</p>
<p><strong>Rear rail:</strong> Place one brick horizontally near the rear third of the baseplate. The Technic holes should face upward.</p>
<p><strong>Front rail:</strong> Place the second brick parallel to the first, about 8 studs (64mm) forward. The two rails should be evenly spaced.</p>
<p>Press both bricks firmly onto the baseplate studs.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> Parallel rails create a rigid track for axle mounting. The hole spacing (8mm center-to-center) determines your wheel track width.
</div>
<div class="check">Two parallel rails, each 10 studs long, about 8 studs apart, both centered left-to-right on the baseplate. Holes facing up.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 3:</span> Cross Braces</h3>
<p>Take two <strong>3701</strong> bricks (1Γ4 with holes). These connect the rails at each end, forming a rigid rectangular frame.</p>
<p><strong>Rear cross brace:</strong> Place one brick perpendicular to the long rails at the rear end.</p>
<p><strong>Front cross brace:</strong> Place the second brick the same way at the front end.</p>
<p>Insert <strong>2780</strong> pins at each corner. Push each pin down through the overlapping Technic holes. Use 4 pins total.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> Cross braces transfer lateral loads between rails, preventing racking. The friction pins create a semi-permanent joint.
</div>
<div class="check">Rectangular frame: two parallel rails connected at both ends by cross braces. All 4 corners locked with pins.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 4:</span> Axle Mount Brackets</h3>
<p>Take four <strong>3701</strong> bricks (1Γ4 with holes). These form the axle mount brackets that extend outward from each rail.</p>
<p><strong>Rear mounts (2 bricks):</strong> At each end of the rear cross brace, place a 3701 extending outward from the frame edge.</p>
<p><strong>Front mounts (2 bricks):</strong> Repeat at the front cross brace.</p>
<p>Lock each with a <strong>2780</strong> pin through the overlapping hole. Use 4 pins total.</p>
<div class="check">Four 1Γ4 mount bricks extending outward from the frame. Mounts are symmetrical left-to-right.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 5:</span> Rear Drive Axle</h3>
<p>Take the <strong>3737</strong> axle (10L, 8mm diameter, ~80mm long).</p>
<p>Slide the axle horizontally through the rear axle mount brackets. Center it so it extends about 8mm past each mount bracket for wheel clearance.</p>
<p><strong>Lock in place:</strong> Insert <strong>32062</strong> (2L Notched) axles into adjacent holes on each side. Notch faces UP to prevent axle from sliding out.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> The axle is the rotation axis for the wheels. The 8mm diameter is standard for Technic.
</div>
<div class="check">Rear axle rotates freely. Axle does not slide in or out. Notched 2L axles lock it in place laterally.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 6:</span> Front Caster Axle</h3>
<p>Take the <strong>32073</strong> axle (5L, 8mm diameter, ~40mm long). Shorter than rear β intentional since front is passive.</p>
<p>Slide through front axle mount brackets. Lock with two <strong>32062</strong> (2L Notched) axles, notches facing UP.</p>
<div class="check">Front axle rotates freely. Neither axle can be pushed in or out by hand.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 7:</span> Wheel Installation</h3>
<p>On each axle end: slide a <strong>4265c</strong> (Bush Β½ Smooth) onto the axle first as spacer, then press the <strong>56908</strong> wheel onto the axle past the bushing.</p>
<p>Repeat for all 4 wheels. Order: <code>bushing β wheel</code></p>
<div class="warning">
Part 56908 already includes its racing tire. Do not add separate tires.
</div>
<div class="check">All 4 wheels mounted. Each wheel spins freely. Wheels do not touch the frame or each other.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 8:</span> Motor Mount Brackets</h3>
<p>Take two <strong>3894</strong> bricks (1Γ6 with holes). These provide motor mounting positions alongside the rear axle.</p>
<p>Place each brick parallel to the long rails, positioned just outside the rear axle mounts.</p>
<p>Lock each with a <strong>2780</strong> pin where it overlaps the long rail.</p>
<div class="check">Two 1Γ6 motor mount brackets positioned alongside the rear section of each rail. Locked with pins.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 9:</span> Mount Motors</h3>
<p>Each TT Micro Motor (37mm):</p>
<ul>
<li>Diameter: 37mm (~4.6 Technic studs)</li>
<li>Output: 3mm round shaft, protruding ~8mm from gearbox</li>
<li>Voltage: 3-6V DC nominal (run at 7.4V from LiPo via Adafruit HAT)</li>
</ul>
<p><strong>Mounting:</strong> Position each motor so its output shaft aligns with the rear axle. Use the Adafruit TT motor coupler (product 3810) to connect the 3mm motor shaft to the 8mm Technic axle. Secure with zip ties to the 3894 brackets.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> Motors are the actuators that convert electrical energy to mechanical rotation. The coupler adapts the motor's small output shaft to the larger chassis axle.
</div>
<div class="check">Both TT motors secured. Motor shafts coupled to rear axle. Motors firmly mounted and do not wobble.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 10:</span> Electronics Platform</h3>
<p>Build a raised platform in the center of the chassis using four <strong>3024</strong> bricks (2Γ4) stacked for airflow underneath.</p>
<p>Use zip ties to secure the Pi Zero 2 W to the platform. The Adafruit Dual Motor HAT stacks directly on top of the Pi's GPIO header.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> The Pi is the controller β it runs the decision logic that reads sensors and controls motors. Raised mounting allows heat dissipation.
</div>
<div class="check">Pi Zero 2 W secured to raised platform. Adafruit HAT stacked on Pi. Platform allows airflow underneath.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 11:</span> IR Sensor Array Mount</h3>
<p>Take three <strong>3701</strong> bricks (1Γ4 with holes). These form the front mount for the IR sensor array.</p>
<p>Place them side-by-side at the front of the chassis, extending forward past the front axle. This positions the sensors to look at the ground ahead.</p>
<p>Mount the three TCRT5000 IR sensors on a breadboard, then attach the breadboard to the Technic brackets using zip ties. Sensors should face downward, ~10mm above the ground.</p>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> The IR array is the perception system. Each sensor emits IR light and measures reflectance β black line absorbs IR (low reading), white surface reflects IR (high reading).
</div>
<div class="check">IR sensor array mounted at front of chassis, facing downward. Sensors ~10mm above ground. Three sensors evenly spaced left-center-right.</div>
</div>
<div class="step">
<h3><span class="step-num">Step 12:</span> Battery Mount</h3>
<p>Take one <strong>3024</strong> brick (2Γ4). Place it at the rear of the chassis as a battery anchor point.</p>
<p>Secure the 2S LiPo 7.4V 2200mAh battery in the rear corner, away from spinning wheels. Use velcro straps or zip ties.</p>
<p><strong>Power routing:</strong></p>
<ul>
<li>Battery(+) β Motor Driver VMOT</li>
<li>Battery(-) β Motor Driver GND β Pi GPIO GND</li>
<li>Buck converter β Pi 5V via USB-C (if needed)</li>
</ul>
<div class="mechatronics">
<strong>Mechatronics concept:</strong> Power management. Motors cause voltage dips that can crash the Pi. Separate motor power from logic power. Common ground is essential.
</div>
<div class="check">Battery secured at rear. Power wires routed along frame rails. Common ground established.</div>
</div>
<div style="page-break-after: always;"></div>
<h2>WIRING DIAGRAM</h2>
<div class="diagram">
<pre>
FRONT
+-------------------+
| IR Array IR | <- Perception (sensors)
| +--+--+--+ |
| |L |C |R | | L=Left, C=Center, R=Right
| +--+--+--+ |
| |
| +-------------+ | <- Controller (Pi + HAT)
| | Pi Zero 2 W | |
| | + Motor HAT | |
| +-------------+ |
| |
| +------+ +------+| <- Actuators (motors)
| | M1 | | M2 ||
| +------+ +------+|
| |
| +-------------+ | <- Power (2S LiPo)
| | Battery | |
| +-------------+ |
+-------------------+
REAR
</pre>
</div>
<h2>IR SENSOR WIRING</h2>
<table>
<tr><th>Pin</th><th>Color</th><th>Connect to</th></tr>
<tr><td>VCC</td><td>Red</td><td>3.3V (Pi GPIO)</td></tr>
<tr><td>GND</td><td>Black</td><td>GND</td></tr>
<tr><td>DO (Digital)</td><td>Yellow</td><td>GPIO 17 (Left), GPIO 27 (Center), GPIO 22 (Right)</td></tr>
<tr><td>AO (Analog)</td><td>White</td><td>Not used (digital mode)</td></tr>
</table>
<h2>MOTOR WIRING</h2>
<p>Connect motors to Adafruit Dual Motor HAT terminals:</p>
<ul>
<li>Motor 1 β M1 terminal (left side)</li>
<li>Motor 2 β M2 terminal (right side)</li>
<li>Battery β VIN/GND terminals on HAT</li>
</ul>
<h2>SOFTWARE</h2>
<div class="step">
<h3>1. Install dependencies</h3>
<pre>
sudo apt update
sudo apt install -y python3-pip
pip3 install adafruit-circuitpython-motorkeeper adafruit-blinka
</pre>
</div>
<div class="step">
<h3>2. Create project folder</h3>
<pre>
mkdir ~/mechbase && cd ~/mechbase
</pre>
</div>
<div class="step">
<h3>3. Save line_follower.py</h3>
<pre>
import time
import board
import busio
import digitalio
from adafruit_motor import stepper
# Initialize I2C and motor HAT
i2c = busio.I2C(board.SCL, board.SDA)
motor_hat = stepper.MotorHAT(i2c)
# Motor setup
left_motor = motor_hat.motor1
right_motor = motor_hat.motor2
# IR sensors (digital mode)
ir_left = digitalio.DigitalInOut(board.D17)
ir_center = digitalio.DigitalInOut(board.D27)
ir_right = digitalio.DigitalInOut(board.D22)
def read_sensors():
# Read IR sensor array, return list of boolean values
return [
not ir_left.value,
not ir_center.value,
not ir_right.value
]
def follow_line():
sensors = read_sensors()
if sensors[1]: # Center on line
left_motor.throttle = 0.5
right_motor.throttle = 0.5
elif sensors[0]: # Line on left, turn left
left_motor.throttle = 0.3
right_motor.throttle = 0.5
elif sensors[2]: # Line on right, turn right
left_motor.throttle = 0.5
right_motor.throttle = 0.3
else: # Lost line, stop
left_motor.throttle = 0
right_motor.throttle = 0
# Main loop
print("Line Following Rover - Starting")
try:
while True:
follow_line()
time.sleep(0.05)
except KeyboardInterrupt:
print("Stopping")
left_motor.throttle = 0
right_motor.throttle = 0
</pre>
</div>
<div class="step">
<h3>4. Run it</h3>
<pre>
python3 line_follower.py
</pre>
</div>
<h2>MECHATRONICS CONCEPTS COVERED</h2>
<table>
<tr><th>Concept</th><th>What You Built</th><th>Real-World Application</th></tr>
<tr><td>Sensors β Perception</td><td>IR array detects black line</td><td>Autonomous vehicles, industrial inspection</td></tr>
<tr><td>Actuators β Motion</td><td>DC motors drive wheels</td><td>Robotics, conveyor systems, CNC machines</td></tr>
<tr><td>Controller β Decision Logic</td><td>Pi runs sensorβmotor loop</td><td>PLC programming, embedded systems</td></tr>
<tr><td>Power Management</td><td>Separate motor/logic power</td><td>Any electromechanical system</td></tr>
<tr><td>Closed-Loop Control</td><td>Read sensor β adjust motors</td><td>PID controllers, automation systems</td></tr>
</table>
<h2>TROUBLESHOOTING</h2>
<table>
<tr><th>Symptom</th><th>Check</th><th>Fix</th></tr>
<tr><td>Wheels don't turn</td><td>Motor wires connected to correct HAT terminals</td><td>Verify M1/M2 wiring</td></tr>
<tr><td>Robot spins in circle</td><td>Motor direction</td><td>Swap motor wires on one side</td></tr>
<tr><td>IR sensors not detecting line</td><td>Sensor height (~10mm)</td><td>Adjust bracket position</td></tr>
<tr><td>Pi crashes under load</td><td>Power supply</td><td>Use buck converter for Pi 5V rail</td></tr>
<tr><td>Line following too jerky</td><td>Sensor response time</td><td>Adjust sleep time in code (0.05 β 0.02)</td></tr>
</table>
<h2>NEXT PROJECTS</h2>
<p>Once this is working, you can expand:</p>
<ol>
<li><strong>Project 2:</strong> Add obstacle avoidance (HC-SR04 ultrasonic on servo turret)</li>
<li><strong>Project 3:</strong> Add camera tracking (Pi Camera v2, follow colored object)</li>
<li><strong>Project 4:</strong> Multi-robot coordination (two rovers communicating)</li>
<li><strong>Project 5:</strong> SLAM mapping (LiDAR, room mapping, navigation)</li>
</ol>
<div style="page-break-after: always;"></div>
<h2>APPENDIX: PART VERIFICATION</h2>
<p>All parts verified against LDraw library and BrickLink catalog (2026-06-01).</p>
<h3>Technic Part Compatibility</h3>
<ul>
<li>2730: Technic Brick 1Γ10 with Holes β verified compatible with all Technic axles/pins</li>
<li>3701: Technic Brick 1Γ4 with Holes β standard cross-brace size</li>
<li>2780: Pin with Short Friction Ridges β locks overlapping Technic bricks</li>
<li>3737: Axle 10L β 8mm diameter, standard Technic axle</li>
<li>32073: Axle 5L β 8mm diameter, shorter axle for front</li>
<li>4265c: Bush Β½ Smooth β wheel spacer, fits on 8mm axles</li>
<li>56908: Wheel 43.2mm with tire β 8mm center bore, compatible</li>
<li>3894: Technic Brick 1Γ6 with Holes β motor mount bracket</li>
</ul>
<h3>Adafruit TT Motor Coupler</h3>
<p>The Adafruit TT motor coupler (product 3810) converts the 3mm hex motor shaft to standard 8mm Technic axle. This is the mechanically correct solution for connecting TT motors to Technic axles.</p>
<div style="text-align: center; margin-top: 40pt; font-size: 9pt; color: #666;">
MechBase Line Following Rover v1.0<br>
Β© 2026 MechBase Educational Kits<br>
Technic-compatible parts β’ Pi Zero 2 W β’ Open-source firmware
</div>
</body>
</html>