Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Simple Pi Robot – Build a 2‑WD Autonomous Rover with Raspberry Pi

Simple Pi Robot is a hands‑on guide that turns a Raspberry Pi into a fully‑functional autonomous mobile platform. Whether you’re a hobbyist or an educator, this tutorial walks you through every step—from selecting components to writing control code and streaming video in real time.

Parts List

Step 1 – Choosing a Motor Driver

The L298 is a proven, cost‑effective choice that provides a regulated 5 V supply for both motors and servos. It also supports separate enable pins for speed control. Other options include the RTK Motor Controller Shield, Pololu DRV8835, or Adafruit DC/Stepper Motor HAT, but the L298’s simplicity makes it ideal for beginners.

Step 2 – Wiring the L298

Connect the board to the chassis as follows:

Step 3 – Setting Up the Servo

The servo requires a constant 5 V supply and a PWM control signal. In this build we use a Futaba S3003 (4.8‑6 V). Use the RPIO.PWM library for reliable servo control via DMA:

sudo apt-get install python-setuptools
sudo easy_install -U RPIO

More on RPIO.PWM.

Step 4 – Assembling the Chassis

We use the Ellipzo 2‑WD chassis kit, which includes motors, a pan/tilt servo mount, and all necessary hardware. Follow the kit’s instructions to attach the Pi, L298, and power components.

Step 5 – Adding the HC‑SR04 Distance Sensor

Connect VCC to +5 V and GND to ground. The TRIG and ECHO pins go to GPIO pins (e.g., 18 and 17). Add a 1 kΩ resistor on the echo line to protect the Pi. The following Python snippet measures distance:

TRIG = 18
ECHO = 17
# (initialize GPIO and perform measurement)

Step 6 – Camera and Live Streaming

Attach the official Pi Camera module. Install VLC for streaming:

sudo apt-get install vlc

Stream via RTSP:

raspivid -o - -t 0 -n | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264

Open the stream on any device with VLC: rtsp://<PI‑IP>:8554/.

Step 7 – Pin‑Out & Python Control Code

The full Python script below controls the robot’s motion, distance sensing, and servo. It uses RPi.GPIO for motor logic and RPIO.PWM for servo PWM.

from RPIO import PWM
import RPi.GPIO as GPIO
import time
from subprocess import call

GPIO.setmode(GPIO.BCM)
# Setup GPIO pins
GPIO.setup(19, GPIO.OUT)
GPIO.setup(26, GPIO.OUT)
GPIO.setup(16, GPIO.OUT)
GPIO.setup(20, GPIO.OUT)
GPIO.setup(21, GPIO.IN)
GPIO.setup(8, GPIO.OUT)
GPIO.setup(27, GPIO.OUT)
GPIO.setup(9, GPIO.OUT)

TRIG = 18
ECHO = 17

# Movement functions

def fwd():
    GPIO.output(19, True)
    GPIO.output(26, False)
    GPIO.output(16, True)
    GPIO.output(20, False)

# (other movement and sensor functions omitted for brevity)

while True:
    inp = raw_input()
    if inp == "1":
        fwd()
        print("robot moving forward")
    # ... (handle other commands)

GPIO.cleanup()

Step 8 – Assembly Photos

Refer to the accompanying images for visual guidance on wiring, mounting, and final assembly.

For full source code and additional resources, visit the original Simple Pi Robot page.

Manufacturing process

  1. Professional Fanuc Servo Motor Repair Services
  2. Servo‑Driven Obstacle‑Avoiding Robot: Build with Arduino & HC‑SR04
  3. Joy Robot: An Arduino‑ESP8266 Powered Smart Robot
  4. Create an Autonomous Line-Following Robot with Arduino UNO
  5. Build an Autonomous Home Assistant Robot: Full Parts List & Setup Guide
  6. Omni-Directional Robot Designed for Safe People Tracking
  7. Interactive Servo Motor Project with Arduino and HC‑SR04 Sensors
  8. Arduino‑Powered Robot Arm with Custom Controller – Servo & Potentiometer Build
  9. Servo Motors Explained: How They Work and Why They Matter
  10. Understanding Servo Motor Reducers: Functions, Benefits, and Applications