Skip to content
All prices US$ - All orders receive free delivery, worldwide - Click here to learn more
All prices US$ - All orders receive free delivery, worldwide - Touch here to learn more
This Raspberry Pi-Powered Light Control System Uses Computer Vision to Adjust a Desk Lamp

This Raspberry Pi-Powered Light Control System Uses Computer Vision to Adjust a Desk Lamp

from hackster.io

Pseudonymous maker "Sindhu" has put together an ambient lighting control system, dubbed Sirius, powered by a Raspberry Pi 4 with an Arducam camera module attached — and supporting both standard and dimmable lamps.



"The purpose of Sirius is to adjust ambient lighting," Sindhu explains. "Sirius controls lighting by periodically taking a photo and calculating levels of brightness in the image. Then the lamp near my desk is turned on if the ambient brightness drops. The lamp is also turned off when the brightness hits the max threshold. Why is this important to me, you ask… because I prefer working in a well lit (mostly bright) environment."



While a Raspberry Pi and a camera module might seem overkill for an ambient light monitoring project — "I first started with photoresistors," Sindhu explains, "but I really wanted to use a mini cam[era]" — it's undeniably effective: Still images captured from the camera module are analyzed, using either the Python Image Library (PIL) or OpenCV, for brightness levels, which are then used to drive a connected lamp.

On the lighting side, two versions were built. The first uses a standard, non-dimmable lamp connected to a TP-Link Kasa smart plug and addressed using the python-kasa library; the second uses a dimmable Mi smart LED lamp and the python-miio library, allowing for direct control over brightness rather than a simple on-off binary.



"I started off using our existing lamp which was connected to the outlet via a smart plug," Sindhu explains. "But then I realized that I wanted to also try the same approach with a dimmable lamp. Luckily I already had one — and by I, I mean my husband had one. Much to his dismay, I ended up using it for this project."

Full details on the Sirius project are available on Sindhu's build log.

Finally - to keep up to date with interesting news, offers and new products - interact with us on facebookinstagram, and twitter.

Previous article An x86 Raspberry Pi?

Leave a comment

Comments must be approved before appearing

* Required fields