Current mirror with gain?

Sep 25, 2011 50 Replies

On a sunny day (Sun, 25 Sep 2011 18:42:51 -0400) it happened Spehro Pefhany wrote in :

output.

Thank you, that is exactly what I am looking for. Of course I appreciate all the other suggestions with op-amps etc, but I had been scribbling something with 2 transistors on a piece of paper and could not figure out the above circuit it seems. It was not so much a 'cannot use an opamp', but more 'it has to be possible with 2 transistors'. Accuracy is not so important, neither is dead band (dead band is good, for off), but it should not drift too much with temperature. I may use it to let a PIC DAC (pin 19 18F14K22 ) drive a LCD backlight. Will use a series resistor from DAC output the the base of Q1, the collector of Q2 to the cathode of the LEDs in the LCD. Later today I hope, will let you know how that pans out.

Thank you all for the great suggestions.

On a sunny day (Sun, 25 Sep 2011 18:42:51 -0400) it happened Spehro Pefhany

DAC output.

OK, I tried the above circuit, and it did NOT work with these values: +5V | Iout ~= In * R1/R2 | .---------------. | 3,3V drop | | LCD backlight |

0-+5V 47 k '---------------' ---====---+----- + | | | | | |/ BC547 |/ BC547 |----|---------| |> |>

| | | | .-. .-. | | | | | | 1000 | | 10 '-' '-' | | | | === === GND GND

For +5 V at the input it should see about 90 uA, x 100 for R1/R2 should be 9 mA, I measured much much lower if anything at all.

So I put it in LTspice, and that shows for a 2N3904 I in 47 kOhm 92 uA I in 1000 Ohm 87 uA I in 10 Ohm 1.47 mA Ib in second transistor 4.7 uA Ic second transistor 1.47 mA

So anyways, before double checking with LT Spice for wiring errors, I changed the circuit to this:

+5V | .---------------. | 3,3V drop | | LCD backlight | 0-+5V '---------------' | |/ Pin 19 PIC DAC out -- 22k ---- | |> BC547B | | /// This gives me 0-30 mA for 0-5V in. I tested the temperature stability by heating the transistor with the soldering iron, no observable difference in LCD brightness. A bit beta tolerance for this transistor is not so bad, as different types LCD displays also seem all different, The brightness control is very smooth (32 DAC steps, up and down button). So decisions, ... this one.

Any idea why your circuit does not do current multiplication by 100 with these values?

DAC output.

off),

That won't get you to 1000x unless you use Darlingtons. The beta of Q2 is too low.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net

Note that you get your gain by setting R1 and R2 to different values. You get reasonable current mirroring by setting R1 and R2 so there's some voltage across them -- I usually shoot for 1/4 to 1V (and if there's not enough headroom, then I'm using the wrong circuit!).

Mr. Hobbs' point about beta is to be heeded -- you may need to do this with Darlington devices, and I suspect that means that you'll need to jack up your resistances to get halfway decent matching (if that's important to you). There are superbeta transistors out there, but I don't think they'll help enough...

Tim Wescott Control system and signal processing consulting www.wescottdesign.com

DAC output.

off),

mA,

the circuit to this:

soldering iron,

displays also seem all different,

values?

The voltage over the emitter resistors should be well greater than Vbe to mask the differences in Vbe at different currents.

Tauno Voipio

On a sunny day (Mon, 26 Sep 2011 20:18:08 +0300) it happened Tauno Voipio wrote in :

DAC output.

off),

mA,

the circuit to this:

soldering iron,

LCD displays also seem all different,

these values?

Yes, and then you may aws well eave the first transistor out. And I do not have space for that much voltage drop.

Do you remember the folks (including me) who mentioned that transistor beta may be an issue? Did you consider it? DigiKey reports at least three variations on that transistor's theme, with betas ranging from 110 to 420. So if you have a beta=200 version that's got 9mA collector current, that implies that you need 45uA of base current, which means that your 90uA of current from the DAC is being divided between the two transistors just about equally.

Do you remember the folks who mentioned beta being an issue mentioning Darlingtons? If you use those then your VBE increases to 1.4V, but your current gain can be in the tens of thousands, allowing

Figure that your current gain error is going to be approximately equal to the ratio of your design current gain (R1/R2) and the transistor HFE (and then only if HFE is relatively large). So if you want just 10% error, you want an HFE that is at least 10 times higher than R1/R2. You didn't do that.

So try again with transistors with more gain, and see how things fly.

www.wescottdesign.com

It's still not clear to me if he needs 1000:1 dynamic range, or just

1000x current gain.

This is the thing I described for Vout:

+5v -+- | R1 .----< Iout | |/ +------| Q2 Iout ~=3D Vin/R2 | |>. |

The voltage over the emitter resistances doesn't have to be greater than Vbe -- just significantly greater than the expected differences, which are not great.

www.wescottdesign.com

Indeed. If you run the math 10*kT/q, or ~0.25V is quite adequate to absorb most rational offset differences.

For large ratios though, I'd do the OpAmp trick, but use a 2N7000. ...Jim Thompson

[On the Road, in New York] | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

ny

ance DAC output.

/R2

er

or off),

=3D In * R1/R2

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | 3,3V drop = =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | LCD backlig= ht | > 0-+5V =A0 47 k =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'---------------' > =A0 =A0 =A0---=3D=3D=3D=3D---+----- + =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0 =A0| =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0|/ BC547 =A0|/ BC547 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0|----|---------| > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |> =A0 =A0 =A0 =A0|> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.-. =A0 =A0 =A0 .-. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| | =A0 =A0 =A0 | | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| | 1000 =A0| | 10 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0'-' =A0 =A0 =A0 '-' > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D=3D=3D =A0 =A0 =A0 =3D=3D= =3D > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GND =A0 =A0 =A0 GND > > For +5 V at the input it should see about 90 uA, x 100 for R1/R2 should b= e 9 mA, > I measured much much lower if anything at all. > > So I put it in LTspice, and that shows for a 2N3904 > I in 47 kOhm 92 uA > I in 1000 Ohm 87 uA > I in 10 Ohm 1.47 mA > Ib in second transistor 4.7 uA > Ic second transistor 1.47 mA > > So anyways, before double checking with LT Spice for wiring errors, I cha= nged the circuit to this: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 +5V > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .------------=

DAC output.

off),

mA,

the circuit to this:

soldering iron,

LCD displays also seem all different,

these values?- Hide quoted text -

You posted something like that maybe 5 years ago, but with a

2k2 resistor across the load (I think for a resistive path always, that way) and it taught me a useful pattern. Love the use of the emitter resistor!

Jon

On a sunny day (Mon, 26 Sep 2011 22:20:11 -0700 (PDT)) it happened Fred Bloggs wrote in :

That is a very nice circuit, and I actually understand it (unlike the previous one) :-) Yes, this is nice, I will test this out. many thanks :-)

On a sunny day (Mon, 26 Sep 2011 12:24:10 -0700 (PDT)) it happened snipped-for-privacy@yahoo.com wrote in :

Yes that works, but not in the case of my LCD backlight that drops 3.3V and 5V supply. Or I would have to divide down Vin, then it would work.

I don't understand how the LCD backlight is connected from that description.

If you mean "the hot side of the load goes to +5v, and drops 3.3v (an LED)"--

+5v -+- | +5v .-----. -+- | LCD | | '-----' R1 |. |

impedance DAC output.

off),

mA,

changed the circuit to this:

soldering iron,

LCD displays also seem all different,

these values?- Hide quoted text -

Keep that in mind for CMOS, also. An easy way to get per-stage gm up. ...Jim Thompson

[On the Road, in New York] | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

impedance DAC output.

off),

9 mA,

changed the circuit to this:

soldering iron,

LCD displays also seem all different,

these values?- Hide quoted text -

I do understand this use, above, very well. I'm not sure I do yet with CMOS. But will keep your point in mind as I go forward. Thanks.

Jon

one) :-)

I've used it. It is excellent, not at all difficult to design fairly well before testing, works remarkably well, and can be readily combined with other concepts.

Nicely, if you socket the backlight and someone accidentally touches a screwdriver to the LED pins and shorts them out, it doesn't behave badly as other circuits often do. It's very useful and understandbale besides. That emitter resistor use/re-use actually qualifies as downright beautiful.

I found the bootstrapping idea for the standard degenerative BJT amplifier, the one used to greatly stiffen the input impedance, something quite enjoyable to learn about as well. But it wasn't in the same league of 'simple and beautiful elegance' as the above pattern is, to me.

Jon

Bloggs

=A0+5V

-----.

=A0 =A0 =A0 =A0|

=A0 =A0 =A0 =A0|

=A0 =A0 =A0|

=A0 =A0 =A0|<

-- | =A0BC557

=A0 =A0 =A0|\

=A0 =A0 =A0 =A0|

.---------------.

| 3,3V drop =A0 =A0 |

| LCD backlight |

'---------------'

=A0 =A0 =A0 =A0|

=A0 =A0 =A0 |

=A0 =A0|

=A0|

evious one) :-)

One caveat--it can oscillate. Happened to me for an A/D buffer, back in the horse-and-buggy days.

-- Cheers, James Arthur

Bloggs

previous one) :-)

Although I haven't used the above form exactly (and there are enough differences that it may matter) I'd appreciate it if you might explain what can cause that oscillation. It would help me to understand it better.

Jon

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required