A Wireless Motion Sensor Array – Part 2

In part 1 I got the RF links talking to each other. In this part I’m going to wire up the PIR sensor so the alarm only goes off when it is tripped.

Upload this sketch to your transmitter Arduino (very, very close to the initial sketch) :

The only thing I added was a new unsigned long global variable called alarmTime and a conditional in the loop() function. The conditional (if statement) checks to see if pin 2 is HIGH (indicating the PIR sensor sees something), and that at least 5 seconds has gone by since the last alarm. If those conditions are met it fires off the alarm using the same function that sends “A1” out via the 315MHz transmitter.

Wiring :

  • PIR + to the 3v3 power pin on the Arduino
  • PIR – to the GND pin of the arduino
  • PIR data/signal to digital pin 2 on the Arduino

I put the PIR sensor in my vise to keep it pointed away from me – just make sure it isn’t pointed right at you or it will continually go off.

That’s about it. Plug it in and wait a few seconds for the PIR sensor to settle down, then wave your hand in front of the PIR sensor and the buzzer on your receiver should go off.

Nifty, eh?

2 comments to A Wireless Motion Sensor Array – Part 2

  • Harry Vaughan

    Tried your wireless motion sensor. The only thing I had trouble with was where in part 2 you say to Upload this sketch to your receiver Arduino. does’t work you need to Upload this sketch to your transmitter Arduino.
    Then it works great. Thank you Harry Vaughan. PS keep up your great work.

  • Oh, wow, you’re absolutely right Harry! I just edited the article to fix that. Thanks!!

Leave a Reply to mitch Cancel reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">