Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!

Glen Akins' Bike Rack Gets Smart Yet Accessible Lighting, Thanks to Zigbee, MQTT, and Python

Powered by a Nordic nRF52840, a simple pair of satisfyingly-chunky push buttons uses Zigbee, MQTT, and Python to tame smart lighting.

Maker Glen Akins is making smart lights smarter once again — this time adding waterproof physical buttons to control landscape lights over Zigbee.

"We had a much wetter than normal summer here last year. My bike (and myself) were often too muddy to bring in the house after a ride," Akins explains of the inspiration behind his latest lighting project. "I'd either get done with a night ride or get home after dark after a long drive home and couldn't see to rinse the bike off in the backyard bike rack I built many years ago. I decided I needed some lights for the bike rack and I wanted to control them outdoors with real buttons. I did not want to need to dig my phone out of my pocket or take my gloves off or walk in the house to control the lights."

When you don't fancy digging out your smartphone to trigger your smart lights, there's only one answer: physical buttons. (📹: Glen Akins)

The actual lights themselves are off-the-shelf pathway lights, which can be set to output a warm white light or a color of the user's choice via the company's proprietary smartphone app. When you're back from a cold, muddy bike ride, though, you might not want to dig your phone out of your pocket — which is where Akins' physical buttons come into play.

"I selected some generic 22mm momentary mushroom head push buttons in bright colors. They’re listed as IP65 but I’m a bit skeptical," Akins writes of the chosen chunky buttons, finished in red and green for off and on respectively. These were fitted to off-the-shelf IP65 enclosures into which Akins fitted a custom control board based around the Minew Semiconductor MS88SF2 module, built around the Nordic Semiconductor nRF52840 — a device low power enough to run from a CR2450 coin cell battery attached to the board's rear.

Zigbee2MQTT with a custom converter proved capable of listening out for a button push, transmitting actions to an MQTT broker for consumption by a subscribing Python program. This then handles actually controlling the lights, bypassing the need for the proprietary smartphone app through the use of the TinyTuya Python library — something with which Akins was already familiar thanks to a previous project in putting patio lights from the same company under Python control.

Full project details are available on Akins' blog; source code and board design files are available on GitHub under an unspecified license.

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