12v Light Circuit, dual input single output

Thread Starter

Cynephoba

Joined Aug 28, 2017
4
Hi all,
I've been toying with this one for a while but i'm just not savvy enough with circuit design to quite get it right.

I'm wanting to build a 12v, low amp circuit to power some lights on my car. However, I want some logic around when the lights are on/off.

There will be two inputs for the circuit, input 1 and 2. Single output. This is how I want the circuit to work (similar to an OR logic gate):
  • If input 1 is powered, light is on
  • If input 2 is powered, light is on
  • If both input 1 and 2 are powered, light is on
  • If neither input 1 or 2 are powered, light is off.
The light output could either be powered by input 1 or 2, or an external 12v source via a relay - doesn't matter either way.
If possible, i'd love for the output to be dimmed with a resistor if inputs 1 and 2 are both powered, but no dimming if it's just an individual input.
 

WBahn

Joined Mar 31, 2012
30,051
One simple way to achieve your OR is to just put a diode in series with each input and connect the two cathodes together as your output. You will have about a 0.7 V drop across the diodes (if you use silicon) that that will probably leave you with enough for your lights.

To get the dimming behavior you want, you can use two SPDT relays, a resistor, and a diode.

Are the inputs floating with unpowered, or are the grounded?
 

crutschow

Joined Mar 14, 2008
34,418
You can do all the items in the dotted list with two diodes, but dimming the lights powered by two inputs, as noted in the last paragraph, will require some additional logic circuitry.
Are you willing to do that extra circuitry just to dim the light?
 

AnalogKid

Joined Aug 1, 2013
11,038
Assuming the lights will run on 12 V vehicle power, how much current do they require? Also, since this is vehicle power, the assumption is that everything is common grounded.

As above, the logic tree you describe (without dimming) is simply two power diodes, called a diode-OR circuit. Dimming only in the A+V case requires some circuitry to force the dimmer to full brightness in two conditions and let it dim in one condition. This will require an AND function somehow, either with discrete components or a CMOS logic gate. How do you want to dim the lights - PWM, an inline series resistor, a voltage regulator, ... ? Also, fixed dimming percentage or adjustable?

ak
 

Thread Starter

Cynephoba

Joined Aug 28, 2017
4
The dimming isn't necessary at all, would just be a cool feature. The simpler the better in this case, most likely.

These are LED lights, so extremely small current draw. My idea was that they'd be full power when either the car is on OR when flicked manually, but if both manual and car power that they'd be dimmed (fixed dimming). Not necessary though.

Currently they're not grounded, positive and negative is supplied explicitly. But i guess it doesn't make much difference whether they're grounded or not as it comes from the same place. But for the design of this circuit, let's assume that i'd have to supply both positive and negative to the light.



I'm guessing this is similar to what you guys are talking about - which seems like it will do what i'm chasing. Thanks heaps!
In the case of supplying ground, would I have ground from both A and B joined to the ground for the output (bypassing the diodes), and the positive would flow through the diodes and then out to the positive on the light?
Any recommendations on the best diode to use? Would any 12v one be suitable or are there better ones for this kind of application? I haven't done a lot with diodes.
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
I think this might work.

Theoretics:
Vbase = 12V - 0,7V = 11,3V
Vload = 11,3V - 0,7V = 10.6V

You change the current by adjusting the "50ohm" resistor, make it a pot and with it change the current. There will be some voltage drop over the transistor, so the voltage over the "50Ohm" pot can be maximum "12V - 10.6V".
 

AnalogKid

Joined Aug 1, 2013
11,038
The circuit in post #6 is fine as far as it goes, but we're still missing two important pieces of information.

1. What is the total LED current? This is what sets the diode type. In a power (as opposed to small signal) application, the diode voltage and current ratings both should be at least twice the peak conditions in use. So for a 12 V car that regularly has voltage spikes above 40 V, a 100 V rectifier. If the LED string has a 100 mA recommended operating current, then a 1/4 A diode. More is better, so a 1N4002 (100 V, 1 A) is a nice fit.

2. Current limiting. Some LED strings have this built in, and some don't. Adding external current limiting when not needed doesn't hurt anything, but makes the lights more dim. Not having current limiting when it is needed usually causes destruction of the LEDs. Current limiting can be a simple as one series resistor, but it is important.

As for grounding, your circuit is sourcing power to the load, so the - end of the LEDs goes to chassis ground. If A is coming from the vehicle lights, it already is referenced to the chassis. If B is a switched line coming from a switch that goes to some other +12 V source within the car, such as some point in the fuse block or a direct connection to the battery, then it already is referenced to chassis ground also.

ak
 

ArakelTheDragon

Joined Nov 18, 2016
1,362
The circuit in post #6 is fine as far as it goes, but we're still missing two important pieces of information.

1. What is the total LED current? This is what sets the diode type. In a power (as opposed to small signal) application, the diode voltage and current ratings both should be at least twice the peak conditions in use. So for a 12 V car that regularly has voltage spikes above 40 V, a 100 V rectifier. If the LED string has a 100 mA recommended operating current, then a 1/4 A diode. More is better, so a 1N4002 (100 V, 1 A) is a nice fit.

2. Current limiting. Some LED strings have this built in, and some don't. Adding external current limiting when not needed doesn't hurt anything, but makes the lights more dim. Not having current limiting when it is needed usually causes destruction of the LEDs. Current limiting can be a simple as one series resistor, but it is important.

As for grounding, your circuit is sourcing power to the load, so the - end of the LEDs goes to chassis ground. If A is coming from the vehicle lights, it already is referenced to the chassis. If B is a switched line coming from a switch that goes to some other +12 V source within the car, such as some point in the fuse block or a direct connection to the battery, then it already is referenced to chassis ground also.

ak
I thought he said to power the lights of his car?
My circuits are at post 8. I can suggest 1 more circuit, thats a summer with an operational amplifier, when the voltage at the plus is higher, the voltage on the output will be the positive supply.

I think car lights drain "1A"?
 

AnalogKid

Joined Aug 1, 2013
11,038
I thought he said to power the lights of his car?
Nope.
These are LED lights, so extremely small current draw. My idea was that they'd be full power when either the car is on OR when flicked manually, but if both manual and car power that they'd be dimmed (fixed dimming). Not necessary though.
He is adding lights to his car. To me, "the car is on" refers to a line from the ignition switch or from some relay it controls.

ak
 

crutschow

Joined Mar 14, 2008
34,418
Below is the LTspice simulation of a circuit to dim the LEDs when both inputs are available (note the reduction in LED current when both inputs are high).
It requires the addition of an AND gate IC, a P-MOSFET transistor, and 3 resistors, in addition to the diodes.
The resistor values are arbitrary and must be selected for the actual current your LEDs take.
R1 may already be part of the LED fixture.
U2 must be connected to 12V and ground (not shown).
M1 can be any P-MOSFET with at least a 20V rating and an on-resistance of ≤0.1 ohm.

upload_2017-8-29_8-12-31.png
 
Last edited:

Thread Starter

Cynephoba

Joined Aug 28, 2017
4
The circuit in post #6 is fine as far as it goes, but we're still missing two important pieces of information.

1. What is the total LED current? This is what sets the diode type. In a power (as opposed to small signal) application, the diode voltage and current ratings both should be at least twice the peak conditions in use. So for a 12 V car that regularly has voltage spikes above 40 V, a 100 V rectifier. If the LED string has a 100 mA recommended operating current, then a 1/4 A diode. More is better, so a 1N4002 (100 V, 1 A) is a nice fit.

2. Current limiting. Some LED strings have this built in, and some don't. Adding external current limiting when not needed doesn't hurt anything, but makes the lights more dim. Not having current limiting when it is needed usually causes destruction of the LEDs. Current limiting can be a simple as one series resistor, but it is important.

As for grounding, your circuit is sourcing power to the load, so the - end of the LEDs goes to chassis ground. If A is coming from the vehicle lights, it already is referenced to the chassis. If B is a switched line coming from a switch that goes to some other +12 V source within the car, such as some point in the fuse block or a direct connection to the battery, then it already is referenced to chassis ground also.

ak
The lights already have current limiting in them.

What role does the rectifier play in this circuit? And where would that sit in the circuit - i think i'm misunderstanding the diagram I posted above.
 

WBahn

Joined Mar 31, 2012
30,051
The lights already have current limiting in them.

What role does the rectifier play in this circuit? And where would that sit in the circuit - i think i'm misunderstanding the diagram I posted above.
The diodes are needed since you said that the inputs are grounded when not powered.

If the inputs were coming from a simple switch that connected them to 12 V when ON and left them disconnected from anything when OFF, then you could just tie the two switches together directly.
 
Top