Turning a pedestrian traffic light into an interactive piece of art to inspire makers.
In this issue, our regular contributor Steph Piper shows off her amazing Arduino-based party light with crosswalk button. It is a great example of applying clever maker thinking to upcycle a redundant piece of hardware that would have been destined for the rubbish dump, and turning it into a piece of art. Here’s what Steph had to say about her project.
The party button project is a great, interactive way to get newcomers excited about working with electronics. When the button is pressed, just like crossing the road in real life, the slow beeps begin. Instead of the classic ‘cross the road now’ sound, the beeps transition into one of ten randomly assorted party tracks, ranging from ‘Bag Raiders – Shooting Stars’ to ‘Phil Collins – In The Air Tonight’. Meanwhile, the hacked ‘walking man’ lights up in a rainbow of colour cycling RGB.
It’s a fun project for an active makerspace, where new visitors can experience creative upcycling in an interactive way. Currently, the project is retired from it’s its present display area with the COVID-19 precautions in mind where we aren’t encouraging active touching of surfaces, but it will return at the right time.
This project began when a friend of mine got hold of some old ‘walking man’ traffic lights after a traffic light upgrade in town. He gifted me one, and I had to do something special with it.
After re-fitting the old green lights with colour-cycling RGB LEDs (no microcontroller required) I knew this project had to go bigger.
I was able to pick up a clear light dome at the right size ($15) and a real crosswalk button ($100) from Aliexpress. The crosswalk button is a giant reed switch and didn’t come with the shaking clicker in other buttons I’ve seen outside. To manage the electronics, I’ve used an Arduino compatible Mega (but a Uno will do) and a Sparkfun WAVTrigger board to manage the sounds.
The WAVTrigger board works by loading your chosen tracks onto an SD card. There’s an audio jack for plugging in your own speaker of choice and pins that can be tied to trigger specific tracks. I also needed a small speaker, and I mounted the system on a PVC pipe with old swivel chair base for easy transport.
The electronics are mounted inside two sheets of laser cut, clear acrylic. Many projects have their ‘ugly’ electronics tucked away in some kind of enclosure, but I like the idea of participants seeing the electronics as part of the display. This means that you can easily explain how it works, pointing and explaining at each component in turn. If you’ve already had a taster of Arduino, seeing the inner workings of projects like this makes it that more tangible to imagine building something similar.
HOW IT WORKS
- 9V Traffic Light
- Traffic Button (Reed Switch)
- Speaker with aux input
- Breadboard Power Supply with DC Jack
- Arduino Mega or compatible board.
- Sparkfun WAV Trigger Board
- BD135 NPN Transistor
- 3.3KΩ Resistor
- 10KΩ Resistor
- 12V 1.5A Power supply for WAV trigger board
- 9V, 1.6A Power Supply for Traffic light
This circuit takes input from the traffic button, activating both the traffic light and WAV trigger board for 13 seconds of music and light.
First, the button push is registered by the Arduino compatible Mega. As a reed switch, the button requires a 5V input from the Mega board and a link back to ground. The WAV trigger activates first, playing the first five seconds of the slow beep sound effect. At 5.5 seconds, the traffic light switches on, timed to play with the transition into the party track. To trigger the traffic light, an NPN transistor setup is needed to activate the light from the mega while using it’s own 9V power supply.
The WAV Trigger board plays music through an aux cable into a speaker, and needs to be set up separately with the board software. Load the sounds you’d like to play on a microSD card, labelled with 001 – Sound, 002 – Music and the file names correspond with the trigger pins on the board. The software lets you set up special functions like randomising the sounds that I used for this project. For the traffic sounds, I used Audacity software to mix the sounds of real crosswalk beeps with party tracks for a smooth transition.
The Arduino code for this project had to be written a bit differently to standard projects with timing delays. You may be used to the delay() function in the classic blink project. This couldn’t be used to stage the timing of the sounds and light at the same time as the delay function can’t multitask two tasks at once.
Instead of the delay() function, the millis() function was used, setting a zero time point when the button is pushed, acting as a reference point for triggers to happen at 5500 and 13000 milliseconds after this point. This means that the slow beep sounds can begin before the ‘party begins’ and the music and lights activate at the same time.
When the project is connected, opening the serial monitor shows a feed of the state of the button push to make troubleshooting easier.
You can find a repository with the Arduino code here: https://github.com/sjpiper145/Partybutton or on the DIYODE website.
This project might be undergoing some radical improvements for a public display soon, turning this prototype project into something that looks like a real traffic fixture. For updates on this project, follow Steph's twitter at @sjpiper145
If you like Steph's work, check out more on her website at www.piper3dp.com