Automating lights with Computer Vision & NodeJS

A smart Computer Vision and NodeJS based solution that turns off the lights when not in use, and saves power.

Mudassir H
Dec 6, 2019 · 5 min read
Photo by Henry McIntosh on Unsplash

The Challenge

It is common to see visuals in homes and offices with illuminated spaces having few people or none in the near vicinity.

So how do we address this?

While there are a lot of smart control and automation solutions available in the market, most solutions require additional hardware to be set up at regular intervals and leads to additional maintenance costs.

Our response

The solution is to express our intention of saving energy through the eyes of a computer — through Computer Vision.

“Computer Vision, often abbreviated as CV, is defined as a field of study that seeks to develop techniques to help computers ‘see’ and understand the content of digital images such as photographs and videos.”

— Jason Brownlee, in his article on machine learning.

To illustrate, just like an eco-friendly person, who looks out for illuminated rooms or spaces, that are unoccupied, to turn off lights, our system will be programmed to do this automatically. The system will look into the incoming stream from the camera, which is essentially the field of vision of the camera. Each captured frame is divided into 4 quadrants. And if there are no people in a particular quadrant, the lights belonging to that quadrant will be turned off.

Steps to implement

  1. Import required libraries.
Since people are present in Quadrant 2, the system lights up only quadrant 2

Conclusion

This is one of the many examples to show how technology can be used for the betterment of the planet, by saving energy. You can also learn how to solve a common workplace challenge through this simple implementation.


Mudassir is a tech agnostic Engineer at Softway, who believes choosing the right problem to consider solving is dependent on the value it brings to society rather than the technology chosen to solve it. He enjoys family time on weekends and dotes on his baby boy, when not working on tech.

Stack by Softway

We are a digital agency in the business of transformation. Digital. Cultural. Procedural. Professional. We can transform anything. We do it through love — love for the work, love for our clients, and love for each other.

Thanks to Clency D' Almeida

Mudassir H

Written by

I'm a Tech agnostic Engineer. I believe in the fact that "life is too short to do repeated tasks". So let's automate

Stack by Softway

We are a digital agency in the business of transformation. Digital. Cultural. Procedural. Professional. We can transform anything. We do it through love — love for the work, love for our clients, and love for each other.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade