Get all your news in one place.
100’s of premium titles.
One app.
Start reading
Tom’s Hardware
Tom’s Hardware
Technology
Ash Hill

Anyone can control these IoT-enabled dorm room traffic lights

Raspberry Pi.

Sometimes you need a project that can really motivate you to go—or in this case, also slow down and stop. Today we've got just such a creation thanks to maker and developer Riley Hutton. With the help of an ESP32 microcontroller, he's managed to modify a decommissioned traffic light so that anyone can control it remotely from a web browser.

According to Hutton, the project began as a decorative light piece for his dorm room at University. The idea was to make it web-controlled so that other students could check it out and activate the lights from a webpage. After it was completed, however, Hutton decided to release the project to the world by posting a link to a livestream video of the traffic light over at Reddit. This was met with great success and thousands of visitors visited the website to interact with the salvaged hardware.

We took the opportunity to reach out to Hutton who shared more details about the project and its creation. Hutton confirmed that at one point, the website had over 12,000 visitors and 100 people trying to change the light at once. This was enough to blow the green light, forcing a rapid repair. The traffic lights will change instantaneously but there is a 3 to 4 second delay in the video feed.

You can view the livestream and control the traffic lights via the embedded content below.

Trying to control a traffic light can be tricky, especially if you haven't tinkered with one before. Hutton explained that he found a transformer behind each bulb that's used to step down the UK mains outlet 230V power to a modest 12V AC. To control these transformers, he's using solid state relays instead of mechanical relays as they silently operate (although we do love the click of a mechanical relay.)

Hutton chose the ESP32 after using the ESP8266 in a myriad of projects. The ESP32 has a faster clock speed, providing extra bandwidth for the many users attempting to DDOS a traffic light. Programming the ESP32 was made possible via the Arduino IDE, Hutton also took the opportunity to add an OLED display for debug purposes.
We know what you are thinking. "Could a Raspberry Pi Pico W do the same job?" The answer is yes, and the Raspberry Pi Pico 2 could also do a great job, you'll just need to hack Wi-Fi onto it... with an ESP32!

(Image credit: Riley Hutton)
(Image credit: Riley Hutton)

The ESP talks to the web app using an MQTT broker with the help of Amazon Lightsail. The webpage uses this MQTT broker to receive the user input. The ESP32 subscribes to the correct MQTT topic, then waits for input. As a user clicks on the web app, it publishes a message via MQTT to the broker, where the subscribing ESP32  is waiting. This provides real-time control of the lights used in the traffic lights, with only a few seconds delay being visible on the YouTube livestream

If you want to see this project in action, you can check it out over at Riley Hutton's website. Hutton will be a guest on a future episode of our show, The Pi Cast.
We also recommend perusing our list of best Raspberry Pi projects for more cool creations from the maker community.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.