Please help troubleshoot AM312 sensor connection

Hi
I have AM312 PIR sensor
AM312

when I it connect directly to LiIon I get 2.99 Volts for two seconds when exist motion (shake hand)
Vcc on my scheme - it is multimetr its show me 2.99V so sensor is working and I get High level for motion
schema

But, when I create sketch and connect sensor to interrupt pin nothing happen

setup(){
  pinMode(3, INPUT);
  digitalWrite(3, LOW);
  EIFR = bit(INTF0);
  attachInterrupt(0, level, CHANGE );
}
loop(){
}
inline void level(){
  detachInterrupt(0);
  sms_count++;
  #ifdef USE_LOG
  Serial.println(F("low_lvl"));
  #endif
}

when I check Volts I get only 0.2 volts from sensor.
and when I directly connect interrupt pin with Vcc line I get on serial monitor my text, so interrupts is working, but cannot understand why sensor is not sending 2.9Volts to arduino
please help troubleshoot

Please check your sensor code without interrupts first. Eventually mode INPUT_PULLUP will help?

Vout is +2.9V
I need to catch Rise edge
with INPUT_PULLUP I can catch only falling edge. i do not understand how pull up can help me

Too many wrong assumptions :frowning:

Why don't you try what I told you?

On UNO, pin 3 is INT1, NOT INT0.

yes. correct.

I tried. as was described above . pir w/o MC returns 2.9V
interrupt also is worked w/o PIR

so... I have connected (initial) pin 4 as pull down. as it should be if we want to catch rising edge. but I dont know why this doesnt work
after that I have connected Vout from PIR direct to pin3 and its working now
hm....

It's not related, your assumptions about pullup/down are wrong.

then why after that I connected it directly it start works ?
any idea?

What did you connect? Of course the module output should be connected to an input pin, that's nothing new.

Vout to pin directly.

and removed pulldown for that pin

tried now with pin change interrupt on digital pin 11. the same shit
when pin is pull down and Vout from sensor goes to this pin then interrupt is not fired.

if Vout goes directly to pin 11 (and pin 11 doesnt have pull down) then interrupt is working

hm...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.