relay help

Joined
Mar 9, 2004
Messages
3,322
I'm trying to wire up a little relay to switch on a 12v .5amp source when an led turns on. I first tried a normal 12v car relay I had laying around and the led didnt have enough voltage I suppose to flip the switch.

So I picked up a some little reed relays from radioshack http://www.radioshack.com/search/index.jsp?kwCatId=&kw=reed%20relays&origkw=reed relays&sr=1 (I tried the other one after the first didnt work)

So the 5v one works, but almost instantly gets stuck on. The 12v one wont switch on with led voltage and even after switching with 12v it gets stuck on as well. Rather than guess at another one I figured I'd just ask. (I'm guessing now that the voltage rating is for the coil and amp rating is for whatever is going through the switch)
 
Are you sustituting the relay for the led in whatever circuit you have? Most likely the series current limiting resistor for the led is not allowing enough current to operate the relay correctly... If that is the case you will either have to remove the limiting resistor or incorporate some kind of transistor like driver to drive the relay from another power source.

Perhaps you could be more specific regarding the application and intended results?

Also if you are using this relay in a computer type or other sensitive environment, you'll want to have a reversed biased protection diode across the relay terminals to guard against the high voltage spikes produced when the relay coil collapses...
 
Are you sustituting the relay for the led in whatever circuit you have? Most likely the series current limiting resistor for the led is not allowing enough current to operate the relay correctly... If that is the case you will either have to remove the limiting resistor or incorporate some kind of transistor like driver to drive the relay from another power source.

Perhaps you could be more specific regarding the application and intended results?

Also if you are using this relay in a computer type or other sensitive environment, you'll want to have a reversed biased protection diode across the relay terminals to guard against the high voltage spikes produced when the relay coil collapses...

The led has been disconnected right now, although I would like to put it in parallel with the relay later. I dont think it's a current problem as I can switch the 5v relay fine, but I will go ahead and test the 12v reed relay later with something of equal voltage, that I know doesnt have a resistor.

What would be causing the switch to stick on after being connected for a short amount of time? (eg led turns on, turns off later, but 12v doesnt turn off with the led.) My guess is that I'm putting to much current through the switch, but I would like to be sure. As for the diode do I connect it to the coil, the switch, or both?

I'm trying to switch on a little cold cathode light (12v .5 amp draw according to the package, uses an 12v dc inverter) when an led turns on.
 
Long version:

To begin with, if this is an led source from a pc, like moboard, it may not provide enough current to operate the relay, or you may potentially damage the ciruict attempting to draw enough if you bypass the limiting resistor... mobo led sources are simply not designed to source that level of current.

A magnetic field (like used in a relay) is actually controlled by the current through a wire, not the voltage. The reason different voltages effect the strength of the field is because the resistance of the wire is fixed, and in accordance with ohms law, increasing voltage will also increase current. The 5v relay likely works because that coil has less resistance, allowing a larger field and operation of the relay.

Though coils are often rated by voltage, it is actaully the current that is the primary factor. That said, if you are using the spec'd voltage, you cannot feed too much current into the relay.

Relays also have different pull-in and pull-out voltages; there isn't a single voltage or current point when the same power that pulls a relay wiper in will release it. There may be some capacitance or other cause of slow voltage change in your circuit that is causing the prolonged relay action... even with this paraemeter, if the coil voltage was immediately cut off, the relay should release.

The protection diode should be placed across the coil terminals only, with it's polarity opposite the power source. Link


Short version ;) :

You might also get away with a simple mosfet circuit and avoid all that :) I'll see if I can find an easier example, but look at page 4 of this pdf. Basically a simply n-channel mosfet switches the ground of the inverter, controlled by the led circuit connected to the gate terminal... As mosfets are voltage triggered, not current, you can keep your led resistor as is... In fact you may have to keep the led in place because mobos' usually control led's by providing a constant 5V and switching their ground on & off (exactly as the mosfet schematic link, hmmm.... ;)).. So you will have to tap the anode led lead as the gate control. This will result in 'reverse logic' at the relay, meaning it will be on when the led is off, so you will just have to wire the relay wiper contacts accordingly.
 
Okay, I think I need a more general usage regarding the mofset (although theory on how it actually works is always apreciated) Your saying that if I connect my led to one leg on this gismo, when it gets voltage it will disconnect contact between its two other legs? Then I could use any voltage / current through those two legs to power whatever I wanted? (assuming I dont melt the thing of course)

I'm tempted to pickup a diode and try out this last relay here: http://www.radioshack.com/sm-5vdc-1a-spdt-micro-relay--pi-2062480.html which should work... but then again I thought the first 5v one I bought would.
 
That's the idea. +5V on/off signal connects to Gate pin, it's not a bad idea to put a 100K resistor in series with that just for extra protection in case of some type of part failure. +12V to inverter like you would normally wire it up. Inverter grnd to mosfet Drain pin. Mosfet Source pin to ground. Problem solved ;) Basically, the mosfet Gate controls the flow of electricity between the Drain and the Source, much like a relay coil controls the flow of electricity between the wiper and it's contact.

I'm having trouble with my ftp, when I get it working I'll post a schematic illustration. But if you can image the inverter placed where the motor (load) is on that pdf, running off 12V instead of 28, and the +5V signal being the signal generator on the lower left, it's basically the same idea.

edit - look at the relay controller schematic here... same idea, substitute your inverter for the relay (and you wouldn't need the protection diode)..
 
Alright, got everything, soldered it all up, but one small problem. The mosfet wont switch with the led voltage. (12v works, 7v works, 5v no go, led no go.) Although I must admit the little thing is neat. ;o)

Also, I'm using the 5v relay I mentioned before to negate the output of the mofset and the thing has quite a loud click. (at least it works though) I fear that it will fail due to mechanical overuse a little quicker than I would like. (led wouldnt switch the relay alone either)

Is there some ready made semiconductor combination that will do what I'm trying or is a mosfet the closest I'm going to get?

Edit: This is how I have it connected right now
 
Not sure I fully understand you... The mosfet Source pin should be connected directly to ground, and it appears you have it connected to +5V? The term 'source' may be confusing, but it technically refers to a 'source' or electrons (negative), not a positive source of electricity.

My ftp is still fubared, but look at these Imageshack schematics I made and see if you follow...

N Channel mosfets switch the 'low side', or gorund, of a device. The inverter or relay should be powered by 12V direct and the ground side of the device runs through the mosfet.

I've used similar circuits triggered by 5V before (the IRF510 has a gate threshold spec of 2-4V), so see if the following work for you...

This one uses a 12V relay to switch the inverter, similar to what I think you have hooked up:


But the whole purpose of using the mosfet is do do away with the relay like this:
 
Alright, I'll try those later. I think it's kind of odd to name a source in terms of electron flow and not current direction and I was under the impression that the mosfet was simply a semiconductor switch. (But then again I havent heard of mofset till you've just told me)

The reason the relay is in there is because I thought you've said that I would have negative logic if I used the mosfet alone.

Your help is much appreciated ;o)
 
Alright, I'll try those later. I think it's kind of odd to name a source in terms of electron flow and not current direction and I was under the impression that the mosfet was simply a semiconductor switch. (But then again I havent heard of mofset till you've just told me)

The reason the relay is in there is because I thought you've said that I would have negative logic if I used the mosfet alone.

Your help is much appreciated ;o)
Damn them old scientists and their backward ways! LOL
By the time the true direction of electron flow was discovered, the nomenclature of "positive" and "negative" had already been so well established in the scientific community that no effort was made to change it, although calling electrons "positive" would make more sense in referring to "excess" charge. You see, the terms "positive" and "negative" are human inventions, and as such have no absolute meaning beyond our own conventions of language and scientific description.

Forgot about the led... my bad. That's likely a big part of the problem not working on the 5V, also because there is probably current limiting on the mobo before the wiring... try this:


This way the the original led signal will turn on the inverter, and the led is now tied to that and will be on when the inverter is on, but not interfere with the gate circuit. I've also added 1Meg resistor R3 that is a good mosfet design practice to guard against a charge building up on the gate and keeping it on. Led current limiting resistor R2's 1K value is calculated for a std red led @ 10ma off a 12V source; you may have to adjust if using another led type.

edit -

Just ran this through my simulator to verify and all looks good...
 
Alright, I figured a way out. I used the first 5v reed relay that would trigger with the current from the led to switch voltage to the gate of the mosfet. And since there was no current going through the reed relay, it couldnt get stuck on. (gate senses voltage only) That opened the mosfet so 12v could power the cold cathod light. (the mosfet output required no negation at all as the gate voltage connected the legs instead of disconnecting them like I thought originally)

My guess as to why I needed so much voltage on the gate is that due to the high voltage on the drain, my current was being "pinched off" in the mosfet as illustrated by this applet linked off wikipedia: http://www-g.eng.cam.ac.uk/mmg/teaching/linearcircuits/mosfet.html
 
Could you tell me a little more about the simulator you've ran it through? Everything I've seen in that area is obtuse and expensive.
 
Could you tell me a little more about the simulator you've ran it through? Everything I've seen in that area is obtuse and expensive.
Glad you got it working. Not sure what the need of the 5v relay as I've used similar mosfets to switch 50V+ stepper motors off 5V signals, but hey, if it's working for ya...

Regarding the simulation, I use a non-obtuse (but unfortunatley somewhat pricey) app called Proteus VSM. However, they do offer a hobbiest-friendly version called Proteus Lite that is quite affordable and only cuts thye more exotic features. I find it very easy to use.
 
Yeah, I know there are probably more efficient ways to do it. But as long as it works I wont question it. That and I couldnt make heads or tails of some of your schematics. ;o)

I find it surprising that there isnt a well known free version of this kind of software already, I even found a "free" version the other day that forced you to donate to their project before you could download the software. Oh well, at least I now know of one that is comprehendable and in use by at least one person.

Thanks for all your help, I probably would have given up a while ago without it.
 
Don't know much about this one, but it comes from Texas Intsruments and it's free, so....

At least these use a graphical interface... SPICE orginated from text entry a table format versions that I doubt I would have the patience for.

As for schematics, I thought they were pretty straightforward... out of curiosity, what was the source of confusion?
 
First one made sense and is pretty much what I didnt minus the relay as I couldnt get the mofset to trigger on 5v. The placement of the diode seems funny on the second one to me as I dont see how it prevents a surge going back to the mofset (Not to mention the relay isnt needed there as I later found out)

The third one has a few extra resistors, no problem, 5v signal, which is my led, good. But then mentions d1 led with a symbol that almost looks like a diode, but has legs, between the inverter, which I thought up till this point was the cathode dc to ac inverter. But then, after seeing what little sense that makes in this diagram, I thought that maybe you meant it as a black box that inverts the signal from the mosfet, which didnt need inverting at all as I later found out.
 
Just for future reference...

Diodes are often placed directly across the relay coil terminals, as in the 1st schem, to create a direct short for the spike that will be created when the relay coil collapses. This collapsing field will be opposite in polarity to the original power source, which is why the diode is 'backwards'. The diode isn't placed before or after the relay to keep the energy from getting to the mosfet; refer back to the link on protection diodes I posted earlier.


The intent of the 3rd schem was to move the led wiring in parallel with the inverter so that both would be on at the same time, just like any two devicess powered side by side. The difference is in this case the led is now powered by the 12V supply instead of the 5V supply, freeing the 5V trigger to connect only to the gate and not have to power an led itself. The 'inverter' represents the cold cathode power supply (aka inverter ;)). D1 is the schematic symbol for an led... the arrows represent the 'light' in 'light emitting', and are not legs or wired connections.
 
That clears a few things up, the way you drew the 12v input on the top of the inverter was making me think about it's AC output for some reason. ;o)

So you've said you've switched higher voltage inputs with 5v signals before with this same mosfet? I think I may have shorted the the thing out once while playing with it. Perhaps thats it? (I tested the mosfet solo by switching the ground of a fan, still wouldnt work on 5v)
 
Back
Top