Category Archives: Raspberry Pi

I got my pan tilt servos working

I’m making a simple camera gimbal and tonight I wired up the right analog stick on my xbox controller to control the pan/tilt servos:

Tomorrow I will print out a prototype gimbal structure.

ping-pong press!

My robot was written about recently on the Raspberry Pi foundation blog, and now on the Pololu blog too, the place I originally got my tracks from!

Robot at RubyConf

I took my robot to RubyConf. It’s not really Ruby related, but I figured it would go down like a robot at a programmers conference… So I took the robot apart, packed it away and headed to Miami:


First job, putting the robot back together again. I was happy it made it through security. It was the first time I’d flown with a small toolkit.

The robot laid bare

I was carrying the robot around most of the first day, people constantly asking to try it out:


It worked well on the shiny floor of the lobby. You can just about see the new 3d printed lifter arm:


Totally coincidentally Ron Evans also did a great talk on Artoo and the newly announced Gobotio.

Programmers love robots!

First robot remote driving test

I programmed some remote control software using a Golang receiving program on the robot and a ruby control client using my gamepad ruby gem and an xbox1 controller. It worked OK. It was a bit jerky, there’s no PWM so no acceleration, it’s either go or stop; anything not totally rigid on the robot wobbles. Also the position of the camera doesn’t show enough of the robot so it’s hard to get a real idea of where the robot is.

I was filming, the robot was being controlled my my wife, Morwenna, from upstairs.

The robot is also prone to shed a track if the “half turn” is used too much, that is one track forwards or backwards, the other one stationary. I can fix this in software if I can work out a way to do PWM on the robot that doesn’t run the Raspberry Pi CPU.

Tagged ,

New robot base design and completed prototype arm assembly

I spent all day at hacman Tuesday and Wednesday printing and tweaking robot parts. I put it all together when I got home. This is the front, the lifter arm has holes to allow me to screw in different attachments, I’ve still not designed that part of the robot yet:


Here is the back view, you can see the lifter arm gear housing (the curved structure) and the motor that drives it, also the battery (underneath the ball hopper)


The lifter arm gear system looking through where the hopper would be:


I need to design an attachment for the end of the lifter arm. Here I’ve created a simple one using meccano. It’s too heavy, the bolts catch on the floor and it dumps the ping-pong balls short of the hopper. Other than that it’s perfect. You can see the camera with capped lens that I’ve just wedged into the structure temporarily:


Next-up: better lifter attachment design, a couple of re-prints with tweaks and some software.

Tagged ,

Testing the new battery + lifter arm circuit

First test of the Raspberry Pi running off battery power with no external supply at all. In the picture the 5000mAh battery is the object at the back with “5000” written on it. My multimeter is measuring the voltage output. One of the Raspberry Pi (the thing with the red light on it) output pins is connected through the MotorPiTX board (the yellow circuit board on-top of the Raspberry Pi) to the breadboard.

The breadboard contains two circuits, the top-right cluster of components is the circuit that turns the output of the Raspberry Pi into something relevant to the motor driver in the bottom left, the bottom left cluster of components is the motor driver itself.

The Pi is pulsing the output causing the motor driver to spin the motor. The micro-switch just on the very bottom of the picture is one of the limit switches for the ball lifter arm.


Tagged ,

An assembled hopper

Today I printed out and glued together the first iteration of the ping-pong ball hopper that takes up most of the space of the robot.

The assembled hopper:


Full of ping-pong balls, I can get 12-14 in without packing them manually. That seems like enough for now, but a larger hopper would be good.


Mounted on the robot. You can see the completed camera mount and Raspberry Pi mounted on the side in the foreground:


The reverse angle:


Tagged ,

Raspberry Pi camera mount + lens holder

I printed out the front half of my Raspberry Pi camera module mount. It serves two purposes, providing a way of mounting the camera on my robot, and giving me a place to attach the wide-angle lens I’d bought earlier.

Raspberry pi camera holderRaspberry pi camera holder

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 ,