Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Delay after output

Status
Not open for further replies.

Jan-hs

New Member
Hi all,

I have a pir sensor that powers a relay when the output is high (motion detected). The relay is connected to a camera and the circuit is used as a wildlife camera trap. In order to minimize stress, I would like to reduce the amount of camera clicks.

For example, the camera clicks only once, and then after 3 times that motion is detected. Or the relay turns off for a certain amount of time after a camera click. Any (simple) ideas how to achieve this? I saw lots of different circuits with 555 timers, but I'm not sure if the above example is possible.

Thanks
 
Welcome to the forum, Jan.
You could use an N counter clocked when the PIR sensor detects motion, outputting a relay-energising pulse every N detections.
 
I have a pir sensor that powers a relay when the output is high (motion detected). The relay is connected to a camera and the circuit is used as a wildlife camera trap. In order to minimize stress, I would like to reduce the amount of camera clicks.

What is the relay coil voltage and current?
What is the battery voltage?
What kind of output does the PIR sensor have (open-collector)?

For example, the camera clicks only once, and then after 3 times that motion is detected. Or the relay turns off for a certain amount of time after a camera click. Any (simple) ideas how to achieve this? I saw lots of different circuits with 555 timers, but I'm not sure if the above example is possible.

Do you want the camera to click on the first PIR output pulse, and then suppress the next two pulses if three come close together?

Or, do you want to suppress the first two, and click the camera on the third?

What about a series of rapid PIR outputs, say five in a row?

How long an interval between a series of PIR outputs should reset the suppression logic so that a new cycle begins?
 
When motion is detected, how long does the relay stay energized?

If there is constant motion, does it stay energized until no motion detected?
 
Some more details:

Battery voltage: 6v. Output of the PIR sensor ( type: HC-SR501) is 3.3v.

The **broken link removed** uses 70 ma. It has a GND, IN and + connection. The IN needs an input between 2.5 and 12v and a few ma to power the coil.

The duration of the PIR signal can be adjusted. When motion is detected it gives a short signal, then the relay coil is powered and the camera clicks only once. The camera is connected to the NO terminal of the relay. After about 4 seconds, the PIR sensor can give the next signal.

Do you want the camera to click on the first PIR output pulse?
Well, preferably one click and then 3 suppressed. Rapid PIR outputs are less of a problem, as animals will normally walk by. Reset could be on the third output, but it also depends on the complexity of the circuit. I'm quite new to this, so if its easier the other way around, then that would be okay too.
 
So, you would like, if an animal is present, take pic on the first trigger. After a 4 second period, wait for another trigger from the pir and take a pic.
Is this correct?

I would go with a timer instead of counter. In the event of many triggers, a pic may be taken too soon, and cause stress - as you mentioned
 
Would this meet your needs? Multiple triggers of the camera are prevented for a delay time adjustable up to ~32 sec with the components shown.
CameraTrigger.gif
The output stage is a push-pull one using Q1 and Q2 to enable the relay input circuit to be pulled high or low (selected with jumpers 1 and 2) as required at several mA current. In this regard the website spec for the relay is unclear in that it says the relay turns on when the control input is high, and is TTL compatible. However, TTL source current in the high state is only ~0.4mA; which is less than the required ~3mA needed to turn on the relay :confused:
 
@BioniC187 No, this is the current situation.

@Alec_t The delay of 32 seconds is not long enough. Should be more in the range of 30 minutes. But thank you for the idea. Regarding the relay input signal, I can only tell that is works perfectly. It is weird though.

I build this 2-bit counter circuit, and used the PIR output instead of the switch. It does count when motion is detected. Though, the relay coil must be energized when both LEDs are on (AND gate?), and should reset soon after the input. Otherwise the camera keeps clicking until motion is detected again.
 
If the PIR can trip every 4 sec than a 2-bit counter will only provide a 4 x 4 = 16 sec delay between camera clicks :(. You need a counter with more stages (e.g. a CD4020).
 
Even if I use a counter with more stages, I am still not sure how to connect the relay.
In case of the 2-bit counter: If the camera clicks on 3, the output stays high until the PIR trips again and goes to zero. If this takes 15 minutes, then the camera will trigger constantly during these 15 minutes, right? Sorry if I am tiring you :-S
 
Here's a more versatile timer. If you use the Q10 output of the 4020 IC the RDelay potentiometer will enable you to set a delay from ~4sec to ~30mins between successive output pulses (camera clicks). If you use the Q14 output the delay will be 16 times as long (~1min-8hrs). RWidth enables the duration of the output pulse to be adjusted (~50ms-1s) to suit the relay/camera.
CameraTrigger2.gif

Edit: I've included a test button so that you can set up the timer without the need for the PIR sensor being attached.
 
Last edited:
Hi Alect_T, thanks for the help, much appreciated. I was already trying a new approach with the counter, before I read your comment. Since I now have these components lying around.. it might be easier to at least try to make it work.

My circuit drawing skills are not that good. I therefore I added a drawing of the circuit on the breadboard.

I now have a 4017 decade counter, that counts on the PIR input. After it reaches the desired count it trips the cam via relay 1 and at the same time powers the 555 timer. I did not manage to make the 4017 work directly on the 555 timer output, so I added another relay.
It works, but the counting of the 4017 via the 555 input is unreliable, probably due to noise? Could you give advice on where to place a bypass cap?

In the circuit I combined two outputs from the NO terminal of relay 1. In my test, I used a third relay because I wasn't sure if I could wire it like that. Should I place diodes on the wires to the cam? Or is it okay like this?

Last question: I also did some testing with a dual PIR setup, that gives a signal via an AND gate. The AND gate is constructed with two 2n2222 transistors, the collector of transistor 1 is connected to +6v, the emitter goes to the collector of transistor two and via a 4.7k ohm to GND and output. The PIR 1 and 2 outputs are connected via a 10k Ohm resistor to the base of transistor 1 and 2, respectively. This setup works when fed directly to the IN of the relay, but when I connect the output of the AND gate to pin 3 of the 4017 nothing happens. Any idea why not?
 
Last edited:
but the counting of the 4017 via the 555 input is unreliable
:confused: Surely the 555 is powered via the 4017?
It would be better to control the 555 via its reset input instead of switching its power pin.

The Relay1 input probably requires greater current/voltage than the 4017 pin 4 can provide via 470Ω, especially as that pin is also driving a LED. CD4000 series circuits have very limited output current capability.

A 555 is not consistent for delays > a few seconds. It won't give your stated 30mins reliably.

The LEDs clamp the IN input of the relays at ~1.8V. That may not be adequate for reliable operation.

Any idea why not?
The output voltage of your AND gate never gets above ~2.4V. Try a diode AND gate instead.

Relay2 appears to be shorting the PIR output to the +6V rail!
 
Last edited:
Ok, I experimented a bit more. Couldn't get control over the 555 via the reset. But I removed some LEDs and the 555 output is now directly connected to input of the 4017. Everything seems to works as it should. Still not sure if I could combine the two outputs from the NO terminal of the relay. Do you see any more problems?

Diode AND gate works!

I know the counter is not suitable for a long delay, but as I previously mentioned: rapid PIR outputs are not really an issue, as animals will normally walk by. If a subject passes the PIR every 15 minutes, both a counter and a time delay setup would work. Your circuit looks promising however.. and I might try to build it.
 
Last edited:
Do you see any more problems?
Can't tell. Your attachment link is invalid :(
 
Why are the PIR and the 555 both driving pin 14 of the 4017 (via diodes)?
Pin 14 has no pull-down resistor to ground, so will be left floating when the two diodes are not conducting. CMOS ICs can behave erratically if inputs are floating.

BTW it would be helpful if you could post a schematic (even a quick pencil sketch would be easier to follow than a breadboard layout).
 
Here's a diagram of the new construction. Seems to work without errors. The counter only resets to one instead of zero:(. Ordered the parts for your second circuit.. may take a couple of days before the items arrive. I will let you know when I have (tried to) put it together..

Why are the PIR and the 555 both driving pin 14 of the 4017 (via diodes)?
Because I couldn't get it working any other way.

circuit-diagram.jpg
 
Hi Alec_T

Your circuit works! Could you give any advice on how to add a second PIR? The diode AND gate and transistor AND gate I have tested don't work as should.

Hope you can help me out one last time.
 
Status
Not open for further replies.

Latest threads

Back
Top