Help needed with led control

Thread Starter

Deen198

Joined Feb 17, 2022
13
For a car project I’m looking for a way to control 2leds with 1 ecu pin.

In the current situation, the ecu output pin delivers 12V, and inside the ecu either a 1k or 2k resistor is used to control the output current. So the ecu can switch between the 2 values

A Led is connected to the output pin, and depending on the ECU state, the led is getting 6mA by the 2k resistor, or 12mA by the 1k resitor.

In the first situation the led will glow slightly, in the second state it will be brighter.

Now my plan is to replace the 1 led design by a 2 led configuration.

Is there a way to control 2 leds (1 turning on when the output is 6mA and the other when the output is 12mA? This by only using the ecu output signal and ground? So without using a connection to the battery?
 

Ya’akov

Joined Jan 27, 2019
9,069
Welcome to AAC.

You can do what you want with a comparator. I will leave it to one of the regulars with greater facility producing simulations to provide you with a practical circuit. But, it is trivial in principle and probably not very hard in practice.

(@crutschow @ericgibbs just a couple of people who came immediately to mind)
 

AlbertHall

Joined Jun 4, 2014
12,344
Welcome to AAC.

You can do what you want with a comparator. I will leave it to one of the regulars with greater facility producing simulations to provide you with a practical circuit. But, it is trivial in principle and probably not very hard in practice.

(@crutschow @ericgibbs just a couple of people who came immediately to mind)
But no power connection for the comparator is available.
So without using a connection to the battery?
 

Ya’akov

Joined Jan 27, 2019
9,069
But no power connection for the comparator is available.
Ah, I missed the impossible requirement. Some goofy schemes come to mind but I wouldn't propose things I wouldn't do.

@Deen198 sorry I missed that bit. You are going to need power to whatever you make. Speaking entirely theoretically and not endorsing it at all, you could possibly do something that used the LED power to light up one or the other at half brightness or one at full brightness and the other at half. But the second LED will never be brighter than half unless you provide power.
 

AlbertHall

Joined Jun 4, 2014
12,344
Ah, I missed the impossible requirement. Some goofy schemes come to mind but I wouldn't propose things I wouldn't do.
Thoughts have been round my head with transistors shunting one or other of the LEDs depending on the current - there is, apparently, easily enough voltage overhead for such a scheme but I do not have a solution.
 

Thread Starter

Deen198

Joined Feb 17, 2022
13
I’m not to concerned about the led brightness. I did some with the led’s I have and found that even with a 10k resistor they are bright enough for my application.
 

Ya’akov

Joined Jan 27, 2019
9,069
Thoughts have been round my head with transistors shunting one or other of the LEDs depending on the current - there is, apparently, easily enough voltage overhead for such a scheme but I do not have a solution.
Yes, we both have the same half-baked idea. It really does seem something could be done but it also seems flaky and unreliable because of the likely very small differential to do the switching after the various voltage drops.
 

Thread Starter

Deen198

Joined Feb 17, 2022
13
Thanks for all the thinking guys.

what exactly is the potentiometer for?

I tried to copy your scematic in my simulation tool but couldn’t get it to work. Am I missing something?
The resistor on the left is the ecu internal resistor btw, which I changed in pic 1 and 2

I’m an electronics beginner so sorry if these are dumb questions
62CCBC0C-4C7C-4581-91E8-E30F9C4F9FEE.png7217C1A0-018D-49C7-B648-A9FDC32543C6.png
 

AlbertHall

Joined Jun 4, 2014
12,344
The variable resistor adjusts the point at which it changes from one LED to the other. From your simulation you need to adjust it so the top half has a higher resistance.
 

Thread Starter

Deen198

Joined Feb 17, 2022
13
The variable resistor adjusts the point at which it changes from one LED to the other. From your simulation you need to adjust it so the top half has a higher resistance.
Understood.

So I played aroud a bit with the potentiometer setting and found that there is no position where 1 led get no current and the other one does, and the 1k 2k switching still works.

But as can be seen in the picture, I found a setting where the led gets 580uA and 154uA and vice versa.

I guess 150uA is basically the led being off right?

Is this the way the schematic is intended to work?
And is there a way to crank up the led current? 580uA a bit low right?4846DEAA-78E2-4F2B-8D74-A6D1049DB836.pngB9965005-7871-4F21-A511-F693137B9671.png
 

sghioto

Joined Dec 31, 2017
5,376
Is this the way the schematic is intended to work?
And is there a way to crank up the led current? 580uA a bit low right?
The problem is in the simulator. Did you specify that the transistors are 2N3904? I'm using sensitive LEDs very similar to ones you mentioned that are plenty bright enough with a 10K resistor. Current closer to 800 to 900 uA measured on the breadboard.
Sometimes you have to assemble a circuit in the real world.
Have you tried simulating the first circuit with the LM393?
 

Thread Starter

Deen198

Joined Feb 17, 2022
13
thanks for the support.

I will order the parts to test it in real life.
My simulator does not allow to connect the vcc of the opamp to anything other then the source, so I could not check the first schematic.

I will keep you updated as soon as I’ve tested it.
In the car it might behave different as the alternator can push the supply voltage to 14.5.

On another forum I got these 2 schematics. So I will build them as well and see what works best.

9E8B4DB4-037D-4274-9CC7-B5189BDBD22C.pngCEB6DD1A-666B-43C5-8474-50E4B041E48D.png
 

sghioto

Joined Dec 31, 2017
5,376
I think you will see better results if you increase the LED resistors to 10k otherwise they will load down the voltage from the ECU.
You can still test the LM393 circuit I posted by setting the supply voltage at the levels I recorded. 9 volts which represents a 2k resistance and 10.3 volts representing the 1k.
To simulate start by setting the supply voltage at 9 volts and vr1 at zero. LED 1 should be ON. Increase vr1 until LED shuts OFF, then decrease vr1 until LED comes back ON, leave vr1 at that setting. Now Increase the supply to 10.3 volts, LED 1 should shut OFF and LED 2 should be ON.
,,
 
Last edited:
Top