sensor Pir


good afternoon,

have here pir sensor detects movement when wire has 4.80ve not detect when thread 0.06v.
it turns out wanted arduino sleep, , when detects movement arduino wakes up.

throughout project have keypad wake arduino. can not sensor wake arduino.

my test code

quote
#include <avr/sleep.h>
#include <virtualwire.h> // lib para rf~

void setup()
{
    pinmode(13, output);   
pinmode(2, input);
digitalwrite(2, high);
vw_set_tx_pin(3); // porta que vamos usar
vw_setup(2000); // bits para comunicação
}

void loop(){
digitalwrite(13, high); 
delay(3000);
  entersleep();
}

void pin2interrupt(){

}

void entersleep()
{
  digitalwrite(13, low);
  attachinterrupt(0, pin2interrupt, low);
  delay(50);
  set_sleep_mode(sleep_mode_pwr_down); 
  sleep_enable();                 
  adcsra &= ~(1 << aden);
sleep_mode();   
detachinterrupt(0);
sleep_disable();
}

code: [select]
  attachinterrupt(0, pin2interrupt, low);
not wake sleep. need study various options interrupt trigger, , choose appropriate one. low correct choice.


Arduino Forum > Using Arduino > Programming Questions > sensor Pir


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62