KevsRobots Learning Platform

Build a SMARS Quad Walking Robot

100% complete

Reset my progress

Make it walk

Install SMARSLab on the Raspberry Pi and bring your SMARS Quad to life

By Kevin McAleer,    2 Minutes


Watch the video


Set up the Raspberry Pi

  1. Turn on I2C: run sudo raspi-config, choose Interface Options > I2C and select Yes.
  2. Check the Pi can see the PCA9685:

     sudo apt install -y i2c-tools python3-smbus
     i2cdetect -y 1
    

    You should see 40 in the grid. That’s the PCA9685’s address.

Install and run SMARSLab

cd smarslab
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python smars_lab.py

Now open a web browser at http://<your-pi-address>:5000 and use SMARSLab to move the legs. The configure_limbs.py script in the same folder lets you check which PCA9685 channel each limb is on, and wiggle a limb to identify it.

How walking works

This video explains the walking cycle in Python: which legs move, in which order, so the robot always has enough feet on the ground to stay balanced.


Common issues

  • Problem: i2cdetect shows an empty grid
  • Solution: Check SDA and SCL aren’t swapped, and that I2C is turned on
  • Why: The Pi can only talk to the board if both I2C wires go to the right pins

  • Problem: The servos twitch or the Pi resets when the legs move
  • Solution: Power the servos from their own 5V supply on the PCA9685’s V+ terminal
  • Why: Eight servos can draw a few amps, far more than the Pi can supply

Check your understanding

Quick quiz 1 of 2

What I2C address does the PCA9685 normally show up on?

Quick quiz 2 of 2

Why does the PCA9685 need its own power supply for the servos?

What’s next

< Previous

You can use the arrows  ← → on your keyboard to navigate between lessons.


What are you looking for?
Watch Videos Get Ideas Learn Something Read a Review Read the Blog Search
... Z Z z