Monday, 10 November 2014

Pedestrian Crossing



What you see here is a working model pedestrian crossing, specifically a Puffin Crossing as is increasingly being used in the UK. I built this as a Christmas present in 2008 for a younger member of the family, who had just got very interested in traffic lights, and was starting to understand what the red man and green man at the crossing mean. This seemed like too good an opportunity to miss for something both enjoyable and educational, and that's not just for the young recipient, but also for me in building it! It was a pretty instant hit with the recipient too, and he's spent the days since playing with it.

Design and Construction

Pelican or Puffin crossing?

Pelican crossings are perhaps better known, but seem to be rapidly being replaced by Puffin crossings. The Puffin crossing has a simpler arrangement of red and green man signals, i.e only on the push button unit, and not distant across the road. This also makes for an easier design for a single pole model, as a representative sample of all the operational parts can be included on a single pole. On this basis, a Puffin crossing was chosen.

Puffin crossings use regular UK traffic light sequences for the traffic (i.e. red and amber appear together, and there is no flashing amber). Similarly, there is no flashing green man.

However, the flashing green man is one area where I departed from the Puffin crossing, and used the Pelican crossing sequence with a flashing green man phase to indicate finish crossing, but don't start crossing. This was done because the child is likely to come across Pelican crossings as a pedestrian, and having this in the crossing sequence is a useful education, even if not 100% accurate. In practice, a Puffin crossing (unlike a Pelican crossing) doesn't provide visible red and green men whilst crossing, so it has no need of such an indication.

Puffin crossings monitor the progress of pedestrians across a crossing rather than just operating for a timed period like Pelican crossings. However, in the context of a model toy, timing is used, and there is no sensing of positions of pedestrians, unlike the real thing.

Control

A simple PIC microcontroller is used for the control. The PIC is able to drive 25mA directly from its outputs and includes internal reset and clock source, so other than a few resistors to limit LED current and provide pullups/downs, no additional control components are required.

Sequence of crossing:

1
2
3
4
5
6
1

The crossing stays at step 1 until the crossing button is pressed. It then stays at step one for a further 5 seconds, so child doesn't get the impression a change of lights will happen immediately. In the toy, the remaining steps then follow through on different timers, until we get back to step one. During step 4, there is also a beep - beep - beep - beep sound, like a real crossing. Pushing the button after step 4 will result in the sequence going around again when it gets back to step 1. As mentioned earlier, we also have a step 4a which is the flashing green man, although this is strictly not correct on a Puffin crossing.

Construction

All the parts used are standard electronic contruction parts, except for the pole which is a plastic coated steel tube which is part of a net curtain rod, and handily includes a plastic knob on the end which looks a bit like the top of a traffic light pole. The plastic knob seemed to be firmly attached (an important consideration for a child's toy).

The lights are all LEDs. Standard 10mm ones are used for the traffic lights. The red and green men use clear 5mm LEDs which light a white reflective surface behind cutouts of the red and green men profiles.

A sounder produces the beep - beep - beep - beep sound during the [steady] green man crossing period. This is set to a low volume so repeated operation of the toy doesn't annoy the parents!

A battery compartment is fitted inside the case (screwdriver required for access, as is normal with toys for the young). D cells were chosen to give long battery life and to provide a good weight in the base to prevent tipping over when the pedestrian button is pressed.

I only had about 6 hours to design and build the unit. This included the electrical breadboarding to make sure the PIC could drive the LEDs without any buffering, and selection of current limiting resistors to give matched illumination from the different coloured LEDs, not to mention writing the software. Also, looking up some parts of the Puffin crossing specification to get the sequence right.

One feature I designed, auto power-off, I didn't initially have time to breadboard and implement in the hardware (although it is in the software), so that got missed out, and a separate on/off switch had to be added, much as I wished to have got away without one. A couple of years after first constructing the pedestrian crossing, I got the unit back for a day, and added the auto power-off hardware, allowing the on/off switch to be removed.

In Use

I noticed a small bug in the software during the first day, and reprogrammed the PIC to fix that after the little one had gone to bed. Another issue I noticed was due to not using a pullup in the PIC's reset line - it sometimes took up to 3 seconds to come out of reset when powered-up, which is something that didn't happen on the breadboarded version. I fixed this too.

I was concerned about the strength of the bond between the pole and the base-box. All I had time to do was to superglue it, and I would have preferred to do something stronger. A 2½ year old doesn't have a good understanding of fragility. Having said that, it's been carried around, dropped, hit with a hammer from another toy, and it stayed in one piece for a couple of years, but the bond did eventually break, so I modified a small brass plumbing fitting to fix the pole to the base.

It was certainly well appreciated by the child, and that's the main thing. A few years later, he took it to school to show the rest of the class.