intrusion detection

Intrusino, a new friend in pIoT-land

It’s been a while since I haven’t published anything about pIoT.

This is because I have beenquite busy with many things, and one of these it’s this shiny new pIoT node, I’ve called it¬†intrusino.

It’s placed over the back door and its role is to detect when people open the door and pass by.

Its main sensors are two: a simple magnetic contact sensor and an extremely small, low power, low cost movement sensor (PIR).

Both sensors are attached to an interrupt. The node works this way: it stays in low power mode (except from the PIR, which is always on) and is woken up by either the PIR or the door sensor. If the status of the PIR or the door is different from the previous one, a message is sent. Also, each hour, the node sends its state anyway.

I have observed that the PIR sensor is not completely stable, which means that, if one passes next to it, it will produce a short burst of 1 and 0 zeros. In order to avoid sending too many packages, I have programmed the node to only send PIR updates if an update hasn’t been sent for more than 2 minutes.

In addition, I have also plugged the usual light sensor.

Here is how a single message looks like on the server:


The “movement” field is an average of the PIR detections over the last hour. The higher the number, the more movement was detected. “DoorOpen” means that the door was opened when this packet was sent.

If we look at some graphs over a day:

We can see clearly the light over the day and also the little tail around 8 PM that is the light coming from the kitchen. In terms of movement, you can see when people was moving around the backdoor, typically in the morning to go to work, or in the afternoon to go to do some shopping. That suspicious activity around 4 AM must be the cats!

The server can also be programmed with a rule to light up an LED in the bedroom whenever the door is opened. This can be used to tell people when someone is coming in, or as an intrusion detection at night!

Here’ s how the rule looks like:



I am powering this node with 3 AA batteries. This was necessary because 2 batteries were not enough to power the PIR sensor, but, be careful, the PIR needs 3.3V maximum, therefore a voltage regulator is necessary. Alcaline batteries last about 1 month. In the future I will likely try to install a small solar panel on it, given that the sensor is exposed to natural light all the day.