According to Pete: Current Mirrors


It’s time again for your prescribed monthly dose of According to Pete (Dokter’s orders - tssssss), and this time around, Pete is discussing and demystifying current mirrors! Current mirrors are used to regulate the current of one component or circuit with the current of another, and Pete attempts to break down how they work and where you might find or utilize them. So let’s dive in:

As always, if you have any questions, comments, fan mail or suggestions, leave them in the comments, and we’ll see you again in February!


Comments 41 comments

  • “Did you have any gray in your beard when we first started doing this?”

    Yup, he did. Here’s the first According to Pete from April 2011, and there are a couple of subtle streaks of gray already visible.

  • Pete, contrary to your claim, current mirrors/sources/sinks can be constructed easily using discrete, unmatched components, and are done so all the time. You’ll find them in virtually any discrete audio amplifier. A current mirror is simply a current amplifier with a gain of… one. The output of a class A/B amplifier is often biased with a constant current source to reduce crossover distortion. The constant current LED driver you said was impractical is actually easy. I’ve put several of them into production.

    If your goal is to produce only a constant current, rather than a mirrored current, you need only one transistor. You’ll find such a circuit in figure 5 on the Wikipedia page for “current source”… http://en.wikipedia.org/wiki/Current_source On that page you’ll see several methods for setting the current and reducing its temperature dependence, none of which require matched transistors.

    If you really want a mirror, and there are applications that need them, you can get good performance from discrete, unmatched transistors using emitter degeneration. You’ll find more about that here… http://en.wikipedia.org/wiki/Two-port_network#Example:_bipolar_current_mirror_with_emitter_degeneration

    • Ah, thanks much. Sorry for the late reply, I’m at CES currently (heh) and I’m pretty much working off my phone. I can’t even seem to watch the video, but I remember saying that I haven’t had occasion to use one outside of analog CMOS design. That doesn’t mean it doesn’t happen, it just reflects my experience. When I get on front of something with a bigger screen, I’ll track this down more. Byron (one of the engineers) and i had been talking about different circuits that it would be fun to do here, and we had some conversations along these lines…

      And I wouldn’t call it a “claim” as much as a “cry for help”. Heading down to hotel breakfast now…

    • I back that up! I also used 4 branches degenerate current mirror to charge 4AA NiMH cells. Emmiter degeneration works as a negative feedback, counteracting Vbe drift.

  • Whenever I log on to Sparkfun.com, my 2 year old girl starts begging “More Peep!”.

  • I spent way too long making these from the video thumbnail :)

    RTFM

    Shit’s on fire, yo

    • Lungfishy! You know you’re always going to be “the kid”, right? Nice work. I laughed.

  • Applications of the basic current mirror circuit that I have used it for:

    1) Very simple voltage controlled current source (this has been the most handy for myself) 2) Change a sinking current into a sourcing current or the other way around 3) Active loads on an amplifier (okay… not something I usually do) 4) Setting bias currents that are identical or multiples of the mirrored current 5) I’ve used it to maintain consistent LED brightness over a bunch (10ish) LEDs

    • Sorry if I’m missing something here, but it looks like both Timmeh and the i2c application by Tz are just using the current mirror as a crude current source. Wouldn’t it be easier (and more repeatable) to use a simple current source instead?

  • Way off topic, but a few days ago I went with a friend to see the movie Partly Cloudy With A Chance of Meatballs 2, and kept thinking that there was a remarkable resemblance between Pete and the character Chester V in the movie.

  • According to Pete and a beer. My evening is set!

  • Trapezoidal whiteboard? No room for the camera?

    One place current mirrors are very useful is for I2C, especially when breadboarding and you don’t know if you should have a bigger pullup or smaller pullup or worry about the bus length. I usually use this circuit:

    http://www.i2cchip.com/constant_current_pullup.html Which uses “all one chip” current mirrors. Instead of the RLC ramp, it makes the rise cleaner.

    (It would be nice if the next revs of your I2C boards had the 4 pins, VCC, GND, SDA, and SCL in a stackable form with one of these current mirrors you could put on top - then I could add or remove devices like I can do with Arduino shields)

    • “Trapezoidal whiteboard? No room for the camera?”

      Bingo. Pete’s office is filled to the brim with half completed projects and general engineering clutter, which can make for some interesting camera placement.

  • Nice video, love this series.

    For anybody looking to know more about switching mode power supplies, Linear has a lot of design help and app notes. If that doesn’t work, e-mail me! I’ll help you out, its what I do for my job.

  • Pete, there might be simpler ways to regulate current using discrete components, but current mirrors are actually very useful in ICs. You see, in an IC, a resistor is just a spiraling trace. You can imagine that a power resistor would take a large area on a 2D chip, as opposed to a smaller resistor and 2 microscopic transistors. You see them very often in opamps and many other stuff!

    Anyway, your videos are awesome, keep it up!

  • Can you make a current “multiplying” mirror with discrete transistors? In school, they always talked about setting up the width by length (W/L) ratio of the transistors to multiply the current. I can’t do that in a discrete design, and I’m trying to figure out how that might be done. For example, say I want a reference current of 255 uA to become ~50 mA. That’s a multiplication factor of ~196. I don’t want to use the common op amp - transistor circuit for this nor multiple transistors in parallel. Is it even possible?

  • Is he overdosing on Colorado’s newly legalized drugs before making these videos?

    • Fellow denizens of the internet: When you are about to submit that ha-ha-Colorado-marijuana-get-it-guys-WEEEEED comment, you might take a moment to ask yourself how many times a hypothetical resident of Colorado has already heard it from everyone else they know in the entire rest of the country.

  • Usefulness of Current Mirrors: 1. For me at least, it’s another example of how transistors behave. I’m trying to understand them better, so practical application isn’t necessarily top o'my list. 2. It seemed to me that might be the current mirror is useful if you were wanting to measure a current without necessarily changing it. Don’t know, it was just one thought that came to mind. I tend to see electronic circuits a bit like tinker toys or leggo’s. The more you are aware of and can use to some extent, the easier it is to do things (though maybe not always in the “best” way).

  • A practical use for current mirrors pertaining to parallel strings of LEDs.

  • I have read that current mirrors are commonly used in op-amp circuits, I’m a newbie, so I don’t know why. Can anyone explain this? Would such a design work for discrete linear amps?

  • Current mirrors or constant current sources are great for making a linear voltage ramp when charging a capacitor. Some of the earliest analog oscilloscopes used constant current source charging a capacitor to make the horizontal sweep time base.

  • Pete, For the comment by member # , I believe the intent of the comment about parallel LEDs was to use a constant current source on the first LED and use a current mirror on the second LED to ensure that an upset in the circuit doesn’t cause one LED to source current away from other parallel LEDs and burn out or if a LED fails, the other LEDs burn out from excess current. I was looking for something similar too. I was recently looking to drive three Cree MK-Rs in parrallel (each require 12.0v @ 1000mA for what I want to do) and I wanted to use a single DC-DC converter from a 6S hobby LiPo pack.

    Thanks, Frank

    • Interesting. Thanks much sir.

      • Is there another way to reliably run three LED’s in parallel without three separate DC-DC converters? Ultimately, if doing a current mirror as suggested above, if the first LED fails and no longer draws current, then the whole system fails, but I can live with that because i don’t kill all LEDs when one fails open because they are in true parallel.

        I need to prototype this… where is the time!

        • Can you use 3 linear regulators in constant current mode? One for each LED? http://www.maximintegrated.com/app-notes/index.mvp/id/4404

          • And therein lies the problem. I need adjustable LED brightness via adj. current or PWM at the above 12v and 1000mA and equally parallel across three LED.

            Three DC-DC converters require too much footprint. I can potentially use an off the shelf PWM LED driver for one LED with my 6S LiPo requirement. My hope is to do the current mirror.

            • hand match them, but this won’t help you if one fails short. if you’re using salvaged materials, usually you can get one or two pairs matched for Vthresh out of a cheap 9LED/3AAA flashlight. once you have matched units (down to 2 decimal places) you can treat them as a single larger diode. there are calculators for parallel LED configuration a google search away

        • I know, right? These videos always inspire me to spin up a few, as Gregg says, “half finished projects”.

  • Pete, I would have preferred to contact you privately but this public comment space seemed to be the only way to pass along my disappointment in the way you explained this crucial and fundamental circuit building block. It is important that newcomers to electronics like high school students get correct explanations of key circuit concepts like the current mirror from the get go so that when and if they get to their first electronics class at university they don’t have to unlearn any bad information they might have been exposed to earlier. Anyway to help that process along I would like to refer you and your readers to a free on line text book chapter I’ve written on current mirrors:

    https://wiki.analog.com/university/courses/electronics/text/chapter-11

    This chapter takes the reader through current mirrors starting with very basic first principals to build an understanding of how the circuits works. Earlier chapters in the text of course explain what transistors are and the basic amplifier configurations. Not to sound too immodest but it is one of the better ways I’ve come across to explain how current mirrors work.

    • K, I don’t wanna sound like a Pete group-ee, but IMHO your missing the value of Pete’s byte sized tutorial/lecture/educational mmm video thing-ee’s. Happily, your also validating one of their key values. As a total noob/non-degree’d I just wanna learn kind of guy Pete’s short segments on the core basics of various types of electronics that include just enough math to get into trouble with (or in some cases more than enough for the job) are just a start, I think. A very basic primer that might (and for me at least, does) give a person a bit of really useful, often practical information about designing and using transistors.

      I took a look at the site you mentioned: I’d never seen it before and might never have encountered it, unless you’d commented on Pete’s excellent video. I’ll definitely be chewing my way through the content there and the Labs(They looked like awesome learning opportunities).

      Point being, for nitwits like me, content like Pete’s video’s are a god send, as are the many helpful comments that get posted by folks. I don’t ever hear Pete claiming to be the final authority on anything, but I think he provides excellent insights into some rather difficult subjects that have, in my case at least, been a huge help in refining my understanding of electronics.

    • Well, sorry to disappoint you, but I admitted that I hadn’t had cause to use them much since college (I began working with Nate right out of school). I sorta prefer to view this as an informal discussion rather than a reprimand. I try not to take this personally, and I’m fairly up front about what I do and don’t know. And this is, after all, about educating, right? I’ve certainly got some from the people that watch, and I do ask for participation. If you ripped me in private, you wouldn’t be playing the game right, would you?

  • As an analog IC designer I’ll give you a B+ for this one! As others have said current mirrors are used in discrete form quite often. Matched pairs of transistors are typically used but it can be done and with quite a bit of precisionl. Overall a good effort and how about a simple diff amp next episode to leverage off this one? Maybe that is what you already have planned. Keep it up.

  • I would disagree. Current mirrors can be very useful for LED drive… but the whole purpose is matching the brightness of two LED strings. You are right in saying that it’s not that useful for driving a single string. You also need to design your circuit in a way that you don’t burn a ton of power in the transistor (by changing your series/parallel setup of your LEDs).

    Also, as someone else pointed out, emitter degradation resistors help with the matching problem.

  • If you put about 1V of resistance in the emitter of those bipolar transistors your matching problems are greatly diminished.

    I use current mirrors to drive LEDs when I don’t know how many, or what color LEDS or what battery voltage the customer is going to use. I just have a terminal labeled LED that I know will draw about 18mA from whatever positive source they have available.

    • This bit got me a little confused. If you have a current mirror setup to supply some known current, for a string of LED’s say, and you aren’t certain of the number of LED’s, how does that effect the overall voltage drop across the transistor MOSFET? Do you more or less pick a supply Voltage that can accommodate the Max number of LED’s the circuit should allow? If the number of LED’s is less than that Max, is it reasonable to assume that voltage across the transistor (say it’s a BJT) will be Vs - (n*VLed)?

      I’m gunna have to wire one up to find out for myself, but just thought I’d ask.

      • Yes, you need a supply voltage to accommodate the worst case number of LEDs. Any excess voltage produces extra transistor voltage and therefore extra transistor heat so try not to go overboard. The Vbe of bipolars varies less than the Vgs of MOSFETS so biploars match better so long as temperature is not a problem. With TO92 packages it is easy to glue two together for a cheap thermally matched pair.

  • Quick sort of nit-picky comment. On a single IC you still need to worry about the lambda part of the equation but your k1/k2 and Vgs-Vt/… do go away. The dependence on the drain source voltage in the lambda section means most high precision current mirrors on-chip are a bit more complicated than the basic current mirror shown.


This Week

This Month

Heartbleed

Happy Arduino Day!

SXSW Create 2014