Tag Archives: hacman


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 ,

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

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 ,