3
\$\begingroup\$

I'm using the following circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

What's the best way to measure the current through the LED with an oscilloscope?

Because the oscilloscope probe ground is connected to the same ground in the circuit, I believe I con only connect the probe ground to the circuit GND so I don't short anything and blow something up.

So the only way I can think of is to add a 1Ohm resistor between the LED and R1, and then use two probes on that added resistor and the MATH function of the oscilloscope to subtract the values.

This seems pretty complicated just to measure a single current, and also the 1Ohm resistor will change the circuit somewhat.

Is there an easier way?

\$\endgroup\$
10
  • 2
    \$\begingroup\$ oscilloscope probe ground is connected to the same ground in the circuit ... why? \$\endgroup\$
    – jsotola
    Apr 14, 2022 at 2:02
  • 1
    \$\begingroup\$ you do not write 5oranges ... why do you write 1Ohm? \$\endgroup\$
    – jsotola
    Apr 14, 2022 at 2:04
  • 1
    \$\begingroup\$ write 1 Ohm ... make sure that the oscilloscope ground is isolated from circuit ground ... measure voltage across the 180 Ω resistor, then do math ... google ohm and copy the symbol Ω \$\endgroup\$
    – jsotola
    Apr 14, 2022 at 2:19
  • 7
    \$\begingroup\$ You don't really need to measure it. Measure the voltage on the top of R1 with the oscilloscope. Then measure the voltage on the bottom of R1 with the oscilloscope. Subtract and divide by 180 to figure out the current. \$\endgroup\$
    – user57037
    Apr 14, 2022 at 4:01
  • 2
    \$\begingroup\$ My comment was explaining a way to use the 180 Ohm resistor as a current sense resistor with only one oscilloscope probe. Of course you are assuming that each waveform is the same as the last. But that is a pretty good assumption unless temperature is changing rapidly during the measurement. \$\endgroup\$
    – user57037
    Apr 14, 2022 at 4:13

5 Answers 5

7
\$\begingroup\$

Use the 180 ohm resistor as your current sense. Use two channels on the oscilloscope to monitor the voltage across the 180 ohm resistor and do a differential measurement. If your scope doesn't have differential mode (many inexpensive scopes don't), then use a math function to subtract between channels. If you have multiple levels of math, then divide by 180 on Math1 to give you current.
Math_1: Channel_1 - Channel_2
Math_2: Math_1 / 180

Or, ditch the scope and use a hand-held multimeter to measure the voltage across the 180 ohm resistor.

\$\endgroup\$
7
\$\begingroup\$

So the only way I can think of is to add a 1Ohm resistor between the LED and R1, and then use two probes on that added resistor and the MATH function of the oscilloscope to subtract the values.

You already have a 180 Ohm current sense resistor, giving you 180x larger voltage (and thus better sensitivity!) than a 1 Ohm current sense resistor would. Zero changes to the circuit needed.

You can (and should!) use the preset store/recall of the scope to make setting up such a measurement take a fraction of a minute, in case you worried that bringing up the Math menu and setting it up every time is too much hassle (it's not once you've used the scope enough - but do use the presets, they are handy!).

This seems pretty complicated just to measure a single current.

For reference: in a professional setting, I just grab a DC hall current probe, clip it on a wire in the circuit, hook output to the oscilloscope, and call it a day.

Such probes, with good specs, go for $1k+. So you're essentially claiming that the value you get out of connecting just two cheap voltage probes and using a MATH function on the scope - that you paid for! - is not a good deal or is "too cumbersome"? It's an excellent deal! Be happy you can do this measurement so easily!

But, if you think that just one voltage probe will really save your day, and assuming that your circuit is not isolated from the mains ground, then adding a diagnostic current mirror is the next best thing.

A current mirror can make a copy of the current that is ground-referenced:

schematic

simulate this circuit – Schematic created using CircuitLab

Q2,Q3,Q4 form a current mirror that copies the current from its left branch to the right branch. R3 is a load that then converts that current into a voltage: 1V per each 10mA of load. The measurement error is about 3%. D2,R3,R5 replicate the load on the left branch of the current mirror, and keep the collector potentials of Q2 and Q4 similar. This keeps the accuracy of this approach reasonable in spite of its simplicity. D1 and D2 should be the same type.

R3+R4+C1 form a low-pass filter with time constant of 11ms. The transient response plot below shows the output setting; the average current is about 4.7mA, the PWM is 50% @ 10kHz.

Response of the low-pass filter

If you want a better current mirror, you'll need a couple more transistors. The measurement error is well below 1%, and is mostly determined by the accuracy of R3, as long as the transistors are not terribly mismatched.

schematic

simulate this circuit

This latter current mirror design comes from “Current mirror circuit with accurate mirror gain for low β transistors” by Chen, Whiteside and Geiger, and performs admirably with discrete transistors.

Q8's collector can be alternatively connected to ground, instead of the base. This alternative configuration is best evaluated experimentally, and chosen if it's more accurate.

I often leave such diagnostic capabilities in-circuit for small production runs, since when there's a problem, they pay for themselves handsomely. In non-trivial circuits, the cost of a couple dozen extra surface mount transistors is essentially nil, and there never are shortages of those parts, vs. let's say a current sense amplifier chip (never mind its cost!).

\$\endgroup\$
4
  • \$\begingroup\$ You can get better matching in a current mirror like this by using monolithic matched-pair transistors, which can improve accuracy over discrete transistors. (some are even available in through-hole packages for easy breadboarding.) There are even some dedicated current mirror ICs--the venerable REF200 for instance, in addition to its two current source references, contains a 1:1 current mirror (with fairly low current limits, however; it's only designed to operate up to a few hundred μA). \$\endgroup\$
    – Hearth
    Apr 14, 2022 at 19:37
  • \$\begingroup\$ @Hearth Of course, but most people don’t have those laying around, and these days monolithic transistor pairs that are on the same die are often unobtainium due to shortages. The 2nd current mirror circuit was specifically designed to perform well with mismatches up to 30%, IIRC to allow use of lateral bipolar transistors in CMOS processes. Those transistors are rather poorly matched and have low beta. The mirror works surprisingly well even with beta around 20. It is a go-to mirror for discrete transistors. I’ve found nothing else in the same class. I hope to give that gem some recognition! \$\endgroup\$ Apr 15, 2022 at 3:14
  • \$\begingroup\$ That's certainly an impressive level of mismatch for a current mirror to still work under! Should be serviceable with discretes, especially if you thermally bond them (even hot gluing two TO-92s together is better than nothing), but if you just have a grab bag of parts you have laying around it's unlikely you'd get 30% matching without a curve tracer to compare them with. Two of the same part from the same lot, sure, but two of the same part from the bottom of your parts box, probably not. \$\endgroup\$
    – Hearth
    Apr 15, 2022 at 4:32
  • \$\begingroup\$ @Hearth Agreed. \$\endgroup\$ Apr 15, 2022 at 5:25
4
\$\begingroup\$

Swap the positions of the LED and the 180 ohms, then just measure the bottom end of the led vs the 5v supply.

if the 5v supply is stable you may be able to just assume the 5V and measur with a single probe.

\$\endgroup\$
3
\$\begingroup\$

no need for a microscope. just use a basic multimeter and measure voltage across resistor for V=IR.

\$\endgroup\$
2
  • 6
    \$\begingroup\$ Microscope, do you mean Oscilloscope? \$\endgroup\$
    – HandyHowie
    Apr 14, 2022 at 7:06
  • \$\begingroup\$ A basic multimeter can't really be used to measure the amplitude of a PWM. \$\endgroup\$
    – Rodney
    Apr 15, 2022 at 12:35
1
\$\begingroup\$

If you're using a 5V PWM source, consider changing your circuit to this to assist in measuring the LED current. An added plus is that you won't need a base resistor any more.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ for equivalent performance, ctually you want a bit more than 5V on the pwm signal, it's probably easier to use PNP and invert the signal., \$\endgroup\$ Apr 15, 2022 at 1:31
  • \$\begingroup\$ @Jasen You're right that it isn't perfectly equivalent. You would need to add Vbe to your diode forward voltage when calculating what your resistor should be... but if there's a 180Ω resistor now, there's probably room in the resistor budget. \$\endgroup\$
    – W5VO
    Apr 15, 2022 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.