Our traffic lights challenge, by Rainham School for Girls.

So the first task, which is cabling up the LEDs and the Microbit to mimic traffic lights. Out of interest, do they look like this in Spain, Finland and Hungary (and anywhere else where you're reading - we're in Kent in the UK).

We connected the LEDs to the mb with alligator clips for the positives and jumper leads for the negatives (with a breadboard so that there was a common jumper lead back to the mb), but you could easily just clip all three negative leads onto one Alligator clip and take that back to the mb.

Using alligator clips we've connected red to Pin zero on the mb, amber to Pin 1 and green to Pin 2 (to the positive legs of the LEDs, which are the longer legs). We connected all of the negative legs (the shorter legs on the LEDs) to the Pin GRD on the mb.

Somebody told us years ago that it makes sense to connect a negative earth after we've connected the positive connections, so that if anything happens during cabling then at least there is less chance of a short circuit. Not so important here as it is on a car battery, but it's probably a good habit.


20170223 Traffic light cabling.png

Now we coded the lights, although we need to work on the timing... we believe a full cycle of UK traffic lights takes 90 seconds, although we're not quite sure how that cycle is allocated to each light, so we just wanted to get it going... You can download the published code here if you want to just import it:

https://pxt.microbit.org/13079-69066-91306-01544

20170223 Traffic light coding.png

Challenge 1 - can you debug the code to make the timing accurate?
Challenge 2 - can you add some script to say "walk" and "stop" or show similar picture on the mb LEDs, to sync with the lights, so that pedestrians know it's safe to cross?
Challenge 3 - can you make multiple mb lights communicate? (Not for the feint-hearted that one!)

Or can you think of a better challenge?!

20170216_193425.jpg

Good luck!!! Please add a comment to let us know how you get on, and we will too.

Matt (at Rainham Girls School) and Phil (at the IET)

NEXT STEPS: March 1st

In a STEM club kick-off meeting with teacher Matt Wells at Rainham School for Girls, we discussed the "grand challenges" for future engineers, one of which is future cities. We explored future transport and driverless vehicles, and the girls in the STEM club wanted to explore the wider challenges of driverless cars for society: imagine the cross-curricular potential of that!

So we're making a fleet of line following buggies and a small town road system of Micro:bit controlled traffic lights. The challenges include deconflicting channels on the Micro:bit controlled vehicles, controlling the speed of the buggies with the scheduling of the lights (smart traffic lights), and adding signals for the pedestrian crossings to signal with the traffic lights. Anybody ready to take on the challenge? We're planning on using it for the IET stand at the Big Bang @ Disovery Park, Kent on 17 Mar 17. Please join in at the wiki with a challenge of your own!


Microbits are going to be used at the IET stand for the 2017 “Big Bang @ Discovery Park” in Sandwich, Kent, where 1000 students will visit. They’ll be used by students for workshops, shows and more on 17 March 2017. Microbits will be used to control traffic lights, run electric motors for vehicles and as remote controls for cars, to discuss how engineers can keep people safe:



First, the teams will use Microbits to control the timing and scheduling of a small town’s traffic lights – top marks if all the sets communicate!
Other Microbits will then turn control a buggy if the lights are green, but be careful of an intruder using a rogue Microbit as a remote control! Can we use cyber-security and the internet of things to protect the traffic?
For full enjoyment of our driving trials
smiley
smiley
, go to the YouTube links at
https://youtu.be/5QyLzWkw8lc and https://youtu.be/KBeUCSELY04

Quotes from our trial drivers:

Rosi at STEM Learning: “Aaaarrghhhh”.
Tsige at STEM Learning: “Look out!”.
Phil from the IET: “You drive then!
The cyber criminal: “I can’t wait to control the entire town’s traffic!