When are the lights on?


The Things Network User

Posted on 18-11-2017

A small and simple application using LoRaWAN and TTN.

We have on our garage yard moting detectors to switch on the lighting when some motion is detected on the yard. These detectors should trigger only when some things (people, cars, ...) move on the yard.
Over the years I wondered about when the lights are really switched on, as I was suspicions about that they were even on when nobody was on the garage yard.

To provide an answer for, I had the idea that I could use my already installed TTN-Gateway nearby.
I built a simple LoRaWAN beacon, which get its power from the same power source as the lights on the yard. This beacon sends about every 15 seconds a signal over LoRaWAN to TTN thru my gateway. This way I get the beacon signals only when the lights are on. When the lights are off the beacon gets no power, it remains silent. To display the data I use the TTN data storage integration to buffer the data, poll from there the data records in regular intervals, write them to a local MariaDB database, and display the data with a D3.js generated interactive heatmap, as seen in the picture. This heatmap shows darker colours for high number of 'pings' per hour. Clicking on a hour displays the respective hour detailed down to one minute intervals.

This application has already proven ist value. Now I know that strong wind triggers the motion detectors, probably due some moving tree branches visible by the sensors. This is seen in the picture in the first two rows, these days we had strong winds here. The next step is to optimise the field of view and sensitivity of the motion detectors.

When time allows, I will provide more details about this application, including the my source code under a open source license.