Detect a few mV variations in a Volts range signal - Page 1
Forum section: electronics / projects

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 07:47:12 am
content: Hi,what methods we can use to detect few mV changes in a 5-Volts or more amplitude signal?Even these variations are not significant in the oscilloscope screen, because volts-division was set on 5V and if we reduce it, then the signal will pass the screen limits.

author: Whales
author_rank: Super Contributor
timestamp: May 29, 2018, 07:56:58 am
content: You may be after 'AC coupling'. Almost all scopes have the capability of doing this for you, otherwise you can do it yourself. Lots of literature on the web either way.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 08:40:42 am
content: Quote from: Whales on May 29, 2018, 07:56:58 amThe signal is already AC. the AC itself has this amplitude and it has not made by the DC part.

author: BravoV
author_rank: Super Contributor
timestamp: May 29, 2018, 08:45:33 am
content: Quote from: VanitarNordic on May 29, 2018, 08:40:42 amWhales already pointed out, all you need is just switch your scope to AC coupling, you will able to see the "change" aka ripple of that DC 5 V line.The flat DC part 5 Volt is ignored and will not be displayed (plain at zero flat line) if in AC mode at your scope.Edit : Sorry, assuming you have a scope of course.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 09:16:41 am
content: As I mentioned this is not the case. The signal is already AC and on the AC section of the oscilloscope. I don't know why you mention this answer. Consider it is a sine waveand has 5V amplitude but it may have variation in few mV. I want to detect those variations.

author: jbb
author_rank: Super Contributor
timestamp: May 29, 2018, 09:20:15 am
content: Sounds like you’ve got an AC signal of ~5V amplitude and want to keep an eye on it.How do the ‘few mV’ show up? Is it a change in the amplitude over a period of time? (If so, suggest some kind of AC peak detector or true RMS converter.) Is it ripple at a higher frequency (in which case a frequency selecting filter could be good. Maybe a notch filter to knock the main waveform down?).Could you sketch the waveform you're interested in? And show what kind of result you want?

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 09:47:18 am
content: Quote from: jbb on May 29, 2018, 09:20:15 amThank you, you got it. These variations could appear in terms of amplitude and it is not constant like a ripple. it is like signal decay variations which appear in the tail of signal. I don't want to filter them, I want to detect them but because these variations are small in comparison with the whole signal, it is difficult to detect. one way is using ADC.

author: Dr. Frank
author_rank: Super Contributor
timestamp: May 29, 2018, 09:48:25 am
content: Measuring that by a scope is probably not possible, as this change in signal exceeds the dynamic range of the scope, especially as digital scopes have 12bit ADC at most.That depends on the waveform, and the part of latter, you're interested in.. maybe you can faintly see that change, if the offset function of the scope is big enough..If it's a low frequency signal, (up to 100kHz, or so) you might better use a good bench DMM with RMS and at least 6 1/2 digits resolution, or you might use an AC/DC multi junction thermo converter, with a nV meter for high resolution.

author: jbb
author_rank: Super Contributor
timestamp: May 29, 2018, 11:09:50 am
content: Quote from: VanitarNordic on May 29, 2018, 09:47:18 amYes, you can always look at sampling the crap out of it with an ADC, and then addressing it digitally. What is the frequency range of interest? Does the DC value of the signal matter (impacts folter and amplifier options)?With a 5V amplitude, you could use, say, a +- 6V range (12V total). To resolve 1mV then you would need at least 14b resolution. However, you will probably lose at least a couple of bits to ADC noise and INL. So maybe a 16b ADC would do. At these resolutions you need to be quite careful with noise (both random thermal noise and stray coupling), drivers and references.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?An example waveform and system block diagram would be very helpful.

author: MadTux
author_rank: Frequent Contributor
timestamp: May 29, 2018, 11:30:07 am
content: Just put a 7A22 into the vertical compartment of your favorite 7000series mainframe and problem solved ;-)

author: vk6zgo
author_rank: Super Contributor
timestamp: May 29, 2018, 12:15:48 pm
content: Quote from: MadTux on May 29, 2018, 11:30:07 amOr probably any old plugin with a voltage offset function.I think the 7A18N in my 7613 would do it, too, or a 1A5 plugin in a 545B.We did stuff like that every day back in the old days without thinking.OP--- remember that an ac waveform does have a DC component, it's just that it is zero volts.

author: exe
author_rank: Unknown
timestamp: May 29, 2018, 01:45:44 pm
content: So, the amplitude slowly drifts? One idea is just to use a precise DMM in AC mode (if specs are good-enough).Another idea is to build an AC-to-DC converter using an ideal diode rectifier (based on opamp), and a low-pass RC-filter. Then just measure dc value at the output. Not sure if this is better than a "true RMS" IC...

author: BNElecEng
author_rank: Regular Contributor
timestamp: May 29, 2018, 01:56:35 pm
content: Are you trying to measure this mV variation once or as an operation in a larger circuit?I've had some luck with using the infinite persistence display option on my oscilloscope to pick this sort of thing up.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 29, 2018, 03:51:07 pm
content: It's going to be pretty challenging to do this reliably under all conditions. Think of it, it's equivalent to detecting a modulation of 0.1 % in amplitude. Any noise or drift due to temperature may cause a change in amplitude greater than this. Are you going to do this only in lab or does it have to be implemented in a product and automated?

author: David Hess
author_rank: Super Contributor
timestamp: May 29, 2018, 04:26:12 pm
content: Quote from: MadTux on May 29, 2018, 11:30:07 amOr a 7A13 which was designed as a differential comparator for exactly these types of measurements. A 7A13 can measure -10 to +10 volts at 1mV/div; it is like having a trace position control with a range of 20,000 divisions.I am not as familiar with the 7A22 despite having 3 of them now so I have to look this up. It has an offset range of +/-10 volts at 20mV/div so not nearly as good as the 7A13 in this application.The usual way to make this measurement with a modern DSO is to use the built in offset function which is separate from the position control however offhand I do not know of any which can handle an offset of 5 volts at 1mV/div or even close.It is not difficult to build a circuit to help though. Use an instrumentation amplifier and 5 volt reference to subtract out the 5 volts DC leaving the residual for the oscilloscope to measure. This is essentially how a differential probe like a Pintek DP-60HS could be used if you had a separate 5 volt reference.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 04:26:53 pm
content: QuoteThe frequency is fixed. but will be decided to be something lower than 1KHz.QuoteYes, 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.

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: May 29, 2018, 05:44:35 pm
content: most built in PC sound chips today are 'HD" and can sample 24 bit @96kyou 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 variationsif 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 resolutionhigher quality 'pro-sumer' soundcards can better the noise performance of most PC internal sound chipsand low pass filtering can inprove resolution too if your signal of interest is also few kHz

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 29, 2018, 06:10:24 pm
content: Ok, looks like nothing I had in mind. So the scope screenshot helps a lot.What is it exactly that you need to measure? Wouldn't computing the falling rate of the decay enough to infer the information you're trying to get, instead of trying to measure what I guess would be the final voltage of the decay tail?

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 06:32:03 pm
content: Quote from: SiliconWizard on May 29, 2018, 06:10:24 pmYou mean measuring falling or rising time? yes, that's one method but I'm not sure if those variations are more significant than variations in the amplitude. In this scope screen, I can not consider the variation except they are high enough to be visible in the 2V-division setting.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 29, 2018, 06:56:33 pm
content: Quote from: VanitarNordic on May 29, 2018, 06:32:03 pmYes basically.Quote from: VanitarNordic on May 29, 2018, 06:32:03 pmDo you mean you need to measure the variation between successive such acquisitions?

author: jbb
author_rank: Super Contributor
timestamp: May 29, 2018, 07:24:11 pm
content: Quote from: VanitarNordic on May 29, 2018, 06:32:03 pmOK, it looks like now might be the time to do some rough prototyping. As f5r5e5d said, a PC sound card input might do the trick (remember to check your peak levels so you don't blow the card up) to get some high resolution capture data. Then you can do analysis to determine what detection algorithms will be appropriate. After that you can do some further analysis to determine what impact various errors have (noise, gain drift etc.).Note on noise filtering: analog filtering can be a bit difficult for precision work because the filter characteristics vary with component parameters. You can get more precise components and use higher order filters, but it costs more money. Alternatively, you can only apply anti-alias filtering quite high above the frequencies of interest and then do precision filtering in the digital domain where it will be more consistent.

author: exe
author_rank: Unknown
timestamp: May 29, 2018, 07:31:33 pm
content: I fail to see why mV accuracy is needed here. Capturing tail is "easy": it's the second rising edge,mostmany 'scopes can do it. I'd say it should be possible to just capture datapoints and process in software if the scope cannot provide automated measurement (is "fall time"? It's often calculated as 90% amplitude drop). Oversampling/bw-limiting/"smoothing" can help with noise (there is not much detail in the waveform anyway).

author: nctnico
author_rank: Super Contributor
timestamp: May 29, 2018, 07:51:17 pm
content: Quote from: VanitarNordic on May 29, 2018, 09:47:18 amYou have to filter them! By definition for a variation to be detectable on a large signal the frequency will need to be different and hence you can seperate the signals using a filter. It is fairly easy to construct a steep 7th order elliptic filter. I've done something similar to look at small signals injected into 50Hz mains.

author: StillTrying
author_rank: Super Contributor
timestamp: May 29, 2018, 08:08:39 pm
content: The curve in the yellow box looks more like just the AC amps recovering from overload, and not the decay curve you want, - I think.Possiblecatch upposts:www.eevblog.com/forum/projects/lf357-opamp-replaced-by-an-ad797-subsititude-must-work-better-but-it-dosn't%21%21%21/msg1506352/#msg1506352Given up on the link! - fixed it.

author: Marco
author_rank: Super Contributor
timestamp: May 29, 2018, 08:17:57 pm
content: I'm assuming you want to know the height of the peak? Easier said than done if the time constant of the rise/decay changes with the amplitude. I'd try digitizing it, picking some mostly translation insensitive denoising algorithm and then do peak detection on the denoised signal.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 29, 2018, 09:12:10 pm
content: Quote from: f5r5e5d on May 29, 2018, 05:44:35 pmShould 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.

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: May 29, 2018, 09:59:48 pm
content: line inshould 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 noiseplenty of info in "PC sound card oscilloscope" or "sound card impedance measurement" searches

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: May 29, 2018, 11:25:53 pm
content: 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.

author: vk6zgo
author_rank: Super Contributor
timestamp: May 30, 2018, 01:56:07 am
content: Quote from: VanitarNordic on May 29, 2018, 04:26:53 pmThis doesn't fit with your original post, which sounded as if you needed to see somelower frequencyripple on a sine wave.Are you looking for something like that with the signal you have shown us, or for ahigher frequencyripple 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.

author: JS
author_rank: Frequent Contributor
timestamp: May 30, 2018, 02:18:32 am
content: 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

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 30, 2018, 06:17:21 am
content: 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.

author: jbb
author_rank: Super Contributor
timestamp: May 30, 2018, 07:52:46 am
content: It sounds like you need to develop apreciseunderstanding 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?

author: BravoV
author_rank: Super Contributor
timestamp: May 30, 2018, 11:14:55 am
content: 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 ?

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 30, 2018, 11:19:40 am
content: Quote from: BravoV on May 30, 2018, 11:14:55 amI have already posted a screenshot and explained it. I'll explain more, no problem.

author: Marco
author_rank: Super Contributor
timestamp: May 30, 2018, 12:39:10 pm
content: 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).

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 30, 2018, 12:59:19 pm
content: Quote from: Marco on May 30, 2018, 12:39:10 pmyes 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.

author: StillTrying
author_rank: Super Contributor
timestamp: May 30, 2018, 02:33:09 pm
content: Quote from: VanitarNordic on May 30, 2018, 12:59:19 pmUnless 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!

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 30, 2018, 03:00:23 pm
content: Quote from: VanitarNordic on May 30, 2018, 12:59:19 pmSo 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?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.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 30, 2018, 05:05:43 pm
content: QuoteYour 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 secretQuoteYes, it is. but a little bit more precise. in the similar situations they use ADC, but I look for the best possible solution

author: StillTrying
author_rank: Super Contributor
timestamp: May 30, 2018, 09:59:44 pm
content: "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 ingreen) 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

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 30, 2018, 11:01:58 pm
content: Quote from: StillTrying on May 30, 2018, 09:59:44 pmOhh 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.

author: StillTrying
author_rank: Super Contributor
timestamp: May 31, 2018, 01:07:02 pm
content: Quote from: VanitarNordic on May 30, 2018, 11:01:58 pmLOLIt 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.Thegreen V(out)is the output.Thered 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.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 31, 2018, 01:48:14 pm
content: Thank you againI can use a P-channel Mosfet such as IRF9640 no problem with that.QuoteNo 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.

author: StillTrying
author_rank: Super Contributor
timestamp: May 31, 2018, 02:06:49 pm
content: Quote from: VanitarNordic on May 31, 2018, 01:48:14 pm? 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.QuoteI'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.

author: VanitarNordic
author_rank: Frequent Contributor
timestamp: May 31, 2018, 02:23:27 pm
content: QuoteI 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:

author: StillTrying
author_rank: Super Contributor
timestamp: June 03, 2018, 01:31:59 pm
content: 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.Redis the input to the op amp, looks about right,greenis the output of the NE5532,blueis the output of a lower gain LT1214 instead,yellowis 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