Tag Archives: Ping-pong robot


The Raspberry Pi camera doesn’t have a field of view that is wide enough for my robot, I’d have to mount it really far from my robot to see enough context to make it drivable so I’ve bought some wide angle iPhone lenses to try out.

Wide-angle and fish-eye lenses

Here’s a photo taken using the fish-eye lens held up to my iPhone:


Tagged ,

Batteries and battery charge circuits

I’m currently powering my robot via cable and mains adaptor. This works fine but. I need to power it by battery so it can roam around a room. I’ve looked at which batteries to get, and I guess I’m going to get something like a NiMH battery. LiPo sound like a good idea, except for the whole exploding/setting on fire thing, the robot will be left alone while charging and if I burn down the office no-one is going to be pleased. So I’m thinking of buying something like this NiMH battery for my robot.

The problem I have is how to charge the battery. The robot needs to “dock” and charge unattended, rather than have someone change it’s batteries manually so standard consumer battery chargers are out. I also need to get charging status somehow so I can get remote status / prevent the robot from moving off until the battery is charged so some sort of SPI/I2C interface will be needed (the docking station will be a Raspberry Pi).

It looks like there are chips out there to do this sort of thing, like the LTC1759 (from here) and more.

Unfortunately I have 0 surface mount skills, or confidence that I could make a circuit out of that that would work so I need some help:

  • Does anyone have any suggestions for boards that already exist that use a chip like this…
  • …or suggestions as to how I could handle the charging?

Shutting down your Raspberry Pi cleanly with the MotorPiTX

The MotorPiTX I’m using for my robot comes with a power switch that can either hard power-off the Raspberry Pi, or signal software running on the Pi to do a clean shutdown:

Purely to control the ATTiny chip, to turn on the Pi, but also to shutdown as well. With the Pi off, pressing it once will turn the Raspberry Pi and MotorPiTX board on. With the Pi active, pressing it again will set GPIO 8 high, signalling that the button has been pressed and should be used to shutdown the OS. See Installation for more details.

Holding the button for 3 seconds will cut all power, useful if something goes wrong, such as the Raspberry Pi crashes and refuses to respond.

I’d never bothered to write any software to listen for GPIO8 going high before, I’d always relied on being able to SSH in to shut the machine down. Recently however I’ve been playing with the Pi camera, this was causing the Pi to pull too much power and it would shut down the USB ports cutting off my (wireless) SSH access and my USB keyboard both at the same time leaving me with no alternative but to hard power off. It was time to do something with that GPIO8 pin signal, and so I wrote motorpitx_power_control.

motorpitx_power_control is simple, from the README:

A program to listen for MotorPiTX power button presses and cleanly shutdown your Raspberry Pi.

It’s a really small program written in Go that checks the status of GPIO8 every half a second and initiates a shutdown sequence if the pin goes high. I’ve included instructions for building and installing on Arch linux, but it will work on other distros too.

Why Go?

I think Go is a great language for the Raspberry Pi. Go creates small, efficient, statically compiled binaries that easily fit within the resource limits of the Raspberry Pi. motorpitx_power_control is a relatively small 2.5MB binary that uses almost no CPU at all.

Getting it

The project requires a working Go install to compile, this is simple enough to get on Linux and OS X, check your package manager or homebrew. If you have Go installed head over  to the motorpitx_power_control Github page and clone the repo. Follow the build instructions, copy the binary file to your Pi and run it. That’s it!

Check the Contributing  & TODO sections of the README if you want to contribute back to the project.

Tagged ,

Prototype robot base #1

The robot base design from my previous post printed OK. Here it is printing:

Robot base printing

The finished print. The two small separate objects are the motor covers:

Completed robot base print

The assembled robot, including Raspberry Pi and MotorPiTX:

Assembled robot base

The underside of the robot:

Assembled robot base base

Tagged ,

OpenSCAD robot base design

I’ve re-designed a prototype robot mount in OpenSCAD as Sketchup wasn’t up to the job. It took a while, you have to program the model in a text editor so there’s lots of trial and error. Will have to wait to print it to see if this design will work.

Prototype robot base designed in OpenSCAD

I’ve made some improvements over the original design, most notably thicker side walls and motor mounts, more accurate measurements and added the cross-pieces with a Raspberry Pi mount.

Here’s the original Sketchup design for comparison:

Robot base designed in Sketchup

Sketchup was great, really easy to use, the only problem was that it seemed to create invalid model files.

Tagged ,

Trying out the prototype caterpillar track mount

It works, but it needs more refinement.

Testing the new motor mount

Tagged ,

Designing a track mount

Designing a track mount for my pololu caterpillar tracks. Sketchup is trying  very hard to prevent me.

Pololu track mount

Tagged ,

Secret project – MotorPiTX motor board

I soldered together my MotorPiTX motor controller today and fitted it to the robot:

Robot with MotorPiTX board

Robot with MotorPiTX board

It’s a hell of a lot neater than my original effort, and only trails one wire. It goes forwards and backwards now too. To the left of the blue relay near the top you can see my homemade heatsink attached to the voltage regulator:

Heatsink detail

Heatsink detail

The robot in action, being driven by a Go program on the Raspberry Pi:

Next up, getting the camera working, and figuring out a better power supply/battery.


Secret project

Tiny motor

One of my new motors. It’s about 10mm in diameter

I’ve started work on a top-secret project. I can’t really hide the fact that it’s going to be a robot, but I’m not going to say what it is, at least not just yet.

So, last night I was designing a 3d printed mount for the tiny 3-6V motors I bought and I started to wonder if I could cobble something together using my old technic lego. I dug out the lego, but on top of that was my dusty old meccano set, even better!

WIthin a short amount of time I had some motor mounts and a frame made, including tensioning springs for the caterpillar tracks. All that was left was to take it for a spin. I hooked it up to my Raspberry Pi via my Custard Pi breakout board, a ULN2803A and a custom voltage regulator circuit.

Meccano wheel mount

Motor mount

Seeing if it drives in a straight line:

Hooked up to the Raspberry Pi, controlled by microswitches. You can see the top of the Custard Pi poking out over the mess of wires that is my breadboard and the cheap wireless dongle/antenna I got from eBay. The voltage regulator circuit makes an appearance being dragged along behind:


MotorPiTX kit

Right now it only goes forwards because I didn’t have the circuitry for anything else, but I got my MotorPiTX in the mail this morning so that will change soon.

Tagged ,