Easter & Bank Holiday Information: Kitronik is closing for the Easter bank holidays, orders placed after the Thursday cut off will ship Tuesday 2nd April.

BBC micro:bit Pedestrian Crossing Project featured image
This Pedestrian Crossing project was submitted to us by Thomas Stratford. Thomas started this project to try out the pre-written code that came with the IET Pedestrian Crossing resource. The aim is to use the BBC micro:bit to develop a prototype for a pedestrian crossing for a local secondary school.
  Thomas Stratford is an ICT Technician for the Misbourne School. When he isn't fixing IT problems, he spends his time making, tinkering and building Electronics projects. He is currently learning about the recently released BBC micro:bit.

BBC micro:bit Pedestrian Crossing Project:

In order to create this project in the same way as the example below, you will need to source the following components: Parts List: Note: With the exception of the 5 x 220Ω resistors, all of the parts used used in this Project can be found in the Kitronik Inventors Kit. If you have the Inventors Kit you can substitute the 220Ω resistors for the 47Ω resistors that come with the Kit.

Stage 1 - The Traffic Lights:

First, I connected three LED’s to P0, P1 & P2 via series resistors as show in the picture below. Stage 1 Suggested Breadboard Layout:

BBC micro:bit Pedestrian Crossing Project -edge-connector-lights-870

 
BBC micro:bit Edge Connector Breakout Board Breadboard Connection
P0 pin Red Traffic LED via 220Ω Resistor.
P1 pin Orange Traffic LED via 220Ω Resistor.
P2 pin Green Traffic LED via 220Ω Resistor.
0V Pin Breadboard negative rail.
3V Pin Breadboard positive rail.
  Stage 1 Completed Example:

BBC micro:bit Pedestrian Crossing Project -lights-870

Stage 2 - Adding Pedestrian Crossing LEDS:

This worked well so I thought I would try adding two more LED’s via series resistors to ports (P8 & P12). I modified the pre-written program so that the two additional LED’s would also be controlled.

Stage 2 Suggested Breadboard Layout:

BBC micro:bit Pedestrian Crossing Project -connector-pedestrian-870

 
BBC micro:bit Edge Connector Breakout Board Breadboard Connection
P0 pin Red Traffic LED via 220Ω Resistor.
P1 pin Orange Traffic LED via 220Ω Resistor.
P2 pin Green Traffic LED via 220Ω Resistor.
P8 pin Green Pedestrian LED via 220Ω Resistor.
P12 pin Red Pedestrian LED via 220Ω Resistor.
0V Pin Breadboard negative rail.
3V Pin Breadboard positive rail.
  Stage 2 Completed Example:

BBC micro:bit Pedestrian Crossing Project -prototyping-board-no-870

Stage 3 - Adding The Crossing Beeper:

The final part of this project was to add a piezo sounder to simulate the crossing beeper. I connected a piezo sounder to port (P16) via a driver transistor. I modified the code once more to add this functionality.

Stage 3 Suggested Breadboard Layout: BBC micro:bit Pedestrian Crossing Project -edge-connector-all-870

 
BBC micro:bit Edge Connector Breakout Board Breadboard Connection
P0 pin Red Traffic LED via 220Ω Resistor.
P1 pin Orange Traffic LED via 220Ω Resistor.
P2 pin Green Traffic LED via 220Ω Resistor.
P8 pin Green Pedestrian LED via 220Ω Resistor.
P12 pin Red Pedestrian LED via 220Ω Resistor.
P16 pin 2.2kΩ Resistor for Transistor.
0V Pin Breadboard negative rail.
3V Pin Breadboard positive rail.
  Stage 3 Completed Example:

BBC micro:bit Pedestrian Crossing Project -complete-870

Note: The Breadboard layout shows a buzzer with leads but the completed example shows a buzzer that fits directly to the breadboard, therefore the wire link or jumper wire is connected differently. It would be better to follow the breadboard image layout as this is easier to follow. Code: The original code was written in Microsoft Touch Develop. This editor has since been taken out of commission and the code has been recreated in the Microsoft MakeCode editor, see below.
  We would like to thank Thomas for sharing his excellent project with us. For up to the minute accounts of Thomas' projects, follow him on Twitter: @MrTomsWorld

2 comments

Mark Donnison

Mark Donnison

Hi Jay, they are to ensure that the supply is correct to each of the LEDs. We used ohms law to determine the value of the resistors that would be needed.

Jay

Jay

Why do we need the resistors?

Leave a comment

All comments are moderated before being published