Skip to content

Adventures in building a toy rover and controlling it using Python

License

Notifications You must be signed in to change notification settings

tristanpenman/rover-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rover Kit

Adventures in building a toy rover that can respond to commands over Wi-Fi and send back readings from ultrasonic distance sensors.

Sensor mounted, not quite wired up...

Parts

The rover is based on the following parts:

This is all wired up with an assortment of resistors, jumper wires, and breadboards.

Power to the Motor HAT is provided by a 12V battery pack. And power to the Raspberry Pi is provided by a portable USB power supply.

Inspiration

This project is inspired a series of blog posts that Mat Kelcey wrote about building a rover (I've used the same basic parts) and training it to move around autonomously.

My project is less ambitious. Seeing what he did made me think it would be fun just to tackle it as a hardware hacking project.

Early Prototype

When I first started this project, I was using a regular Raspberry Pi 3.

I eventually switched to using a Raspberry Pi Zero W, so that power usage and space requirements would be reduced.

Switching to Raspberry Pi Zero W

The two front sensors were not attached when I took this photo.

Part way through soldering the final sensor interface board (this was very slow, because I'm new to soldering):

Half way through sensor interface board

It all felt much neater with the new interface board. Now to figure out wiring:

Figuring out wiring after soldering was complete

Other photos can be found here.

Python

The scripts for controlling the rover are written in Python, and rely on some very useful libraries:

Test scripts:

Main control script:

Rover Control

The Rover Control frontend, which is served by the rover_control.py script, is pretty ordinary HTML and JavaScript. It currently provides the following commands:

  • Forwards
  • Backwards
  • Spin Clockwise
  • Spin Counter-clockwise

The code can be found in src/web.

License

This code is licensed under the MIT License.

See the LICENSE file for more information.

About

Adventures in building a toy rover and controlling it using Python

Topics

Resources

License

Stars

Watchers

Forks