# indicating switch status with 2 leds

#### Deen198

Joined Feb 17, 2022
13
I'm trying to convert a signal coming from an electronic controller. the controller has 2 internal switches (relays) and resistors I cannot acces.
Depending on which relay is active I would like to light one or the other LED.
Unfortunately I can't figure it out myself. I tried to build something from transistors and comperators, but it did't work

All help or ideas are welcome .

#### ElectricSpidey

Joined Dec 2, 2017
2,823
Sounds like schoolwork.

#### Deen198

Joined Feb 17, 2022
13
Sounds like schoolwork.
hahah left school 20 year ago. I guess I should have paid more attention in class then.

#### ƎLECTRON

Joined Jan 8, 2022
5
If you can measure the current in each status of relays (maybe with a shunt resistor), then you can specify which relay(s) is ON.

#### MrChips

Joined Oct 2, 2009
30,920
Is it possible to interchange the two switches?

#### Deen198

Joined Feb 17, 2022
13
there is no possibility to physically acces the relays, nor to interchange the two switches

#### BobTPH

Joined Jun 5, 2013
9,106
It is an boring problem if you just brute force it, more interesting if you try to come up with a simple, clever solution.

Can you come up with a set of comparisons that will tell you which of the four states it is in? After you do that it is simple.

A brute force solution would have 4 outputs from the comparators, only one of which is ever high. Can you do that much?

#### ericgibbs

Joined Jan 29, 2010
18,976
hi,
Is the Green arrowed line normally to 0V or some other point?
E

#### Attachments

• 51.1 KB Views: 3

#### Audioguru again

Joined Oct 21, 2019
6,746
Only if the output from the two resistors has no other connections:
An opamp can be used as a comparator to light a white LED when the input current is 6mA (from the 2k resistor) or light a green LED when the current is 12mA (from the1k resistor).

#### BobTPH

Joined Jun 5, 2013
9,106
hi,
Is the Green arrowed line normally to 0V or some other point?
E
It is clear from the diagram. It is floating is neither switch is on.

#### ericgibbs

Joined Jan 29, 2010
18,976
Hi,
If the Relays are in a box, powered from +12V where is the return line.??
How can it be 'floating'
E

#### Ya’akov

Joined Jan 27, 2019
9,228
A small MCU with an ADC could do this pretty easily—unless I am missing something, which is possible.

#### MrChips

Joined Oct 2, 2009
30,920
A small MCU with an ADC could do this pretty easily—unless I am missing something, which is possible.
I had assumed that TS wanted a solution using comparators and logic gates, not MCU.

#### Ya’akov

Joined Jan 27, 2019
9,228
I had assumed that TS wanted a solution using comparators and logic gates, not MCU.
Well, he said he failed doing it that way but I didn’t read it as a specification. The ATTiny85 would do it, it has 4 10-bit DACs and the parts count would certainly be very low.

#### Deen198

Joined Feb 17, 2022
13
hi,
Is the Green arrowed line normally to 0V or some other point?
E
it was originally connected to 1 led, that had 2 brightness levels depending on the which switch is active. As the brightness difference was hard to see, I decided to use 2 leds instead

#### Deen198

Joined Feb 17, 2022
13
I had assumed that TS wanted a solution using comparators and logic gates, not MCU.
yes I would like to do it with logic components. I found a solution using a comperator, but this requires a reference voltage from the source. My goal is to avoid running an extra wire from the battery, as it not easy to run an extra wire to this location.

The goal is to only use the available chassis ground and the output wire from the red box.

#### MrChips

Joined Oct 2, 2009
30,920
yes I would like to do it with logic components. I found a solution using a comperator, but this requires a reference voltage from the source. My goal is to avoid running an extra wire from the battery, as it not easy to run an extra wire to this location.

The goal is to only use the available chassis ground and the output wire from the red box.
Of course, there must be a return wire to the battery.

#### ElectricSpidey

Joined Dec 2, 2017
2,823
i don't think you have any options at all including any logic, analog or a micro without having the positive voltage available.

#### WBahn

Joined Mar 31, 2012
30,229
How much current do each of the LEDs need?

When SW2 is closed (and SW1 is open), you would only get 6 mA if the output of the box were shorted to ground. With a White LED, you are looking at only about 4 mA. Unless your LED is able to be sufficiently visible at something like 1 mA, you aren't going to have much to work with.

If you LEDs are able to work at the 1 mA level, then I think there is a solution that is pretty simple.

#### BobTPH

Joined Jun 5, 2013
9,106
The goal is to only use the available chassis ground and the output wire from the red box.
Then you should have said that in the fist post. In your diagram the 12V line, as well as the ground is outside the box, so I assumed those two were available.