Why Traffic Lights are good for Computing

I’m well known for promoting the simulation of Traffic Lights using Scratch so I thought it was about time I said why and explained how good they are for the new computing curric.

In the old days,  Data Harvest with with Flow-Go box and GO software were the No 1 method of engaging pupils in the practical computing.

The Flo-Go box has yet to be bettered (or equalled) in terms of its design/sturdiness and ease of use.

The Go software had many activities but no 1 in my mind was the concept of simulating Traffic Lights.  They even provided a 1 m high cardboard set of lights with Red/Amber/Green – a wait light and a switch for whole class room

The hardware was superb but the programming software was based on flowcharting concepts.

Which was fine at the time but then Scratch came along 🙂

So, although the hardware stuff was brilliant, Scratch was such a transformation in bringing programming to young people that I switched to doing all my teaching using it and abandoned  Flow-Go 🙁

I still loved using Traffic Light simulations to teach control concepts but missed having real lights to control.

2 Years Ago
The Raspberry Pi was launched with Scratch built into it and the capability of easily controlling its GPIO pins.  The PiFace team very generously shared their code with me and I’ve built up ScratchGPIO so that Scratch on Pi can be used to control lots of hardware plugged into the Pi and we can now do “real” Traffic Lights again 🙂

Using Traffic Lights as Teaching Tool.

You can approach this in various ways – I like to use it as a bit of Road Safety exercise and a test of observation skills to see who knows what the main TF sequence is.

It turns out not many young people know the full sequence and you can have a lot of discussion on why they go Green/Amber/Red – Red & Amber/Green

(TopTip: Always start off from Green as the sequence down is much simpler than the sequence up)

So then you can get your pupils to program up the Green/Amber/Red sequence.

The move onto the Red & Amber/Green up sequence.

Then we can discuss and get into the pedestrian crossing version with its flashing Amber.

Then add in Red/Green Man – and the Wait light – and the button

So with all this we have used sequencing, repetiton and hardware input/output .

But we can also use costume changes on a TF sprite to do the same (or as well as) as using LEDs

And have a baby doing cartwheels across a crossing when the lights go to Red 🙂

I love it 🙂



You may also like...

2 Responses

  1. I love traffic lights. It teaches flow charts, timings and pure logic. I’ve done it in “normal ” Scratch and then linked to the Pi and the Arduino. The best thing is how the children use their imagination to enhance the project by adding buttons and buzzers.

  2. Anne Carlill says:

    Yes, this seems a really good way to use the Pibrella I’ve got.

Leave a Reply

Your email address will not be published. Required fields are marked *