How do I use PIR motion sensor to trigger 3v relay module?

Discussion in 'The Projects Forum' started by truwebs, Apr 5, 2016.

  1. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Looking for help on my project. See images. Testing before connecting to high voltage device. This is my first attempt using a relay. Using a 3v relay triggered by the PIR signal. As you see wired now, There is no ground wire coming from PIR only Red + and Yellow signal to relay.. The circuit would not trigger relay with a ground wire to the PIR. When this does trigger ( without the ground wire on PIR) I noticed on the relay that the LED would not go completely off. It dimmed showiing that the relay board was still receiving power. So I check to find that when relay turns/switches "off" the PIR is still sending 2.6-2.8 volts to the relay. This will obviously just drain the battery. Not enough to trigger the relay, but enough to show power through the LED. Obviously something wrong here where the PIR or Relay are still drawing power. Can you help?

    When the ground IS connected to the PIR the relay will not trigger. For some reason there does not seem to be enough current to drive relay with PIR.

    With ground connected to PIR and PIR disconnected from Relay... Voltage coming from output pin at PIR is 3.31 volts. Powers a sling LED light no problem.

    Here are the components I am using.
    PIR sensor

    http://www.amazon.com/2013newestsel...1&redirect=true&ref_=oh_aui_search_detailpage

    3v Relay

    http://www.ebay.com/itm/331413255692?_trksid=p2060353.m2749.l2649&ssPageName=STRK:MEBIDX:IT


    I am a complete novice hobbiest here. So... schematic drawings are not helpful as I am just struggling through this. Hense the wiring diagram that I drew. I have read some of the other posts that a MOSFET may be the solution. If somebody could elaborate on a MOSFET it would be helpful. Would rather a near 100% validation before I make the purchase of MOSFETS.

    Your help is greatly appreciated. Have some cool ideas to make for the kids if I can get what seems to be a simple circuit to work.

    Regards,

    TRU
    . breadboard.jpg drawing.jpg
     
    atamu10 likes this.
  2. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi,
    I use that type of PIR, the output goes High, 3V when the PIR is activated, it is only a low power output, so it will not drive a relay directly.

    The Relay PCB requires a 3V power supply for the Relay coil.
    The Input signal from the PIR PCB should drive the on board transistor on the Relay PCB.

    The 9V battery is OK for the PIR , but it is too high a voltage for the Relay PCB.

    You need a 3.3V regulator from the 9V bty to the Relay PCB or a suitable resistor that will drop 6V at the relay operating current. [ very inefficient]

    Do you follow that OK.
    E
     
  3. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Can you recommend "a suitable resistor that will drop 6V at the relay operating current"?

    TRU
     
  4. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Let me ask this as well. Could the problem be solved as well if each component were powered by its own power source? Say each is powered by its own 3v source rather than sharing a source?
     
  5. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi,
    You could power the Relay PCB with a 3V battery and the PIR with a 9V battery.
    Connect the negative ends of the two batteries together as a 0V line.
    OK.?
    E
     
  6. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    no luck. the pir will trigger the relay indicator light very dim, but the coil will not trigger.
     
  7. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2


    truwebsThread StarterNew Member

    Can you recommend "a suitable resistor that will drop 6V at the relay operating current"?
     
  8. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi,
    You may have damaged the 3V relay circuit when you applied 9v , in your initial test.
    The circuit has an opto-isolator onboard, its output drives a transistor, which in turn controls the relay coil supply.

    Try this, power the relay PCB with +3V and connect the Signal Inp to a +5V source [ ensure that the 3v and 5v 0V lines are connected together.

    As you apply the +5v the relay should 'click' as it it operates.

    E
     
  9. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Hey E,

    I have done what you have asked. The relay does click as you have requested the circuit with a 3v and 5v source. And I went ahead and tested all the relays the same way with success.

    But, then I put the PIR back inline with the 5v instead of the 9v source and got the original result from my initial circuit. I tested the PIR disconnected from the relay and record 3.3 volts output from the PIR.

    Once I connect the PIR to the relay there is a 2.78 volt reading at the connection terminals between PIR out and relay in.

    What is happening (voltage loss) or needs to happen to get this PIR to drive the relay or any relay for that matter?

    Thanks!

    TRU
     
  10. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Your drawing only shows two connections to the PIR module and it needs 3...
    its input seems to be 5-20V which would be between VCC and - (negative)
    The output will rise to some voltage close to its supply when it triggers.

    The relay also requires 3 wires... maximum of 3,3V between VCC and ground and a signal which must share a ground but looks. if the listing is correct, like it cam be as high as 20V

    I wouls suggest that you supply the PIR from the battery directly.
    Addf a small buck converter board ti derive 3.3v from your 9V supply and power the relay/s with that.

    Regards
    Al
     
  11. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Yes, I understand the PIR drawing is missing the PIR - connection. This is explained in my initial post of behavior with and without connection. With EricGibbs last post I believe we have narrowed down the problem that there is a loss of strength from PIR to relay to drive the relay. With testing that Eric recommended it was noted that once the PIR is connected to the relay there is only 2.78 volts being measured at the connection between PIR and relay.

    TRU
     
  12. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi t.
    Your relay PCB has a EL817 opto-coupler for the input signal, it requires a 5V drive voltage on the Input in order to drive the onboard transistor which controls the relay coil current.
    With only a 3v drive from the PIR output, there is insufficient current to drive the opto and transistor.

    Did you try the relay board test I suggested earlier.?
    Check you have not damaged the relay logic by applying a 9v power supply, as it is specified as 3v working.

    You need a voltage level shifter between the PIR out and Relay input in order to increase the signal from 3v to specified 5v.
    Eric
     
    truwebs likes this.
  13. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Ok.... so... what voltage level shifter would you recommend for this application?

    Again i am a novist hobbiest enjoying bringing ideas to fruition.

    Tru
     
  14. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi,
    This is a very simple circuit that will step the low current, 3v PIR out signal up to +5v, suitable for driving the Relay PCB's opto-isolator.

    The transistors are general purpose low cost NPN / PNP transistors.

    E
     
    truwebs likes this.
  15. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    E,

    Thanks for your efforts and help on this project. I knew it was just a matter of time that i would have to start learning how to read schematics and work with resistors and transistors. That time has come!

    Can you recommend where i would purchase a good STARTER kit with the needed parts?

    I believe i understand what resistors and transistors i need....

    what is D1 and DLED_RD? Are those components already integrated in the relay PCB?

    TRU
     
  16. ericgibbs

    Senior Member

    Jan 29, 2010
    2,499
    380
    hi TRU,
    D1 and DLED are the same component, it and R4 are already a part of your Relay PCB circuit.

    If you are keen to start learning to make up your own circuits, I would recommend that you buy a Bread Board.
    That is the type of board where you plug in the components rather than soldering.
    This will allow you to quickly build and try out different circuits prior to making a final PCB assembly, which will save you money by reusing components.

    There are many suppliers on line that sell bread boards, [ some times called Project boards] as well as components.

    Mouser are well known supplier, based in the States.
    http://www.mouser.co.uk/_/?Keyword=breadboard
    E

    EDIT:
    Check these out:
    https://www.amazon.co.uk/s/ref=nb_s...as=aps&field-keywords=electronic+bread+boards
     
  17. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Already have boards. The beginner component kit of other stuff is what i need.
     
  18. allenpitts

    Active Member

    Feb 26, 2011
    77
    7
    Hello Tru,

    Saw your reply on my post 'Pir sensor to Arduino'. Yes, I have done several
    PIR sensor projects to drive relays. Actually some are PIR sensors to drive
    relays and some are PIR sensors to drive transistors that act as switches in
    place of relays. But in the circuits that use PIRs to drive relay a transistor
    has been used between the PIR output and the relay because the 3.3 v max
    signal from the PIR is not sufficient to reliably drive a relay.
    Its not that complex. The transistor has three leads. Collector, emitter and
    base. The collector is connected to a higher voltage source like nine volts
    (that can also be used to drive the PIR). The emitter is connected to the relay
    coil. The base is connected to the signal output from the PIR. When the
    PIR signal is activated by movement the three volts at the base allow
    the nine volts to flow thru the transistor and to the relay coil closing
    (or opening) the relay.

    I am at work now but have some Fritz format circuit diagrams with part numbers
    that I will post in this thread when I get home tonight.

    By the way, in doing PIR driven circuits several wrinkles in PIR sensors have been
    encountered. PIRs by SparkFun, RadioShack, Parallax and Adafruit have been used.
    The documentation of the Sparkfun PIR is cryptic and confusing. The Radioshack
    product seems to be made by Parallax and both are pretty easy to use. The best of
    the lot comes from Adafruit.
    https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview
    Besides supplying a pigtail with PIR that allows it to be connected easily to
    breadboards and circuit boards, the Adafruit #189 has two variable potentiometers
    that allow the adjustment of the length of time the PIR sends a signal and the distance
    to which the system is sensitive.
    By studying the Adafruit PIR it was discovered that the Adafruit product is
    actually an HC-SR501. This is the data sheet on the HC-SR501 and has a good
    deal of excellent info.
    http://www.mpja.com/download/31227sc.pdf
    Depending on the manufacturer the HC-SR501 may have a jumper switches that
    allow the PIR to operated in Disable Repeating Trigger or Enable Repeating Trigger
    modes. In Disable Repeating Trigger mode the PIR goes thru a complete cycle
    (Sense movement, Send signal [go HIGH] for the programmed time [usually about 5
    to 10 seconds], Stop sending signal [go LOW] reset to sense new movement).
    In Enable Repeating Trigger mode the PIR will interrupt the present cycle
    when it senses motion before the current cycle is complete and begin a new
    cycle.0
    All of the four vendors mentioned above, including Adafruit, sell their motion
    detectors for about ten bucks. If you are willing to wait a week or two
    for them to come from China they can be purchased for a little as a dollar
    apiece. They can also be found on Amazon and eBay for $3-4.

    As mentioned will have get home to post the circuits. And sometimes my
    girlfriend ambushes me on Friday night, lying in wait with a bottle of
    wine and intentions involving adult activities. In that case it will
    be Saturday morning before I post the details. But I will post.

    Allen Pitts, Dallas Texas
     
  19. truwebs

    Thread Starter Member

    Apr 2, 2016
    54
    2
    Allen,

    Any and all information you could share will be appreciated. Best of luck to you this evening.
     
  20. allenpitts

    Active Member

    Feb 26, 2011
    77
    7
    Hello Tru,

    Have a bunch of GIFs to post. Trying to figure out which to post.
    Started progression from the simpler to the more complex.
    The first one is titled 'Pencil's Excellent PIR to Relay Schematic'.
    The key to this schematic is Pencil showed me that a diode is
    needed on either side of the coil to keep the current from bouncing
    when the coil throws the relaw switch. Also they introduced me to
    using a transistor as trigger from the PIR signl to operate
    the relay. Theya also gave an indicatpr LED (LED1) and gave me
    value for the resitor between the PIR signal and the transistor
    because the 3.3 volts coming from the PIR needs to be knocked
    down to keep from overloading the transistor.

    [​IMG]

    Frim there a PCB from RadioShack (276-159B [I'm going to miss
    RadioShack]) was used to construct the schematic. A 5 volt relay
    was used because it was what I had but the 9 volt battery burned
    it up pretty soon.

    [​IMG]

    More experimenting led to breadboarding. Looking for something to drive
    with the relay a second LED was added as sort of a load.

    [​IMG]

    Not realizing that the voltage source used for the PIR/relay circuit could
    also be used to drive a load like an LED display a second breadboard
    was added to be operated by the PIR/relay circuit

    [​IMG]

    The idea of using one voltage source to run the PIR/relay circuit
    and the display circuit led to combining the two. Also started using
    a different PCB from Datak.

    [​IMG]

    This video is sort of rough and oriented the wrong way but it is enough
    to see whats going on. The yellow LED nearest the battery indicates when
    a signal is going from the PIR to the relay. The relay sends voltage to the
    breadboard. The breadboard has a 555 timer that is set in astable mode to
    turn the red LED closest to the toggle switch on and off at about one hertz.
    That pulse is going to a 4147 decade counter connected to a ten LED
    display. Every time the 4147 gets a new pulse it turns on the next LED.


    If you are like me everytime a get an answer I develop three more questions.
    So let me know if we need to fill in the gaps.

    Uhoh I hear me girlfriend coming down the hall. Gotta go. Good luck.

    Allen Pitts, Dallas Texas
     
    Last edited: Apr 8, 2016
    truwebs and absf like this.
Loading...