1

I'm trying to get a circuit for PIR motion sensor**. I'll need to use 2 sensor's - first in a single trigger mode and the second one is continuous trigger mode.

** HC-SR501 (datasheet, link goes to PDF)

First sensor will trigger the light and will remain on until the (less)delay set for the first PIR. If any motion detected on second PIR again the high input goes to OR gate and will keep the lamp on (doesn't matter if the delay expired for the first one lamp will be on).

If there is any motion detected on first again it will trigger and switch off the light. (Counter is meant for deactivating the connection ) - while leaving the restroom

I'm looking to have it in rest room. First one is right under the rest room door and the second one will be just before the shower area.

3.3 V battery in diagram represent the out put from PIR sensor

enter image description here

PDF version of this schematic can be found here

Nick Alexeev
  • 37,739
  • 17
  • 97
  • 230
San44
  • 11
  • 1
  • 3
  • 2
    We do engineering here, not hand waving. – Olin Lathrop Apr 14 '14 at 13:21
  • Really ? i I was unable to upload the Diagram. I believe diagram means i tried my self to an extend – San44 Apr 14 '14 at 14:38
  • If you don't have enough rep to post a diagram, include a link to it and someone will edit it in-line. However, you'd better do it quickly. Until you fix it, this question needs to be closed. Only two more close votes to go. – Olin Lathrop Apr 14 '14 at 14:49
  • Done ! http://www.electro-tech-online.com/threads/help-needed-for-dual-pir-motion-sensor.140775/ – San44 Apr 14 '14 at 14:53
  • That link goes to some forum with several posts, not a schematic or a diagram. – Olin Lathrop Apr 14 '14 at 15:28
  • OK, by following a couple links we can get to a PDF schematic...but there are no PIR sensors shown on the schematic and you haven't actually asked a question. – Joe Hass Apr 14 '14 at 15:29
  • I did it in a simulator but the voltage wasnt enough to trigger the 4017 counter. Also i was not sure about the OR gate there. Also as i mentioned in the thread - 3.3 battery represents the PIR - PIR output is 3.3V – San44 Apr 14 '14 at 15:41
  • @Olin - Please see the attached diagram in pdf format. Should be able to see in the first thread itself. file name - pir.pdf – San44 Apr 14 '14 at 15:42
  • Motion sensor mode is HC-SR501 http://www.mpja.com/download/31227sc.pdf- Data sheet says its TTL output but not sure why its not able to drive 4017 counter – San44 Apr 14 '14 at 15:52
  • to say TTL out when chip is powered by 3.3V with same swing is true, but not ideal for Hmos threshold of Vcc/2. A series diode, R pullup can fix this or equiv. –  Apr 14 '14 at 17:01
  • i managed to get the trigger working by removing the parallel resistor and cap. but now the output of OR gate is not driving the transistor connected to the relay – San44 Apr 14 '14 at 19:18
  • @San44 Welcome to EE.SE. I've edited your question - to demonstrate what should be included in a good question on EE.SE . – Nick Alexeev Apr 14 '14 at 20:23
  • http://www.electro-tech-online.com/threads/help-needed-for-dual-pir-motion-sensor.140775/. Please look for the last update in the thread. filename pir-updated.pdf – San44 Apr 15 '14 at 20:09
  • i replaced Q3 - BC547 with 3904 and its working like a champ ! 4K series, 100 K & 220 parallel. Am i good to use 3904 transistor to drive the relay ? please let me know if you have any suggestions? – San44 Apr 15 '14 at 20:09

1 Answers1

1

What you need is Logic level converter, you can acomplish that with one or two transistors BC547 like in the image : Logic level shifter

You can also check this thread.

There is also this really interesting logic level shifter from sparkfun : logic shifter

  • Many thanks ! i have tried the same in simulator but it was unable to drive the counter next to it - 4017 – San44 Apr 14 '14 at 14:41
  • Make sure to have the same common **GND** all the way since the 3.3V power source to the uC and the transistors in the schematice above. `3.3V in, 5V, 5V out`. – Electropepper Apr 14 '14 at 15:55
  • I managed to get the trigger working by removing the parallel resistors & Cap. Now i have one resistor (1k) serial to the 4017 input trigger. Trigger is working fine and i see the 4017 out put is 5v but its unable to drive the OR gate connected to it. – San44 Apr 15 '14 at 11:41
  • You need to connect both U1 and U2 supply pins, **pins 14vdd/7vss for U2** and **pins 16vdd/8vss**, VDD is 5v. – Electropepper Apr 15 '14 at 14:48
  • Its already connected. Please see the power & GND associated just above the 4017 (U1). Do you think i need to get another power and ground for U2 ? Infact i'm getting 5V out from counter and ~ 2.68 out from OR IC too – San44 Apr 15 '14 at 14:56
  • Both power supply (5V) to the chips need to came from a common stable continuous power supply. – Electropepper Apr 15 '14 at 15:39
  • Yes it is. In Proteus, component "POWER" is 5V. Since i have 2 IC's, not sure whether i need to use 2 instance of both power & GND. Both VCC & VSS is hidden pin's in Proteus. – San44 Apr 15 '14 at 15:45
  • i replaced Q3 - BC547 with 3904 and its working like a champ ! 4K series, 100 K & 1 K parallel. Am i good to use 3904 transistor to drive the relay ? please let me know if you have any suggestions? – San44 Apr 15 '14 at 19:54
  • http://www.electro-tech-online.com/threads/help-needed-for-dual-pir-motion-sensor.140775/. Please look for the last update in the thread. filename pir-updated.pdf – San44 Apr 15 '14 at 20:06