Jump to content
Electronics-Lab.com Community

Controlling a Relay via an LED Circuit


Recommended Posts


I am always looking to automate things in my house and often times it would be helpful to be able to control a relay based on the status of an LED. For example I just purchased a wireless driveway automobile monitor and I would like to tie it into my homeautomation system. It has an LED that turns on when someone comes pulls into the driveway. Not just for this project but in general is there a simple circuit I could build that would allow me turn on a relay when an LED lights up. I'm thinking I would need to either turn on a transistor or some sort of gate  1st so as not to load the LED driver circuit. This xsistor or gate IC would then drive another xsistor that could sink enough current to close a relay.

Thanks in advance

Rob

Link to comment
Share on other sites

There would be many ways to do this. Some require tearing into the circuit and making some measurements and some do not.
Do you still need to see the LED? If not, you could install a LDR on it and use the LDR as part of a voltage divider to turn on a relay. This would probably be the easiest method.
Another way is to tear into the device and measure how much voltage and current you have available. Then you can calculate a bipolar transistor to be used as a switch. You might also want to look farther ahead on the circuit and see what is turning on the LED. You might already have what you need to control a relay ahead of the drop-down resistor that limits the current to the LED.
Hope some of this starts you with some ideas. Any chance you have a schematic? It would be very helpful and would make the project a lot easier.

MP

Link to comment
Share on other sites

What is an LDR? I have never heard the term. I'm guessing "Load ? Resistor" Not sure. I don't have a schematic unfortunatly.

In most cases I don't think I could do with out the LED.

As far as looking at what drives the LED and trying to determine how much current is available I was hoping to have a more generic approach. My thinking may be flawed and correct me if I'm wrong, but don't just about all LEDs that would be used for say an indicator light drop 1.5 volts and draw less than say 20ma.

The 1.5 volts is pretty much a given and the current unless it's some sort of specialized LED should be pretty much within a given range also.

Given these specs and assuming that we can remove the LED is there a simple circuit that would work most of the time without having to be concerned about specifics of what is driving the LED.

Thanks again for the help. Mt theory may be all wrong here. I'm just thinking out loud.

Rob

Link to comment
Share on other sites

LDR means Light-Dependent Resistor. These are made with some material that changes conductivity when illuminated -- the typical Cadmium-Sulfide LDR will have less than 1 kOhm when in the light, and something like 1 MOhm when in the dark.  This variance in resistance can then be used to control a driver transistor and a relay.

However, there is another option where there is an LED that can be removed, which is to use an optocoupler. This device contains an LED and a phototransistor inside a small package resembling an IC. When there is current passing through the LED its light will cause the phototransistoer to conduct, and as with the LDR, it can be used to drive a heftier transistor  and a relay. There could also be another transistor driving a visible replacement LED if so desired...

Another advantage of the optocoupler, similar to the solution using and LDR, is that it provides isolation, so it will have the possibility of working without problems no matter what kind of circuit is driving its LED -- as the optocoupler merely replaces it, and the currents and voltages associated with the relay can be on a completely different power circuit, so as to avoid disturbing whatever unit it is hooked up to.

The 4N35 optocoupler or one of its equivalents would be useful here.

Ashtead

Link to comment
Share on other sites

Thanks for the info Ashtead. I like the idea of the opto-coupler. I now need to figure out how to build the actual relay driver circuit that will be switched on by the Transistor side of the opto-coupler. Do you know if there is a good example of a relay driver circuit like this somewhere?

Thanks Again

Rob

Link to comment
Share on other sites

Rob,

I have usually fed the output of my optocoupler circuits into some logic circuits, and used a simple resistor-transistor combination driven from some other part of the logic. I have typically used something like in the attached figure, where the transistor's base is left open, emitter is grounded (to 0V), and the collector output is returned to +5V via a 2.2 kOhm resistor, for an approximate 2 mA transistor current ICE on. (This current can be lowered, meaning this resistor can be increased,  10 kOhms for 0.5 mA for example).

The following 74HC14 Schmitt-trigger gate will make a nice transition when the transistor goes into or out of conduction, and then it drives the 2N3904 that drives the relay itself. I have shown a possibly different voltage for the relay, again, this can be the same or the 5V for the optocoupler transistor can be obtained from a voltage regulator. Or the 74HC14 can be replaced by a 4584  which can work anywhere from 3 to 15 V, and then feed this off the same power supply as the relay for a 6V or 12V relay. Just increase the values of the 2.2 k and 1k resistors accordingly.  These values are not terribly-critical, anything that provides between 0.5-2mA for the optocoupler transistor and at least 1 mA base drive for the 2N3904 (or another simliar general NPN type such as BC108 or BC237) transistor will do.  Another part of the 74HC14 or 4584 can be used to drive a locally visible LED.

And of course there should be some resistor or current-limiting for the LED in the optocoupler, as for every other LED.

Hope this is useful.

Ashtead


post-16369-14279143192839_thumb.png

Link to comment
Share on other sites

One thing to keep in mind if you are adding the opto coupler in series with the existing LED is that the opto coupler has a LED in it which is going to drop your voltage and change the available current to both devices. When calculating current in a circuit with an LED, you always subtract the LED voltage drop from the circuit before dividing into the value of the resistor, thus, in this design, you might have to remove the resistor in the original circuit and replace it with a different value. Not a big change, but something to be aware of in case the original limiting resistor will only feed the existing LED.

MP

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
  • Create New...