Circuit stopped working when I swapped op amp - Page 1
Forum section: electronics / beginners

author: Infraviolet
author_rank: Super Contributor
timestamp: May 20, 2022, 12:13:14 am
content: I've got a peak detector circuit based on:https://www.electronics-tutorial.net/wp-content/uploads/2015/09/Peak_D2.pngit worked fine with an MCP6024, when a 100KHz sine signal (+/- voltage about 2.5V) was fed in it outputted the max peak height as DC voltage level, but I've tried swapping to an MCP6004 now, and it has completely stopped working. With the 6004 the output stays at 2.5V constantly, however large or small the incoming sine wave's amplitude gets.It isn't a dead chip, I've tried with several MCP6004s.And it isn;t an error in the circuit layout, the 6004 and 6024 are fully pin compatible so I've levered one out of a breadboard setup and put the other in, when a 6024 goes in it works, when a 6004 goes in all I get is a constant voltage.My input resistor is 19K, the feedback resistor is 27K for some slight amplification, the diode is 1n4148, the capacitor is 100Nf and the timing resistor 10K. The op amp is powered with about 4.8V (5V but some losses in breadboard wires) and gnd.Any thoughts?Thanks

author: ledtester
author_rank: Super Contributor
timestamp: May 20, 2022, 12:53:47 am
content: Couple of things to note:1.QuoteThere is no amplification in this circuit.2. If you have any unused op amps you should read this thread:https://www.eevblog.com/forum/beginners/should-spare-op-amp-connections-be-left-floating-or-tied-to-ground/msg4180723/#msg41807233. The MC6004 datasheet has a section on designing a peak detector. In particular, the relatively low slew rate of the device (0.6V/us) has to be taken in consideration.MC6004 datasheet:https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP6001-1R-1U-2-4-1-MHz-Low-Power-Op-Amp-DS20001733L.pdfBy contrast, the MC6024 has a slew rate of 7V/us.MC6024 datasheet:https://ww1.microchip.com/downloads/en/DeviceDoc/20001685E.pdf4. The MC6024 datasheet says the op-amp is "unity gain stable" but that doesn't appear on the MC6004 datasheet. In any case, read the section in both datasheets on "Capacitive Loads".

author: Infraviolet
author_rank: Super Contributor
timestamp: May 20, 2022, 09:09:34 am
content: 1. Ok, thanks for alerting me to that.2. I do have op amps in the same package floating, but that makes things a bit noisier to my understanding, it shouldn't prevent one op amp on the package from doing any outputting at all? And I was getting away with floating op amps when it was an MCP6024, so why wouldn't the 6004 like this?3.For a 100KHz wave of about 1V maximum amplitude I should be within the 0.6V/uS slew rate, and surely if I wasn't then I'd just have a bit slower a response to changes in signal amplitude, not a constant fixed output?4.Wouldn't a lack of unity gain stabilty just put some slight oscillations on to the output dc waveform, and some ugly transients as it changes when the amplitude of the input wave rises or falls? I did spot the section on capacitive loads, but placing an appropriate resistor between the op amp's output and the diode's input didn't help at all, the MCP6024 still works when I do this, but the 6004 doesn't.Thanks

author: Infraviolet
author_rank: Super Contributor
timestamp: May 20, 2022, 09:25:52 pm
content: I'm really at a loss to explain why this simple circuit won't work with a different op amp used, but I've also noticed, which might be relevant, that the 6004 also doesn't work too well on another separate op amp task either, when used elsewhere (and as a separate chip, not a shared one in the same package) to provide an extremely strong bandpass amplification. The amplification in question turns out to be several times less than when using a 6024 is the same role.So it is looking like I need to pick a different op amp, the 6024 is perfect but it isn't available in the form factor I need for the final design that this breadboarding work is in aid of. Is there anything I can get in SOIC which has not got lead times of several months and worse, with the same pin arrangement as the MCP6024 but which would work a lot more like it than the 6004 does?

author: Infraviolet
author_rank: Super Contributor
timestamp: May 21, 2022, 01:01:36 pm
content: Would the MCP6294 be cross compatible with my use case of a 6024? The main difference I spot is the 6294 is marketed as "general purpose" where the 6024 which works is caleld "precision". Those are avalable, however minimum purchase quantity is 10 and at present chip crisis prices plus shipping that comes to spending rather a lot on something for which I wouldn't know whether or not it would work. Especially problematic as I'd have to buy twice if they did work, one lot of more DIP chips than I needed to prototype with and then another lot of more SOIC chips than I'm needing if they did work so I could then use them on the PCB I'm designing (which has to go in a pretty tight space).

author: CMTan
author_rank: Contributor
timestamp: May 23, 2022, 06:35:50 am
content: I think you have stepped into typical problem of this type of peak detector.In the positive half cycle the OP amp works as expected, but in the negative half cycle, the OP amp actually goes into negative saturation making the diode reverse biased. This negative saturation is problem if you do not select the right op amp. Typically, when a OP amp goes into saturation (negative or positive), it takes a much much longer time for the OP amp to recover back to normal operation. Some OP amp just does not recover.If you try to reduce the frequency to say 10Khz, you might get the peak detector working with MCP6004. Unfortunately, this is not always mentioned in the OP specification. Try to use a another peak detector design. This is one of the problem with this simple peak detector. Typically for these type of design, you need a high speed OP (a few order faster than the highest freq) to get this to work, so that the recovery time is still within the response time of you max operating frequency.If you look at the bandwidth for MCP6024, it is 10Mhz, but for MCP6002, its only 1Mhz. You might think that 1Mhz should be able to handle 100Khz signal, but no, the recovery is much longer than the response time of the system. When that happen, the the capacitor is charged but never discharge resulting in you observed when the IC is changed.

author: magic
author_rank: Super Contributor
timestamp: May 23, 2022, 08:30:32 am
content: This is a good observation.Another problem is slew rate. On negative half-cycles, the output slews towards ground. If it manages to get all the way to ground, a positive half-cycle lasts only 5µs and the output can only slew up to 3V before another negative half-cycle begins.Testing at 10kHz is a good idea. You would need a scope to really see what's going on at 100kHz.

author: Zero999
author_rank: Super Contributor
timestamp: May 23, 2022, 08:46:10 am
content: Add another op-amp.

author: Infraviolet
author_rank: Super Contributor
timestamp: May 23, 2022, 08:59:19 am
content: CMTan, thank you, very helpful.Is this sort of recovery time typically publicised in datasheets, or is this one of those hihgly variable properties which manufacturers try to avoid making any promises about.magic, thank you, the input wave never has quite such an amplitude so as to go all the way to ground. I have been using a scope to observe what is going on, but couldn't make much sense of what I was seeing before given today's advice. I can test the principle at 10KHz, but will have to find an op amp with speed comparable to the mcp6024 for the final design, it does have to be at close to 100KHz.Zero999, any alternative designs which still feature just one op amp? I'm very constrained for board space (mdimensions of where the finished thing must go in to) and am using quad op amp packages, I have enough room for everything involved in the whole circuit if I dedicate one op amp in a package to this process, but daren't add extra op amp packages of any sort. I'm breadboarding now, but it is all in aid of having a design to go on a very small PCB later.

author: RoGeorge
author_rank: Super Contributor
timestamp: May 23, 2022, 09:04:13 am
content: See if any of these helps:

author: Zero999
author_rank: Super Contributor
timestamp: May 23, 2022, 10:39:00 am
content: Quote from: Infraviolet on May 23, 2022, 08:59:19 amTry this, but don't expect great performance at 100kHz.

author: CMTan
author_rank: Contributor
timestamp: May 23, 2022, 04:56:15 pm
content: Quote from: Infraviolet on May 23, 2022, 08:59:19 amUnfortunately, I have not seen it in OP specification on the time taken to get out of saturation. However, there is one indication for MCP6004 that it should work at lower frequency. Refer to datasheet at Fig 2.21. It says "show no phase reversal", so the OP amp should not lock up or misbehave under saturated condition, it just take more time to get back to normal. Some OP will indicate that phase reversal can happen, and I am not sure if every manufacturer mention it even if they know it.