Problem with delaying a PIR's output via relay

Discussion in 'The Projects Forum' started by szabikka, Jul 11, 2015.

  1. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Hello ladies and gentleman!

    I am designing a circuit in which a passive infrared motion detector (PIR) is triggering a bistable 555 timer. Trick is that the PIR sensor needs some time (roughly 1 minute) to calibrate itself, during this it outputs a few signals that triggers the bistable but this is not good for me. Bistable should only be triggered by detected motion. My solution was to build in another 555 that works as a delaying device. After the delaying time runs out it operates a relay that is feeding power to the bistable. I created two similar set ups, but none of them is perfect, that's why I'm asking for your help. In the pictures below, the PIR sensor's driving circuit is not shown just the sensor itself. I try to describe what's happening here:
    The left 555 is the delaying device. When power is applied C2 starts to charge up through R4. During this the trigger (pin2) of the delay 555 is held high, so the output of the same 555 is low and works as a sink for LED D2 that emits green light, furthermore electricity is flowing through Q2 transistor which activates the relay and the normally open contact gets closed that way the bistable is not receiving power. After about 2 mins C2 saturates and level drops low at delaying 555's trigger and it's output goes high at pin 3 which deactivates LED D2 and transistor Q2. At the same time the relay turns off, hence closing the normally closed contact and enabling power supply for the bistable 555. This time if you move your hand in front of the PIR it activates the output of the bistable and in turn the LED D1 starts to emit red light. WOHOO! But there is a problem. When the battery is connected to the circuit the red LED D1 blinks for the fracture of a sec, because the mechanical relay needs that time to pull in and break the normally closed contact, while the electrons traveling with light speed reach the bistable's pin8. Basically, problem is that the relay is slower than light speed. I thought of using a solid-state relay, that has no moving parts and in theory is able to break the contact with light speed, but I don't have a solid-state as they are very expensive. Do you think it could work with a solid-state? Circuit1.png
    My other circuit is pretty much the same, difference is that while C12 is charging the trigger of the delaying 555 is held low and the relay is not operated, because the same 555's output is high (only D4 is lit). When time runs out trigger of the delaying device is pulled high and the output goes low, hence firing Q8 which in turn activates the relay. The problem in this case is that the relay is turned off for the short calibration phase and after it remains pulled in hence supplying power for the bistable. This stage can be long (days) and the relay eats up too much electricity this way. I think the whole project should be redesigned but I'm out of ideas. In short the upper one turns on the red LED when it should not (only for the fracture of a sec, but it is unacceptable nonetheless), the lower one eats up too much electricity. If you have any ideas on how to delay the PIR'S output reaching the bistable for the calibration phase in a power saving manner I would greatly apprecaite your help! Cheers! Circuit2.png
     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,819
    If the stabilization of the PIR is slow, then you could use capacitive coupling out of the PIR and, with a resistor, you can filter these slow signals with a high-pass filter that passes faster (real) signals to your output.
     
  3. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Hmmm! Not a bad idea! I will try to measure if there is any relevant difference between the speed of calibrational and normal outputs. Thanks for the advice!
     
  4. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Instead of powering the second 555 through the relay, why not provide it constant power and use the reset (pin 4) to control it?

    - Eliminate current pin 4 connection, then use a pull down resistor to hold pin 4 low until the first 555 has completed its timing cycle.
    - Eliminate rl3.
    - Connect the output from q2 to the second 555's reset (pin 4,) which also has the aforementioned pull down resistor.

    With this setup, the second 555's default condition will be no output because its reset pin is held low by the pull down resistor (no waiting for mechanical relay movement to achieve the correct initial state.) Only after the first 555 times out will the output of the second 555 be allowed to activate.

    I have little experience with 555s, so I may be missing something obvious here, but I think this should work.
     
    GopherT and szabikka like this.
  5. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    I don't see how the second 555 operates as a bistable? :confused:
     
  6. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    This worked! Thanks for your help!
     
  7. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Well, crutschow, it's only a half bistable, that can only be triggered but can't be reseted. To reset it one must turn off the power supply. It works nonetheless.
     
  8. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    OK. Then the more correct term for such a device is a "latch".

    To provide a simple inhibit delay, connect the drain of an N-MOSFET to the Reset input of the right 555 along with a 10kΩ resistor to V+. (The left 555 is not needed).
    Connect the MOSFET source to common.
    Connect a 100uF capacitor between V+ and the MOSFET gate.
    Connect a 1MΩ resistor from the gate to ground.
    If V+ is less than 10V then the MOSFET should be a logic-level type device.

    When power is applied, V+ will be coupled through the capacitor to the MOSFET's gate, turning it on and holding the 555 Reset pin low so it can't trigger.
    This gate voltage will gradually go down due to the 1MΩ resistor, until the MOSFET turns off.
    This causes the 10kΩ resistor to pull the Reset pin high, enabling the 555 to be triggered.

    This circuit draws no power after it times out.
     
    ebeowulf17 and szabikka like this.
  9. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Excellent! Glad it worked. Good job!
     
  10. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    This sounds interesting. I have never done anything similar, so I will definitely try it out. Thanks for your help! Omitting one of the 555's is a big positive too.
     
    ebeowulf17 likes this.
  11. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Hi Crutschow!

    I have redesigned the circuit as you suggested. It workes great. I have tried to build the following configuration, in which the 555 drives a relay via a BC547 transistor (Q13). I had the following problem. Without the protecting 1N4148 flywheel diode (D11) everything was fine, but when I added the diode Q13 started to smoke and burnt out. I have no idea what could have caused this. Do you have any idea? mosfet delay.png
     
  12. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Did you try reversing the diode orientation? If it were accidentally forward biased instead of reverse biased, you'd essentially have a short circuit whenever Q13 was activated.
     
  13. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    I did not have the balls to turn around the diode, after it fried one of my transistors, but the black marked half of the diode was connected to the positive rail, so I'm pretty sure it was connected the right way. Another interesting thing is that my relay's coil seems to be out of its mind. I tested it by connecting one coil pin to the positive part of the battery, the other one to the negative and it didn't work. I thought it was damaged but when I reversed the wiring it pulled in. I tried it with another one with the same results. I thought the coil pins' wiring is interchangeable as my other type relays work connected both ways. These are Takamisawa RA12W-K relays. I have checked the datasheet but haven't seen anything that would suggest these are "one-way only" relays. Has anyone seen anything like this before?
     
  14. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Yikes! We're definitely past my knowledge level. I'll have to wait for someone more experienced on this one!
     
  15. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    The data sheet I looked at for the relay showed + and - markings by the coil terminals. They appear to have polarized coils.

    It sounds like a bad or incorrectly connected diode.
    Check them with the diode test function on your multimeter.
    Else check them with a 1k resistor in series with the 12V battery to see which way they conduct (by measuring the voltage across the resistor, no voltage, no conduction).
     
    Last edited: Jul 15, 2015
    szabikka likes this.
  16. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,800
    1,103
    If your relay is the type that has a built-in flywheel diode (the + and - marks suggest it is) and you had the coil connected with the wrong polarity, that would account for Q13 letting out the magic smoke (regardless of the orientation of your diode D11).
     
    szabikka likes this.
  17. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Thanks for the answers everyone! I will take another look at that datasheet. It's actually a new thing for me that some relays come with built in flywheel diodes and so their coil is polarized. Funny thing is that I have designed numerous stripboard layouts with these takamisawa relays and looks like it was pure luck that I haven't met this problem so far.
     
  18. crutschow

    Expert

    Mar 14, 2008
    13,014
    3,234
    Note that in your Post #11 circuit, the pull-up resistor R31 is not needed since resistor R35 and LED D10 provide all the pull-up voltage needed.
     
    Last edited: Jul 14, 2015
  19. szabikka

    Thread Starter Member

    Sep 3, 2014
    77
    1
    Thanks crutschow! I removed it.
     
  20. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Shouldn't the white marked end be connected to the positive rail? That's the cathode, right?
     
Loading...