Jump to content

How To Relay

So I've made a circuit where I want to use generated power to turn on a lightbulb or whatever.  I want to have the output turn off immediately when the input stops, but I need a battery in between the input and output to help run the controller and act as a capacitor, but it's causing the light to stay on long after the input has been turned off.

 

I am thinking of using a relay (probably an automotive one) so that if the input switches on the output (the funky colours in the diagram), but I'm not 100% sure how relays work so I'm afraid most of the current will go into the relay if I just hook it up to the input voltage and blow it up, or lead to large losses. Any examples I've seen for relays have been a small amount of voltage (from an Arduino or something) that switches on a higher voltage so I'm not totally sure about using one in this application.  If there are some more electronically inclined people here could you let me know if this is a terrible idea?

Amazing Relay.png

Link to comment
Share on other sites

Link to post
Share on other sites

I know nothing about electronics, but can you please send me a copy of ALEXCADTM? I think solidworks finally has a competitor. Hope you find what you're looking for!

Main PC:

AMD Ryzen 7 5800X • Noctua NH-D15 • MSI MAG B550 Tomahawk • 2x8GB G.skill Trident Z Neo 3600MHz CL16 • MSI VENTUS 3X GeForce RTX 3070 OC • Samsung 970 Evo 1TB • Samsung 860 Evo 1TB • Cosair iCUE 465X RGB • Corsair RMx 750W (White)

 

Peripherals/Other:

ASUS VG27AQ • G PRO K/DA • G502 Hero K/DA • G733 K/DA • G840 K/DA • Oculus Quest 2 • Nintendo Switch (Rev. 2)

 

Laptop (Dell XPS 13):

Intel Core i7-1195G7 • Intel Iris Xe Graphics • 16GB LPDDR4x 4267MHz • 512GB M.2 PCIe NVMe SSD • 13.4" OLED 3.5K InfinityEdge Display (3456x2160, 400nit, touch). 

 

Got any questions about my system or peripherals? Feel free to tag me (@bellabichon) and I'll be happy to give you my two cents. 

 

PSA: Posting a PCPartPicker list with no explanation isn't helpful for first-time builders :)

Link to comment
Share on other sites

Link to post
Share on other sites

This should work, a few things to look out for.

 

IDK the input power, but if the voltage is changing(like a hand crank), it may cause the relay to toggle. A lot of this depends on what your input is.

 

Make sure the coil voltage on the relay is correct, the car relays are normally 12v on the coil, and 24v can start to cause issues. Also make sure to use a diode on the relay coil due to the inductive spike when turned off.

 

Id look into a mosfett, should be able to do this aswell.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, Electronics Wizardy said:

This should work, a few things to look out for.

 

IDK the input power, but if the voltage is changing(like a hand crank), it may cause the relay to toggle. A lot of this depends on what your input is.

 

Make sure the coil voltage on the relay is correct, the car relays are normally 12v on the coil, and 24v can start to cause issues. Also make sure to use a diode on the relay coil due to the inductive spike when turned off.

 

Id look into a mosfett, should be able to do this aswell.

Ideally the relay would turn on around 12V but be able to handle up to around 30V without turning into smoke, which I'm guessing means I'll need to get something a bit more specialized than whatever I find at the parts store.

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not sure if it's 24V AC or DC that you're using as an input, you've put an AC sign before 24V 
If that's DC, you've just saved yourself a lot of trouble 
24-28V DC relays are all over the place.
Just get yourself a decent one and use a diode(flyback) in reverse biased to protect the circuit.
You can do that with a Transistor. MOSFET whatever your heart desires or even better an IGBT, can easily handle hundreds of amps no problem.

Datasheet for AC/DC relay (https://www.mgelectronic.rs/ProductFilesDownload?Id=4174)

If it's 24V AC, if not skip the rest
Ok, so the coil resistance of a 24V AC relay is around 160ohm.
Connecting it to 24V AC will cause about 150mA current through it.
So, (24*0.15) 3.6 watts of wasted power right?

WRONG!!!
Coil is an inductive element and will have reactance in AC circuit combing that with the coil resistance you will get the impedance.
This impedance will cause 50-60mA(depends on the frequency) current to flow instead of 150mA lowering the power loss to 1.2W
and surely 50-60mA isn't much and there is no way most of the current will flow just to switch the relay.

Just look out for the types of relay that you get.
There are mainly two types, one with AC coil and with DC.
Since you're using 24V AC to switch the relay you must get a relay with AC coil and rated voltage.

Link to comment
Share on other sites

Link to post
Share on other sites

44 minutes ago, Cannon Lake said:

I'm not sure if it's 24V AC or DC that you're using as an input, you've put an AC sign before 24V 

I normally use ~ as an approximation sign, guess I'll never do that again with regards to electronics since this is DC.  Thanks for the info!

Link to comment
Share on other sites

Link to post
Share on other sites

You can buy several kinds of relays.

 

There's a cheaper relay type which is non-latching, which means you have to keep the coil energized to keep relay ON (meaning the secondary contacts connected together and current flowing through them). As soon as the coil is not energized, the relay turns OFF and the secondary contacts no longer let energy flow.

There's slightly more expensive relays called latching, which only require you to send a sort of pulse of energy on one of its pins to turn the relay ON (and something mechanically changes inside to have the secondary contacts connected) and then even if you stop that pulse of energy, the relay will be permanently in the ON position.

You turn such latching relay OFF by sending another pulse of energy on another pin, for a period of time.

 

So the non-latching relays are let's say 1-2$ and they need maybe 12v at around 30-50mA constantly to keep the coil energized and allow energy to flow to the inverter.  You would use a part of your battery power just to keep the relay on. It may make more sense to buy a latching relay which would only need let's say 12v at 50mA for a second to mechanically flip the relay to the ON position, and another such second pulse on another pin to turn it OFF.

 

Here's an example of a cheap non-latching relay that can handle 10A of current on the secondary contacts: digikey link It's $1.3 if you buy one and says it uses 400mW (12v @ ~33 mA) to stay on.

Here's an example of a latching relay that can handle 16A of current on the secondary and it's not too expensive at around 4$: digikey link

The operation and release time is only 10ms, so you can be fairly sure you turned it on or off if you send power on one of the pins for a bit more than 10 ms, afterwards it stays on or off without having to keep pumping energy in the relay. It needs slightly more energy (around 600mW) and the burst of current would be slightly higher but it's for such a short time that it won't matter.

 

Anyway, what you want to do can be easily done with some general purpose npn transistors and some diodes. It can be done even easier with a microcontroller like an arduino or a PIC.

circuit_relay2.png.6ed90f8fc910fee6872102fb0b18c7af.png

 

 

You'll need a transistor with good enough voltage on base pin (at least 30v or so), or you can use 2 resistors (voltage divider) or a zener diode to reduce the voltage on the base pin to some reasonable level.

 

Another option would be to add a diode between the dc-dc converter and the battery and then use a microcontroller to measure the voltage on the left and right side of the diode - on the left you'd have the voltage of the dc-dc converter (so you'd know if there's no voltage, then charger isn't working) and on the right you have the voltage of the battery.

You can keep the microcontroller powered 24/7 from the battery, through a small 12v to 5v regulator, since it will basically use mA worth of power while monitoring the two power sources using it's ADC module. This way you can use either a non-latching or a latching relay but a latching one would be great because the micro can send the pulses of energy to turn on or off the relay whenever you think it's needed and not waste energy keeping the coils energized (for example, measure input voltage from dc-dc converter 2-3 times a second and turn off the relay only if the dc-dc converter stops outputting 12v for 30 seconds or so,  or turn off the relay only when the battery voltage drops below 10.5v  (most relays will work down to around 9v but lead acid batteries can be damaged if voltage goes too low)

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, AlexTheGreatish said:

but I need a battery in between the input and output to help run the controller and act as a capacitor

What controller ? Your current drawing has no need for the battery at all, more information on how this "controller" comes into play might help towards a better solution.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×