Turn relay on/off with pulse. Pulse-on, Pulse-off

robotix123

Joined Jan 17, 2019
8
Hello. I've spent all morning looking for a solution but have yet to find something that meets what I need to do (except for an alternating relay which is overkill for my project and i can only seem to find AC input ones). I'm looking to send a 20 ms long DC signal to a relay to flick it on and keep it on until i then again send the same 20 ms long DC signal to turn it off.

Basically, a push button turns relay on and keeps it on. I push the button again and it turns relay off. I can't seem to think of a method to do this with my basic electrical knowledge so any help or suggestions are greatly appreciated. Thanks in advance!

Also, i'm not 100% sure this is the correct thread for this but it's general, right?

Raymond Genovese

Joined Mar 5, 2016
1,653
Hello. I've spent all morning looking for a solution but have yet to find something that meets what I need to do (except for an alternating relay which is overkill for my project and i can only seem to find AC input ones). I'm looking to send a 20 ms long DC signal to a relay to flick it on and keep it on until i then again send the same 20 ms long DC signal to turn it off.

Basically, a push button turns relay on and keeps it on. I push the button again and it turns relay off. I can't seem to think of a method to do this with my basic electrical knowledge so any help or suggestions are greatly appreciated. Thanks in advance!

Also, i'm not 100% sure this is the correct thread for this but it's general, right?
https://www.mouser.com/ds/2/357/105A_755-7090.pdf

See impulse relay. Is that what you want?

wayneh

Joined Sep 9, 2010
17,166
Doable. What sort of power are we talking about? You'll need DC power to energize the relay coil and to run a small circuit. Do you already have a power supply? How much voltage and current does the relay require?

I'm thinking of the using a 555 timer IC to perform the latch. Haven't worked out the details but I'm pretty sure this is an off-the-shelf application.

dl324

Joined Mar 30, 2015
14,317
I'm looking to send a 20 ms long DC signal to a relay to flick it on and keep it on until i then again send the same 20 ms long DC signal to turn it off.
What is the source of this pulse?
Basically, a push button turns relay on and keeps it on. I push the button again and it turns relay off. I can't seem to think of a method to do this with my basic electrical knowledge so any help or suggestions are greatly appreciated.
Is there a reason why you can't just use an alternate action mechanical switch? From the details you provided, I can't understand what you want.

djsfantasi

Joined Apr 11, 2010
8,256
Hello!

This is a simple and common circuit requirement. Unless it turns out that it’s not so simple.

The not so simple part. Is it germane that the signal is 20ms long? Or could it be 10ms or 30ms, as long as it alternately switches the relay. Basically, I’m asking if the requirement is one pulse on, next pulse off, next pulse on and so on. If so, keep reading.

Thus action screams flip flop. One could use a CD4013B wired as a toggle flip flop. The output would go to a transistor which will drive the relay. Note that you’d want to place a diode reverse biased across the relay coil to keep the transistor from

Here is how to wire the CD4013B as a toggle flip flop.

Attachments

• 36 KB Views: 40

crutschow

Joined Mar 14, 2008
29,494
Below is a circuit with LTspice simulation that controls a relay with a momentary push-button.
It uses a CMOS flip-flop and transistor to control the relay.
It has a power-on reset.
It includes debounce suppression of the PB mechanical switch.
It can operate from a DC voltage of 3-15V.

robotix123

Joined Jan 17, 2019
8
I dont see an option to edit my post! But here's a wiring diagram. My pulse source is from a counter that sends a 20ms signal to my relay. But I realized that wont work with an AC signal since the pulse is too short and doesn't always see the entire wave of the 60 Hz (realized it after experimentation) so im transitioning to a DC signal. The counter is counting up to XX, sends signal to relay #2 and makes motor go reverse/forward. That's what i need my system to do. When counter pulses once it hits XX, make motor switch direction. Hope this is a little more clarification. Thanks again for the help.

https://imgur.com/a/7vsCpBB

Joined Jan 15, 2015
6,527
Basically, a push button turns relay on and keeps it on. I push the button again and it turns relay off. I can't seem to think of a method to do this with my basic electrical knowledge so any help or suggestions are greatly appreciated. Thanks in advance!
If you just want a simple quick turn key off the shelf solution there are inexpensive relay cards off the boat from China like this one. If you wish to roll your own a few very good solutions have been posted. The link comes in your choice of 5, 12 or 24 VDC operation.

Ron

dl324

Joined Mar 30, 2015
14,317

djsfantasi

Joined Apr 11, 2010
8,256
While I was typing, dl324 asked an important question... A push button will have to be “debounced”, requiring at least an RC circuit. I’m in a long Disney World line, so can’t come up with an example.

robotix123

Joined Jan 17, 2019
8
Hello!

This is a simple and common circuit requirement. Unless it turns out that it’s not so simple.

The not so simple part. Is it germane that the signal is 20ms long? Or could it be 10ms or 30ms, as long as it alternately switches the relay. Basically, I’m asking if the requirement is one pulse on, next pulse off, next pulse on and so on. If so, keep reading.

Thus action screams flip flop. One could use a CD4013B wired as a toggle flip flop. The output would go to a transistor which will drive the relay. Note that you’d want to place a diode reverse biased across the relay coil to keep the transistor from

Here is how to wire the CD4013B as a toggle flip flop.
Hi! The pulse time can be changed from the counter at a minimum of 0.01s up to 99.99s. But increasing my time affects the accuracy of my project, so the shorter the time, the better. 20 ms is about the longest time I can do before my project's accuracy begins to deteriorate.

The "pulse" is triggered once the counter has counted up to a preset number, XX. After i push the start button, my motor is moving forward which makes the counter count up to XX using an encoder. Once the counter sees XX it sends a "pulse" of 20 ms to trigger my relay which causes the motor to reverse. The counter also resets to 0 and starts counting to XX again but the motor's direction is now reversing. The problem i currently have with my alternating relay is that the input requires it to be an AC signal. Since the pulse from the counter is short, it doesn't always see a full wave to trigger the "switch command" on the relay (see datasheet below). I figured if i switch to a DC source i will not have this problem. I can have the counter output AC or DC so there's no problem as to the power source.

https://www.littelfuse.com/~/media/...littelfuse_protectionrelays_arp_datasheet.pdf

robotix123

Joined Jan 17, 2019
8
Sorry! I got this project from someone else and i'm having a hard time understanding the diagram as well. The counter outputs a pulse of 20 ms once it has reached a preset number. That pulse is currently an AC source which triggers my relay to switch but that's where my problem arise since the pulse is short and doesn't see the full wave. I'm trying to convert it to a DC system where the counter outputs a DC pulse of 20 ms that will have the relay stay on/off until the counter outputs the pulse again. So the relay is just waiting in an on/off state until it sees a pulse and switches. If that didn't clarify it, i'm sorry, i'm about as lost as you are at that point! Thanks for the help.

robotix123

Joined Jan 17, 2019
8
If you just want a simple quick turn key off the shelf solution there are inexpensive relay cards off the boat from China like this one. If you wish to roll your own a few very good solutions have been posted. The link comes in your choice of 5, 12 or 24 VDC operation.

Ron
This actually looks pretty good! May try it out.

Joined Jan 15, 2015
6,527
Worst case you are out about $10. Ron Raymond Genovese Joined Mar 5, 2016 1,653 Worst case you are out about$10.

Ron
Or even \$3.09

Looks like they use an STC 15F104W microcontroller. So, I can see how that makes sense.

There are a few others, however, that claim to be latching, flip-flop , but I see no MCU - and from the schematic, I don't see how it could operate that way at all - what's up with that? What nomenclature is being exploited that I don't understand?

djsfantasi

Joined Apr 11, 2010
8,256
Hi! The pulse time can be changed from the counter at a minimum of 0.01s up to 99.99s. But increasing my time affects the accuracy of my project, so the shorter the time, the better. 20 ms is about the longest time I can do before my project's accuracy begins to deteriorate.

The "pulse" is triggered once the counter has counted up to a preset number, XX. After i push the start button, my motor is moving forward which makes the counter count up to XX using an encoder. Once the counter sees XX it sends a "pulse" of 20 ms to trigger my relay which causes the motor to reverse. The counter also resets to 0 and starts counting to XX again but the motor's direction is now reversing. The problem i currently have with my alternating relay is that the input requires it to be an AC signal. Since the pulse from the counter is short, it doesn't always see a full wave to trigger the "switch command" on the relay (see datasheet below). I figured if i switch to a DC source i will not have this problem. I can have the counter output AC or DC so there's no problem as to the power source.

https://www.littelfuse.com/~/media/...littelfuse_protectionrelays_arp_datasheet.pdf
Ok. So the length of the pulse is not critical (relatively). And it is coming from a counter, not a push button. Then a CD4013B is an appropriate solution with a transistor driver.

crutschow

Joined Mar 14, 2008
29,494
I missed the 20ms pulse requirement.
For that you would need to remove R1 and C1 in my post #6 circuit.

robotix123

Joined Jan 17, 2019
8
Thanks everyone for all the suggestions. I will try as many as i can until I find a solution. Will probably start with crut's and dj's suggestion since I have those components in the shop (i think ...)

I have a clearer idea as to what to do though. Will order some of the other components needed in order to try them all. Thanks so much!

djsfantasi

Joined Apr 11, 2010
8,256
What @cmartinez said; that was what I had in mind.

Cmartinez: what’s the purpose of R3 and C4? And is R1 really necessary? And although the CD4013B power connections aren’t shown, shouldn’t a 0.1 uF decoupling capacitor be connected between Vcc and ground? Just asking for my own curiosity.

cmartinez

Joined Jan 17, 2007
7,632
What @cmartinez said; that was what I had in mind.

Cmartinez: what’s the purpose of R3 and C4? And is R1 really necessary? And although the CD4013B power connections aren’t shown, shouldn’t a 0.1 uF decoupling capacitor be connected between Vcc and ground? Just asking for my own curiosity.
Hello, djs. Are you sure you meant to tag me? I'm not a participant in this thread. Didn't you mean a different thread, or was this thread split from a previous one in which I was a participant?