Smart Home Automation Forum

Full Version: KC868-A8 with Motion Sensor HC-SR501
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need help connecting pir motion sensor with A8 board. Should i connect with DI 1-8 or s2, s3 terminals? 

Here is the code part I am currently using. 

Code:
switch:
  - platform: gpio
    name: "Study Room PIR"
    id: a8_study_room_pir
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: false

binary_sensor:
  - platform: gpio
    name: "a8_study_room_pir"
    device_class: motion
#    on_press:
#      then:
#        - switch.toggle: a8_study_room_pir
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: false
if your PIR sensor is dry contact signal, all port can use. just DI1-8 support wire long distance, support 300 meter wire no problem. S2, S3 port by short distance.
suggest use DI1-8 port.
I've connected my PIR to D8, but my output got stuck at "Cleared".

I did a wire short test between D8 and GND, no response. 

But when is short D8 with +12V , then the pir got detected and released when short is disconnected.

It is suppose to be D8 vs GND, what I am missing here?
what D8?? DI8? it set by your PIR sensor use by "NC" or "NO". A8 digital input just use by 0v or 12v logical voltage.
I use DI terminal 8 and PIR uses NO

This is the PIR sensor I am using https://components101.com/sensors/hc-sr501-pir-sensor
change the config line:

inverted: false ----> inverted: true
(07-07-2023, 11:15 PM)admin Wrote: [ -> ]change the config line:

inverted: false      ---->      inverted: true

I've changed the config inverted as true.

  - platform: gpio
    name: "a8_study_room_pir"
    device_class: motion
    on_press:
      then:
        - switch.turn_on: a8_study_room_pir
    on_release:
      then:
        - switch.turn_off: a8_study_room_pir
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true


But still is not getting detected, after changing inverted as true, Motion detection is inverted when shorting D1 8 with +12 V. 

Which means when motion detected the logs says it is cleared, and motion clear inverted as detected.
open your PIR sensor, maybe inside on PCB have jumper, it can set "NO" or "NC", you can chose it.