James West

May include blinky lights. And cocktails.

Author: James (page 1 of 2)

Quick make: Adding LEDs to a world map to show the status of stuff

In a recent sale my local branch of The Works was selling this cork world map. It was only a few quid – even less than the £7 sticker price and I thought it could be improved by adding some LEDs to it.

Today I finally got this sorted, starting out with a test build of the circuit, wiring two groups of LEDs in parallel (blue and yellow to match the buttons I’d got), with a 100 ohm resistor for each one.

I decided where to put the LEDs on the map, and drilled 3mm holes with my Dremel for them. I also marked out where the buttons needed to go and used a craft knife to cut through the layers of cork, corrugated paper and card that make up the sandwich of the board. The LEDs were hot-glued into place after being pushed through the map, Because the board was quite thick they ended up being just about flush with the surface which gives quite a nice effect when they light up.

I also fastened a 3 x AAA battery box onto the back and stuck the power rails from a breadboard nearby to help hook up the LEDs.

Next I soldered a resistor to the cathode of each LED and wired up the buttons and battery pack to the breadboard. Then I connected the LEDs to the power and used electrical tape to cover up the exposed LED legs to prevent an short circuits.

I’m happy with how this came out. The location of the LEDs in this case isn’t important, they can be used to indicate whatever you imagine: the location of Dalek invaders and UNIT forces for instance. You could put them on specific continents or oceans to help with geography homework or show where particular food, animals, or resources come from.

Cramming the Google AIY kit into a Roberts radio

The Google AIY kit that came with issue 57 of the MagPi makes a great internet radio. The cardboard box it comes with, however, is functional, but not wife-compliant so I wanted to find a better enclosure for it. For a while I mounted it behind a perspex Muji photo frame, which was OK but still not what I really wanted. Then I remembered the Pimoroni ARRR600 which had an internet radio inside an old Roberts.

Roberts radios are fantastic. They look amazing and, and are well built. When I first started working in radio the BBC’s local stations used them extensively for off-air cue at outside broadcasts and they survived a lot of rugged handling while still retaining their looks and sound quality. So I went to eBay and found a few for sale as “spares or repair.” I didn’t want to gut a functioning radio, or pay too much for just the case. I was out bid on a couple of R600s, but won the auction for a Roberts Rambler 2.

Roberts Rambler 2

Taking it apart and removing the old innards was pretty easy. I had to make a mounting plate for my four new buttons, so cut down some 3mm acrylic sheets I had left over from something else, and carefully drilled holes in the right places, using the top cover as a template. I fitted the new buttons and pots, and soldered all the wires to them and to the Google Voice hat. I used the original speaker from the radio, connecting it to the hat via the volume pot so it can be adjusted without having to bother the AIY kit. (Although you can still say “Volume up” or “Volume down” to it if you like). The pulsing LED is mounted underneath the top panel, and shines through nicely. As there are plenty of spare GPIOs available on the hat I connected the buttons as mentioned, and added three extra LEDs too. These don’t do anything at the moment, but I suspect I could add some code for them if inspiration strikes me.

Usual mess of wires

I used KTinkerer’s code and excellent blog post to get the BBC radio stations playing on the AIY kit, but I modified some of the station names to be more on-brand and swapped my BBC locals for Radio Nottingham from their example.

Roberts Rambler 2

I’m pleased with the outcome of this, and it sits nicely on the desk in the front room with my Twitter ticker. Strangely the LED connected to GPIO 5 is always dimly lit. If anyone has any idea what might be causing that, or any other feedback, I’d be interested to hear in the comments.

Desktop Twitter ticker

I’ve already made a couple of Raspberry Pi powered Twitter tickers with wildly different display sizes and, honestly, levels of success. Most importantly, they’ve both failed to be wife-compliant; that is they weren’t finished to a standard where I’d be allowed to leave them out and actually make use of them!

With wifi now built in to the Raspberry Pi Zero W, and Pimoroni’s neat Scroll pHat HD available, I wanted to have another go at this, and having learned a lot of general makery-ness over the last couple of years I thought I could manage to box it up in a smart display.

The code was the easiest part of this project; I just had to modify my previous efforts to work with the Scroll pHat HD rather then the PaPirus Zero or LED matrices I’d used before and add some GPIOZero bits to get the buttons working. You can see the code on GitHub.

Perpendicular Pi

Raspberry Pi Zero W lies flat, but hidden behind the Scroll pHat HD and ProtoZero board

The hardware was straightforward too. I used a right-angle header on the Pi which connected to a ProtoZero board with a long female header to plug into the Scroll pHat HD. I soldered the wires for my two buttons onto the ProtoZero. I needed the Pi to lie flat so I could connect power into it while the display was standing upright. (I’ve used ProtoZero boards in several of my projects, they’re really useful for breaking out GPIOs and neatly soldering your buttons, LEDs and other bits and pieces onto.)

The case was the bit I expected to find most difficult. I wasn’t good at woodwork at school, and haven’t done anything like this before.


I did a lot of head-scratching and drawing before making any cuts.

But I had a plan.

I thought I could sandwich together sheets of plywood with a hole cut through the middle of them to make the case. There was some transparent red acrylic left over from supersecretproject#2 that would make a nice diffuser for the really very bright LEDs on the display.

So I did a lot of measuring of the assembeled hardware and drew my pictures, before heading out to treat myself to a jigsaw. This was a good decision.

A slice of the box

It doesn’t matter how scruffy the hole in the middle is, as long as there’s clearance to get the Raspberry Pi Zero W and Scroll pHat HD through there.

I cut the plywood into biscuits and then drilled out the corners of the big hole I was about to jigsaw out of the piece. I made nine of these to accommodate the hardware, and then the front and back plates with feet to stand the box up on the table. I made a tidier hole in the front panel to show the display through, but drilled just a 12mm hole in the bottom corner of the back piece for the power lead. I used wood glue to glue the front half together in one stack, including the plastic and front panel, and then glued the back half separately. I drilled holes for the buttons into the top of this back half and then sanded everything down, rounded the corners slightly and gave it a varnish. This really brought out the colours in the different layers of ply and I think looks rather nice. I pushed the nuts to secure the buttons onto the wires, soldered up the buttons and threaded then into the holes I’d drilled into the top.

Now I did a last test of everything before gluing it all up and happily found everything worked as it should.

Then I glued the rear half onto the front, pushing the Scroll pHat HD right up against the acrylic, threaded the power wire through the rear hole and plugged it back into the Pi and glued the final back slice onto the sandwich.

When it all dried everything still worked, but the feet weren’t quite the same height and it wobbled when you pressed the buttons, so I sanded a few millimetres off the offending foot and gave myself a strong and stable foundation for the project!

This slideshow requires JavaScript.

I’m pleased with how this one has come out, and think it’s certainly wife-compliant, but as always I’d love to hear your suggestions for improvements in the comments.

UPDATE: Alex Burns tried to run the code from GitHub and found it wouldn’t run. This is because the Twython OAuth packages only install for Python 3 so you have to force the program to run in Python 3. To do this I typed the following at the command line:
python3 scrolltwitter.py

VW badge with LED rainbow

Wallpaper - Not VW camper vans

Not VW camper vans

When we redecorated the hall we went to B&Q in search of some wallpaper to run up the stairs. You know the stuff; probably floral. But then we saw this, and just had to get it.

We’re not massive VW fans, but the dream is to get some sort of camper van when we retire and hit the road, so it’s a little nod towards what might be.

When Cora, our neighbour, gave up her Golf she kept the badges off it’s boot and radiator, and when she saw this wallpaper she gave us one of them. I went to eBay and got a display frame to put it in, and it’s lived on the radiator shelf at the bottom of the stairs since then.

But it’s not felt quite finished; after all, everything can be improved by adding LEDs to it. There was (of course) a spare Raspberry Pi Zero and Blinkt! stick in my makers’ box, so I Dremmelled a Blinkt! sized slot in the bottom of the frame, poked the LEDs through and screwed the Zero onto the bottom of the box.

I’ve not done any fancy code, it just runs the rainbow.py script from Pimoroni’s Blinkt! library.

PS: This video was made with Apple’s Clips app. I really made it as an excuse to play with the app, which is a lot of fun and not that difficult to get started with.

Quick make: cocktail cabinet LED rainbow

We love our cocktail cabinet, bought at a vintage shop in Northallerton. But you can improve everything by adding LEDs to it, right?

Cocktail cabinet lights

After finishing my K9 build I’ve time to spend on a few smaller ideas I’ve had kicking around, like how to make the cocktail cabinet glow. I splurged on a Mote kit from Pimoroni and the pHat to go with it. I made a simple frame from some plywood that was in the shed and screwed the Mote strips to the outside edges. A Pi Zero W went in the middle and I threaded the cables through the gaps I’d left at the corners.

Mote sticks frame

A couple of screw eyes and some picture wire let me hang it on a picture hook behind the cabinet. I’ve just got one of the example scripts provided by Pimoroni running for the rainbow effect, but in the future I’d like to make the LEDs flash or change colour in response to a Twitter hashtag like #cocktailtime

I also think it’s time for that wallpaper to go, and paint a nice clean white wall instead.

Building a K9 toy

We have a young Doctor Who fan in the house. His bedroom door is painted to resemble the TARDIS and my original #SuperSecretProject was a TARDIS console that sits on Edward’s desk. For #SuperSecretProject2 I decided to make a toy K9. Definitely a toy, and not a replica prop; I wanted Edward to be able to play with his K9 without worrying about bumps and scrapes, and I understand the limits of my time, patience, and most of all skill.


I wanted K9 to be able to be driven around by remote control, to play some sounds from the TV show and for his red eye panel to light up.

Acrylic sheets

Excitingly it all started with sheets of acrylic bought off the internet. You can get this cut to size in all kinds of colours, so obviously I chose grey (and one transparent red sheet). I got 3mm thick sheets, cut to A4 size. I remember cutting Perspex in design lessons at school with a hack saw and spending ages sanding the edges to a smooth finish, but that was over 30 years ago and the internet suggested scoring the acrylic and then snapping it like tiles. I’ve never actually cut tiles, but get the idea and gave it a go.

Trimming acrylic

Nine times out of ten this worked really well, and as I’d deliberately over-ordered I wasn’t worried about the odd miss-snap. The deeper I scored the better this worked, with ten passes of my Stanley knife seeming to be enough to ensure success. I made paper templates and transferred the measurements to the acrylic, which comes with a paper sheet covering each side making it easy to mark up, and protecting the surface from finger prints and tool marks.

K9s main body is made from four trapezoids hot-glued together, with strips of acrylic inside the corners to hopefully reinforce the joints and make it more rigid. Before I built any more of the structure I needed to stuff it with the gubbins that would make the robot dog bark and run.

So I sketched out a schematic of the circuitry, ordered some more stuff off the internet and started coding. I planned to use a Raspberry Pi Zero W for the brains (built in blue-tooth was going to be helpful for connecting to the Wii Mote), a Speaker pHat from Pimoroni to allow the sounds to be played and the motors and motor controller from a CamJam Edukit 3 I’d previously bought. I added one red and one blue LED, as well as a big arcade button, all of which I soldered to a Protozero board sandwiched between the Raspberry Pi and Speaker pHat.

Power for the motors would come from four AA batteries, with the Raspberry Pi getting juice from a USB powerbank, with a Micro USB extension mounted on the back panel of K9 so he can be easily charged up in between adventures.

The red LED was to be mounted behind the transparent red Perspex of K9’s eyes, and the blue one was planned to go alongside a button on his back. The button would trigger playback of the sounds I’d chosen to include in the project.

I’d previously coded a robot with the CamJam kit using RPI.GPIO, but this time decided to use GPIOZero which has brilliantly simple motor and robot recipes built in. It’s also really easy to program buttons, so K9s audio would be easy to do too. While I was doing the coding I realised it would also be easy to make the A button on the Wii Mote trigger sounds remotely, so I added that option too. The code is on Github if you want to look – K9’s blue LED flashes when he’s ready to pair with the Wii Mote and he says “Affirmative” when the pairing is complete and the blue LED goes steady.

I got a prototype assembly of the hardware and software going with very few tweaks, which I was pleased about.

K9 prototype

Next I had to squeeze everything into the body. This was harder than I’d expected because I’d built the body without really thinking about how much I’d have to stuff in there, or how I was going to mount it. But with a bit of patience and lots of hot-glue I got most of the innards located and was able to test drive K9 without his head or back in position. This was very comforting moment, because I was now almost certain that I’d be able to complete the project.

The head was too complex a shape for me to make quickly and easily in acrylic, so when I found a pack of five white A4 sheets of foam board at The Works for £3 I was delighted. I began by sketching head shapes and then making paper templates I transferred onto the boards before cutting with a knife. I had some grey spray paint left over from something else which wasn’t a bad match for the body, so applied a couple of coats and then hot-glued four of the pieces together. I’d drilled a hole in the front of K9’s body to pass through the wires for the red LED and made another in the base of his skull. I used a short corner section of black drain pipe for the neck, threaded the wires through and glued the neck onto the body. Then I soldered the LED (and a resistor, of course) to the wires and glued the rest of the head together before sticking it onto the top of the neck.

The arcade button and blue LED were pushed through holes in K9’s back and also soldered to their respective wires before glueing the back onto the top of the body.

This picture shows the mess of wires and parts inside K9.

K9 internals

Shopping list:

Stuff I already had in my maker box:

Doing a larger project like this is fun because it has really got me to do some problem solving and has made me work with materials I’ve not used before (or not for a very long time).

Do let me know what you think in the comments – how would you do it differently, or what would you like to build as a robot?

Raspberry Pi camera

Avenue evening

I do like a timelapse.

I recently subscribed to The MagPi magazine, and as a welcome gift received a Raspberry Pi Zero W, official Raspberry Pi case, camera connector cable and a few other bits and pieces. I already had a Raspberry Pi camera module knocking around, and as the case comes with a front that has a hole pre-cut for the camera, this gave me the perfect excuse to lash them all together.

Here’s a full list of parts used in the project:

  • Raspberry Pi Zero
  • Official Raspberry Pi Zero Case with camera connector
  • Camera module
  • ProtoZero board
  • Pimoroni Blinkt!
  • Male GPIO header
  • Female GPIO header
  • Right angle GPIO header
  • 3 tactile buttons
  • Hook up wire
  • Suction cups

I wanted to use buttons to trigger the starting and stopping of the timelapse, and to be able to take a single image, and planned at first to solder wires onto the back of the Pi Zero and hot glue some small buttons onto the case. Then I thought it’d be nice to also include an LED to show if the camera was on or doing something. (Everything is better with LEDs, right?)

This started to seem a little messy, but I remembered that in one of my boxes of bits I’ve a few ProtoZero boards from a Kickstarter a while ago. These are neat Raspberry Pi Zero sized boards with GPIO breakouts and lanes of breadboard-type sockets for components.

Raspberry Pi camera

The Raspberry Pi case comes with different fronts you can swap out. One is plain, with no openings, one has an opening for the GPIO pins and one has a hole and mounting points for the camera module. I needed to use this one, but it meant I had to solder a female header onto the back of the Pi Zero and connect the ProtoZero board onto that upside down. I added a right angle GPIO header to the ProtoZero board which let me add a Pimoroni Blinkt! for lots of LEDs, instead of just one.

Raspberry Pi camera

I was surprised, and relieved, when this rather hacky set up worked and my first attempt at running some code for the camera actually translated button presses into action.

Despite lots of trying, and lots of bad code, I’ve not been able to work out how to make a button interrupt a process and reset the Pi ready for another event, so I changed plans slightly and now have one button to take a single still image, one to start a half hour long capture of 120 images for a short timelapse and the third button to keep on taking pictures for a timelapse until your inelegantly pull the power out.

The Blinkt! lights shine white on booting up to show the camera is ready. When you take a single photo they flash red then reset to white. During a timelapse they display a column of lights counting up to the next image capture and flash red when a photo is being taken, so you’ve some idea when the next picture is due.


To put the timelapse together I FTP into the Pi, copy the images onto my MacBook and use iMovie to make them into a video.

The code is on GitHub – please comment if you can see improvements or have any ideas for me. I’m not a coder and would love to hear your suggestions. I found the GPIO Zero documentation to be really helpful, especially the recipes, and Alex Ellis‘ blog post was inspiring.

Finally, to secure the case to a window Frederick Vandebosch came up with this case mod just in time, so I ordered some suction cups off eBay and got cracking with my craft knife.

I’m really pleased with how this has turned out – even though it doesn’t have the functionality I intended when I started out I think the project has turned out really well.

Corpse Reviver no. 2

This weekend we stayed at Stow House, just by Aysgarth Falls in the Yorkshire Dales. We have history with the place, having been back several times since our wedding reception there in 2000.

In the last few years Stow House (built in the 1870s for Reverend Stow who was Rural Dean of Wensleydale and a keen photographer) has been brilliantly refurbished by Sarah and Phil Bucknall who aim to provide beautiful rooms, excellent service and punch-packing cocktails. On Saturday before we went out for dinner, Sarah made us one of those cocktails and it certainly lived up to the mission statement. Rather than offering a full cocktail menu, Sarah asks what you like as a base for your drink and then suggests something for you. We went with gin, and Sarah offered us the Corpse Reviver No. 2, adding that it was one of the drinks made by Harry Craddock at the Savoy, and recorded in his Savoy Cocktail Handbook.

The recipe requires equal measures of gin, lemon juice, Cointreau, and vermouth to be shaken with ice and strained into a glass that’s had a rinse of absinthe. Lots of the recipes online specify Kina Lillet – as used in James Bond’s Vesper – for the vermouth, but that’s not available now so I reckon you can use whatever you’ve got in the cabinet. If you’re short of absinthe I expect you could get away with using pastis for an anise flavoured rinse.

Sarah’s Corpse Revivers were delicious, with an orange-and-lemonyness not unlike Inamoratas. It’s a refreshing drink that we’ll definitely be mixing at home, but I’m not sure I’ve the strength of constitution to drink it as a hair-of-the-dog.

Boozy book safe

There are loads of guides for making book safes on the internet and all the ones I looked at are pretty similar. The main ingredient is a book thick enough to hide your stuff.

Book safe

I had pretty specific requirements; I wanted to be able to store a drinks measure and a small bottle, so I went for my six novel James Bond anthology (when I did @bondsbooze I bought them all individually so I don’t feel any guilt about gluing the pages together and hacking a big hole through them).

We went away for the week recently and I was able to squirrel the measure and a bottle full of sugar syrup into our luggage, but I could have easily snuck a couple of miniatures in there. I think Q would approve.

I’ve broken my radio!

I’ve been trying to add new features to the radio in my previous post.

It’s meant to display the current time on the 7 segment display unless you push the button to change station. Then it displays the number of the new station from the playlist (Radio 1 is 1, Radio 2 is 2… you get the idea) for a few seconds then return to showing the clock. The clock runs as a subprocess called by Popen and I can get it to stop to allow the radio to show the new station, but then I can’t re-start the process. The code is here on GitHub, with the related config.py and is repeated below.

It’s line 42 that reads config.proc_Popen that’s got me baffled. If you’ve any clever ideas please leave a comment.


import time
import datetime
import os
import config
import subprocess
from time import sleep
from gpiozero import Button
from speakerphat import clear, show, set_led
from signal import pause
from subprocess import check_call

def shutdown():
    os.system("mpc stop")
    check_call(['sudo', 'poweroff'])

def retune():
    config.station += 1
    # Assumes there are 7 stations
    if config.station > 7:
        config.station = 1
    os.system("mpc play "  + str(config.station))
    # updates the Speaker pHat LEDs to show the station
    for x in range(config.station):
    # stops the clock subprocess and shows the station on the 7 seg  
    config.proc_Popen # This is the bit that's got me baffled.

shutdown_btn = Button(17, hold_time=3)
shutdown_btn.when_held = shutdown

retune_btn = Button(23)
retune_btn.when_pressed = retune

# starts clock.py

# sets the Speaker pHat LEDS to indicate the station
for x in range(config.station):
os.system("mpc play " + str(config.station))
Older posts

© 2017 James West

Theme by Anders NorenUp ↑