Author Topic: Detect a few mV variations in a Volts range signal  (Read 6929 times)

0 Members and 1 Guest are viewing this topic.

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #25 on: May 29, 2018, 09:12:10 pm »
most built in PC sound chips today are 'HD" and can sample 24 bit @96k

you would need a divider but the soundcard ADC effective resolution can be well over 14 bits so you should still be able to see mv variations

if the siganl is stable and repetitive then you could average a bunch and then send out the averaged waveform thru the DAC for a diff amp measurement at much higher resolution

higher quality 'pro-sumer' soundcards can better the noise performance of most PC internal sound chips

and low pass filtering can inprove resolution too if your signal of interest is also few kHz

Should I use Mic input or Line-In?

What is the voltage tolerance of each input?

I can set to 24Bits/96K or even 24Bits/192K sampling but I am not quite sure after I reduce the voltage level by some resistors or Zener diodes, then the small variations are detectable.
 

Offline f5r5e5d

  • Frequent Contributor
  • **
  • Posts: 349
Re: Detect a few mV variations in a Volts range signal
« Reply #26 on: May 29, 2018, 09:59:48 pm »
line in should accept 2 Vrms full scale, will be AC coupled (both a internal C in series in the PC and a digital high pass in the ADC bleow 20 Hz)

you will need a ~ 2:1 divider, keep R below 10 kOhm to not add noise

plenty of info in "PC sound card oscilloscope" or "sound card impedance measurement" searches
« Last Edit: May 29, 2018, 10:07:12 pm by f5r5e5d »
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: Detect a few mV variations in a Volts range signal
« Reply #27 on: May 29, 2018, 11:25:53 pm »
You haven't said much about the time scale and periodic nature of the variations relative to the 5V signal. If the signal is appropriate then you could pass it through an RC differentiator.

In the attached example, there is a 25mV @ 100Hz ripple on a 5V @ 5Hz signal. The blue line is the composite signal and the orange/brown is the differentiated signal.
« Last Edit: May 29, 2018, 11:28:03 pm by JohnnyMalaria »
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7704
  • Country: au
Re: Detect a few mV variations in a Volts range signal
« Reply #28 on: May 30, 2018, 01:56:07 am »
Quote
What is the frequency range of interest? Does the DC value of the signal matter (impacts folter and amplifier options)?

The frequency is fixed. but will be decided to be something lower than 1KHz.

Quote
Also, what is the triggering situation going to be? If you have a solid trigger signal from some other part of the system you may be able to do clever stuff rather than using brute force.  Is the waveform periodic? Constant frequency?

Yes, the triggering is from an MCU in the same circuit (or from the waveform generator on the test bench) and therefore it is a clean and noise free signal. The signal itself is not a simple wave or periodic like a sinewave. Look at the picture below. The interesting part is its tail which I put inside a rectangle. I want to program the ADC in a way which just grabs the tail. The highest ADC resolution I was found in the MCUs, was 12 Bits from STM32. if you think it is not enough, I have to use an external ADC.

The whole signal is AC and it does not have a DC value. It has passed through a cap.



This doesn't fit with your original post, which sounded as if you needed to see some lower frequency ripple on a sine wave.
Are you looking for something like that with the signal you have shown us, or for a higher frequency ripple on the " sine like" bit after the pulse?

In both cases, you should be able to use a voltage "offset" function of an Oscilloscope to look at the lower level ripple.

The capacitor coupling causes the signal to distribute itself with equal areas above and below the zero voltage point.
The "offset" control will effectively add or subtract a variable voltage from the zero point, allowing you to just look at the voltage level of interest, then use higher sensitivity ranges to measure the ripple.

We used to look at "back porch noise" of a few millivolts on a 1volt analog video signal with an analog 'scope back in the day.
It is a few years back, but I am pretty certain I did it in ac coupled circuits as well as DC coupled ones.

We also looked at small signals on valve/tube equipment which were often offset by several hundred volts.
(The 1A5 plugin, in particular, had a very wide offset range.)

Unfortunately, I don't have a DSO, so I'm not sure what, if any, offset adjustments are available on them.

 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: Detect a few mV variations in a Volts range signal
« Reply #29 on: May 30, 2018, 02:18:32 am »
Which point of that waveform do you want to measure?
Do you need that value for every capture or an average?
Do you have (or can get) a mathematical model of the waveform in question?

  Let's say you wan't to measure the peak of the waveform with more precision than the noise and ADC is allowing, but you do know it's coming from an RLC circuit so the response should be represented by two exponentials. If you take your samples to the PC and try to fit a curve formed by two exponentials it will give you a pristine curve that reassembles pretty closely the one you have, so you can now take from that your highest value. You can, with this method, know roughly the error you are dealing with (from the approximation to your samples), if it's too big you can improve the model, to say include ESR of the cap, DCR of the inductor, inductor's parallel capacitance, etc. Same thing if you try to measure rising and falling times, etc.

  If you are interested in the lower part of the curve, in shape and value, you could clip out the higher bit of the signal and just look at the lower bit, even with a low resolution ADC it might be good enough. Be careful with the clipping, you should do it before the ADC with some resistor and diode clamping.

JS
If I don't know how it works, I prefer not to turn it on.
 

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #30 on: May 30, 2018, 06:17:21 am »
The variations are in form of a decay. it means the highlighted wave may be reached to zero sooner or later. The illustrated wave is in the stable condition.
 

Offline jbb

  • Super Contributor
  • ***
  • Posts: 1231
  • Country: nz
Re: Detect a few mV variations in a Volts range signal
« Reply #31 on: May 30, 2018, 07:52:46 am »
It sounds like you need to develop a precise understanding of what you want to measure. Then you can work out a measurement plan. This will help you to pin down required resolution, noise, magnitude accuracy, drift over time and temperature etc.

Until you understand what you need to measure, you can’t make good choices. This will tend to force you towards overkill. For example, an 18 bit 1 MS/s converter would likely do the job but might be a waste of money...

Other factors: how fast do you need the final results after measurement? How often do the pulses come in?
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7549
  • Country: 00
  • +++ ATH1
Re: Detect a few mV variations in a Volts range signal
« Reply #32 on: May 30, 2018, 11:14:55 am »

Since it is clearly a language barrier here. All the op needed is just to draw the wave on paper, take photo and post it here, no need fancy scope's screen or computer made illustration, about the "details" that he wants to capture/see/measure. 

How hard is that ?   :palm:


Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #33 on: May 30, 2018, 11:19:40 am »

Since it is clearly a language barrier here. All the op needed is just to draw the wave on paper, take photo and post it here, no need fancy scope's screen or computer made illustration, about the "details" that he wants to capture/see/measure. 

How hard is that ?   :palm:

I have already posted a screenshot and explained it. I'll explain more, no problem.
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 6966
  • Country: nl
Re: Detect a few mV variations in a Volts range signal
« Reply #34 on: May 30, 2018, 12:39:10 pm »
It looks like a second order differential equation (like the impulse response of a RLC circuit). If that's what it is you can do a least squares fit to find the parameters of the function (just google for least squares second order differential equation).
 

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #35 on: May 30, 2018, 12:59:19 pm »
It looks like a second order differential equation (like the impulse response of a RLC circuit). If that's what it is you can do a least squares fit to find the parameters of the function (just google for least squares second order differential equation).

yes somehow. The sensor is a coil which shows a different behavior in presence of metal, in terms of return pulse decay. The signal has amplified and that picture shows that. so that's the interesting part.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Detect a few mV variations in a Volts range signal
« Reply #36 on: May 30, 2018, 02:33:09 pm »
The sensor is a coil which shows a different behavior in presence of metal, in terms of return pulse decay. The signal has amplified and that picture shows that. so that's the interesting part.

Unless you can explain why your decay signal is now 200 times slower, and opposite polarity, from the previous thread.(scope image below) I'm convinced the curve you're now showing is just the high gain amp recovering from saturation, and not the decay curve. Which would mean your high gain amp is messed up, I hope I'm completely wrong, somehow!


.  That took much longer than I thought it would.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15360
  • Country: fr
Re: Detect a few mV variations in a Volts range signal
« Reply #37 on: May 30, 2018, 03:00:23 pm »
It looks like a second order differential equation (like the impulse response of a RLC circuit). If that's what it is you can do a least squares fit to find the parameters of the function (just google for least squares second order differential equation).

yes somehow. The sensor is a coil which shows a different behavior in presence of metal, in terms of return pulse decay. The signal has amplified and that picture shows that. so that's the interesting part.

So this is some kind of proximity sensor and you want to be able to infer a distance, or maybe just a metal detector and you want to be able to infer the metal composition? :popcorn:

Anyway, if all you want is to estimate the decay part, I think taking several points along the decay curve instead of just trying to measure how low it got, would be much more reliable and additionally wouldn't necessarily need an ADC with as high a resolution.

Since it's probably an exponential decay, it will still be difficult to get reliable results: approximating an exponential curve with a few points can lead to a very significant error (refer to: https://en.wikipedia.org/wiki/Propagation_of_uncertainty )

Your best bet would still be to approximate the curve with some kind of exponential regression IMO (assuming this is exponential decay). To get an idea of the suitability of this approach, you may use SciDAVis ( http://scidavis.sourceforge.net/ ), which has an "exponential decay fit" tool (SciDAVis  is a great graphing and analysis tool actually). Then if it appears to meet your requirements, you can implement that later on.


 

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #38 on: May 30, 2018, 05:05:43 pm »
Quote
Unless you can explain why your decay signal is now 200 times slower, and opposite polarity, from the previous thread.(scope image below) I'm convinced the curve you're now showing is just the high gain amp recovering from saturation, and not the decay curve. Which would mean your high gain amp is messed up, I hope I'm completely wrong, somehow!

Your posted picture is the original signal, and this picture is the result of inverted amplification. I amplified it using an opamp in an inverting mode, but at hight gains. Yes, it is covered from the saturation by adjusting the + rail voltage. Nothing secret  :popcorn:

Quote
So this is some kind of proximity sensor and you want to be able to infer a distance, or maybe just a metal detector and you want to be able to infer the metal composition? :popcorn:

Anyway, if all you want is to estimate the decay part, I think taking several points along the decay curve instead of just trying to measure how low it got, would be much more reliable and additionally wouldn't necessarily need an ADC with as high a resolution.

Since it's probably an exponential decay, it will still be difficult to get reliable results: approximating an exponential curve with a few points can lead to a very significant error (refer to: https://en.wikipedia.org/wiki/Propagation_of_uncertainty )

Your best bet would still be to approximate the curve with some kind of exponential regression IMO (assuming this is exponential decay). To get an idea of the suitability of this approach, you may use SciDAVis ( http://scidavis.sourceforge.net/ ), which has an "exponential decay fit" tool (SciDAVis  is a great graphing and analysis tool actually). Then if it appears to meet your requirements, you can implement that later on.

Yes, it is. but a little bit more precise. in the similar situations they use ADC, but I look for the best possible solution
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Detect a few mV variations in a Volts range signal
« Reply #39 on: May 30, 2018, 09:59:44 pm »
"and this picture is the result of inverted amplification."

That's the point, your energizing voltage is now shown inverted, but not the decay curve, so I'll have to stick to my conclusion that your amp is chopping off the decay curve (drawn in green) at about 1V, and the new curve you've got is just the ac coupled inverting op amp recovering from saturation.

I don't think it can easily be done with a AC coupled amp, which is why I went straight to DC coupled simulated versions on the previous thread.
https://www.eevblog.com/forum/projects/lf357-opamp-replaced-by-an-ad797-subsititude-must-work-better-but-it-dosn't%21%21%21/msg1510033/#msg1510033
.  That took much longer than I thought it would.
 
The following users thanked this post: VanitarNordic

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #40 on: May 30, 2018, 11:01:58 pm »
"and this picture is the result of inverted amplification."

That's the point, your energizing voltage is now shown inverted, but not the decay curve, so I'll have to stick to my conclusion that your amp is chopping off the decay curve (drawn in green) at about 1V, and the new curve you've got is just the ac coupled inverting op amp recovering from saturation.

I don't think it can easily be done with a AC coupled amp, which is why I went straight to DC coupled simulated versions on the previous thread.
https://www.eevblog.com/forum/projects/lf357-opamp-replaced-by-an-ad797-subsititude-must-work-better-but-it-dosn't%21%21%21/msg1510033/#msg1510033

Ohh Yes you are right. Thank you very much. Actually I decided to open another topic to just focus on this.

The OP has cut the signal in that point and the rest is recovery. That's true. But I see many variations in that yellow part either you know. I think for the DC coupling I have to reference to the ground and choose a P channel mostet.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Detect a few mV variations in a Volts range signal
« Reply #41 on: May 31, 2018, 01:07:02 pm »
Ohh Yes you are right.

LOL
It would have been a lot easier if I'd have been wrong.

"But I see many variations in that yellow part"

The way it recovers will depend a quite bit on how it saturated, and what's left of the real decay tail.

You might be able to do it perfectly well with an AC amp, but the best I could come up with is the DC coupled +5V and -12V version, I'll post a slightly updated version right here, It looks simple-ish too me, you might be able to pick something useful from it.

Possible advantages.
The coil is permanently connected to 0V, rather than 12V.
The decay curve is at 0V and positive going.
Uses the same n mosfet, now on the -12V supply.
The DC coupled non inverting op amp needs no coupling, or bias decoupling caps.
Can use very low value gain resistors and a low input impedance op amp.

Possible disadvantages.
The odd +5V and -12V supplies.
Switching the mosfet when it's on the -12V supply, but at these switching speeds an opto or 1 transistor would do, - probably.
The high DC gain of the op amp can cause a DC offset on the output, not too difficult to fix.
Probably quite a few more that I haven't thought of.


The gain of the simulation shown using the LT 28MHz op amp is about 1000 @ 10kHz, and about 650 @ 40kHz.
V9 is nothing, just a 1mV sine to measure the gain in the simulation.
SW S6 gets replaced by the n mosfet.

The green V(out) is the output.
The red V(out2) is a version with an analogue switch on the input, so that it doesn't saturate too much on the first large pulses.
Both versions are in the .asc, it's a bit messy but hopefully someone will run it and suggest improvements!

Phew.
« Last Edit: May 31, 2018, 01:12:28 pm by StillTrying »
.  That took much longer than I thought it would.
 
The following users thanked this post: VanitarNordic

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #42 on: May 31, 2018, 01:48:14 pm »
Thank you again  :-+

I can use a P-channel Mosfet such as IRF9640 no problem with that.

Quote
The odd +5V and -12V supplies.

No problem to use extra components to have better results but my only concern regarding negative voltage is that I have to use chips like 7660 to generate it, which contains some ripple. I'm not quite sure if it will affect the output because the switching frequency is high.

I'll test your suggestion.
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Detect a few mV variations in a Volts range signal
« Reply #43 on: May 31, 2018, 02:06:49 pm »
I can use a P-channel Mosfet such as IRF9640 no problem with that.

? In the +5 & -12v version it has to be a N-Channel same as you've already got ?

I'll swap the simulation SW for a switching N-Channel soon.

Quote
The odd +5V and -12V supplies.

No problem to use extra components to have better results but my only concern regarding negative voltage is that I have to use chips like 7660 to generate it, which contains some ripple. I'm not quite sure if it will affect the output because the switching frequency is high.

I'd start with the 12V because it has to be a high enough current for energizing the coil, and produce a 5V from the 12V volt.
.  That took much longer than I thought it would.
 
The following users thanked this post: VanitarNordic

Offline VanitarNordicTopic starter

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Detect a few mV variations in a Volts range signal
« Reply #44 on: May 31, 2018, 02:23:27 pm »
Quote
In the +5 & -12v version it has to be a N-Channel same as you've already got ?

I mean I'm researching about this to find the best method and I am not bounded to just use P or N. I think with reference to ground, it might be easier to use a P Mosfet maybe, but you are professional and more experienced about this. Look at the below circuit:



 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Detect a few mV variations in a Volts range signal
« Reply #45 on: June 03, 2018, 01:31:59 pm »
I've simulated the first few few components of that circuit, the 555, mosfet, coil and NE5532.
It pulses at about 600Hz, the coil current peaks at about 1.5A.
Red is the input to the op amp, looks about right, green is the output of the NE5532, blue is the output of a lower gain LT1214 instead, yellow is a 2nd LT1214 added giving a total gain of about 18,000.

You should download LTSpice and try these options yourself!
http://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html

.  That took much longer than I thought it would.
 
The following users thanked this post: VanitarNordic


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf