BRS Differential Drive Robot Control Board

From Bespoke Robot Society
Revision as of 16:21, 11 October 2025 by John (talk | contribs) (Claude edited based on my notes, prompt, and SimpleBot code repository)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
BRS Differential Drive Robot Control Board
File:PCB schematic.png
Purpose Integrated motor control and sensor interface for differential drive robots
Type Through-Hole (THT) / Surface-Mount (SMT variant planned)
Microcontroller Raspberry Pi Pico or compatible 40-pin boards
Key Components Template:TB6612FNG, Template:MP1584, Template:LM393, nRF24L01 header, MPU6050 header, sensor expansion
PCB Layers 2-layer PCB
Est. Cost $5-10 for 5 PCBs (JLCPCB) + ~$10-15 components
Gerber Files GitHub Repository
Repository GitHub - SimpleBot

The BRS Differential Drive Robot Control Board 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.

Overview

This PCB was designed with BRS's core mission in mind: lower the barrier to entry for robotics. The through-hole version uses only THT (through-hole technology) components, making it ideal for:

  • Educational environments (schools, workshops)
  • Beginners learning to solder
  • Rapid prototyping without specialized equipment
  • Easy component replacement and repair

A surface-mount variant is planned for more compact builds and higher-volume production.

Key Features

Integrated Components

  • Raspberry Pi Pico Socket - 40-pin header for any Pico-compatible board
  • Motor Driver - TB6612FNG module socket or external H-bridge header
  • Power Regulation - MP1584 buck converter (6V → 3.3V)
  • Optical Encoders - LM393-based comparator circuit for wheel encoders
  • Expansion Headers:
    • nRF24L01 2.4 GHz radio (SPI)
    • MPU6050 IMU (I²C)
    • 4× sensor headers (3.3V + GND + GPIO)
    • Analog expansion (3× ADC pins)
    • Digital expansion (GPIOs)

Design Philosophy

  • Through-Hole First - Easy to solder for beginners
  • Modular - Use standard breakout modules where possible
  • Expandable - Room for additional sensors and features
  • Repairable - Socketed components can be replaced
  • Open Source - Full schematics and KiCad files available

Schematic

The PCB is organized into functional sections:

Power Section

File:PCB power.png
Power regulation section

The power section converts 6V from 4× AA batteries to regulated 3.3V:

  • Input: 4.5V – 6.5V from battery pack (via power switch)
  • Buck Converter: MP1584 module provides 3.3V at up to 3A
  • Important: Buck converter must be pre-tuned to 3.3V BEFORE soldering to PCB

The power switch should be wired to disconnect batteries when USB is connected, preventing back-feeding.

Microcontroller Section

40-pin socket for Raspberry Pi Pico or compatible boards:

  • Raspberry Pi Pico (official or clone)
  • Raspberry Pi Pico W (adds Wi-Fi)
  • Raspberry Pi Pico 2 / 2W (RP2350-based)

The socket allows easy replacement if the Pico is damaged, and permits swapping between different Pico variants.

Motor Control Section

File:PCB motor.png
Motor driver section

Two options for motor control:

Option 1: TB6612FNG Module (Standard)

  • Solder TB6612FNG breakout module directly to PCB
  • Controls two TT motors independently
  • PWM speed control via Pico GPIOs
  • Direction control via logic pins

Option 2: External H-Bridge (Advanced)

  • Install 2×5 DuPont header underneath TB6612FNG footprint
  • Provides PWM, direction, and logic signals to external H-bridge
  • Allows use of higher-power motor drivers
  • Same Python code works - control signals are identical

This flexibility allows SimpleBot to be upgraded to more powerful motors without redesigning electronics or software.

Optical Encoder Section

File:PCB Optoencoder.png
Optical encoder circuit

The odometry section uses LM393 dual comparator to convert analog encoder signals to digital pulses:

  • Per Channel:
    • 1× IR LED (emitter)
    • 1× Photoresistor (detector)
    • Voltage divider resistors
    • Comparator output to Pico GPIO
  • Function:
  1. LED shines through slotted encoder wheel
  2. Photoresistor detects light/dark transitions
  3. LM393 converts analog voltage to clean digital pulses
  4. Pico counts pulses using interrupts
  5. Software calculates distance traveled

This provides optical odometry for dead reckoning and position tracking.

Expansion Headers

nRF24L01 Radio (SPI)

  • 2.4 GHz wireless communication
  • SPI interface (SCK, MOSI, MISO, CS)
  • Range: 10-100m depending on antenna and environment
  • Use cases: Remote control, swarm robotics, telemetry

MPU6050 IMU (I²C)

  • 3-axis accelerometer + 3-axis gyroscope
  • I²C interface (SDA, SCL)
  • Heading estimation, tilt detection, dynamic balancing

Sensor Headers (4×)

Each header provides:

  • 3.3V power
  • Ground
  • GPIO pin from Pico

Use for:

  • Additional line sensors
  • Ultrasonic distance sensors
  • Bump switches
  • Custom sensors

Analog/Digital Expansion

  • Analog Header: 3× ADC pins for custom analog sensors
  • Digital Header: Multiple GPIO pins for digital I/O

PCB Layout

Top View

File:PCB front.png
PCB top side (component placement)

The top side contains:

  • All component footprints
  • Module sockets (Pico, TB6612FNG, MP1584)
  • Expansion headers
  • Power and motor terminals

Bottom View

File:PCB back.png
PCB bottom side (traces and ground plane)

The bottom side contains:

  • Signal traces
  • Ground plane (for noise reduction and current return)
  • Minimal components (optional pull-up resistors)

All Layers

File:PCB all layers.png
Complete PCB stack-up

The 2-layer design uses:

  • Top Layer: Signal routing and power traces
  • Bottom Layer: Ground plane + additional signal routing

Bill of Materials

Component Description Qty Notes
Modules
Raspberry Pi Pico Microcontroller board 1 Or Pico W for Wi-Fi
TB6612FNG Module Dual H-bridge motor driver 1 Or external H-bridge
MP1584 Module Buck converter 1 Pre-tune to 3.3V!
ICs
LM393 Dual comparator IC 1 DIP-8 package
Passive Components
Resistors Various values for encoders and pull-ups ~10 See schematic
IR LEDs Encoder emitters (940nm) 2 Through-hole
Photoresistors Encoder detectors 2 Through-hole
Connectors
40-pin header Pico socket 2 Female, 2×20
Motor terminals Screw terminals or header 2 2-pin each
Power terminals Battery input 1 2-pin screw terminal
Sensor headers Expansion connections 4 3-pin male header
Optional
nRF24L01 header Radio module socket 1 2×4 female header
MPU6050 header IMU socket 1 2×4 female header
DuPont header External H-bridge 1 2×5 male header

Full BOM with part numbers and suppliers available in the GitHub repository.

Assembly Guide

Assembly Order

  1. Pre-tune buck converter to 3.3V (CRITICAL!)
  2. Install low-profile components (resistors, ICs)
  3. Install sockets and headers
  4. Install modules (buck converter, TB6612FNG)
  5. Test voltage output before connecting Pico
  6. Insert Pico into socket
  7. Connect motors and sensors
  8. Upload code and test!

Full step-by-step assembly instructions: SimpleBot PCB Guide or GitHub version

Critical Steps

1. Buck Converter Adjustment

DO THIS FIRST:

  1. Connect multimeter to buck converter output
  2. Apply power to buck converter input
  3. Adjust potentiometer to exactly 3.3V
  4. Verify voltage is stable
  5. ONLY THEN solder to PCB

Failure to do this can damage your Pico!

2. Test Before Connecting Pico

After soldering the buck converter:

  1. Apply battery power (do NOT connect Pico yet)
  2. Verify 3.3V on all power rails
  3. Check for shorts with multimeter
  4. Only after confirming correct voltage, insert Pico

Manufacturing Files

Gerber Files

Ready-to-manufacture Gerber files available:

  • Through-Hole Version - Beginner-friendly THT components
  • SMT version (coming soon) - Compact surface-mount design

PCB Specifications

  • Dimensions: ~90mm × 70mm (approximate)
  • Layers: 2-layer PCB
  • Thickness: 1.6mm (standard)
  • Material: FR-4
  • Surface Finish: HASL or ENIG
  • Min Trace/Space: 0.3mm / 0.3mm
  • Min Drill: 0.8mm

Ordering

Upload the Gerber ZIP file to any PCB manufacturer:

  • JLCPCB - ~$2 for 5 PCBs + shipping
  • PCBWay - ~$5 for 5 PCBs + shipping
  • OSH Park - ~$20 for 3 PCBs (US-based, high quality)
  • Seeed Studio - ~$5 for 5 PCBs + shipping

Manufacturing typically takes 2-5 days + shipping time.

Design Files

The PCB was designed in KiCad (open-source EDA software):

  • Schematic: Full circuit diagram in KiCad format
  • PCB Layout: Complete board design with traces and copper pours
  • Gerber Files: Manufacturing-ready outputs
  • Bill of Materials: Component list with part numbers

All files available in the GitHub repository under open-source license.

Usage in Projects

SimpleBot

This PCB was designed specifically for SimpleBot, but the design is generic enough for any differential drive robot with:

  • Two DC motors
  • Wheel encoders
  • Line sensors or similar digital/analog sensors
  • Battery power (4.5V – 6.5V input)

Other Robots

The modular design makes this PCB suitable for:

  • Line-following robots
  • Maze-solving robots
  • Dead-reckoning navigation platforms
  • Educational robotics projects
  • Small autonomous vehicles

Variations

External H-Bridge Variant

Install the 2×5 DuPont header instead of TB6612FNG module to use external motor drivers:

  • L298N - Lower efficiency but higher current
  • BTS7960 - Much higher current (43A!) for large motors
  • Cytron MD30C - High power with heat sink

Same Pico code works with all drivers - only change is physical wiring.

Custom Sensor Configurations

Use the sensor headers for:

  • Additional line sensors (6-8 sensor arrays)
  • Ultrasonic sensors (HC-SR04)
  • IR distance sensors (Sharp GP2Y0A)
  • Bump switches
  • Servo motor control

Future Variants

  • SMT Version - All surface-mount components for compact design
  • High-Power Version - Integrated high-current motor driver
  • All-in-One Version - Integrated sensors (no external modules)

See Also

Resources