# Transistor current limiter, microcontroller controlled?

I've come across a few transistor current limiter schematics, similar to this one:

However, I am not entirely sure how I could implement microcontroller functionality to control this. I think Rsense would cause Q2 to conduct if at a threshold (0.65V assumably) and Rbias will determine how much it will be limited, however that is unclear to me, especially if Rsense will be somewhere highside and just turning on Q2 with my uC seems to not do anything (in simulation at least)

How would I come up with the formulas for a variable limit that I can control? I would rather not have to use a digital potentiometer in place of R2, if I can somehow have sense voltage compared with a comparator with a voltage my uC defines, that'd be great! But how could I start the limiting? What do I "turn on" when the sense resistor shows enough current? Does Rbias have to be there to limit it to a certain level, and I'll end up having to use a digipot anyway?

Any solutions to a uC controlled current limiter would be great, that can be controlled easily with just a pin or two.

• This is not a current limiter, but a current source...if you want a uC-controlled current source, you can just use a transistor and drive it with the ADC, controlling the range of voltages... Commented Mar 15, 2012 at 6:52
• Remove Q2 and have an opamp compare a control voltage with the voltage across Rsense. If Vrsense > Vcontrok then opamp shuts down Q1 somewhat. If too low it turns Q1 on more. Commented Mar 15, 2012 at 7:31

When you want a current limiter, David L. Jones provides and explaines one in his Lab Power Supply Design series. I will try to summarize his explanations (Video 1: starting at 19:45).

At $V_{SET}$ you provide a voltage between 0V - 1V to get the current drawn at OUT limited to 0A - 1A. Lets assume a voltage of 10V at OUT.

For 0V at $V_{SET}$ the voltage $V_{Adder}$ will be $\frac{0 + 10}{2}V=5V$. This is also the voltage at the non-inverting input of the opamp. The opamp tries to keep 5V at his non-inverting input by driving the transistors. When you get 5V at the non-inverting input the voltage accross the 1R resistor is 0V, because you got 10V on his left and 10V on his right side. The current will be 0A.

The circuit is linear so you get a linear relationship between the voltage $V_{SET}$ and the limited current.

To control the limiting of the current by a microcontroller you could apply a filtered PWM signal to $V_{SET}$.

• I've built a circuit similar to that one and it's a little tricky. The 10K resistors need to be at least 1% and maybe 0.1% depending on what accuracy you need. At 1% the actual accuracy could be more sloppy than what you'd expect at first glance. Increasing the 1 ohm resistor will make this better, but at a price. Also, you need to make sure that the input and output voltages are not too close to the power rails (since some op-amps aren't as good at running rail-to-rail). This means changing the 10K resistors and/or changing the power supply for the op-amps.
– user3624
Commented Mar 15, 2012 at 12:54
• @PetPaulsen, very nice, although huge drop on sense resistor at higher currents.. 100mOhm will require 20mV on opamp to compare with, :). Maybe I'll get precision 10-100mOhm shunt? resistor and amplify 10-100x to compare with uC, a quad op amp (assuming all of those require the same type) could work! Commented Mar 15, 2012 at 21:39