Whether you want someone to stay out of your room or your snack draw, this DIY security system will alert you when someone moves into its field of view. For this project the breadboard, SoundPlayer and EmailSender blocks were used.
Configuring PIR sensor
Configure the pins on the BreadBoard block as per the “PIR sensor tutorial”.
Wind the Sensitivity anti-clockwise to increase the sensing range to its maximum distance. Also wind the time delay anti-clockwise to shorten the time delay to its minimum time.
Move the jumper from the L side to the H side to allow for retriggering.
Setting up email
Using the properties of the Email Sender block populate each of the fields with whatever you want to send. For the send limit I would choose a larger time interval since your email will start filling up if someone stays in front of the sensor for a few minutes.
Initially the configuration below was attempted. The way it works is when the PIR sensor is triggered the input will go HIGH which will flow through and trigger an email to be sent and a siren noise from the computer. However I realised that after the initial trigger it would false trigger a few more times afterwards. The false triggering would eventually subside after a minute or so. I think this may have to do with some noise in the system triggering the sensor. It might just be the sensors I have, so try this first example first and if you have the same issue I have outlined how to fix it below.
I found that the false triggers would come approximately 8-10 seconds after the initial trigger and would occur a few times before going back to normal. In order to stop the false triggers from setting off the alarm system i used a switch to control the input triggers getting through to the notification and alarm system.
On the first trigger the switch gate will be closed but once the alarm has sounded the switch will be set to open using the setValue gate.
The false trigger check, checks the time elapsed from the last trigger and will only let a trigger through once it has been more than 11 seconds from the last trigger. This then flows down to the set value which will close the switch gate allowing for signals to get through to the notification and alarm system again.
The order of flow is important in this case, since the False Trigger Check must open the gate before the trigger gets to the gate. The diagram below shows the correct order that the Input must flow to allow the system to work.
If all goes well, when someone comes into view of the PIR sensor you should hear a siren coming from your computer and get an email in your inbox.
You could potentially put a few in a few different rooms and have them send separate emails that tell you exactly where the intruder is in your house, which isn’t really much help if you’re not home anyway. I guess the next step is to build a battle bot to get the intruder out of your hour house. 🤖