Page 1 of 1

or gate IC

Posted: 07 Oct 2021, 00:12
by asuz
Hello all,
I need to combine 3-4 (maybe 2) motion sensors (hc-sr501)to the same input of the esp easy. I read something about or gate ic component, is there anybody advice me which or gate ic should i choose?

Re: or gate IC

Posted: 07 Oct 2021, 04:04
by ThomasB
Your requirements are very simple, so an IC is not needed. Instead use small signal diodes (1N914, 1N4148, etc.). One diode per PIR sensor module.

The HC-SR501 data sheet states that the module has an active high output (goes to 3.3V when triggered). So here's what I recommend:

1. Connect each diode's anode to a sensor output.
2. The cathode of all diodes are tied together and then connected to a single GPIO pin.
3. Connect a 10K resistor from ground to the GPIO pin (A.K.A. pull-down resistor).
4. Disabled the GPIO's internal pull-up. Important, must do this.

You've just created a discrete RTL OR gate. Any sensor that has an active high output will trigger the GPIO.

High state voltage will be approx 2.6V, but that is sufficient for the ESP8266. If you desire a more traditional 3.3V logic level then use your favorite schottky diode instead of the silicon variety.

- Thomas

Re: or gate IC

Posted: 07 Oct 2021, 09:31
by TD-er
Just one remark.
Since Thomas suggests a pull-down resistor, you cannot connect this to GPIO-0 or -2.
Those need to be high at boot.

Re: or gate IC

Posted: 07 Oct 2021, 23:17
by asuz
Thanks ThomasB and TD-er both of you. I will do what you describe.