Hi, I made this circuit trying to activate a motor for Sm seconds after the PIR sensor stops its signal (when room is empty). I'm using a 555 to regulate Sm time (1s to 6s). The relay is activated when the input is grounded and it work ok with the motor. I've used a signal generator to emulate the PIR pulse (not sure if is right). But on the graph the simulation generates I'm not able to keep the motor running for Sm seconds after the PIR drops from 4V to 0V. Here is the simulation:
https://www.circuitlab.com/circuit/35szs4/flusher1/ Any help would be greatly appreciated. |
by james008
July 01, 2013 |
Hi, Thank you for your help. I built this circuit on the breadboard and unfortunately it behaves like this; the relay is always on, and when the sensor activates, it turns off, and on again after Sm seconds. What I need to do is; A) I didn't mention before; turn relay1 (lights) on when PIR activates. B) Turn relay2 (motor) on for Sm seconds after the PIR deactivates(and lights turn off). I don't know if is important but the relay's power supply is on the same Vcc and Gnd, and their inputs are normally +3.5V and when 0V they activate. I've amended the diagram with the relays and the R1 I'm using 1MOhm The relays I use: http://www.ebay.co.uk/itm/New-5V-2-Channel-Relay-Module-Shield-for-Arduino-ARM-PIC-AVR-DSP-Electronic-10A-/290754099268?hash=item43b24b7844 The PIR Sensor I use: http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=140922588990&ssPageName=ADME:L:OC:GB:3160 |
by james008
July 01, 2013 |
Thank you, I'm looking into it. I am aware of the Pole & Throw, but since the nominal state is with the lights off, I thought I should use that contact in case my circuit fails (and leaves the lights on) and because of wear & tear. Am I correct in that assumption? |
by james008
July 03, 2013 |
"since the nominal state is with the lights off" That may be so but you didn't say anything about this up front so I guessed that the normal operating state may be long periods of inactivity (PIR output low, lights off, motor off) with occasional activity where the PIR output goes high and stays that way for some seconds. My example circuit is designed to that spec. "I thought I should use that contact ... " Which contact? You're talking about lights now. I was referring above to your statement about the motor behaviour. " ... in case my circuit fails (and leaves the lights on) and because of wear & tear." Your circuit can fail in many different ways. Some may cause the relay to hold the lights and/or the motor on, some off. (If the failure mode is important to you then please feel free to contact me to discuss your requirements.) The wear and tear will be the same whether you use the NO or the NC contacts. "Am I correct in that assumption?" Who knows man. My CL model of the ebay relay shield is based on the useless info available for it on the ebay page and eyeballing the photos. I may have misinterpreted how the relay is driven and how it may be connected on the shield. Based on my interpretation of the ebay relays, for both your lights and your motor relays, you should be using the normally open (NO) contacts. In the event of a Vcc supply failure then both lights and motor are off. |
by signality
July 03, 2013 |
Hi, This is great, makes more sense now! I didn't realise I had to model the shield as a subcircuit. Yes you are correct; " I guessed that the normal operating state may be long periods of inactivity (PIR output low, lights off, motor off) with occasional activity where the PIR output goes high and stays that way for some seconds" I got confused as on my original drawing I used the NPN just to invert the signal (as the shield needs low to activate), whereas I can see you use in conjunction with the second one, to create a single short pulse . I modified the breadboard and is working now: https://www.circuitlab.com/circuit/xfr932/flusher05/ R9 = 1KOhm as it was attenuating the signal too much. I changed the relays to double throw as I should have done. Connected the RLY1 to output of Q3, and used its NO contact. So now the lights work perfectly when there is activity. On RLY2, used NC contact. So now the motor works for a bit after the activity stops. I want to do the same with RLY2 as in RLY1, and use the NO connection (as you suggested). I could add another NPN transistor to invert either the "trigger" or the "output" signals. Is there perhaps another way to do that without adding a transistor? P.S. Not sure if the simulation works, but the breadboard does. |
by james008
July 05, 2013 |
"Not sure if the simulation works ..." The simulation works. The question is whether my understanding of how the ebay relays work is correct. Since you are using the NC contact for the motor relay it sounds as though I have the logic sense of their inputs wrong. In your first posting, you said: "The relay is activated when the input is grounded ..." I'd forgotten about that so maybe I have got the logic sense wrong. This is how you could connect them if they have active low inputs. The problem with this is that during the inactive period, with the motor off, both relays are energised and so are wasting power: Here's how to connect the relays to avoid this (which is I think how you connected the lamp relay anyway) but it does require an extra transistor for the motor relay: The final refinement though is to get rid of the extra transistor like this: (Sorry they're not very well drawn to make it clear that the two relay driver transistors have been swapped to PNP.) Donations gratefully received! :) |
by signality
July 05, 2013 |
Please sign in or create an account to comment.
CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.