Electrical – Dimming LED based on 12v signal

dimmingledtachometer

I've got an LM358 comparator turning on an LED. What I'd like to add is a way to dim the LED by a fixed amound when a 12v signal is sensed.

It's in a tach circuit in a car, and when the headlights are turned on the dash lights get fed power, so when that occurs it's probably dark enough where the LED should be less bright.

I've got something modeled in ltspice with a resistor and npn on parallel with the led to draw off some of the current. Does that seem sensible or is there maybe a better way? Thanks!enter image description here

Here's an example of a similar 2-stage shift light in action:

This is an example of a similar 2-stage shift light

Best Answer

I think it will be difficult to make your scheme work properly. Essentially, you are trying to use an NPN transistor to connect a resistor in parallel with an LED, hoping that the resistor will draw some large fraction of the current that would have gone through the LED. The problem I see is that the voltage across the resistor is proportional to the current passing through it while the voltage across the LED is (relatively) constant. So, the degree of current sharing between the LED and the resistor will change significantly as the supply voltage changes. What you have indicated as your "+12V" supply will actually vary quite a bit as the engine RPM changes, the A/C cycles on and off, and the battery charge level changes...it's probably over 14V when the battery is charging with few other loads. At low RPM the LED may not work at all.

To make the circuit more reliable you should probably add a voltage regulator for the LM358 comparators, so the LED circuits will see a more constant voltage. To change the brightness of the LEDs you should try to control the current through them. You need a way to add resistance in series with the LED when your headlights are on.