← All Posts

Making a Mozilla Webthing — A Lux Sensor — Part 1

July 02, 2019

Right this second I have a TSL2561 lux sensor wired into a Raspberry pi 3B+ sat on top of the fridge.

It’s taking broadband and infrared luminosity readings every minute. The plan is to figure out what thresholds / moving averages will be required to create a Webthings “Lux Switch”.

This switch will be on when it certain lighting conditions are met, and off when those lighting conditions are not met.

In our usecase the switch should be on when:

  • the wall lights in our living room are switched on

The switch should be off when:

  • the wall lights in our living room are switched off

We’ll have to see from the data how difficult that will be. Is the sensor sensitive enough to distinguish between day light and artificial light?

components before making their way to the fridge

Front of the TSL2561 Sensor

Front of the TSL2561 Sensor

Back of the TSL2561 Sensor

Back of the TSL2561 Sensor

The wall light and the fridge

The wall light and the fridge

Next Post

There will be, at the very least, a graph of the luminosity in our living room. Hopefully I’ll also have a prototype python script for detecting the state of the wall lights.


I, Pete Taylour, shall be writing up some projects.
I'm a full-stack software dev from London Brighton.

[LinkedIn for work]. [Github for code].

© 2023