NodeMCU PIR Sensor Not Stable

Hi All,

I have created a motion sensor but the problem is that is not reliable. Sometimes goes into detects mode but in fact there is no movement at all. I have many doubts on the hardware (nodemcu, pir sensor, wires or power supply).

I have installed EspEasy in nodemcu and I have this configuration in HA.

binary_sensor:
  - platform: mqtt
    name: "Motion Living Room"
    state_topic: "/Nodemcu/Motion/Motion"
    command_topic: "/Nodemcu/gpio/15"
    payload_on: "1"
    payload_off: "0"
    qos: 1
    retain: true

I would appreciate if anyone can give me a hand.

Hardware parts:

Nodemcu

PIR Sensor

Wires

I tried to help someone with a similar problem in this thread. Unfortunately, I’m not sure he ever got his working.

Thanks.

I suspect you have the same setup. Is it reliable for you?

Yes, it has been for over a year - although I had to replace the NodeMCU once after a power cut.

I did however, have to shield the PIR from the NodeMCU when I put it all in a box. See this post

Hi, that sensor suffers from RF interference (there was a video on Bruh’s Youtube channel on this). Either use long (very long, like 40 - 50 cm) cables or get one of these:

https://www.aliexpress.com/item/HC-SR505-Mini-body-induction-module-SR505-Human-body-induction-switch/32831310829.html?

Or go with microwave:

https://www.aliexpress.com/item/1PCS-RCWL-0516-Microwave-Radar-Sensor-Module-Human-Body-Induction-Switch-Module-Intelligent-Sensor/32799533784.html?

Guys,

Thank you for your feedback.

I will chime in as well. I have tried more than 5 different SR 501 sensors as gpbenton referenced in my thread.

After lots of different shielding options an wired/wireless attempts, I think that the wires connecting my PIR to the NodeMCU or Raspberry Pi nano were SOME (not all) of the issue. However, after a full day of testing long, shielded cable, I found that the sensor stopped working and I gave up. I wish I had been able to get my homeassistant solution working, but it was just taking too much of my time to troubleshoot trying to get a stable reading. I have resorted to the NEST Secure solution.

Though, I am very intrigued by both of the sensors mentioned here. The NEST sensors (which are very impressive) work great and they use PIR…so it must be possible to get things working.

I would say I am facing more or less the same issues. I have ordered a new model already as @Petrica suggested above. In case I manage to get this thing working, will let you know.

Hi guys,

If you don’t have special security requirements and only want to use the PIR sensors for triggering the lights at home, then I highly recommend 433 mhz PIR models P819 and P829 on Aliexpress, combined with an Arduino Uno/Mega gateway running OpenMQTT.

P829 is a little more fashionable and is also sending signal for low battery (also refer to below dual power) but P819 should be more than enough in most of the cases and during sales period can be found in bulk for about 5 USD/piece.

Both P819 and P829 have dual powering modes (battery and 5V micro-usb cable) so they are not influenced by power losses. They can be used connected to the micro-usb cable (so to is the NodeMCU PIR, thus no difference in operating mode); I’ve run tests and when the power loss occurs, switching to battery is instantaneous. Anyway, in about one year, the batteries have lost less than 20% of their original voltage so battery only mode should be quite sufficient (add up the fact that it doesn’t need approval from higher authorities to lay down inaestheticall cables around the room :slight_smile: )

Regardless of the security concerns (the 433 mhz signal can be picked up by your neighbor’s kid; however jamming the 433 mhz signal is unlikely), an attacker is more likely to succeed on the NodeMCU powered PIR if it turns off the power and you don’t have UPS backup for your devices. Also, there is another vector of attack for wireless devices (represented by your router’s wireless security). In most of the cases 433 mhz devices are quite secure (except for arming and disarming the home alarm system for which an alternate method should be opted for).

Hi I bought some of microwave sensor, bu they are no reliable too. I have so many false alarms.
First I tried on GPIO on Raspberry, them in one nodeMCU 1.0, same result in both .

Capturar

Hi,

Please include also the hardware details (what type of microwave sensor, if it came with its own casing or it was connected to a micro controller unit (MCU), what type of MCU - Arduino Uno/Mega/ESP8266…, what firmware/sketch was loaded for the MCU - Bruh/OpenMQTT/ESPEasy/…, connected over MQTT/…, etc.).

The same sensor you publish in Mar 4.
https://www.aliexpress.com/item/1PCS-RCWL-0516-Microwave-Radar-Sensor-Module-Human-Body-Induction-Switch-Module-Intelligent-Sensor/32799533784.html

First I used in same Raspberry I have HA them in a ESP-12F module MINI nodemcu:

I used it before on my Raspberry to take photos , but my programming only take photos after a one amount of detection.

So I’m think to do the same kind of solution on this nodmcu , by the way I use Arduíno IDE to program this.

That’s the best description I can do whit my por Knowledge and English .

No worry :slight_smile:

Can you run OpenMQTT on the board? (GitHub - 1technophile/OpenMQTTGateway: MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LORA.)

Use the same settings as for HCSR501 with the 5V input (3.3V on the microwave is not for input).

What do you mean by

?