2

I need to have a relay turn on/off power to a circuit, with the push of a button.

The way this will work is, when the button is pressed, power will be stopped to the circuit.

If it is pressed again, power will be restored.

I am new to relays, and I am not sure what a circuit like that should look. Seeing similar projects online, I saw projects where power can be enabled when the button is pressed.

However, in projects like these the power was on, only when the button was being pressed. There was no memory involved.

What I want is the button to enable the power on/off.

Also, is a diode always required when using relays in the circuit?

The power is 12 V. The circuit indeed runs at 12 V. I get the 12 V from a transformer. The output of the transformer is fed to a barrel jack switch (like the big black one the Arduino has). There I have my 12 V. Then the 12 V should go into this board. But I have a button that when pressed will shut down power to the board, in order to turn off the servos immediately - in case of an emergency.

This is why I have to have a latching relay, so that it retains memory (when button is pressed once - the circuit is powered on/off). However, since this is the first time working with relays, I am not sure how I should wire the whole thing. Also, I am not sure if a diode should be used - or if it is not needed and is implemented inside the relay.

Null
  • 7,448
  • 17
  • 36
  • 48
user1584421
  • 1,259
  • 2
  • 17
  • 32
  • 3
    Just use a toggling pushbutton button. I prefer a toggle lever, personally. – DKNguyen Feb 22 '22 at 15:42
  • 1
    There are relays that toggle each time they're activated. Would that work for you, or are you treating it as an exercise in relay logic? https://www.digikey.com/en/products/filter/power-relays-over-2-amps/188?s=N4IgjCBcoGwOwFYqgMZQGYEMA2BnApgDQgD2UA2iAMwxVwBMEAusQA4AuUIAyuwE4BLAHYBzEAF9xxehRB982TAE8QTcUA https://www.digikey.com/en/products/filter/signal-relays-up-to-2-amps/189?s=N4IgjCBcoGwOwFYqgMZQGYEMA2BnApgDQgD2UA2iAMwxVwBMEAusQA4AuUIAyuwE4BLAHYBzEAF9xxehRB982TAE8QTcUA – Cristobol Polychronopolis Feb 22 '22 at 15:51
  • @Yes that would work. So just the toggle and the relay? Is there a need for diodes or other circuitry? I have never worked with relays before. – user1584421 Feb 22 '22 at 15:52
  • A flyback diode across the coil is always preferred, to prevent the current from causing arcs and damaging other parts of the circuit. Other than that, yes, each time you activate the coil (momentarily) the relay will toggle from one state to the other. – Cristobol Polychronopolis Feb 22 '22 at 15:54
  • @CristobolPolychronopolis That's not how a single-coil latching relay works. You have to apply current through the coil in one direction to turn it on, and the *opposite* direction to turn it off. – Hearth Feb 22 '22 at 16:00
  • I haven't used one in years, but the last one I used worked as I described. IIRC, it used the solenoid portion to advance a cam which drove the contacts. Maybe that type has a different name? If you can clear this up, I'll be grateful, but OP even more so. – Cristobol Polychronopolis Feb 22 '22 at 16:03
  • @CristobolPolychronopolis I updated the question with the relay i plan on using. Can this be driven without a microcontroller? Because it says for arduino. Just hook up the circuit and the toggle button... Do i also need a diode for it? – user1584421 Feb 22 '22 at 16:07
  • Does this answer your question? [How to make an ON/OFF circuit to light up a led, using only relays and one normally open button?](https://electronics.stackexchange.com/questions/609073/how-to-make-an-on-off-circuit-to-light-up-a-led-using-only-relays-and-one-norma) – vu2nan Feb 22 '22 at 17:03
  • *What is “power”?* 12V, 5V, mains ac voltage, …? All those will need slightly different solutions. You show a really with a 12V coil. Does your circuit run on 12V, and if so: where does that 12V come from? Whatever the source of 12V is, don’t you want to turn it off too? Please edit your question to clarify the exact application. – Kuba hasn't forgotten Monica Feb 22 '22 at 20:32
  • @Kubahasn'tforgottenMonica Thank you. I updated the question with the information you needed. – user1584421 Feb 22 '22 at 21:57

3 Answers3

7

A simple low-cost solution would be to just use a push-to-on / push-to-off switch to control the power.

enter image description here

There would be no need for a relay.

vu2nan
  • 15,929
  • 1
  • 14
  • 42
2

Here is my proposed solution. It require 4 small SPDT relays ( 5 or 12 V ) and 1 big 120VAC SPST contact relay with 12Vdc coil if you need lots of switching power. Need also 6 passive diodes. Basically, it is a mechanical RS flip/flop. No complicated electronic but require a bit of wiring. 5 or 12V could be supplied with a cheap plugin power block enter image description here

Fred Cailloux
  • 799
  • 7
  • 15
1

What I want is the button to enable the power on/off.

You can make a push-button do what you want by using this circuit: -

enter image description here

Image from this Q and A.

Then, on the logic output of the 2nd inverter, add a transistor for controlling the coil current for the relay. A bit like this (but instead of the LED and 29=70 Ω resistor you fit the coil: -

enter image description here

Image from this Q and A. Your coil supply isn't limited by the supply to the latching inverters either.

Also, is a diode always required when using relays in the circuit?

Yes, you'll need a reverse acting diode across the coil.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • Thank you very much! But a comment on my question suggested toggle buttons. I think this would make the circuit far simpler. If you would like, you can edit the question, and add the toggle button circuitry as well. – user1584421 Feb 22 '22 at 15:53
  • @user1584421 I am not recommending that route; I'm recommending the above route. – Andy aka Feb 22 '22 at 15:55
  • @user1584421 I'm also not recommending the relay (added to your question) for two reasons; (a) it comes from Shamazon and they are not a quality route for electronic components that I can ever recommend until they get their brown-stuff together in a far greater way and (b) there is no data sheet for the part hence, if you can work out what the coil resistance is then good luck to you. – Andy aka Feb 22 '22 at 16:21
  • Thank you very much for your input. I am a complete newbie to relays. Searching more - after i posted the question - i found out about latching relays, that preserve the state. So i think i will go with these. – user1584421 Feb 22 '22 at 16:26