Raspberry Pi Wifi Robot Car (2016)

Off the bat, I'm not a 'maker' but I have an interest in that area, and have for a long had some Raspberry Pis, an Arduino Uno board and random other things about the place for various mini home projects and genmeral tinkering.

Here then, I'm going back in time a few years to Summer 2016, and the Raspberry Pi wifi robot car I built. It's not that complicated, and largely was done by following a project guide, and getting components from Adafruit.com. I had a Raspberry Pi 2 kicking around since I got a 3, was looking for something to do with it, and something which would be something my kids could do some thinking on, without it being a simple remote control item.

I bought the few bits I needed from Adafruit, which was mainly the motor HAT, metal chassis, motors and a wifi dongle since the Pi2 doesn't have that onboard.

Prior to this, it'd been a while since I'd done any soldering in anger, so getting the HAT pins all connected and tested with the multimeter was a lot of fun, and in all honesty, they all worked first time. The robot has two batteries - a USB one which fuels the Pi itself - in the photo thats the large brick looking one, but in use, I have a smaller cylindrical one which works fine. The secon battery pack is the black one on top, which is 4 x AA batteries which powers the motors via the HAT.

The trickiest part was getting my cylinderical battery to sit proporly on the front, which I initially solved with BluTak, then with a mount made from some Sugru I'd forgotten about.

There's a few pictures there to show the build, but what about the usage?

In short it did exactly what I wanted, but what was that? I wanted something where I could programmatically direct a 'vehicle' around the house, and this allows me to do that. So the way I was using it was to connect from my laptop (or via JuiceSSH from my phone sometimes for a bit of fun) over SSH and create basic Python scripts locally on the car to tell it how to move.

All of that is down to some configuration, largely via the Pi HAT Python library available on github. You can edit some of the defaults, which determines the speed the motors turn, a certain amount of trim, and torque, within limits, which address variability on what can be a loose build in some ways.

The rest is really telling your robot car how you want it to move, so how long to move forwards, how long to drive one wheel to effectively turn and so on. It was actually when I thought about this stage that it occurred to me that this was some how addressing repressed shame at breaking the BigTrak my parents bought me when I was a kid (sorry about that).

In the couple of years since I've built it, I've programmed it to 'draw' pictures in the street outside when I mounted some chalk to it - not great, but it worked. I've also sat and made some scripts with my kids to see how long a script they could do without running it, and how closely it matched to the way they imagined it in their heads. The goal of that thread was to get it to navigate a simple maze.

In the future, especially now as I revisit it, I wanted to add a few bumper sensors, for it to stop when it hits objects and build upon that.

I also note from reviewing the current Adafruit page on this, is that they now recommend using a Bluetooth low energy Feather controller to not only remove the Pi from the equation, but to control it via BT from your phone. I'm not sure that's the direction I wanted to take this, but that's definitely an interesting alternative.