How to control a robot over Wi-Fi with Pico W

Raspberry Pi Pico W controls a Pololu Zumo robot chassis via a web interface over Wi-Fi. Christopher Barnatt (aka Explaining Computers) has created a tutorial to show you how it’s made.

The ExplainingComputers channel is well worth subscribing to

That’s the top thing about our Raspberry Pi Pico W microcontroller: it comes with a fully certified module on board featuring 2.4GHz 802.11n wireless LAN, making it the perfect solution for projects requiring wireless communication, like this one.

Hardware

  • Raspberry Pi Pico W
  • L2989 motor controller
  • Pololu Zumo robot chassis
Wi-Fi controlled robot with Pico W

How to build the robot chassis

Christopher made a separate dedicated video walking through the robot chassis construction. The motor controller interfaces with the Raspberry Pi, and Python code brings it all to life. For this latest Wi-Fi-controlled version, he stripped the Raspberry Pi out and started again with a Pico W inside the chassis.

Learn how to build the robot chassis

Four AA batteries power the robot, and there’s a built-in place for them underneath the chassis. Micro metal gearmotors are what get the robot moving.

Making it wireless

Christopher had previously written some Python code to create a web interface for his Pico W weather station project. And he also lifted some from this Getting Started guide.

controlling a robot over Wi-Fi with Pico W
Screenshot of the web interface used to control the robot

In a nutshell, the code defines five functions to get the robot moving: forward, backward, stop, left, and right. Those commands correspond to clickable buttons on the web interface (pictured above), so when the driver clicks ‘Forward’, the robot moves forward, and so on and so forth.

Build your own robot

Here’s all the code you need. And you can download the design for the 3D-printed bracket from Thingiverse.

We do love the Explaining Computers’ tutorials, as they’re so beginner-friendly. If you’ve always wanted to code something a bit fancier but were worried it would be too difficult, you can’t go wrong with Christopher’s reassuring pace. Go for it. And report back in the comments!

2 comments
Jump to the comment form

Avatar

It’s cool how you can use the pico as a web server. Never thought of putting that together with a robot though, good idea.

Reply to Callen

Avatar

It’s funny how the Pico is slowly taking the Pi’s place as being the affordable (and actually available) computer.

Reply to Brian

Leave a Comment