Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pir sensor wiring for nodemcu esp32
#1
I have a kincony pir sensor but still waiting to receive the A4 board so in the meantime I was thinking to wire it to a nodemcu esp32. 

Looking at the wiring diagram https://www.kincony.com/how-to-use-pir-sensor.html


How should I wire the signal and COM to a nodemcu ? 

Is the signal just a 3.3v so I can just connect it to any gpio ?
What about the COM ?

Thanks
Reply
#2
PIR output is dry contact. you can connect PIR output to GPIO of ESP32 directly. PIR's COM with ESP32 GND.
Reply
#3
Thank you, a follow up question

I opened the sensor and i see there is a COM and then one NO and one NC connector.

If i connect the COM and NO it works as expected, but if i connect the COM and the NC to the esphome device it behaves exactly the same .... the binary sensor is OFF until motion is detected and then it switches to ON

I would expect the 2 type of connection to be inverse of each other and so if i connect "COM" to ground and "NC" to the GPIO input pin the binary sensor should be ON until motion is detected and then switch to OFF

what am i doing wrong ?
Reply
#4
ESPHome can set "invert" ture or false.
Reply
#5
Thank you.

I know but that is not the point. That will onlyaffect esphome

The problem is that if I connect "com" and "NC"  or "com" and "NO" the sensor behaves the same. In both cases it behaves as if it was a Normally open connection.

It does look like there is something wrong with the relay
Reply
#6
that need check sensor with your multimeter.
Reply
#7
Will do. What voltage do you expect for NO and NC?
Reply
#8
you can use any voltage with NO, NC, it just a relay contact.
Reply
#9
> you can use any voltage with NO, NC, it just a relay contact.

Then i am not sure what do you want me to check with the `multimeter`

can you be more specific ? do you want me to check

* voltage when NO
* voltage when NC
* Resistance when NO
* Restistance when NC

?

Never mind, i moved the sensor to another board where i don't have such a mess of connections and configuration, simply configured as

```
binary_sensor:
- platform: gpio
pin:
number: 5
inverted: false
mode:
input: true
pullup: true # So that it fires when the sensor is disconnected and stop flapping
name: "PIR 1"
id: pir1_motion
device_class: motion
filters:
- delayed_on_off: $sensor_debounce_time
```

and it works as expected.

* When there is no sensor connected to GPIO5 -> Binary sensor is ON ( Good )
* When the NO is connected to GPIO5 -> Binary sensor is always ON and turn off when movement is detected ( Good )
* When the NC is connected to GPIO5 -> Binary sensor is always OFF and tunr ON when movement is detected ( which is what i need )


Thanks
Reply
#10
sorry, i am not understand your questions clearly. can you take a video of your problem and send to whatsapp number: +86-15381188302
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)