or gate IC

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

or gate IC

#1 Post by asuz » 07 Oct 2021, 00:12

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?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: or gate IC

#2 Post by ThomasB » 07 Oct 2021, 04:04

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

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: or gate IC

#3 Post by TD-er » 07 Oct 2021, 09:31

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.

asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

Re: or gate IC

#4 Post by asuz » 07 Oct 2021, 23:17

Thanks ThomasB and TD-er both of you. I will do what you describe.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests