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.

Help needed for controlling relay

Status
Not open for further replies.

Rocket-Man66666

New Member
Hi guys, first time poster here. But I've been working on a little project which got me stuck... :confused:

I have a relay (3V, single coil latching) which I would like to control using a momentary push switch. What I would like is that when I push the button, the short current latches the relay in a certain position. Now comes the fun part: If I push the button again, I need a reversed current to the relay to latch it in it's other position.
Since it has to run on a single 9 volts battery, it has to be pretty power friendly hence the latching and the momentary switch. But I'm unable to come up with something that works, without making it way more complicate than it has to be...

So could someone help me out? :)
 
Welcome to the forum!
How much current does the relay coil draw (or what is its resistance)?
 
Something like this?
LatchingRelayDriver.gif
 
Woow that was fast and looks exactly like what I need!
I only have one question though:
How hard is the circuit on the battery when it remains in standby?

The reason I ask this is because I'm going to be using this to activate a certain build-in effect in a guitar. Although I will be using a stereo jack to remove the battery out off the circuit when the guitar is not plugged in, how will this circuit drain the battery life when the guitar is plugged in?

Eitherway, thank you so much for providing me with this diagram!
 
How hard is the circuit on the battery when it remains in standby?
Standby current is ~ 20-30 μA (chiefly leakage current in C2/C3). R3 may need adjustment, depending on the current and pulse duration needed to flip the relay.

Edit: My simulation assumed a coil resistance of 32 Ohms, but from the datasheet for the single-coil latching type isn't the coil resistance 45 Ohms? If so, you might be able to reduce the C2/C3 values.

Edit: For a 45 Ohm coil (current = 66mA nominal), reducing C2 and C3 to 100uF each should give a pulse ~ 70mA lasting ~ 6mS (twice the max flip time specified).
 
Last edited:
Yes you are right, it is indeed 45Ω! Thanks for double checking my statement!
If I reduce those values of C2 and C3, do I still have to figure out the best resistance for R3?
 
With a fresh 9V battery R3 is theoretically needed to limit the current into the 3V 66mA rated coil. However, the coil will withstand a brief pulse exceeding 66mA, since coil heating depends on both the current and the pulse duration.
The values shown for R3 and C2/C3 give a pulse which exceeds 66mA for only a few mS (so is not harmful), but is ~66mA for sufficient time (hopefully!) to allow the relay to flip.
Reducing R3 would increase the peak current. Reducing C2/C3 would reduce the pulse width to compensate. A balance has to be struck between a pulse with enough current and duration to operate the relay reliably even when the battery voltage drops, and excessive current or duration which could cause overheating (unlikely) and waste battery power. As a compromise I think I'd leave R3 at 33Ω and make C2/C3 perhaps 220μF each. You may need to experiment to get the ideal values for your particular relay and various battery states.
Even if the relay were operated 100 times a day the battery should last > 1 year.
 
Haha...those are numbers I like to see! :D
I can't thank you enough for helping me out!
I only have one question remaining:
I've never worked with this kind of IC before, and by the looks of things it seems like I only have to wire up one side...
I'm assuming that this is correct, but I might as well double check it.

I've attached my scematic (with the old values and missing switch) and the data for the IC. So is my scematic correct?
 

Attachments

  • iccd4013.jpg
    iccd4013.jpg
    19.2 KB · Views: 190
  • Relaydriver.jpg
    Relaydriver.jpg
    33.1 KB · Views: 200
I've never worked with this kind of IC before
In that case be aware that CMOS ICs can easily be damaged by static electrical discharge, e.g. from the human body, so take due precautions when handling it. This is a dual latch IC (as you've noted). Unused CMOS inputs should be grounded. Here's the schematic with pin numbers added.
LatchingRelayDriver(pinout).gif
 
So, picking up on my old thread...
Finally received my much needed relay (took like 4 months). I had already designed the board and put everything on it. So it was already ready to be tested, all it needed was the relay.

So I put it on, hooked it up and it works, sort of... I could use some help debugging...
So here's what it does: let's say the relay has two positions where it latches,the ON position and the OFF position. When I hook up the power supply, nothing happens and the relay remains in the OFF position. When I press the button, the relay latches in the ON position, but when I press it again nothing happens.
When I then remove the power, nothing happens, even if I press the button. When I reconnect the power supply, the relay latches to the OFF position. Now the cycle can be repeated. There's only one other thing: after the relay gets "stuck" in the ON position and I reconnect the power for a brief moment, the relay latches back to the OFF position and the switch then works once without a power source connected. After using the switch without the power connected, the relay switches to the ON position and remains there, even when the button is pressed again or when the power supply is reconnected. It only latches back off when I dis- and reconnect the power once again.

That's about as detailed as I can be...
Where could the problem lie?
 
Which circuit are you using to drive the relay? Post a link, or the actual schematic
 
Alec_t helpt me out a bunch, by designing the circuit for me and he posted the final schematic in his last post. It's the one from the 1st of July
 
Assuming it is wired right...

I notice that the only timing info on those data sheets shows the relays being driven with a 20Hz square wave. That would make the pulse period ~50ms. Alec's circuit applies a pulse width which is ~15ms. It is wide enough?

Another likely problem is that the push button is not debounced. If the button causes the flip-flop to change multiple times at each push, there could be either an odd or even number of flip-flop transitions. If you put a scope or meter on the Q of the flip-flop, does it change state from 0 to 1 and 1 to 0 per each button push?
 
I'm gonna try to clarify what I've measured here at Q...
If I put power to the circuit, I read 9 volts on Q. Pressing the button causes the readout to drop to zero and I can hear the relay click into the ON position. After this pressing the button again does nothing. Disconnecting the power supply when in the ON position causes Q to be a little negative (not even half a volt) and goes back up to zero. Then when I reconnect the power, I can hear the relay click to the OFF position and the reading on Q becomes 9 volts again.
Now if I remove the power when in the current state, than I see the voltage dropping slowly. Which is definetly a capacitor discharging. As long as the power is above a certain threshold, I can press the button and I can hear the relay click to the ON position, but the readout doesn't drop completly to zero. But then when I reconnect the power the first time, it DOES drop to zero. Then again pressing the button in this state changes nothing. When I disconnect, uppon reconnecting the relay clicks back to the OFF position and I once again get 9 volts at Q.

I assume that since the relay response to the first press, the duration is fine. I feel like there's something else that isn't working as it's suppose to...
 
After some more digging I've come across a site that had the old datasheets stored. The actual nominal current is 93.8mA with a resistance of 32Ω.
Here's a link to the real datasheet:
https://www.onlinecomponents.com/datasheet/tq4-3v.aspx?p=10561993&Resource=1

Hi rocket..

Is this relay "magnetically" latched? That is, does it retain it's last operated state even if power is removed?
Maybe I missed it but I couldn't find this info in the data sheet...

eT
 
Mike
Alec's circuit applies a pulse width which is ~15ms. It is wide enough?
The spec gives the switching time as 3ms, so 15ms should be enough.
Another likely problem is that the push button is not debounced.
It is debounced, by R1C1 (time constant 47ms).

Rocketman
Check that R1 is properly connected.
What is the voltage at the C2/C3 junction?
Can you confirm you have pins 4,6,8,9,10,11 grounded?
Try connecting a 220uF capacitor (if you have a spare) directly between pins 7 and 14.
 
Last edited:
eTech yes this relay retains it's last position even when the power is removed. It needs a current in the opposite direction for it to latch into the other state.

alec_t Reducing R3 doesn't help. Furthermore the voltage at the C2/C3 junction is 8 volts and it drops slightly when the relay latches into position and than it moves back to 8 volts.

I don't now what happened, but the whole thing isn't doing what it used to anymore...
At Q, the voltage remains 9 volts, despite the position of the relay. Furthermore, I'm having a really hard time getting the relay to latch back to the OFF position. When I used to disconnect and then reconnect the power, the relay would latch back to the OFF position. Now I have to take the power off and wait like 10-15 seconds before reconnecting for it to sometimes latch. And when it does, it usually latches to a sort of hybrid state, where one pole connects to both sides of the switch and the the others point in opposite directions...
Also when I get it to entirely latch back to the OFF position, a single press of the button sometimes latches it to the hybrid position and another press makes it latch entirely to the ON position. The button has also become quite unstable. Sometimes it reacts no sooner than the fourth press.
So has the relay died because of some flaw in my layout or what what the hell is going on?
 
I have edited my previous post, but your latest post must have arrived while I was doing that.
So let's try another debug strategy.
First, disconnect one end of the relay coil from the circuit so that we can see whether the problem is with the circuit.
Then confirm all the IC pin and R1 connections and power up the circuit.
What is the voltage now at the C1/C2 junction?
Does the Q voltage switch from 9 to 0 and back when the button is pressed (allowing at least half a second between presses)?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top