<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MechBase — BrickLink Studio Guide & Project 1 Instructions</title>
<style>
  @page { size: letter; margin: 0.6in; }
  body { font-family: 'Segoe UI', Arial, sans-serif; line-height: 1.5; color: #1a1a1a; max-width: 700px; margin: 0 auto; }
  h1 { color: #2563eb; border-bottom: 3px solid #2563eb; padding-bottom: 8px; }
  h2 { color: #1d4ed8; margin-top: 20px; border-left: 4px solid #2563eb; padding-left: 10px; }
  h3 { color: #334155; }
  table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 11px; }
  th { background: #f1f5f9; font-weight: 600; text-align: left; padding: 7px; border-bottom: 2px solid #cbd5e1; }
  td { padding: 6px 7px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
  tr:nth-child(even) { background: #f8fafc; }
  .note { background: #eff6ff; border-left: 4px solid #3b82f6; padding: 10px; margin: 12px 0; font-size: 11px; }
  .step { background: #f0fdf4; border-left: 4px solid #16a34a; padding: 12px; margin: 10px 0; }
  .step-num { font-weight: bold; color: #16a34a; font-size: 13px; }
  .code { font-family: monospace; background: #f1f5f9; padding: 2px 5px; border-radius: 3px; font-size: 10px; }
  .footer { margin-top: 30px; font-size: 10px; color: #64748b; border-top: 1px solid #cbd5e1; padding-top: 8px; text-align: center; }
  .download-link { color: #2563eb; font-weight: bold; }
</style>
</head>
<body>

<h1>MechBase Starter Kit — Project 1: Rolling Chassis</h1>
<p><strong>Age:</strong> 7+ | <strong>Concept:</strong> Basic circuit, motor control, cause &amp; effect</p>

<div class="note">
  <strong>Before you build:</strong> Download <a href="https://www.bricklink.com/v3/studio/download.page" class="download-link">BrickLink Studio</a> (free, Windows/Mac). Build the chassis virtually, then print professional step-by-step instructions with photos. Studio uses the LDraw part database — every LEGO-compatible part is available.
</div>

<h2>BrickLink Studio — Quick Start</h2>
<ul>
  <li><strong>Download:</strong> <a href="https://www.bricklink.com/v3/studio/download.page">bricklink.com/v3/studio/download.page</a> (free)</li>
  <li><strong>Platform:</strong> Windows 10+ or macOS 12+</li>
  <li><strong>Part library:</strong> 100% of LEGO parts + compatible alternatives</li>
  <li><strong>Instructions:</strong> Build → File → Create Instructions → Auto-generates step-by-step with photos</li>
  <li><strong>Export:</strong> PDF, PNG, or interactive HTML</li>
</ul>

<div class="note">
  <strong>Workflow:</strong> Build the chassis in Studio using the parts list below → Generate instructions → Print for the kid. The software handles part positioning, collision detection, and photo rendering. Way better than hand-coding SVGs.
</div>

<h2>📋 Verified Parts List</h2>
<p><em>Part numbers verified on BrickLink. Search these exact numbers.</em></p>

<table>
<tr><th>Part #</th><th>Qty</th><th>Name</th><th>Use</th></tr>
<tr><td><span class="code">3811</span></td><td>1</td><td>Baseplate 32 × 32</td><td>Chassis foundation</td></tr>
<tr><td><span class="code">3701</span></td><td>4</td><td>Technic Brick 1 × 4 with Holes</td><td>Axle mounts, beam structure</td></tr>
<tr><td><span class="code">3894</span></td><td>4</td><td>Technic Brick 1 × 6 with Holes</td><td>Longer structural beams</td></tr>
<tr><td><span class="code">3895</span></td><td>4</td><td>Technic Brick 1 × 8 with Holes</td><td>Frame rails</td></tr>
<tr><td><span class="code">3896</span></td><td>4</td><td>Technic Brick 1 × 10 with Holes</td><td>Main frame rails</td></tr>
<tr><td><span class="code">3704</span></td><td>4</td><td>Technic Axle 2L</td><td>Short connectors</td></tr>
<tr><td><span class="code">3705</span></td><td>6</td><td>Technic Axle 4L</td><td>Wheel axles</td></tr>
<tr><td><span class="code">44294</span></td><td>2</td><td>Technic Axle 7L</td><td>Long spans</td></tr>
<tr><td><span class="code">3737</span></td><td>2</td><td>Technic Axle 10L</td><td>Drive axles</td></tr>
<tr><td><span class="code">44260</span></td><td>10</td><td>Technic Bushing ½"</td><td>Wheel mounts, friction rings</td></tr>
<tr><td><span class="code">4256</span></td><td>2</td><td>Technic Gear 12 Tooth</td><td>Motor reduction</td></tr>
<tr><td><span class="code">4257</span></td><td>2</td><td>Technic Gear 20 Tooth</td><td>Speed reduction</td></tr>
<tr><td><span class="code">4258</span></td><td>2</td><td>Technic Gear 40 Tooth</td><td>Output gearing</td></tr>
<tr><td><span class="code">32202</span></td><td>2</td><td>Technic Bevel Gear 12 Tooth</td><td>Direction changes</td></tr>
<tr><td><span class="code">6259</span></td><td>4</td><td>Technic Wheel 1.25"</td><td>Drive wheels</td></tr>
<tr><td><span class="code">6258</span></td><td>4</td><td>Technic Rim 1.25"</td><td>Wheel hubs</td></tr>
<tr><td><span class="code">99233</span></td><td>8</td><td>Technic Pin 1L with Friction</td><td>Beam connectors</td></tr>
<tr><td><span class="code">32062</span></td><td>6</td><td>Technic Axle 2L Notched</td><td>Secured axle connections</td></tr>
</table>

<h2>🔌 Electronics (Same as Before)</h2>
<table>
<tr><th>Item</th><th>Qty</th><th>Notes</th></tr>
<tr><td>Raspberry Pi 4 8GB</td><td>1</td><td>Already owned</td></tr>
<tr><td>Adafruit Dual Motor Driver HAT</td><td>1</td><td>I2C, powers 2 DC motors + servos</td></tr>
<tr><td>TT Gear Motor (90 RPM, 6V)</td><td>2</td><td>High torque</td></tr>
<tr><td>SG90 Micro Servo</td><td>1</td><td>Future projects</td></tr>
<tr><td>HC-SR04 Ultrasonic</td><td>1</td><td>Distance sensing</td></tr>
<tr><td>TCRT5000 IR Sensor</td><td>2</td><td>Line tracking</td></tr>
<tr><td>Limit Switch (Micro)</td><td>2</td><td>Position sensing</td></tr>
<tr><td>LiPo 7.4V 2200mAh (2S)</td><td>1</td><td>Motor power</td></tr>
<tr><td>2S LiPo Charger (1A)</td><td>1</td><td>Safe charging</td></tr>
<tr><td>Breadboard + Jumper Kit</td><td>1</td><td>Prototyping</td></tr>
</table>

<h2>🛠️ Step-by-Step Build Instructions</h2>

<div class="step">
  <span class="step-num">Step 1 — Frame Rails</span><br>
  Attach four <strong>Technic Brick 1×10 with Holes (3896)</strong> to the baseplate in a rectangular frame:
  <ul>
    <li>Two along the long edges (rows 4 and 29)</li>
    <li>Two along the short edges (columns 6 and 27)</li>
  </ul>
  This creates your chassis perimeter. The holes in the beams accept axles and pins.
</div>

<div class="step">
  <span class="step-num">Step 2 — Axle Supports</span><br>
  Attach <strong>Technic Brick 1×4 with Holes (3701)</strong> perpendicular to the frame at each corner (rows 8 and 25, columns 10 and 23).
  <br>These create the axle mount points. The beams slot into the frame holes using <strong>Technic Pins with Friction (99233)</strong>.
</div>

<div class="step">
  <span class="step-num">Step 3 — Install Axles</span><br>
  Slide <strong>Technic Axle 10L (3737)</strong> through each pair of axle support beams (left side and right side).
  <ul>
    <li>Axle goes through: Beam hole → Axle 10L → Beam hole</li>
    <li>Secure with <strong>Axle 2L Notched (32062)</strong> on each end to prevent wobble</li>
  </ul>
</div>

<div class="step">
  <span class="step-num">Step 4 — Wheels</span><br>
  On each axle end: <strong>Bushing ½" (44260)</strong> → <strong>Rim 1.25" (6258)</strong> → <strong>Wheel 1.25" (6259)</strong>
  <br>The bushing provides friction so the wheel stays on the axle during operation.
</div>

<div class="step">
  <span class="step-num">Step 5 — Motor Mounts</span><br>
  Mount each <strong>TT Gear Motor</strong> to the rear axle area using:
  <ul>
    <li>Beam 1×6 with Holes (3894) as motor bracket</li>
    <li>Motor shaft aligns with <strong>Gear 12 Tooth (4256)</strong></li>
    <li>12T gear meshes with <strong>Gear 40 Tooth (4258)</strong> on the drive axle</li>
  </ul>
  This gives ~3:1 speed reduction — slower but more torque for the chassis.
</div>

<div class="step">
  <span class="step-num">Step 6 — Electronics</span><br>
  <ul>
    <li>Mount Pi 4 on top of the chassis (use rubber feet or Technic brackets)</li>
    <li>Plug Adafruit HAT directly onto Pi GPIO pins</li>
    <li>Connect Motor 1 → HAT M1, Motor 2 → HAT M2</li>
    <li>Connect LiPo to HAT VIN/GND terminals</li>
  </ul>
</div>

<h2>💻 Code (Copy to Pi)</h2>

<div class="note">
  See the separate software document for the full Python code. This is the basic drive logic:
  <pre style="background:#f1f5f9;padding:10px;border-radius:5px;font-size:10px;">
# Forward
motor_left.throttle = 0.5
motor_right.throttle = 0.5

# Reverse
motor_left.throttle = -0.5
motor_right.throttle = -0.5

# Turn left
motor_left.throttle = -0.3
motor_right.throttle = 0.5
  </pre>
</div>

<h2>🎮 Project 1 Challenges</h2>
<table>
<tr><th>#</th><th>Challenge</th><th>Concept</th></tr>
<tr><td>1</td><td>Drive forward 1 meter, then stop</td><td>Motor control, timing</td></tr>
<tr><td>2</td><td>Drive forward, reverse, turn — make a square</td><td>Sequencing logic</td></tr>
<tr><td>3</td><td>Use limit switch to stop at a wall</td><td>Sensor feedback</td></tr>
<tr><td>4</td><td>Obstacle avoidance (ultrasonic)</td><td>IF/THEN logic</td></tr>
</table>

<div class="footer">
  MechBase Starter Kit v1.0 | Build in BrickLink Studio for professional instructions
</div>

</body>
</html>