Is this opamp impedance thing? - Page 1
Forum section: electronics / beginners

author: sw_guy
author_rank: Regular Contributor
timestamp: December 14, 2023, 07:53:48 pm
content: hello all,May I ask probably a beginner question about opamps.The diagram illustrates a circuit I have. V2 is 8kHz square wave and U4/U7 is MCP6024. ADC0/ADC1 is AD converter input. The diagram is slightly simplified version, but I think all the key components in terms of my question exist.I am trying to measure peak voltage. Can't remember which video this was introduced by Dave, but the circuit if from one of the vblogs years ago. When R1 and R2 are <10k everything is fine. When R1/R2 are >50K, then ADC0 starts to fluctuate. Not much, but 10-20 bits using 15 bits AD converter. When R1/R2 are say 1k, the ADC reading is rock solid.ADC reading fluctuate can caused by several reasons, but in this common issues like case supply voltage or ADC reference voltage seem not be issue. Fluctuating increases when R1/R2 are increased. Looking input impdedance 6024, it is very high. Should not be affected by 100k resistor the way connected on the circuit.sw gyu

author: sw_guy
author_rank: Regular Contributor
timestamp: December 16, 2023, 06:02:16 am
content: It was diode thing. I used MBR0520 and after a few attempts I tried 1N5819 and it works much better. Wondering if there is even better choice than 1N5819....sw guy

author: liaifat85
author_rank: Regular Contributor
timestamp: December 16, 2023, 07:26:50 am
content: If you're looking for a better choice, you can try with some other SCHOTTKY BARRIER RECTIFIERs.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 16, 2023, 11:06:50 am
content: Vcm for this opamp is 3.5V. The voltage at the top of R1 is 4.9V and U4 would have to swing its output to 4.9+Vf to operate correctly.Even with an input of 3.3V to one of the opamps you're sailing pretty close to the wind.I imagine that exceeding Vcm could cause excess current to flow into the opamp inputs.I dont think Vcm is modeledThe input impedance will affect the magnitude the offset caused by a fault current.This could appear as an offset with unknown drift.Try potting down the inputs to get the amp in its Vcm comfort zone.Its a good idea to use a leakage cancelation scheme. MOSFET resets are leaky.Seen here on Daveviewhttps://www.youtube.com/watch?app=desktop&v=jllsqRWhjGM

author: Neilm
author_rank: Super Contributor
timestamp: December 16, 2023, 05:16:50 pm
content: There is the possibility you are looking at the wrong thing. I have seen the input circuit of an ADC generate current pulses (due to the characteristics of the sample and hold circuit). The capacitor on the input to the ADC supplied this current pulse and lead to very weird oscillations in the reading

author: sw_guy
author_rank: Regular Contributor
timestamp: December 16, 2023, 05:42:39 pm
content: Terry:Thank you for the detailed answer. But isn't it 3V3 on top of the R1 (referenced to ground). 1.65V (referenced to ground) between resistors is virtual ground.Neilm:This was my first subject to investigate but couldn't find anything related. Fluctuation is smooth variation and I was now able to identify that it was coming occasional spikes seen on cathode side of the diode. Those spikes are much smaller now when I changed the diode.At first I tried different combinations of resistor and capacitor in front of the ADC, but it didn't make any difference.Thank you both for answers!sw gyu

author: sw_guy
author_rank: Regular Contributor
timestamp: January 28, 2024, 01:56:29 pm
content: Surprisingly difficult to find a good diode. I have a few 1N5158 that work well. Unfortunately details and source unknown.I bought/tried:1N5819HW1-7-F (super barrier)Fluctuates (so, not exactly the same version as the ones I already have)SMD110PLQ-TP (schottky barrier)Fluctuates.MBR0520L-TPFluctuates.Before I start brute-force method (=buying a punch of diodes and keep on trying until I find a good one), I appreciate to receive good known options to start with.A

author: Gyro
author_rank: Super Contributor
timestamp: February 03, 2024, 12:17:58 pm
content: There's no need to use a Schottky diode - it doesn't look as if you need low Vf for headroom. Try an ordinary Silicon diode, eg 1N4148. It will have much lower reverse leakage current.

author: ArdWar
author_rank: Frequent Contributor
timestamp: February 03, 2024, 12:35:32 pm
content: Is your circuit even stable? Certain opamps really hate direct-driving capacitors, especially large one. Try adding some small resistance (10-100R or something) to isolate the cap.That one specific diode may have just the right V-I curve to stabilize the circuit, but I won't bet on it being consistent across devices, temperatures or other operating conditions.

author: sw_guy
author_rank: Regular Contributor
timestamp: February 03, 2024, 12:54:35 pm
content: >There's no need to use a Schottky diode - it doesn't look as if you need low Vf for headroomThis is what I've started to suspect as well. I thought that speed is a factor - and maybe it is - but not the way I assumed.>Is your circuit even stable? Certain opamps really hate direct-driving capacitors, especially large one. Try adding some small resistance (10-100R it something) to isolate the cap.I am, in fact, currently modifying the PCB to add resistors.Thank you both!

author: ArdWar
author_rank: Frequent Contributor
timestamp: February 03, 2024, 01:56:32 pm
content: I somehow glossed over the fact that this is a nonlinear circuit for the lower half of the signal.Yeah like said by others the most common problem for this kind of circuit is diode reverse current leakage. Your opamp is driven hard to the ground for any input that isn't the peak, making the leakage a bigger concern. For these reason you need to use lower leakage diode and maybe avoid using Schottky. Capacitor leakage and opamp input bias current is another thing to consider.HoweverI still can't quite figure out what kind of possible problem you actually have here, or any problem that would manifest from altering theotherend of the input in general. This opamp don't even have the antiparallel input protection diode.

author: Zero999
author_rank: Super Contributor
timestamp: February 03, 2024, 03:40:52 pm
content: The 1N5819 has a massive leakage current of up to 1mA and a capacitance of 110pF.https://www.vishay.com/docs/88525/1n5817.pdfAs mentioned above, the voltage drop is a non-issue so use the 1N4148, which has much lower leakage current and capacitancehttps://www.vishay.com/docs/81857/1n4148.pdf

author: sw_guy
author_rank: Regular Contributor
timestamp: February 03, 2024, 04:25:00 pm
content: Great, great.. thanks. And the MBR0520L-TP has 170pF and it is the worse I tried. This clearly reflects the results.Since 1N4148 has capacitance of 4pF can I even find a better candidate than that :-)I changed C1 and C2 to 100nF MLCC ceramic and they worked better than 1uF ceramic. I also tried film capacitor (PanasonicECP-U1C104MA5) it did not work well.Will try 1N4148 next.sw guy

author: Zero999
author_rank: Super Contributor
timestamp: February 03, 2024, 07:47:26 pm
content: Have you bench tested the circuit, or is it just simulation?How about using a transistor for the diode? Try both the emitter-base and collector junctions, to see which is better.

author: sw_guy
author_rank: Regular Contributor
timestamp: February 03, 2024, 07:52:32 pm
content: >Have you bench tested the circuit, or is it just simulation?The circuit is in use and it works fairly well.>Try both the emitter-base and collector junctions, to see which is better.Really :-) I have never seen this... I guess any small signal transistor like BC547/2N2222 etc. will do the job(?)sw guy

author: Eraldo
author_rank: Regular Contributor
timestamp: February 04, 2024, 10:15:50 am
content: If you're going to buy diodes then just buy a couple Bav199 which are low leakage fast switching dual diodes used in multimeter input protection.It has very low capacitance (2pF from one datasheet) and has max reverse voltage of 70VMake sure you have a good capacitor too if you want a good peak detector.

author: MarkT
author_rank: Frequent Contributor
timestamp: February 04, 2024, 06:16:04 pm
content: The BAV199 is slow, and has very large reverse recovery (max 3µs @10mA). Its described as "medium speed switching", which I think just means average. 1N4148 style signal diode is what you want for fast switching (max 4ns). There are better circuits for precision rectification / peak detection that clamp the opamp output to stop it saturating (thus avoiding the large delay coming out of saturation).There normally has to be a way to reset the peak detector too!

author: Vovk_Z
author_rank: Super Contributor
timestamp: February 04, 2024, 10:17:05 pm
content: Quote from: liaifat85 on December 16, 2023, 07:26:50 amIf he works with signals but is not designing a power rectifier then he needs small signal Schottky diodes?

author: sw_guy
author_rank: Regular Contributor
timestamp: February 05, 2024, 04:52:10 pm
content: Experiments:I tried 1N4148. After connecting R2, output is not stable for a few seconds. After stabilized, small fluctuating exists. I added 25R resistors in front of capacitors, the circuit became stable. Fluctuating was not bad, but still worse than with unspecified 1N5819.I tried MMBT3904 transistor (B-E) but it did not work at all. Probably it should, but I did not spend much time on this.RC (=R3+C1 / R4+C2) of 5R+100nF stabilizes the circuit pretty well, but still the bestknowndiode is not yet found. (25R+100nF works as well what comes to fluctuating, but takes much longer to find peaks naturally). I also tried 50R+10nF that should limit op amp current preserving behavior, but for some reason 5R+100nF is more stable than 50R+10nF.In the end, with unknown 1N5819 + RC circuit added, ADC readings are rock solid. I know now what diodes I will buy and try to find as good candidate as orderable version.sw guy

author: Zero999
author_rank: Super Contributor
timestamp: February 05, 2024, 06:01:16 pm
content: The fact it works better with the resistor is unsurprising. Adding series resistance is a well-known remedy for op-amp instability, whilst driving a capacitive load.If the 1N5819 is working better than the 1N4148, it might be the leakage current which is increasing the stability, rather than reducing it. You could try the 1N4148 with a resistor in parallel with it, say 1M.

author: Wallace Gasiewicz
author_rank: Super Contributor
timestamp: February 05, 2024, 10:12:18 pm
content: I have had a very hard time finding diodes with low leakage. Even FETs used as diodes with low leakage. Many FETs have lower leakage across the junction than diodes but not low enough for my purpose.I am currently evaluating 2N4118 FETs for use as a low leakage diode. Just tie the source and drain together.Also notice this is s symmetrical FET, the Source and Drain are interchangeable.https://www.interfet.com/jfet-datasheets/jfet-2n4117-2n4118-2n4119a-interfet.pdfPlease note that I am not stating this is your primary problem in the circuit. Adding resistances to the inputs of OP Amps is a good idea.

author: sw_guy
author_rank: Regular Contributor
timestamp: February 07, 2024, 03:16:45 pm
content: So that was the case: adding a resistor in parallel made the circuit work with 1N5819HW1-7-F (also with 1N4148, but not as good). I tried 1M and 680k resistors and 680k is rock solid.Presumable the old stock of 5819s have leakage current closer to 1mA while the 1N5819HW1-7-F has 500uA.Thank you everyone!sw guy