Robot with Raspberry Pi Setup Guide
β οΈ Audience: This guide is written for complete beginners. No prior experience with coding, electronics, or Raspberry Pi is required.
Introduction
Welcome to the official SMD Red Robot Guide using Raspberry Pi. This document will walk you through every single step required to:
Set up your computer environment
Assemble your robot and connect Raspberry Pi and SMD Red hardware
Program and test your robot using Python code and a web interface
By following this guide step by step, you'll successfully build a fully functional smart robot that can:
Drive using DC motors
Rotate pan/tilt servos
Detect objects using sensors
Be controlled via Wi-Fi through a mobile or web app
1. User PC Setup
Before configuring the robot itself, your computer must be ready to write, edit, and transfer code to the Raspberry Pi.
1.1 Install Python
Download the latest version compatible with your operating system.
During installation, make sure to enable βAdd Python to PATHβ.
After installation, verify Python works by opening a terminal/powershell and running:
Expected output: Python 3.x.x
1.2 Install acrome-smd Library
This library allows you to write Python programs that talk to the SMD Red hardware.
π‘ Run this on both your PC and Raspberry Pi later. This step ensures compatibility and development flexibility.
1.3 (Optional) Install Visual Studio Code
Recommended if you want a user-friendly interface for writing Python code.
1.4 Install Raspberry Pi Imager
This tool lets you install the operating system onto the Raspberry Piβs SD card.
We will use this in the next step to flash Raspberry Pi OS.
2. Robot Assembly + Raspberry Pi Setup
2.1 Required Hardware
Hereβs everything youβll need physically:
Raspberry Pi 3B+
MicroSD card (16GB or larger)
1β2x SMD Red Drivers
RJ11 cables: To daisy-chain SMD Red modules and connect Gateway
RJ45 cables: To connect modules (e.g., motors/servos) to SMD Red
12V power supply: Powers SMD Red and motor modules
5V USB-C: Powers the Raspberry Pi
Screws, jumper wires, zip ties: For physical mounting and wiring
2.2 Wiring Overview
USB-A from USB Gateway β Raspberry Pi USB port
RJ11 from USB Gateway β SMD Red 0 RJ11 IN
RJ11 SMD Red 0 β SMD Red 1 β SMD Red 2 (daisy-chained)
Power connection: Each SMD Red unit requires a separate power-to-power cable connection for power supply.
RJ45 from SMD Red to DC motor, servo, sensor modules
π§ RJ11 cables carry communication between controller boards (SMD Reds), and between the Gateway and first SMD Red. π§ RJ45 cables carry signals and power to individual hardware modules.
2.3 Flash the OS and Configure Raspberry Pi
Launch Raspberry Pi Imager
Select: Raspberry Pi OS (Lite β 64-bit)
Click the gear icon for Advanced Options:
Enable SSH (use password authentication)
Set Username:
pi
, Password:raspberry
Enter your Wi-Fi name and password
Set Hostname:
smd-robot
Choose SD card and click Write
Safely eject and insert into your Raspberry Pi
2.4 Access Raspberry Pi Terminal
To configure and program your Raspberry Pi, you need terminal access.
π’ Option 1: Headless (Preferred)
No monitor/keyboard required. Access via Wi-Fi.
Steps:
Power on Raspberry Pi
From your computer:
If that fails, get your Piβs IP address from your router and run:
π΅ Option 2: HDMI + Keyboard
Plug a monitor and keyboard directly to the Pi.
Steps:
Power on
Login with:
Username:
pi
Password:
raspberry
Open terminal and run:
Use this menu to configure Wi-Fi and hostname manually if needed.
3. Programming and Code Upload
Once your Pi is online and you have terminal access, you can upload your robot code.
3.1 Update Raspberry Pi and Install Tools
Run these commands:
These install Python tools and network support, required for running and debugging the robot, or enabling offline hotspot.
3.2 Install SMD Red Python Library on Raspberry Pi
Needed to communicate with the SMD Red hardware using Python.
3.3 Send Your Python Code from PC to Pi
Use the following command on your computer:
This sends your project files securely to the Pi.
3.4 Install Required Python Libraries
On Raspberry Pi:
This includes Flask (for web server), pyserial (for USB communication), and others.
3.5 Set Up Autostart (Optional But Recommended)
If you want your robot to launch automatically on boot:
Create a systemd service file:
Paste the following:
Activate the service:
Now your robot program will automatically start every time your Raspberry Pi is turned on!
4. Run and Test Your Robot
4.1 Manual Test
Run your Python script:
Expected output:
If you see this, your Pi has found the USB Gateway and is running the robot web server.
4.2 Open Web Control Interface
On your phone or computer browser (same Wi-Fi):
You should see:
π’ Buttons to move the robot forward/backward/turn
π Sliders to control pan/tilt servos
π Sensor readout (ultrasonic distance)
π Linear motor control (if connected)
USB Gateway not found
Faulty cable or power
Try different port or cable
No /dev/ttyUSB*
USB Gateway not recognized
Reboot Pi, reinsert device
SMDs unresponsive
RJ11 cables disconnected
Ensure cables are seated tightly
Motors donβt move
Modules not connected via RJ45
Check RJ45 cables and IDs
Script crash
Python package missing
Run pip install again
Web not loading
Flask not running
Run script manually or check logs
6. Final Checklist
Before moving forward:
π Congratulations! You now have a complete robot platform ready to expand and explore!
Last updated