Smart Stair Treads Light the Way Based on Two Time-of-Flight Sensors Processed by a Raspberry Pi

Powered by JavaScript and a Raspberry Pi Zero W, these smart stairs trigger customizable animations when you trigger a sensor.

Gareth Halfacree
2 years ago โ€ข Lights / Sensors / Home Automation

Pseudonymous maker "SchizoDuckie" has given a Raspberry Pi Zero W single-board computer a very important task: Triggering smart stair lighting, from time-of-flight sensor data, so his girlfriend with poor night vision doesn't take a tumble.

"You're actually looking at v2 of this system," SchizoDuckie explains of his build. "v1 used an ESP32 and a 16x relay board with PIR sensors, v2 uses a full blown Raspberry Pi Zero W with NodeJS to listen to incoming sensor data over MQTT which controls two cheap PCA9658 16-port PWM multiplexers so I can also control that last 17th step of the stairs [and] still have spare channels left. All of it is powered by a single 4A 5V power adapter, but the whole thing also works from a USB powerbank for days."

Trigger a time-of-flight sensor and these stairs light up in customizable JavaScript-driven animation. (๐Ÿ“น: SchizoDuckie)

The system is built around two sensors, located at the top and the bottom of the stairs respectively. "[They] consist of an ESP-12 with a Time of Flight sensor hooked up," the maker explains. "Basically a little laser beam that gives you a distance in centimeters. If the distance changed, somebody passed it and an animation triggered."

Once triggered lighting built into each stair tread plays an animation which can be created, customized, and previewed in-browser. Each stair tread is treated individually, allowing for surprisingly complex creations.

"I managed the wires from behind, there's a breaker box and storage below the stairs," says SchizoDuckie of the build. "Each step has a pair of some split up UTP going to it and it all bundles together more near the end. Loads of zip ties along the stairs themselves and in the breaker box it comes together routed through two pipes of PVC which then goes some flex wire management sleeve and into the 3d-printed control box that houses everything."

More details on the build are available in the project's Reddit thread, while SchizoDuckie has pledged to publish a more detailed guide and wiring diagram once a second installation has been completed on the building's attic stairs.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles