Maker Pro
Maker Pro

Need to find a way to do different functions basedon incoming voltage

ddb12

Mar 7, 2015
4
Joined
Mar 7, 2015
Messages
4
Hello.
I am working on a circuit, that could have either12vdc or 24vdc being applied. I need to be able to have the circuit energize a red led if12 vdc, or a green led if 24 vdc is applied.

I have been searching Digi-Key and the internet for some ideas on this, but have not foundanything that would work.

Any suggestions or recommendations would be greatly appreciated.

Thank you.

Darcy
 

davenn

Moderator
Sep 5, 2009
14,260
Joined
Sep 5, 2009
Messages
14,260
hi there
welcome to EP

a couple of comparator circuits may do the trick for you
there are comparator circuit ideas on google and several that turn on a LED for a given voltage
you would need to combine 2 of them one for 12V and one for 24V

that's one idea for you :)

Dave
 
Last edited:

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
Connect a relay with a 24 V DC coil and SPDT contacts to your circuit that supplies either 12 V DC or 24 V DC to the relay coil. Also connect the common contact of the SPDT contacts to this source of power. Now, if 12 V DC is applied to the relay coil it will be insufficient to energize the relay, so connect the red LED (through a current limiting resistor appropriate for 12 V and the LED current) to the NC contact on the relay. If 24 V DC is applied to the relay coil, it will be sufficient to energize the relay, so connect the green LED (through a current limiting resistor appropriate for 24 V and the LED current) to the NO contact on the relay. Voila! You're done.
 

ddb12

Mar 7, 2015
4
Joined
Mar 7, 2015
Messages
4
I had seen the comparators mentioned before, however, i had passed them over as i only have 1 power source. Now that i have do ne more looking at the comparators, i bwlieve that they may be thr answer that iwas looking for. Willhave to wait until Monday to pick up more parts to test it out.
 

ddb12

Mar 7, 2015
4
Joined
Mar 7, 2015
Messages
4
Hevans1944 - i have seen to often devices that are supposed to run on 24vd, run on 12vdc (not very well). While a relay would be the simpliest solution, to high of a chance of a false trigger of the relay.
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
"How does the circuit turn off the red LED when 24 V is present?

The microcontroller does that, along with the comparator.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
Hevans1944 - i have seen to often devices that are supposed to run on 24vd, run on 12vdc (not very well). While a relay would be the simpliest solution, to high of a chance of a false trigger of the relay.
Well, your decision then. Reliability should always be the first concern. I have seen too many circuits that "almost" work "most" of the time.

I've not seen any relays with 24 V DC coils that pull-in at 12 V DC, but plenty will stay pulled in at that voltage or lower, which could cause a problem if the voltage changed from 24 V DC back down to 12 V DC. Depends on the relay construction. Maybe I've never encountered a 24 V DC relay that pulls in at 12 V DC because I never operate relays at other than their recommended coil voltage.

So, it looks like you do need a comparator circuit. Please let us know how that worked out, after the parts you ordered arrive and you get an opportunity to try it. Post a schematic too if you can. We're all here to learn from each other.
 

Colin Mitchell

Aug 31, 2014
1,416
Joined
Aug 31, 2014
Messages
1,416
What an absurd solution to use a 24v relay.
Where were you when they invented the TRANSISTOR ?????
 

davenn

Moderator
Sep 5, 2009
14,260
Joined
Sep 5, 2009
Messages
14,260
I had seen the comparators mentioned before, however, i had passed them over as i only have 1 power source. Now that i have do ne more looking at the comparators, i believe that they may be the answer that I was looking for. Will have to wait until Monday to pick up more parts to test it out.

I think it would definitely be worth experimenting with :)
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
What an absurd solution to use a 24v relay.
Where were you when they invented the TRANSISTOR ?????
I was telepathologically involved with nuclear weapons in 1947 when the transistor was invented, having inspired the development of the atomic bomb three years previously while still in the womb, an attempt to free my father from a German POW camp. Fortunately for Dad, George Patton's Third Army liberated him and thousand of others, but by then the cat was out of the bag so we proceeded to test against Japan. No transistors necessary, but plenty of 24 V relays were involved.
 

ddb12

Mar 7, 2015
4
Joined
Mar 7, 2015
Messages
4
Hello. Just letting you know tbat I based my final design on the one that Colin presented. The only change I made., was to use a 18 volt zener instead of the 12volt. Asx most 12 volt power supplies actually put out around 13.5 volt, I figured that making the division at 18 volt would give the most reliable results.

Thank you for the assistance
 
Top