Opla IoT Kit - Home Security Project - Movement Alarm not working

Hello,

The Movement Alarm (PIR sensor) is not working for me. The others two (Light, Shake) work fine. The sensor is recognised as digitalRead(pir) returns 1. Also when I disconnect the PIR from the carrier the alarm is triggered. However no movement is detected at all.

Any advice?

Thank you,
Alexandre

So for me this sensor was not working until I made some changes and looked at the serial output to figure out what was going on.

First I played with the potentiometers on the side of the sensor. I adjusted them until I saw the value change on the serial output whenever I moved around the sensor. After I made these changes, if I move around the sensor the value will briefly change from 0 to 1 and then back to 0 once movement has stopped.

Because the sensor value is changing to 1 when it detects movement, I changed the code to check for HIGH:

//movement alarm, can be activated from cloud
if (movement_alarm == true) {
if (pirState == HIGH) {
movement_event = true;
}

Now it seems to work pretty well for me.

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