Hack The Tower - 9th February 2013

Tower 42

On 9th February I took part in the February Hack The
organised by John Stevenson (@jr0cket). John
runs this event as a sort of one-day hackathon for the London Java, Scala,
Clojure & Salesforce developer communities and one of its compelling features
is the diverse mix of developers who attend.

I don’t think John advertised the event to the python community but even so
(with John’s approval) I decided to be awkward and turn up with a NAO robot,
planning to write continue work on my NAO wanderer
which aims to provide
NAO with the ability to explore a space, create a map and remember items of
interest. Currently the application is incredibly dumb and just allows NAO to
walk randomly around a space avoiding obstacles. One of my goals was to
explore collaborative application development on the NAO platform - since I
don’t believe that choreograph project files can be merged easily I decided to
move as much of the functionality out of choreograph and into plain python
code that could be worked on by other developers and unit tested. My hope was
that a few more experienced python developers could work on representing and
generating maps and this could be plugged into the existing code.

Unfortunately, I didn’t manage to complete the transition from pure
choreographe to choreographe+python before the event and managed to arrive at
the event with a broken project. This was made worse because I’d used github
as a lazy way to synchronise the code between my desktop machine and laptop
and so the github project was polluted too (facepalm). Also, the USB
thumbdrive I’d copied the NAO development environment (choreographe, Java &
python libs) and simulator appeared to have been corrupted and was unreadable.

Nevertheless a group of about five of us got together and managed to download
the dev environment and get started. Special thanks are due to Richard
Warburton (@RichardWarburto) for
improving on my initial design, writing unit tests, and improving my knowledge
of github and vim. The NAO wanderer github
is now in a usable state
(although unfortunately we didn’t reach this point during the meet up itself)
and at the next Hack The Tower (13th April) I hope to actually get started on
the mapping. The project’s issue tracker shows other items that are
currently on my to-do list

John Stevenson also published a writeup of the February event.

Hacking in progress

To hear about future Hack The Tower events, follow
@HackTheTower on twitter or if you’re
already a member of the London Java, Scala or Salesforce developer meetup.com
groups you should get notified.

You can sign up for the 13th April Hack The Tower meet up via the London Java
London Scala Community
or London Salesforce Developer

UK NAO London hackathon

I haven’t posted anything about NAO for a while, which is a shame since it’s a
great platform and I’ve been having a lot of fun with it. More details (such
as there are) on my NAO project

Over the last year or so a group of UK based NAO
has started to meet semi-regularly and back
in March we decided to run our own hackathon based on the NAO. We hoped to get
registered NAO developers and other coders together for a weekend of hacking
code on the NAO.

Well, the hackathon took place last weekend and it was great fun. It was
especially cool to see people who’d never written a line of python or seen a
NAO before produce working applications. Aldebaran Robotics once again proved
what great people they are by turning up with some spare NAOs for people to
use, staying the whole weekend to help with the event, providing one of the
prizes and paying for most of the food.

The applications developed over the weekend were:

Here’s a summary video that I put together showing all the application demos
and the prize-giving

Photos from the event are available on the UK NAO group on

Finally, thanks again to the sponsors who provided the venue, food and prizes

  • Aldebaran Robotics
  • UCL
  • Eurisko Consulting Services
  • Nuance
  • O’Reilly

Update 3/10/2012: Added links to Dalek and filled circles applications

Update 4/10/2012: Added link to flickr group

View the discussion


Not long after Mum died I noticed that she’d written on the base of a Robin
(the bird) figurine “My Ruby wedding present to Jim 8/8/2004” At the time I
thought it was typically Mum writing such notes on things. When we started
going through her keepsakes in her
muniment chest” (that Dad made for
her) we noticed many things had little labels pinned to them, for example her
wedding dress a pair of trousers that Mum and Dad had bought for me on holiday
in Scotland when I was about the same age as my son is now.

It was only a few months later when I was thinking of what would happen to all
my possessions when I die and how some of them mean more to me than others
that I really understood what my Mum was thinking. She was trying to
communicate to us why all these apparently random things were important to her
(we knew they were important or they wouldn’t have been in the muniment chest
or in pride of place on a shelf). She never actually said or wrote anywhere
“Please don’t throw this away” but I think it was implicit.

I wonder if, at the end of my days, I’ll be labelling my things (digital and
physical) and hoping that my children are as sentimental as I am.

View the discussion


The aim of this project is to entertain both myself and my children by
converting a radio-controlled K9 toy into an autonomous robot under the
control of a RaspberryPi. I chose the
RaspberryPi because of it’s low power requirements, low cost and small form
factor (there is very little space inside the toy).

I have the following loosely defined set of goals

  • Anything that the toy could do via radio control, it should be able to do under the control of the ‘Pi
  • It should be WIFI connected and not tethered to another computer or mains power supply
  • It should have some basic sensors such as bump sensors and ideally a webcam for video input
  • It should have audio output
  • It should be entertaining to build and to play with

A Summary of current Raspberry Pi Motor Control Options

The project I’m currently planning on using my
RaspberryPi for is a robotics
to entertain my children. As part of that I need to be
able to control DC motors from the RaspberryPi

Now that I know how to run the ‘Pi from battery
and get WIFI
the next item
on the TO-DO list is controlling motors. I’ve yet to personally try any of
these methods as I’m still in the process of working out what’s the best
option for this project but I thought it might be useful to summaries the
options I know about here (in the hope that anyone who knows of other options
will say so in the comments).

One option is to develop a board from scratch based on my exact requirements. However, I’m too lazy and my electronics skills are too rusty for me to take this approach. The space constrained nature of the project means that I don’t have space for breadboard and so would have to design a PCB or use stripboard none of which appeals at the moment.

The PiBorg can control up to two motors and two solenoids. Multiple PiBorgs can be connected to allow control of larger numbers of motors and/or solenoids. It looks like a nice piece of kit and is now available for pre-order however it costs 129 and since I need to control at least 3 motors it would be a relatively expensive option.

I wondered if I could control my arduino motor shields from the ‘Pi and then found out that others had already had that idea in the shape of Ponte. This sounds like a great idea but I haven’t seen any updates to this since the end of May and I’m impatient to do something…

Arduino + motor shield
So if Ponte is not yet available why not get the ‘Pi to control an arduino connected to a motor shield? This blog post (and it’s followup post) shows it not only possible but not that hard either. Since an arduino uno costs about 25 and the motor shield also costs about the same I could potentially control 4 motors or less than the cost of one PiBorg (in fairness though the PiBorg has the ability to measure feedback from the motors and maintain a desired speed so it would still be a technically better solution). A disadvantage of this approach is the space required by two arduinos each with a motor shield mounted on them. If I connect to the arduinos using USB I’d then also need a small USB hub (as I need another USB port for the WIFI dongle).

The Gertboard is being developed by Gert van Loo who also worked on some of the Raspberry Pi hardware. It sounds like a nice board but AFAIK is not available yet.

Raspberry Pi to Arduino shields connection bridge
Not sure if this has any relation to Ponte, but the idea of using arduino shields on the Raspberry Pi is the same and it’s available now for 40 euros.

Also worth a mention is the Pi Face but this seems to use relays which rules it out for this project as I need PWM motor control rather than just a simple on/off

Since I already have an arduino and a motor shield I’ll probably experiment more with that before considering any of the other options, but in the meantime if you have any better ideas (or corrections to anything I’ve said above) please say so in the comments.

Update 9/10/2012: Added details of Raspberry Pi to Arduino shields connection bridge

Raspberry Pi on WIFI

Thanks to this
and this post
I have got my RaspberryPi working using the tiny
Edimax EW-7811UN WIFI USB

One thing to note is that though the instructions are still at the original
location (http://dl.dropbox.com/u/80256631/install-rtl8188cus.txt) the
script itself has changed its name slightly and so
http://dl.dropbox.com/u/80256631/install-rtl8188cus-latest.sh should be used
instead of the link in the original forum post.

The script requires only that you enter the SSID, password and encryption type
(WEP or WPA) of your WIFI network and everything else is automatic. Using the
recommended debian distribution I had no issues whatsoever - after the Pi had
downloaded the updates fetched by the script and installed the firmware it
rebooted and the WIFI adaptor worked first time.


Battery Powered Pi

Given that one of the projects I have in mind for my Raspberry
is to build an autonomous robot I need to be
able to power it from batteries. Using a switching DC-DC converter
and a micro USB cable I’ve managed to get the Pi running of a set of AA
batteries. The DC-DC converter is important to:

  1. make sure that the Pi does not get subjected to excessive voltage (see this thread on the RaspberryPI forums), and
  2. to ensure that the supply voltage stays constant as the batteries run down

The RaspberryPi is designed to be powered from a phone charger and has a
micro-USB power input socket. I used this pinout
the micro USB socket to work out which pins I needed for ground and +5v and
then used a multimeter to verify that this was correct.

At first I wasn’t able to to adjust the output voltage of the converter but
finally realised that it needs a load in order to be able to give a meaningful
output voltage. Not wanting to risk trashing the Pi I used a DC motor as the
load until I managed to get the converter’s output voltage to 5v.

Plugging the Pi into the converter’s output resulted in it booting and
appearing to be fully operational. My desk is currently too messy to be very
photogenic so the photo below shows the Pi powered on but on the kitchen table
without keyboard and monitor but with the multimeter that I was using to
monitor the voltage to the Pi during testing.

Raspberry Pi powered by DC-DC convertor

30th anniversary of the Sinclair ZX Spectrum

Today I went to HORIZONS: A celebration of the 30th anniversary of the
Sinclair ZX Spectrum
which was part of Sci-Fi London 2012.

Chris Smith who runs the site zxdesign.info gave
a quite technical talk on reverse engineering the Spectrum’s
ULA. This information
is available in the book: The ZX Spectrum ULA: How to Design a
. Chris also
gave some technical details on determining exactly how many machine cycles
could be executed between line refreshes and how this knowledge could be used
to overcome the ZX Spectrum’s 2 colour per 8x8 pixel block limit.

There was time for some of the attendees to talk about their memories of the
Spectrum and things they’d done. One person had a Speccy
which is an FPGA
implementation of a Spectrum that can read data from SD card.

There were a couple of RaspberryPi‘s on show:
one playing a short film and the other running a Spectrum emulator running
Manic Miner which has to be one of
my all-time favourite Spectrum games - I spent hours playing it and the sequel
Jet Set Willy when they were
released. My son started playing the game and got hooked - I have a suspicion
that if I set up an emulator on the home PC he’d put as many hours in playing
it as i did 29 years ago. Eben Upton of RaspberryPi fame also gave a short
talk on how the Raspberry Pi came to be.

What I hadn’t expected is that people are still developing for the ZX
Spectrum. Using emulators and PC-based development environments experienced
programmers are making use of the detailed knowledge of the machine that was
not readily available (AFAIK) in the 1980s and still cranking out new games
such as Chris Smith’s isometric 3D
and Jason Railton’s