Code Club Raspberry Pi Hack Day

If you know what Code Club, the Raspberry Pi and a Hack Day are, then read on. Otherwise I’m going to introduce them to you.

An introduction

Code Club is a nationwide network of volunteer-led after school coding clubs for children aged 9-11. I run one at Queens Park Primary School in Brighton, and it’s great fun!

The Raspberry Pi is a £30 computer that looks like a credit card sized circuit board, runs off 5V and can, among other things, run linux and be used like a desktop computer. The Raspberry Pi was created with educational use in mind.

A hack day is an event where people who may not have met before all come together to create something new, by drawing on their shared knowledge and combining ideas in unique ways.

An awesome combination

The Raspberry Pi Foundation and Code Club have the same ultimate goal: to show people that engineering is creative, and improve the education system.

The aim of this event was to devise a way that schools and Code Clubs could teach kids to create something which uses the Raspberry Pi, hopefully by taking advantage of a unique feature of this device.

A Raspberry Pi connected to a TV

My recent experiments

100 Raspberry Pi’s were donated to us, but as the Raspberry Pi is a bare bones machine we were all asked to bring along power supplies, cables, monitors and any other components we wished to attach to them.

The GPIO is a series of pins on the Raspberry Pi that can sense input and provide output. These are great fun for starting out in the world of physical computing.

I had recently been playing around with my Raspberry Pi and had already made an LED blink. I’d bought a Pi Cobbler, a cable which attaches to the GPIO port on the Raspberry Pi and allows you to add switches, LEDs, buzzers, sensors and anything else that takes your fancy.

I’d also installed Scratch GPIO on my Pi so that I could control the GPIO using Scratch. Scratch is a program developed by MIT which makes it easy to code by snapping blocks together like lego blocks. It’s what we’ve been using in Code Club and comes installed on the Raspberry Pi disk image.

The big day

On the morning of the hack day I couldn’t have been less prepared. With 30 minutes until my train departed for London I was running around the house picking up everything I thought could be useful. But deciding what might be useful is difficult when you don’t know what you’ll be making yet. In the end I found that constraints are a good thing, and the things I packed helped us discover what we would be making.

I quickly settled into a group with two others, Alex Brown and Jacky Bourgeois. We decided to make a traffic light, largely due to the fact that I had a bag full of red, green and yellow LEDs with me.

A breadboard with two LEDs and a button

Our original plan was for this physical traffic light to control cars on the screen, stopping them when it’s red and starting them when it’s green. We added a button to trigger the change to red, like a pelican crossing. Putting this in the context of kids at a pelican crossing, the idea of the cars going when the light is green may have been misunderstood due to the fact that most primary school kids aren’t driving cars. We realised that what we ought to be creating is a pedestrian crossing light, where green indicates walk and red indicates wait.

A cardboard traffic light

So between cups of coffee and bags of pick and mix we created a scratch project that does just that. Press the button and 10 seconds later it’s safe to cross. The cars have stopped at the lights and a little man crosses the road. Hopefully this will be fun for kids to create and will be teaching them an important lesson at the same time.

A scene of a road, a man and a traffic light

You can see a video of it in action on Vimeo.

I’m hoping to write up a lesson plan on this that might even become part of the Code Club curriculum. But if you want to have a go in the mean time, you can download the scratch project and try it out.

Download the scratch project

You will need the following components to make the circuit:

You will also need the SD Card image for the Raspberry Pi and then install Scratch GPIO onto it.

Good luck, and have fun!

Notice: Array to string conversion in /var/www/ on line 22

Fatal error: Uncaught Error: Function name must be a string in /var/www/ Stack trace: #0 /var/www/ tags(Object(page)) #1 /var/www/ require('/var/www/joshem...') #2 /var/www/ tpl::loadFile('/var/www/joshem...', Array, true) #3 /var/www/ tpl::load('post', Array, true) #4 /var/www/ site->load() #5 /var/www/ require_once('/var/www/joshem...') #6 {main} thrown in /var/www/ on line 22