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.
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.
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.
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.
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.
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.
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.
You will need the following components to make the circuit:
- Raspberry Pi (available from RS, Farnell or Maplin)
- A power supply, HDMI cable, SD card, mouse and keyboard for the Raspberry Pi (usually available as a kit)
- Adafruit Pi Cobbler Breakout Kit
- 1 × Breadboard
- 1 × red and 1 × green LEDs
- 4 × 220 ohm resistors
- 1 × push to make button
Good luck, and have fun!