Live data from Hacker News

Choosing an op-amp for your project

lcamtuf.substack.com

51–60 of 90 posts

Re: Choosing an op-amp for your project

#51
post #21

Earlier quoted context omitted.

Correct. A 10% error can be calibrated out if it is constant (in practice it probably varies a bit with temperature). But for measuring thermocouples or strain gauges, for example, 50 mV (your example) can be 100-500% of the signal, which becomes impractical to calibrate-out (due to maximum output levels, etc). For these applications, Vos is one of the first things to look at. Another one is the temperature coefficie…

> A 10% error can be calibrated out if it is constant (in practice it probably varies a bit with temperature). Unfortunately, Vos on cheaper general purpose OpAmps is the kind of thing that varies by... voltage. Ick. > For these applications, Vos is one of the first things to look at. Another one is the temperature coefficient on the gain. High frequency noise metrics such as CMRR and PSRR are sometimes important if…

> It's weird because CMRR is listed in decibels but it's absolutely a DC spec.

If you get the Franco book equation 5.27 (my edition is the 3rd) explains why they do that. Long story short: It's a convenient form when CMRR = dVcm/dVos due to the orders of magnitude involved.

Re: Choosing an op-amp for your project

#52
post #18

Earlier quoted context omitted.

For current measurement, I'd rather use a Hall sensor. But to measure the signal from that sensor a sensitive opamp is needed, and your comment applies :)

Using Hall-effect sensors to measure current isn’t that common when currents are in the uA to mA range. I’ve also never seen them used even for Amp range measurements when the application is purely on-board power supply meaurement.

The example uses 5A.

For mA range, of course not.

Re: Choosing an op-amp for your project

#53
post #8

I found this post extremely interesting and informative, well above my expectations even given the eminence of its author. I'm not sure that everything in it is covered in The Art of Electronics — it's the kind of stuff the book covers, but I learned things from this post I didn't learn from the book. (But possibly it's information that's in the book that I just failed to absorb the last few times.) I was recently lo…

Nowadays, it is hard to recommend a general-purpose opamp. Just plug the desired parameters into the search function and sort what's left by price. (Distributors like DigiKey and Mouser have somewhat adequate search functions; I usually have to go to manufacturers' web sites like https://www.ti.com/amplifier-circuit/op-amps/general-purpose... to be able to filter by all important parameters. I'm mentioning TI because…

>Nowadays, it is hard to recommend a general-purpose opamp. Just plug the desired parameters into the search function and sort what's left by price.

This 100%. If you need a comparator get a comparator not an op amp. Current measuring? There are specialized chips for that as well, etc.

Re: Choosing an op-amp for your project

#54
post #41

Vos doesn't matter until it does. I find it surprising to see Vos mentioned as likely unimportant right next to CMRR, as CMRR and Vos are innately related in some circuits. In particular, any low voltage current sense circuit is going to require very precise Vos. Let's say you have a 0.01 Ohm current-sense resistor on a 5-Amp or so circuit. Your current-sense is now in the range of +/- 0.05Volts (!!!!). So a Vos of 0…

I was puzzled about that too, so I appreciate you confirming what I thought. I'd think the main benefit of using lower-value current-sense resistors in this application would be that the resistor would heat up less, so its resistance would be more stable?

Accuracy is likely secondary. I expect that most applications are good with 1.5 digits (aka 95% accurate or so). You don't want to blow the entirety of this 5% allowable error on one micro-spec of one component, but I don't expect that most people especially need lots of accuracy here.

The issue is that any circuit with 1 to 5 amps of current is a serious amount of power, meaning power efficiency is likely one of the top priorities.

A 5-Amp circuit with a 0.01 Ohm sense resistor wastes 250mW on the resistor alone, likely more than the entirety of your microcontroller!! You can actually run an entire Linux capable microprocessor + Low-power DRAM off of that kind of power!!

Dropping down to 0.0001 Ohms uses 1/100th the power or 2.5mW. which is likely a more reasonable cost.

Re: Choosing an op-amp for your project

#55

Earlier quoted context omitted.

Nowadays, it is hard to recommend a general-purpose opamp. Just plug the desired parameters into the search function and sort what's left by price. (Distributors like DigiKey and Mouser have somewhat adequate search functions; I usually have to go to manufacturers' web sites like https://www.ti.com/amplifier-circuit/op-amps/general-purpose... to be able to filter by all important parameters. I'm mentioning TI because…

>Nowadays, it is hard to recommend a general-purpose opamp. Just plug the desired parameters into the search function and sort what's left by price. This 100%. If you need a comparator get a comparator not an op amp. Current measuring? There are specialized chips for that as well, etc.

In this strong form, this is excellent advice for someone who is not me and is not doing what I am doing.

I live in a third-world country where importing chips from abroad is expensive, unreliable, slow, and sometimes dangerous. There are circuits I cannot build because I cannot get the very specialized parts they need. Obviously a linear power supply that can measure how much current it's supplying is not such a circuit, unless you have very stringent precision requirements.

It would be to my benefit to figure out a relatively small set of parts I can buy, ahead of time, in bulk, to cover a wide range of possible circuits. Better still if they're so popular that local distributors have them in stock. An analog comparator probably needs to be in that set. A chip specialized for current measuring probably does not.

If you're designing a product for mass production that needs to be competitive in the market, you can't do it that way. Super-specialized parts will always have better performance, and usually better price/performance than overpowered general-purpose parts. (Also, you need to live in Shenzhen.) But hobbyists have other priorities.

Re: Choosing an op-amp for your project

#56
post #41

Earlier quoted context omitted.

I was puzzled about that too, so I appreciate you confirming what I thought. I'd think the main benefit of using lower-value current-sense resistors in this application would be that the resistor would heat up less, so its resistance would be more stable?

Accuracy is likely secondary. I expect that most applications are good with 1.5 digits (aka 95% accurate or so). You don't want to blow the entirety of this 5% allowable error on one micro-spec of one component, but I don't expect that most people especially need lots of accuracy here. The issue is that any circuit with 1 to 5 amps of current is a serious amount of power, meaning power efficiency is likely one of the…

That depends on what "most applications" means. I remember a paint program I saw in high school that some kids had written to draw sprites and backgrounds for their video games. The documentation explained that it could only edit 320×200×256 images, but that that should be adequate for "most projects". Depends on the context!

In the contexts I'm thinking of, I would think that, if your load is drawing 5 amps of current at 3.3 volts, which is 16.5 watts, an extra 0.25 watts in the 10mΩ current shunt is not likely to be a big problem. And if it's 5 amps at 48 volts or 240 volts, it's even less of a problem, relatively speaking. I guess you're thinking of different contexts, contexts where the power-measurement system is paid for from a different budget than the load, but I can't figure out what they are.

Re: Choosing an op-amp for your project

#57
post #48
post #43

Earlier quoted context omitted.

How do you compensate for Vos with feedback?

You probably don't, but your opamp might. https://www.analog.com/en/resources/technical-articles/to-ch... Technically you probably could do it externally in most cases but it would require a bunch of extra stuff, and be a pain, so usually it's best to use the stuff built into the amplifier itself.

Oh, sure. You could totally build a chopper op-amp out of two discrete op-amps. I'd never thought about actually doing that...

Re: Choosing an op-amp for your project

#58

Be aware in a microcontroller design, an lm324-type op amp might outperform the on-chip ADC you’re using anyway. Even the cheapest op amps from major players are better characterized and specified on their data sheets than most microcontroller ADCs. There’s no virtue in spending other people’s money and supply chain risk to use a “better” part just because it wins a bench race or it’s newer or whatever.

What does it mean for an op amp to outperform an ADC?

It can have wider bandwidth, lower noise+distortion, smaller Vos, maybe other things I'm not recalling off the top of my head. In practical terms, you might not be able to run any test with the ADC that can find the limits of the op amp.

Re: Choosing an op-amp for your project

#59
post #56

Earlier quoted context omitted.

Accuracy is likely secondary. I expect that most applications are good with 1.5 digits (aka 95% accurate or so). You don't want to blow the entirety of this 5% allowable error on one micro-spec of one component, but I don't expect that most people especially need lots of accuracy here. The issue is that any circuit with 1 to 5 amps of current is a serious amount of power, meaning power efficiency is likely one of the…

That depends on what "most applications" means. I remember a paint program I saw in high school that some kids had written to draw sprites and backgrounds for their video games. The documentation explained that it could only edit 320×200×256 images, but that that should be adequate for "most projects". Depends on the context! In the contexts I'm thinking of, I would think that, if your load is drawing 5 amps of curre…

You're sniffing out the fact that I didn't have an exact application in mind when I wrote my earlier posts, lol. But yes, you are correct on this front.

The more I post on this subject, the more I'm "backwardsly-targetting" a solar-powered MPPT circuit.

Maximum Power Point Tracking circuits improve your solar-panel's efficiency by changing the current (through the use of a buck-boost converter, changing the voltage-and-current downstream). Or maybe you have excess current sunk ionto a battery of some kind. Either way, you have some kind of configurable-load and can therefore maximize the solar panel's Voltage/Current curve characteristics to seemingly magic energy out of nothingness.

If it costs you 250mW to just *sense* the current and run the calculations, it becomes much harder to justify the small gains of any MPPT circuitry.

------

But yes, I'm changing the target application to suit my argument style. Apologies on that but I think you can forgive me on this!! The point of MPPT is to magic more energy out of nearly nothingness so efficiency is of great concern here!

Re: Choosing an op-amp for your project

#60
post #57
post #48

Earlier quoted context omitted.

You probably don't, but your opamp might. https://www.analog.com/en/resources/technical-articles/to-ch... Technically you probably could do it externally in most cases but it would require a bunch of extra stuff, and be a pain, so usually it's best to use the stuff built into the amplifier itself.

Oh, sure. You could totally build a chopper op-amp out of two discrete op-amps. I'd never thought about actually doing that...

I've seen designs that use a Chopper Op-Amp to actually auto-zero a power-OpAmp, effectively transferring the low Vos characteristics to a different OpAmp with completely different characteristics.
Post reply on HN