# timer circuit with relay output

#### pavo real

Joined Aug 2, 2017
10
I am not the most experienced, so please bear with me. I am looking for a circuit to start timer with a pulse. New pulses would be ignored. After one minute of no pulse, then reset timer and wait to start. After one hour of pulse(s), then a high output to relay.

#### ebeowulf17

Joined Aug 12, 2014
3,275
So, just to make sure I'm understanding this correctly, the relay output only goes high when there have been pulses continuously for an hour, with each pulse no more than a minute after the last pulse? So, if there's more than a minute between two pulses, then the timing of the one hour limit restarts?

Then, once the relay has finally been activated, how long does it stay active? Is that also determined by pulse frequency, or does it stay on for a fixed period of time?

What is this timing arrangement meant to accomplish? It might be easier to understand the timing logic if we understand the design intent.

#### ebeowulf17

Joined Aug 12, 2014
3,275
I am not the most experienced, so please bear with me. I am looking for a circuit to start timer with a pulse. New pulses would be ignored. After one minute of no pulse, then reset timer and wait to start. After one hour of pulse(s), then a high output to relay.
Or do you mean one hour after the first pulse, the relay goes high, no matter how many or how few pulses there have been since the first one? This would still leave the question of how long to keep the relay active, and also what is being accomplished with the one minute timer triggered by each pulse.

#### ScottWang

Joined Aug 23, 2012
6,974
You may draw a timing chart, it's more easily to understand what you trying to do.

#### pavo real

Joined Aug 2, 2017
10
Or do you mean one hour after the first pulse, the relay goes high, no matter how many or how few pulses there have been since the first one? This would still leave the question of how long to keep the relay active, and also what is being accomplished with the one minute timer triggered by each pulse.

#### pavo real

Joined Aug 2, 2017
10
I'll try to answer some of your questions. Timer starts with pulse. Timer continues as long as pulses are less than one minute apart. After one hour relay output goes high. Output time can stay high to wait for manual reset
So, just to make sure I'm understanding this correctly, the relay output only goes high when there have been pulses continuously for an hour, with each pulse no more than a minute after the last pulse? So, if there's more than a minute between two pulses, then the timing of the one hour limit restarts?

Then, once the relay has finally been activated, how long does it stay active? Is that also determined by pulse frequency, or does it stay on for a fixed period of time?

What is this timing arrangement meant to accomplish? It might be easier to understand the timing logic if we understand the design intent.
. There would be need for manual reset after relay goes high.

Your description is correct. The relay would stay on until manual reset.

#### pavo real

Joined Aug 2, 2017
10
An idea I have is to use the pulse(s) to charge a capacitor and use the discharge rate to equal one minute. So as long as the cap has a voltage, then the timer continues to run. But how do I get a high signal at an hour?

#### Tonyr1084

Joined Sep 24, 2015
5,515
It sounds to me like you're asking for a "Monostable Retriggerable" timer. (MSRT) You want to "RE-trigger" the timer with every pulse. But after a minute from the LAST pulse you want the output to remain on for an hour (from the last pulse). Well, an MSRT will trigger with every pulse. So after the initial pulse, if you have a pulse 15 minutes later the timer will be retriggered for an hour. If - before that hour is up - another pulse comes in - your MSRT will again reset its hour long count down.

Now, maybe you're saying you want to receive pulses for a minute. But after the minute you want the timer to lock out any further pulses for up to an hour. In order to lock out pulses after a minute you'd need something like another timer, a "Monostable NON-Retriggerable" timer (MSNRT). A "Non retriggerable" timer will take the initial pulse and hold it for a given time. Any further pulses during that time period will be ignored. Thereby you can get your hour of ignoring any further pulses.

I can't speak for anyone else, but I'm just not quite sure I know what it is you want to accomplish. If I knew then maybe I could come up with an idea. But with greater clarity others here will likely have some pretty good ideas to help you with.

#### ebeowulf17

Joined Aug 12, 2014
3,275
It sounds to me like you're asking for a "Monostable Retriggerable" timer. (MSRT) You want to "RE-trigger" the timer with every pulse. But after a minute from the LAST pulse you want the output to remain on for an hour (from the last pulse). Well, an MSRT will trigger with every pulse. So after the initial pulse, if you have a pulse 15 minutes later the timer will be retriggered for an hour. If - before that hour is up - another pulse comes in - your MSRT will again reset its hour long count down.

Now, maybe you're saying you want to receive pulses for a minute. But after the minute you want the timer to lock out any further pulses for up to an hour. In order to lock out pulses after a minute you'd need something like another timer, a "Monostable NON-Retriggerable" timer (MSNRT). A "Non retriggerable" timer will take the initial pulse and hold it for a given time. Any further pulses during that time period will be ignored. Thereby you can get your hour of ignoring any further pulses.

I can't speak for anyone else, but I'm just not quite sure I know what it is you want to accomplish. If I knew then maybe I could come up with an idea. But with greater clarity others here will likely have some pretty good ideas to help you with.
I believe pavo wants the one hour time measurement to start from the FIRST pulse, but the one hour timer should reset if the stream of pulses is broken.

I have a vague concept in mind, but I haven't fleshed it out, much less sketched it or simulated it yet.

1) Use RC circuit with Schmitt trigger, or 555 circuit, to hold a node high for 1 minute after each pulse.

2) Use that node to control a transistor which powers next portion of circuit. This next section uses a 555 timer, perhaps in conjunction with a counter, depending on accuracy requirements, to count time for one hour. Any time the pulses in section 1 stop, this portion goes dead, canceling 1 hour timer. When pulses resume, timer starts over. Timer output is only triggered after one hour of continuous pulses less than 1 minute apart.

3) Output from timer in section 2 (which may need logic inversion and will certainly need pull up or pull down resistor) is used to activate Triac, which effectively acts like a latching relay for DC current. This Triac controls the relay, so relay will stay active until whole circuit is reset (including a momentary power interruption to Triac supply voltage.)

If that sounds reasonable, I'll try to play with it in LTspice and see if I can make it work.

EDIT: I think when I suggested a Triac earlier, I could've/should've been suggesting an SCR.

Last edited:

#### ebeowulf17

Joined Aug 12, 2014
3,275
An idea I have is to use the pulse(s) to charge a capacitor and use the discharge rate to equal one minute. So as long as the cap has a voltage, then the timer continues to run. But how do I get a high signal at an hour?
Assuming my understanding of your needs is correct so far, I have a few more questions:
1) What power supply voltage do have available to power this circuit?
2) What are the power requirements of your relay coil? Does the coil voltage match the power supply voltage?
3) How accurate does the one hour timing need to be? If it turned on 1 minute early or late, would that be ok? What about +/-5 minutes? I ask because RC timing circuits have a bad reputation for accuracy over long time periods.

#### dl324

Joined Mar 30, 2015
12,224
Sounds to me like you need a missing pulse detector and a counter.

Can't be certain because you refuse to post a timing diagram as @ScottWang requested; or a block diagram.

Is the trigger pulse positive going, or negative going?

Is active output HIGH or LOW?

What type of relay?

#### Tonyr1084

Joined Sep 24, 2015
5,515
post a timing diagram
Yes, I concur. Are you able to post a diagram? Just scribble something on a piece of paper and take a picture of it with your cell phone, then upload that picture using "Upload a File". You can do as I like to do - use Paintbrush as a drafting board. Slow, but it can be elegant. Or sloppy, as long as we get a clear picture of what it is you want to accomplish.

#### ebeowulf17

Joined Aug 12, 2014
3,275
Details and explanation to follow - on my way out the door right now!

#### Attachments

• 5.3 KB Views: 1

#### ebeowulf17

Joined Aug 12, 2014
3,275
Details and explanation to follow - on my way out the door right now!
View attachment 132237
View attachment 132236
Ok, I'll try to explain the uploads in my last post. I *think* I understand what the thread starter wants in terms of behavior. This circuit is complicated and ugly; I'm sure there must be a cleaner way to accomplish this task. As it is, my circuit is almost working the way I want, except for a little trouble with the 555 portion.

The first set of graphs shows that if pulses arrive every minute or less, the Schmitt inverters will be active, keeping the 555 running, but if the pulses stop before the 555 times out the relay will never activate.

The second set of graphs shows that if the pulses continue beyond when the 555 times out, the relay will go high and stay that way as long as the circuit is powered.

The third set of graphs demonstrates my problem. What I expected here is:
1) The break in the pulse stream to drop the Schmitt output and halt the 555 timer, which it does.
2) The new, restarted pulse stream should restart the 555 timer. This part isn't working, which in turn causes the relay to go high at this point. I've tried a bunch of variations on how I'm using the trigger and reset pins on the 555, but I'm really inexperienced with 555s and I haven't been able to make sense of it.

Known issues:
1) I didn't have an SCR model, so I tried "making" one from transistors, but it's a bit touchy. A real SCR would be better, and then again a CMOS latch driving a MOSFET might be better still.
2) RC circuits and 555s aren't great for long delays. This circuit was intended as a conceptual model, not an exact solution. The timer(s) should probably be replaced with something more suitable.
3) 555 won't restart once it's stopped for the first time.
4) 555 is currently set somewhere around 9 minutes instead of 60, just to make logic easier to visualize in simulation.

#### dl324

Joined Mar 30, 2015
12,224
Known issues:
1) I didn't have an SCR model, so I tried "making" one from transistors, but it's a bit touchy. A real SCR would be better, and then again a CMOS latch driving a MOSFET might be better still.
Why do you need an SCR?
2) RC circuits and 555s aren't great for long delays. This circuit was intended as a conceptual model, not an exact solution. The timer(s) should probably be replaced with something more suitable.
OP hasn't given enough information to make that determination.
3) 555 won't restart once it's stopped for the first time.
4) 555 is currently set somewhere around 9 minutes instead of 60, just to make logic easier to visualize in simulation.
You can avoid the largest accuracy problem by using a counter and not having a timer with a 60 minute time period.

Last edited:

#### ebeowulf17

Joined Aug 12, 2014
3,275
Why do you need an SCR?
If I've understood the desired behavior, once the relay output goes high, it needs to stay high. If the relay could be a latching relay, that would solve it. If not, an SCR was the next idea that came to mind - certainly not the only solution, but one possibility.
OP hasn't given enough information to make that determination.
That's a fair point. I was just pointing out that there might be a need, depending on accuracy requirements.
I'm not sure how to go about that. The reset pin is pulled low to stop the 555, and then driven high again to restart it. I also tried adding a diode from discharge to the Schmitt output/reset pin in order to dump voltage there whenever the timer is stopped, thinking that might help, but it didn't. I don't understand 555s well enough to get this part right, and I ran out of time last night when I was working on it. If you have any specific advice, I'd appreciate your help. If not, I'll do some more research. I know there's lots of 555 info out there - I just haven't digested it all yet!
You can avoid the problem by using a counter and not having a timer with a 60 minute time period.
Yes, I figured that would be the next step if greater accuracy was required for the time period. As you can see, I'm still struggling even with basic 555s, so I figured I'd skip that next step for now!

#### dl324

Joined Mar 30, 2015
12,224
I'm not sure how to go about that.
Reset for your circuit will be more involved because you used an SCR and power needs to be interrupted for it to unlatch; unless you specify a sensitive gate variety where you could just turn off one of the transistors.

I'd rather wait for the OP to clarify requirements before jumping to solution space.

#### ebeowulf17

Joined Aug 12, 2014
3,275
Reset for your circuit will be more involved because you used an SCR and power needs to be interrupted for it to unlatch; unless you specify a sensitive gate variety where you could just turn off one of the transistors.

I'd rather wait for the OP to clarify requirements before jumping to solution space.
Looking at the third set of graphs, I want the 555 to start timing again when the pulses restart - and if it does so properly, the SCR won't be triggered yet, just like it's not triggered when the 555 timer is started the first time.

It's possible that I'm misunderstanding the thread starter's needs, but I'm curious to know how to get my circuit working as I intend it, even if it's not the right circuit for the TS!

#### pavo real

Joined Aug 2, 2017
10
ebeowulf17, you seem to have a handle on this. I'll try to clarify a few things. Accuracy is not important. The ability to adjust the timings would be a good thing. Probably would be a 12v DC power source and relay, but that can change.
For those that insist on the purpose I can only say that I don't see the need to disclose the purpose of this circuit. All the information needed has been posted. If you have a specific question/clarification please feel free to ask. Thanks.

#### AnalogKid

Joined Aug 1, 2013
8,805
Of course everything can be done inside a \$1, 8-pin PIC, but where's the fun?

I'm not a big fan of long RC timers, but 1 "accuracy is not important" minute should be fairly repeatable. For 1 hour, use a counter. To keep the output in the ON state after one hour of continuous input pluses has elapsed, stay ON if the input pulses then stop coming, and have a manual reset, you need at least one set-reset flipflop.

1 - CD4060 - 1 hour timer circuit
1 - CD4093 -
2 gates - Output latch/manual output reset
1 gate - 1-minute boxcar timer
1 gate - input signal conditioning.
1 - MOSFET relay driver

Does the switched load run off the same 12 V supply and ground?
If so, what is the peak load current?
If not, what are the voltage and current of the load?

ak

Last edited: