empty

4-way toy traffic light



Scoured some 20 toy and collectibles stores in search of a model/toy traffic light that I can hack and modify. Not a single one had. Unbelievable! So over the week I painstakingly constructed my own 4-way light out of 12 LEDs, a pseudo-lego piece, the tube of a spent marking pen, an AA battery case, and wires of course. Used cyanoacrylate glue, hot melt glue, and epoxy to hold them all together. Spray painted it black all over.

Not pretty at all. It looks worse than any signal light in Japan after it’d been felled and drowned by this week’s Sendai tsunami. Good thing my nephew didn’t mind its looks. Just hope it’s strong enough to withstand the temblors from a 6-year old.

A Microchip PIC 12F1822 microcontroller is the brains behind the lights. To minimize power consumption its internal clock is set to just 125kHz. (This baby is capable of running at 32MHz!). A tactile switch allows the user to cycle between four modes:

1. Lights for opposite directions are on simultaneously. That is, when North-South is red, then South-North lights are red too and when NS is green SN is green too. Same with East-West and West East.

2. Light is green only in one direction at a time. This implies that for the direction that’s green left-turning vehicles can do so at the same time.

3. Four-way flashing yellow

4. Four-way flashing red.

Just for fun I was tempted to add a four-way flashing green albeit at a much faster blink rate (say, 2 to 4 Hz). Would allow my nephews to have cars from all directions crashing into each other and getting a pile up. But I eventually backed out–it’s not a good way to train future drivers :)

Three AA batteries provide the juice. No current-limiting resistors are used for the LEDs. Measurements show they’re not needed. Only four MCU pins are used to switch the LEDs. Charlieplexing is employed to turn one LED in each of the four directions for 4milliseconds every 16 milliseconds (25% duty cycle). That’s a frequency of around 62Hz–enough to fool the eye into NOT seeing the LEDs switching on and off that rapidly.

There’s no on/off switch. The MCU goes to sleep 10 minutes after the last button press. When asleep pressing the button wakes it up and the light resumes in whatever it mode it was in.


Post time: Jun-17-2017
INQUIRY NOW
  • * CAPTCHA: Please select the Flag