Close

Hack Chat Transcript, Part 2

A event log for Low-Level Analog Measurement Hack Chat

Chris Gammell measures his Analog Life

LutetiumLutetium 07/17/2019 at 20:030 Comments

Chris Gammell12:19 PM
you need to have a good resistor and a good op amp

Chris Gammell12:19 PM
and there are a broad range of parts you can buy

Will Patton12:19 PM
...and a bypass cap across Rf.

Chris Gammell12:19 PM
so understanding the critical things will allow you to buy better components that allow more accurate readings

Chris Gammell12:20 PM
any questions about that circuit?

Chris Gammell12:20 PM
in the case of that circuit, the resistor is super critical

Chris Gammell12:21 PM
if you imagine you have a resistor that is a different value than you think it is (say 1.2M instead of 1M), you can calibrate for it

Seth12:21 PM
In the event you would want to measure the current through the photodiode with a scope, are you looking at a 1% tolerance resistor or better?

Chris Gammell12:21 PM
but say you have a resistor that isn't perfectly linear

Chris Gammell12:21 PM
then you can't really calibrate for that

Dustin Sackett12:21 PM
@Chris Gammell last question from me: In your experience, how much does good/bad PCB design/layout contribute to the performance of the circuits we are talking about, qualitatively speaking of course.

Miguel joined  the room.12:21 PM

Chris Gammell12:22 PM
> In the event you would want to measure the current through the photodiode with a scope, are you looking at a 1% tolerance resistor or better?

So you wouldn't be able to measure that current directly, a scope measures voltage

guido.giunchi12:22 PM
Can you just use any high gain opamp? Is it critical?

Chris Gammell12:22 PM
but that circuit actually is a current-to-voltage converter

Kelly Heaton12:22 PM
@Dustin Sackett you can solve a lot of analog problems with the right capacitors between power and ground, as well as a very large ground plane.

Seth12:22 PM
I meant a series resistor you place in for test purposes only.

Chris Gammell12:22 PM
so if you have a good resistor, you can say with confidence that you're looking at what the current is, represented by the voltage output from the op amp

Chris Gammell12:23 PM
> Can you just use any high gain opamp? Is it critical?

No, the other specs matter quite a bit

Chris Gammell12:23 PM
if you have a high offset voltage between the inputs, that can impact things

Chris Gammell12:23 PM
the input bias current will have a large impact in this case as well

Chris Gammell12:23 PM
> In your experience, how much does good/bad PCB design/layout contribute to the performance of the circuits we are talking about, qualitatively speaking of course.

Using that example above again, it can be quite a bit

Chris Gammell12:24 PM
if you have a poorly laid out circuit, it can really impact analog things

Chris Gammell12:24 PM
much more than say an i2c bus

Chris Gammell12:24 PM
but I'd say if you're in the microvolt range or below, then it'll be a bigger concern

Chris Gammell12:24 PM
as a general rule

Chris Gammell12:24 PM
similarly if you're in the nA of current measurement range, it'll have a big impact

Chris Gammell12:25 PM
but that also extends to cleanliness of the board as well

Kelly Heaton12:25 PM
In my experience, if I can make an analog circuit robust enough in a breadboard, then getting it to work on a PCB is relatively easy.

Chris Gammell12:25 PM
any leakage path in an analog circuit is a potential place your circuit accuracy can get worse

Chris Gammell12:25 PM
> In my experience, if I can make an analog circuit robust enough in a breadboard, then getting it to work on a PCB is relatively easy.

Yeah, agree with that

Chris Gammell12:25 PM
there are definitely spots where a breadboard will start to breakdown

Chris Gammell12:25 PM
usually 10MHz+ on the frequency side of things

Kelly Heaton12:26 PM
Yes, parasitic capacitance

Chris Gammell12:26 PM
and those same values above for voltage, current

Dustin Sackett12:26 PM
Is that somewhat frequency dependent, both for the the analog signal of interest, and the related digital signals (SPI, I2C, etc)? If so, do you have a threshold for where things become trickier?

Dustin Sackett12:26 PM
^^ I see your 10MHz comment now!

Chris Gammell12:26 PM
> Is that somewhat frequency dependent, both for the the analog signal of interest, and the related digital signals (SPI, I2C, etc)? If so, do you have a threshold for where things become trickier?

For most things I was working on (and still work on when doing low level meausrement), it's a slow measurement

Kelly Heaton12:27 PM
High-speed stuff is a whole other world. I work in the audible range. Much easier.

Chris Gammell12:27 PM
if you get a DMM off a shelf

Chris Gammell12:27 PM
and go to measure low level signals

Chris Gammell12:27 PM
say a 5.5 digit DMM

Chris Gammell12:27 PM
if you're looking at the bottom of that range, uV measurements

Chris Gammell12:27 PM
you're normally integrating measurements over a long period to get more accuracy

Chris Gammell12:28 PM
so usually on the 1s scale

Chris Gammell12:28 PM
depending on how fast you like seeing your digits dance around the screen

Kelly Heaton12:28 PM
what are you using for the integration over time?

Chris Gammell12:28 PM
> what are you using for the integration over time?

Chris Gammell12:28 PM
In the DMM?

Chris Gammell12:28 PM
that's built in, there are analog to digital converters that are averaging measurements

Chris Gammell12:29 PM

https://en.wikipedia.org/wiki/Delta-sigma_modulation

WIKIPEDIA

Delta-sigma modulation - Wikipedia

Delta-sigma ( ΔΣ; or sigma-delta, ΣΔ) modulation is a method for encoding analog signals into digital signals as found in an analog-to-digital converter (ADC). It is also used to convert high bit-count, low-frequency digital signals into lower bit-count, higher-frequency digital signals as part of the process to convert digital signals into analog as part of a digital-to-analog converter (DAC).

Read this on Wikipedia

Kelly Heaton12:29 PM
Well, I would prefer to know how you would tease out a tiny signal from a noisy world using only discrete components.

Chris Gammell12:29 PM
that's a standard method for ADCs

Chris Gammell12:29 PM
passive discretes? Like Rs and Cs?

Kelly Heaton12:30 PM
Yes. And transistors, diodes are fine too. Just discrete component -- no chips

Kelly Heaton12:30 PM
It explains the principle better

Kelly Heaton12:30 PM
Like stages of filters

Chris Gammell12:31 PM
transistors and diodes are active, so that's what I wnated to deliniate

Chris Gammell12:31 PM
putting power into a system to help amplify is an important distinction

Chris Gammell12:31 PM
short answer for 2019: I wouldn't

Chris Gammell12:31 PM
discrete components are fun, but there are so many better tools out there

Chris Gammell12:31 PM
if I was going to study to go and design chips for the industry, I'd be doing more transistor level design

Kelly Heaton12:32 PM
Understood, but it's hard to grasp what the "other tools" are doing inside of that black box.

Chris Gammell12:32 PM
I see!

Chris Gammell12:32 PM
yeah, it's frustrating sometimes

Chris Gammell12:32 PM
and understanding the underlying architectures can help

Chris Gammell12:32 PM
understanding what's happening at the input to an op amp, for instance

Kelly Heaton12:32 PM
That's the benefit of discrete component examples (active, passive, makes no difference -- just out in the open. Not black box)

Chris Gammell12:32 PM
there are diodes in there which can mess up your measurements sometimes

Kelly Heaton12:32 PM
How so?

Chris Gammell12:33 PM
as you get closer to the rails, it's possible to get "stuck"

Kelly Heaton12:33 PM
Due to the voltage drop?

Will Patton12:33 PM
Excellent points Chris! (ADC, sampling, PCB layout, measurement repeatability/accuracy)!!!

Chris Gammell12:33 PM
so if you have an op amp with +/-15V rails, I normally would try and keep the incoming signals between +/-10V

Chris Gammell12:34 PM
this has gotten better on modern parts

Chris Gammell12:34 PM
but old parts, this was a big issue

Will Patton12:34 PM
Stay away from the rails = "Mind the gap" LOL

Chris Gammell12:34 PM
haha

Chris Gammell12:34 PM
yeah

Kelly Heaton12:34 PM
So rule of thumb -- give your parts 30% more power than your signal?

Chris Gammell12:35 PM
so if I went and built up an op amp from transistors (possible), I'd have to deal with a lot of the issues that op amp designers have dealt with for years (and improved)

Chris Gammell12:35 PM
> So rule of thumb -- give your parts 30% more power than your signal?

No, I wouldn't say that. It's more "read the datasheet"

Chris Gammell12:35 PM
and find parts that optimize your signal chain

Kelly Heaton12:35 PM
Of course

Nicolas Tremblay12:36 PM
"Read the datasheet"

We need t-shirts

Chris Gammell12:36 PM
yeah, kind of like the RTFM stickers from Sparkfun

Chris Gammell12:36 PM
Are a lot of people in here using analog signal processing in their projects?

Kelly Heaton12:36 PM
@Chris Gammell Thanks for getting into the weeds. You can return to fancy expensive equipment

Chris Gammell12:36 PM
would love to get a sampling of what people are currently doing

alexwhittemore joined  the room.12:36 PM

Chris Gammell12:36 PM
or looking to do

alexwhittemore12:37 PM
> so if you have an op amp with +/-15V rails, I normally would try and keep the incoming signals between +/-10V

Rail to rail or bust. Who cares about money? :)

Chris Gammell12:37 PM
also, let's hear it for the Hackaday crew in the house! Thanks @Mike Szczys and @Dan Maloney!

Kelly Heaton12:37 PM
thanks!

guido.giunchi12:38 PM
Would you recommend the art of electronics to learn more about analog circuit design?

monk12:38 PM
On the tips and tricks front. What sort of DFM tricks do you roll into your analog designs? Any sort of calibration at manufacture time concerns, for example?

Mike Szczys12:38 PM
@Dan Maloney does an excellent job with the Hack Chats, nice work! And thanks to @Chris Gammell and a million others for hosting!

alexwhittemore12:38 PM
FWIW my utility for "low level" design is more in characterization of more commonplace designs, without having to buy a $32342342311 SMU or power analyzer.

Will Patton12:38 PM
Chris, I'm working on a "precision rectifier" circuit also known as a "super diode". A diode and op amp (to be sampled by an ADC).

alexwhittemore12:38 PM
When I think "low level measurement" I think more "CurrentRanger" and less analog design.

Chris Gammell12:39 PM
> Would you recommend the art of electronics to learn more about analog circuit design?

Depends on your goals. AoE is a good overview, but ther are lots of good books out there. Jim Williams app notes are free

Chris Gammell12:39 PM
or you can read the "Analog Circuit Design" books from Newnes

Chris Gammell12:39 PM
which are just compiled versions of those things

Alex Ryker12:39 PM
I'm working on a DIY CO detector using a sensor like this:

https://www.sparkfun.com/products/9403

Chris Gammell12:40 PM
> On the tips and tricks front. What sort of DFM tricks do you roll into your analog designs? Any sort of calibration at manufacture time concerns, for example?

As Mike Harrison said on Embedded.fm this week, "You can never have too many test points"

Alex Ryker12:40 PM
I'm actually going through your 'Getting to Blinky 4.0' playlist now so I can design it in KiCAD.

Chris Gammell12:40 PM
killer episode, btw: https://embedded.fm/episodes/294

Chris Gammell12:41 PM
As for other calibration things, the best tip is to not need it

Chris Gammell12:41 PM
so if you can pay that extra dollar for a high accuracy resistor, pay for it

Chris Gammell12:41 PM
calibration is expensive

Chris Gammell12:41 PM
and it sucks

Chris Gammell12:41 PM
so balance it with the overall cost of the product

Chris Gammell12:41 PM
aside from that, hire great manufacturing engineers like @monk :-D

monk12:42 PM
"I need more test points" another great shirt idea -- perfect for FW and Manufacturing engineerings ;)

Discussions