Arduino Home Alarm ee system

Hi guys,

I’m totally new to Arduino and programming.

I would appreciate any help I could get here.

I am using a Arduino UNO R3 as the base of the system. I want to eventually connect 4 pir sensors around my house to this system. I have experimented with a few beginner sketches so far and was successful.
I found some excellent code online which uses resistors across the nc points of the sensors to safeguard against tampering. I successfully tested this code using 1 of my pir’s.

My problem is that i want to add more to this sketch, but I’m still an absolute beginner at this.

The code I’d like to add is the ffg:

  1. I have a non latching remote receiver which I want to use to arm the system - So I need to add the toggle sketch to the existing sensor sketch (I have tested the toggle sketch on it’s own and it worked well) he problem arose when i tried to combine both sketches - It just didn’t work :confused:

  2. I need 1 of the digital outputs to activate a 5v relay when an alarm condition is detected - The relay will activate a 12v siren (Maybe for about 15 seconds)

  3. As per the sketch now the led only lights up for the duration of the pulse received from the pir - I’d like to add another set of Led’s that would stay lit if an alarm condition was received from one of the zones. This should reset back to off by maybe a reset button or by powering down the system and then powering it back up.

I have attached the sensor sketch and circuit diagram of rthe resistors and led I have used so far.

Any help would be highly appreciated,


security-sensors-schematic.pdf (4.72 KB)

Welcome to the forum!

As a self-proclaimed beginner you’ve tried to run before you can walk, IMHO. After analysing your description everything seems possible but you’re just asking for a solution, not help with a problem you’re experiencing whilst trying to devise a solution by yourself.

Break down the entire project into discreet steps and then, as they say, start at the very beginning and formulate what you are trying to achieve and ask yourself “Can I do this?”. If not, you need to read up, investigate, research and ask very specific questions here with examples of your code with which you’re having problems.

The Arduino world is fascinating and overwhelming - don’t be in a rush and try and learn as you go (this is not meant to sound patronising but I’m urging you to reign in your natural desire to getting a complete solution by tea-time tonight!).

Post back here when you have a specific question on a part of the solution which you have tried to solve but are hitting brick walls. Good luck with your endeavours and never, ever be so discouraged you think of giving up - that’s where this forum has mega-genius level contributors who can help you.

the sticky on each forum
pay attention to how to use code tags.

if you want to post your code, use code tags.
or create a txt file and then attach that.
as for your pdf, nice, but better to embed the jpeg into they body, but resize it for the screen.

oh, this statement " - It just didn’t work :confused: "
is about as useful as “I tried everything” or can you go to the store and get me that thing.

I will tell you it DID work, and it worked EXACTLY the way you programed it to.

more correctly you could have said, the results were not what I had expected or hoped for.

we are here to help you get to where it works they way you want.

to that end, please posts both working codes.
and your non working one.

Do you have pets, or are you likely to have them in the future? The pir sensors can false alarm on pets, even when they are supposedly set to only detect large objects. I use radar sensors (no pets) but I back that up with an ambient noise sensor, and only alarm if both motion and a higher than normal noise level is detected. Of course, dogs do bark...