Op Amp as voltage sink - need help

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
I'm trying to design a 0-10V DAC, and had it working just fine until I realized that the lights that I'm using it with (as a dimming control) provide the 10V source, and I need to sink the voltage to the right level (via current draw). I can provide a 0-5V analog signal to drive an op amp, but can't seem to figure out the op amp side to draw the voltage down to the right level from there. What I've found online mostly uses an NPN transistor or MOSFET, controlled by the op amp, but I can't seem to get it to work with the 10V provided from the lights.

Can anyone point me in the right direction? Thanks!
 

wayneh

Joined Sep 9, 2010
16,102
I'm trying to design a 0-10V DAC, and had it working just fine until I realized that the lights that I'm using it with (as a dimming control) provide the 10V source, and I need to sink the voltage to the right level (via current draw). I can provide a 0-5V analog signal to drive an op amp, but can't seem to figure out the op amp side to draw the voltage down to the right level from there. What I've found online mostly uses an NPN transistor or MOSFET, controlled by the op amp, but I can't seem to get it to work with the 10V provided from the lights.

Can anyone point me in the right direction? Thanks!
Do you mean that you need to draw down that supply voltage in order to dim the lights? Do you know how that voltage varies with current, in other words how much current you need to sink to take it down to, say 1V?

Are you sure the control is by analog voltage? I can imagine using PWM to connect that 10V to ground could be a reasonable control scheme.
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
Do you mean that you need to draw down that supply voltage in order to dim the lights? Do you know how that voltage varies with current, in other words how much current you need to sink to take it down to, say 1V?

Are you sure the control is by analog voltage? I can imagine using PWM to connect that 10V to ground could be a reasonable control scheme.
The current isn't fixed because it varies with the number of lights connected in series, but each light is 0.15mA (so even 100 lights is only 15mA, within the range of an op amp).

Yep, I need to draw down the supply voltage... an op amp should be able to do that in a closed loop, but I can't figure out the schematic to get it to work in simulations yet - I'm missing something for sure.

This could be done with PWM yes, but given the system I'm adding this to it would be a much larger / more complex add. I was hoping a simple op amp and NPN would do the trick via an analog current sink. I'll attach a FAILED schematic to show you where I am at the moment - it could just be my poor simulator skills too. Thanks all!
 
Last edited:

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
In the diagram above, V1 is the 0-5V signal coming from the DAC to control the output, and R3 (66 ohm) is to simulate the light load on a 10V supply voltage (to get 150mA - I actually need to drop that by an order of magnitude to get 15mA though)
 

wayneh

Joined Sep 9, 2010
16,102
Suppose the transistor is fully conducting. Your circuit can't draw the voltage below 66/166 x 10 = 4V.
 

wayneh

Joined Sep 9, 2010
16,102
In the diagram above, V1 is the 0-5V signal coming from the DAC to control the output, and R3 (66 ohm) is to simulate the light load on a 10V supply voltage (to get 150mA - I actually need to drop that by an order of magnitude to get 15mA though)
Oh, OK, now I get it. You need to set up a constant current controller.
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
Thanks WayneH... am I way off with my schematic though? The examples I've found so far are all similar to what I have drawn, but the load is typically on the other side of the transistor. I appreciate the help!
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
Well, I've managed to "fix" it by using a PNP transistor instead of an NPN... the feedback loop to the op amp was inverted with an NPN, causing it to make the wrong adjustments.

This works in the simulator - any concerns with the design? Muchas gracias folks!

 

wayneh

Joined Sep 9, 2010
16,102
... am I way off with my schematic though?
The part's that off is the strategy to control LEDs by voltage instead of current. You could accomplish the same thing with a voltage regulator such as LM317. The LEDs will not exhibit a steady "resistance" as shown in the simulation and in fact their resistance drops a little as they get hot. That can lead to thermal runaway.

Another problem is, what happens if you're control signal fails? If V1 goes to zero, your LEDs go pop.
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
The 0-10V signal is actually an industrial standard for lighting control and dimming... it's not directly controlling the lights/LEDs themselves - it's just a control signal - and I'm stuck with that due to the lights we're using (other standards include 4-20mA, but not on our lights). The part that stuck me is that there are two versions of the standard: one where the dimmer/controller provides the 10V source (how I designed it originally), and the other where the lights themselves provide the 10V source and the dimmer/controller sinks it to the right level.

The supposed advantage of having the light provide the source is that if the controller isn't attached (and some failure conditions), the lights go to full brightness.

Thanks for the help man!
 

sghioto

Joined Dec 31, 2017
1,039
A few things of interest.
The LMX321 is rated 7 volts max supply voltage.
The input control voltage is inverted and not linear.
When the control voltage is zero the output current is max.
SG
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
A few things of interest.
The LMX321 is rated 7 volts max supply voltage.
The input control voltage is inverted and not linear.
When the control voltage is zero the output current is max.
SG
Thanks SGhioto - good catch on the LMX321, but that's just a generic op-amp that the simulator I used had. I'll be sure to choose one with an appropriate voltage range.

The input isn't actually inverted - as the 0-10V to the PNP transistor rises, it "closes" the transistor and reduces the current flowing through it. That results in the 10V from the lights being dropped less and less - so the output voltage to the lights rises along with the signal. (it's a sinking circuit)

You're right that at 0V output, the output through the transistor is max current, and the 10V from the lights being sunk all the way down to 0V (and the lights off). This is the downside - an "off" fail condition... but it's desirable for my application too.

Thanks for the input!
 

sghioto

Joined Dec 31, 2017
1,039
I breadboarded your circuit using a LM358 and a 2N3906, appears to work fine.
0 volts in, .82 volts across transistor
5 volts in, 10 volts across transistor.:)
SG
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
Wow, thank you!!! much appreciated! I don't have the parts in my hands or I'd have tried it too. Ordering now... :)
 

AnalogKid

Joined Aug 1, 2013
8,100
It still is not clear to me what you are trying to do. Are you trying to convert a 0-10 V low current control signal into a 0-150 mA output current that is directly proportional to the input voltage?

ak

If yes, there are more traditional ways than the circuit in #9. The circuit in #4 is close, but there is a wiring error.
 

sghioto

Joined Dec 31, 2017
1,039
Looking at the circuit again you can most likely eliminate Q1 in post #9
Connect R2 to the output of the opamp and connect directly to the control input of the dimmer.
The LM358 can sink 20ma, the max input current of a 0 to 10 volt dimmer is usually 10ma.
It will also allow the output to go to 0 volts with 0 in.
SG
 

Thread Starter

MadCow4242

Joined Apr 17, 2019
18
Hmmm...

SGhioto - I did drive them with the op-amp directly (no transistor), but had some issues with the op-amp blowing up. I've found an op-amp with higher sink capabilities though and maybe that's enough. The good part of that is that one design could source or sink current, depending on the system's needs. The good news is I already have a board built for that design, ready to go... if it's just a different op amp.

AnalogKid - what in #4 is incorrect? If I could fix that, it would be an option for me too.

Thanks!
Kevin.
 

AnalogKid

Joined Aug 1, 2013
8,100
AnalogKid - what in #4 is incorrect? If I could fix that, it would be an option for me too.
The right side of R2 should connect the the Q1 emitter, not collector. Search for opamp current source and you will see many examples in the images.

For the values in the schematic, the circuit will not work because Q1 will saturate. With a 5 V input and a 100 ohm sense resistor, the voltage at the Q1 emitter will try to be 10 V. Since you have only 10 V for the output circuit, Q1 will saturate trying to lower its impedance enough to satisfy the loop requirements. V3 must be at least 17 V for the loop to close.

ak
 
Top