You are indeed the best teacher of electronics on RUclips, to the point and no time wasted at all. Pleasure to go over your videos over and over again :-)
At first I wasn't sure if this was going to be a video worth watching because of my initial reaction to the filming. However, it quickly became apparent that it was top notch. Thanks for the video!
This is the second time I have watched this video. I plan on using it as a reference. I have studied Forrest Mims' Engineer's Mini-Notebook on Op-Amp IC circuits but this is more helpful. Thank you!
I'd kiss you if could, man. THANK YOU VERY MUCH!!! This really helped me out, I'm working in a EMG-controlled robotic leg and I needed my signal to go over a threshold but, given that EMG is not a steady signal, like AM waves, my microcontroller just couldnt detect the uprising. Thank you so much, you just won a suscriber.
Excellent, as always - I was waiting for you to stick a probe on the output of the opamp, though - would have been interesting to see what it was doing.
Now that we learned about a "voltage follower op amp circuit" in some earlier video PLUS how to build a "better peak detector with op amps" we can combine those two circuits to have a "high input impedance" peak detector driving some load like some analog amp meter/volt meter without "loading or draining" the peak detectors "sample charge" and build ourselfs some sort of VU Meter/peak level meter.
i would say that depends on the op amp you chose for your application. there are many different types. youll have to read the datasheet on "bandwidth" and such and may do some experiments if your type of op amp suits your needs or not. HOPEFULLY w2aew will do some more op amp videos covering that topic too :-P !!
yes i know. the peal detector got it. but if i would now connect a uA or mA meter directly to its output i would asume it would "drain" the sampling cap more/quicker than someone would like to. so another additional "voltage follower" could buffer the output of the peak detector to drive a needle or something like that without "draining" the sampling cap. that was the idea i mentioned :)
Great Video. In the early part of the video, you show the cap discharging through the resistor (to the left). Wouldn't it discharge to the right - to the output where it would hold up the peak and be seen on the scope? After all, if it discharges to ground, nothing happens at the output.
Great video! One more thing; when you said 'peak detector', and if I want to measure single pulse, then it is not possible to do it with bleeding resistor. My proposal is to use some kind of switch or push-button or NPN transistor (collector to cathode of the diode/capacitor, and emitter to the ground - instead bleeding resistor. To the base of the transistor, short positive current to 'reset' the circuit for next measurement. What will do this circuit now is wait for positive pulse to arrive. Then it will charge capacitor to the voltage proportional to the input peak voltage, and will STAY there until switch is closed - capacitor quickly 'null' or discharged. For longer period, it will be good to use good capacitor with low self discharge rate. And, another opamp with high impedance and unity gain to provide buffer between capacitor and measuring instrument (load), which may discharge capacitor if load has low resistance. What this switch/button, or transistor does is 'reset' function after measuring voltage in next sequence order: sample peak and hold, measure, then reset after measurement (or by additional circuit, or manually by push-button). One of many examples of use of such peak and hold circuit is to measure sound level for sporadic sound occurrence (e.g. thunder, loud bang, etc.), or for many other uses where pulse last very short time. So, this will be actually upgrade from peak detector to peak and hold detector. Does this make sense to you? Cheers, milan
What you've described makes perfect sense. You'll have to be sure to use a low leakage capacitor, and an op amp buffer with very low input bias current to hold the peak voltage on the capacitor for an extended period of time. The reset circuit should work fine. I used a bleeder resistor purposely to show the peak follow and discharge characteristics more clearly.
***** Hi. I'm having a little trouble with a circuit just like the one described by Milan Karakas, I'm trying to detect and hold peaks from single pulses and buffer them to an ADC, the pulse amplitude is very short (62.5 ns to 125 ns) and TTL +5V level. This is basically a Time to Amplitude Converter, so it's important that the pulse duration and the voltage level at the output of the buffer always be proportional. I'm using TL081 Op Amp, a 1N4148 and 470 pF Mica capacitor as followed by another Op Amp as a Buffer, but the output is always null (offset voltage or 0). So can you please give me some hints on How can this circuit be improved for short single pulses?
nature numbers TL081 has only 4 MHz bandwith, so such short pulses as 62.5 nS to 125 nS are higher than 8 MHz. I don't know what you trying to build (FM detector?), but isn't more convenient to measure time directly? Fast divider(s), use 100 MHz oscillator (really cheap on eBay, cca. $1 US, $5 US - lot of 5), feed it to the divider over the gatting circuit. Gate it with your 62.5 to 125 nS pulses. Then read status after dividers (counter) stop counting (don't forget reset dividers/counter after reading is done). After you get number which should be proportional to the time of counting, then you can do whatsoever you want with this number (with MCU). I think this is more convenient than ADC sampling, which may be pretty slow, depending of ADC chip you use. Some MCUs has pretty fast internal conters, up to 60 MHz or so, then you use 50 MHz oscillator instead. Can you tell me what you are about to build? Maybe there is another trick(s). Regards, milan --- EDIT: Bandwith of the opamp usually means that amplification (gain) goes to unity (x1) at mentioned frequency of 4 MHz for TL081. Then, it is too slow to forward your pulses to the capacitor in peak and hold circuit. Since your pulses are always +5V, but with different duration, you can use diode-R/C circuit directly as peak and hold circuit, and with addition of transistor for discharging capacitor after ADC done conversation, you can do what you want. Note that RC circuit is not linear, but you have relative narrow choice of pulses (1/2 to 1 ratio), not 0 to 1 ratio. So, that part may be relative linear. Still, if you want to know duration of the pulses, method of direct time measurement is the best and linear.
***** Hi. Thank you for your time, sorry for not being more specific.. didn't want to extend too much the comment. I'm doing something call Time to Digital Converter, I'm using a pulse counter running at 16 MHz for the coarse acquisition, and a Time to Amplitude (or Time to Analog) converter as interpolation circuit for the fine acquisition, this I hope will give me 1 nS resolution, this is equivalent to a 1 GHz counter, with the obvious differences in error probability and type of measuring error and drifts. This interpolation circuit is pretty simple, a constant current source charges the capacitor during the pulse time, this solves the nonlinearity of the capacitor charging, so the time can be calculated from the voltage level of the capacitor. The problem comes when you tray to mantain that voltage level (lets say a 1 to 5 V span) stable for about 2 uS so that the ADC can do the job. Like you said the problem is the bandwith of the Op Amp, because of the rise time I guess, but besides that, is there any other consideration to take care in this circuits? I mean in order to improve it to the nS pulse region.
Excellent explanation how a peak detector works. It would have been nice to get values of C and R. We know, R shouldn't be too high because of noise, disturbance issues, but what would be a good value for this R?
The capacitor and resistor are generally chosen based on the application. There are no hard and fast rules. The capacitor should be large enough to store the charge (and not be bled off by the load too quickly), but not so large so as to require a very large charging current through the diode. For low frequency/audio applications, a few 10s of uF or more are typical. The parallel "bleeder" resistor may not even be needed, especially if the circuit that follows the peak detector draws off the charge to create the required droop requirements. If you need a faster droop or discharge, then the parallel R can be added for that.
Im trying to figure out if this is used with audio amplifiers, if so how would this work. I would want a circuit only to detect when the audio signal clips and indicates by lighting one led.
You could take the output from the peak detector into a comparator circuit, whose switching threshold is set just below the clipping level, and have that drive an LED. That'll give you indication when you are near & beyond clipping...
Always enjoy and appreciate your videos. Can or would you do some demonstrations regarding valves/tubes? I've also always been interested in building a solid state circuit that mimics harmonic distorting.
Great Video,Thanks !!! I wanted to make an Op Amp based peak detector at 20MHz, will this work?? please let me know what are the things I must consider at such frequencies.
I've always heard that a cap at the ouput of an op-amp will cause stability problems. Is it okay here because of the diode? Or will there be stability problems at certain input frequencies?
Hi Alan - even the old videos are still inspiring - I learns something every time. Can you provide actual representative value for the R and C? I know it is the RC time constant, but have trouble understanding how to get to the flat line DC output for the peak detector. -73 Dean KK4DAS
The thing to think about is *what* is going to discharge the capacitor during it's "hold" time between peaks. What is going to draw current from the capacitor during this time? Increasing the capacitor value and/or decreasing the loading (current draw) will result in less droop, getting closer to the "flat line".
Hey Alan, i didnt get the part when you mentioned what would happen if we pick a resistor thats too large. My best guess would be the capacitor discharges more slowly over the resistor and this flattens our output even more. But you said the opposite, why ?
+dogus ural I don't think I said the opposite. In the case of the "bleeder" resistor in parallel with the peak detector cap, the larger the value, the longer the discharge time of the cap. My "caution" is to be careful when choosing the bleeder value to ensure that the peak detector can properly track the peak of your signal of interest. The idea is make sure the discharge time isn't too short (lot of droop between signal peak), and not too long (holding a peak much longer than necessary, thus missing slow variations of the peak signal changes).
Is it possible to detect peak without using diode.as diode will drop some of the voltage across it.if the voltage is in micro or nano Volt then how it can be ready without using diode..
With the diode in the feedback path of the op amp, you eliminate the diode voltage drop. However, measuring the peak of very small signals such as these, you would likely want to amplify the signal first, then peak detect and scale the output.
Hello, thanks for the explanation! I want to make sure if the type of the amplifier affects the performance of the circuit. I tried the Lm741 and the MCP6273 but peak detection didn't work. Any suggestions? Thank you in advance.
You have to be mindful of the power supply requirements, and the permissable input and output voltage ranges of the op amp that you use. The ancient LM741 is VERY different than the MCP6273. The LM741 is designed for larger power supplies, and usually split supply operation (like +/-15V) and the inputs and outputs can't get any closer than a few volts from either supply rail. On the other hand, the MCP6273 is a low voltage op amp with a MAXIMUM supply voltage of 6V and it's inputs/outputs can go to the rails. Very different! If you don't respect the supply and in/out voltage requirements of the particular op amp you're using, it won't work.
@@w2aew I also have a concern regarding the basic peak detector circuit (diode, resistor). I am using the 1N4004 diode with a 1K ohm resistor. The voltage drop of the diode must appear consistently when I increase or decrease the Amplitude of the input signal. In my case when I increase the input from 0.7 till max i.e 5 or 4 the potenti difference between the input and the output is increasing.
@@w2aew Okay thank you for the note, I didn't pay much attention to this detail since in my application I need the +/-5 V for other purposes. But now another error I am facing is with the peak detector circuit (simple diode and resistor) I mentioned before. If you can help me understand the problem I will be more than thankful!
@@milanakassab5725 This is basically normal, since the diode has an internal series resistance once it is turned on, so that will create a bit of a voltage divider with your 1k load resistor.
Thanks ! that was very helpful, except how to choose the values of the resistors and the capacitor and what opamp family are you using? desired frequency is 500 Hz
Hana Sharaf I used an AD8032, but just about any op amp that meets your power supply voltage requirements, and input/output voltage range will work fine. Choose the capacitor and resistor as needed to achieve your required "hold" or bleed-down time.
Well I tried the circuit in the vid, it shows me the peak and the discharge level only _on the oscilloscope- without any amplitude. In other words it just outputs the difference
Hana Sharaf Without any details on the signal you're trying to measure (peak-peak voltage, output impedance, DC offset, waveform shape, etc., it is impossible to say what might be happening.
Sure, they can oscillate if there is too much phase shift in the feedback path. Worst case is when set for low/unity gain. There are some op amps that are not unity gain stable. However, most modern op amps are compensated to be unity gain stable.
I have tried part of the circuit in the beginning of the video with a really odd result at low signal voltage. I have a 1khz 0.5v square wave going directly into an IN4001 diode with a 470k resitor to ground on the output. On my oscilloscope there is a NEGATIVE 50millivolt spike, below ground. Is the diode causing a negative charge pump voltage somehow?
Could be that you're storing charge in the diode's junction capacitance which then pushes the cathode below ground momentarily when the squarewave goes low (until the stored charge is dissipated).
Alan, love your videos. Best education on RUclips! I was going to build something like this up for a project in the 100-500kHz range (frequency not critical, could go on the low end). What diode would you recommend for this frequency? I always have trouble trying to spec diodes (might be a good video). Also, do you think an LM324 is up to the task? Thanks so much.
+PelDaddy I'd go with a common switching diode like the 1N914A or 1N4148. The LM324 might be a little slow for the upper end of your frequency range, but give it a go...
***** Thanks. My circuit worked very well. It ended up at only 10kHz, and the LM324 seems to be holding up as well. Always look forward to your videos, especially when they involve vintage Tek scopes (which I use too). Thanks again.
Question. Working on designing my first 78.5 mhz AM receiver. Need a diode detector, but the output from my emitter follower should be 10 ohm... I have a second diode to pull the level up to just below forward bias, so the signal can take it over. My cap i selected to be 10 ohm at 78.5mhz , about 202pF. and 500k bleed resistor for the desired time constant... My signal level is very very low... This is counter intuitive cause a bigger cap would short thr signal to ground even more and kill it? My question is, how critical is ompedance matching st this stage... I.e what are design criteria? Also... My 10 ohm would be reactive... Should i take steps to make it look resistive? Please im trying really hard to learn this stuff but i can only get so far on my own qnd would be great if i could discuss this with someone
Impedance matching is not critical in an AM detector stage. However, a diode detector at 78MHz isn't going to be very efficient because of the junction capacitance of the diode. Be sure to use a low-capacitance type diode, such as a schottky diode.
Great video and good review of an old simple circuit. I am constantly amazed at the quality of yours and other educational videos on youtube. Good for the young guys learning and those of us who have been in the field to review and learn. It's like being back in college without the travel, expense and exams. LOL Again, thanks for your efforts! 73 Glenn WA4AOS
You do for some opamps. The nature of the circuit drives a differential voltage between the opamp's two inputs that is as much as the peak-to-peak voltage of the input signal. Some opamps will then draw current through their inputs far greater than the bias current seen when in linear mode. That current must be limited to prevent damage, so a resistor is a sensible precaution in those cases. An LM358 will allow differential input voltages up to the value of the supply rails, so doesn't need the current limit resistor. However, the (expensive) AD8032 being used in the video can be operated with ±5V supplies, but has an absolute maximum differential input voltage of ±3.4V, so needs the resistor in case large signals are applied. Some opamps have internally fabricated diodes across the inputs which limit the differential input to ±0.6V, but will pass excessive current unless a current limiting resistor is used. The AD8032 datasheet recommends such input clamp diodes be added externally if the ±3.4V maximum differential voltage might be exceeded.
what should be the value of resistor and capacitor? Ive used another opamp as a high resistoance and 1 micofarad capacitor, which is giving me a 20% error
The values are highly dependent upon the application and what you're trying to achieve in terms of voltage range, frequency range, etc., so it's not possible to give you exact values.
When the input falls below its peak, the voltage on the inverting input remains clamped to the peak voltage which is held on the capacitor, so the voltage differential between the two inputs will increase as the input voltage falls. We think of that as a comparator mode, and although some opamps are happy with large differential inputs, others are not. In certain opamps, the manufacturers fabricate two diodes across the input terminals in opposite directions, so that the voltage differential across the inputs is limited to 0.6V either way. In that case, there must be a current limiting resistor to prevent excessive current flowing through one of those diodes when the opamp is driven into comparator mode.
i powered the opamp with a 9V battery so in singly supply operating mode. It worked only when the sine wave of the function generator was set in the positive range. I'm not 100% sure why
Because for the op amp to operate properly, the voltages at the inputs have to comply with the input voltage range limits, which rarely included operation outside of the power supply rails. See my video on this topic.
One important aspect of this circuit for high frequencies is that it forces the input of the opamp into saturation (because on the negative cycle the positive input can no longer follow the negative one). Opamps become far far slower than their rated bandwidth when you do that.
hello how are you, excellent explanation, I want to consult you for a detection circuit from peak to peak but it is to measure the power delivered by an ignition coil, from now thank you
Thanks a lot to showing the basing understanding of opr amp but only thinks is pls next time can you go slow down not too slow but just little bit to get the better understanding or result
is that mdo of your's ever going to drop in price on the second hand market? haha. i have a tds2002c and i use it more than my rigol mso5354. i'm buying an ex navy friend a cheap scope for xmas and if he likes it i'm gonna give him the tds. we met at a first responder/military ptsd clinic earlier this year. i'm dropping him off a ton of electronics gear to get his bench started today. 5 hour drive but i'm going up anyway for an appointment. he told me all they used in the canadian navy was tek gear exclusively for everything that measured a wave or frequency. he never took the time to understand any of it, his father was an electronic engineer and just passed and left him a life's worth of fluke equipment. no scopes though. he had great taste in tools though. he didnt understand the worth of what was left to him, he and i are going to get a ham licence in nova scotia. i am holding off buying a radio until i get my cert but i've been gathering parts and taking notes to build my own ham radio. i studied for it last year but i went from software engineering into 911/police/fire dispatch after i graduated and never had the stomach for it for the longest time. worst part about living in a rural area are no swap meets. i know one ham in my area. if my wife get's a promotion and we move for a few years i'm going to get an ee degree. i have almost 2 years worth of math credits i can carry over from my other degree. the nearest ee university is dalhousie, may never use it professionally but it's a cool bucket list item i think. your videos are timeless. keep up the great work. i have a tekdmm 915 if you dont have one (i know you work for them but they're getting rare). i'd gladly send you it as a way of thanking you. i cant afford a new tek scope, so i keep on the look out for a 500mhz/1ghz mdo. i am going to look at a modular tektronics 3 bay mainframe from 1969 next week. has a free bay and 2 channel scope and curve tracer module 800cad seems like a good price, the fella is a retired engineer and has 2 of them he said it weighs like 40kg haha. i forget the model offhand. i've wanted a proper curve tracer for the longest time. i'd go look at the tracer today on the way up but i'm buying a new guitar at a pawn shop, handmade in quebec. well second hand one.
You are indeed the best teacher of electronics on RUclips, to the point and no time wasted at all. Pleasure to go over your videos over and over again :-)
I wish I'd met you 30 years ago, Alan. Thanks for another great tutorial.
Great as always. Extremely helpful in helping me find out what mistake i was making with my own op amp implementation of this.
Your explanation is so clear. Amazing video!
" አመሰግናለው"...that is thank you in Amharic...it is very clear and helpful tnx sir
A lesson is soo much better if you’re showing a practical example on the CRO at the same time. Thankyou!
At first I wasn't sure if this was going to be a video worth watching because of my initial reaction to the filming. However, it quickly became apparent that it was top notch. Thanks for the video!
Awesome as always Alan. Thank You!
binge watching all the circuit tutorials, trying to remember to like and comment on each as well
I have watch this video more than once, not because I didn't understand, its because this dude explains better than my professor does. Thumps up!!
Great video 9Min19sec and all clear. Not like others who need 35 minuts to explain that subject.
This is the second time I have watched this video. I plan on using it as a reference. I have studied Forrest Mims' Engineer's Mini-Notebook on Op-Amp IC circuits but this is more helpful. Thank you!
Great video! I enjoy watching your videos. Better than most teachers! Keep up good work!
I'd kiss you if could, man. THANK YOU VERY MUCH!!! This really helped me out, I'm working in a EMG-controlled robotic leg and I needed my signal to go over a threshold but, given that EMG is not a steady signal, like AM waves, my microcontroller just couldnt detect the uprising. Thank you so much, you just won a suscriber.
Sergio Andres Pineda Castillo I'm glad to hear that this video helped you with your project!
Good Stuff Alan! I really appreciate you taking the time to put these demos together, thanks.
Very clean explanation, I am glad I discovered your channel!
Excellent video!
Excellent, as always - I was waiting for you to stick a probe on the output of the opamp, though - would have been interesting to see what it was doing.
Very useful tutorial. I am currently having trouble getting one of these circuits to work, and I have no idea why.
Very nice demonstration. Thank-you.
Great explanation and examples!
Very nicely done. Thanks for posting this.
Thanks a lot. Keep more coming like these.
Happy new year fella all the best to you and yours for 2020 Steve
Now that we learned about a "voltage follower op amp circuit" in some earlier video PLUS how to build a "better peak detector with op amps" we can combine those two circuits to have a "high input impedance" peak detector driving some load like some analog amp meter/volt meter without "loading or draining" the peak detectors "sample charge" and build ourselfs some sort of VU Meter/peak level meter.
i would say that depends on the op amp you chose for your application. there are many different types. youll have to read the datasheet on "bandwidth" and such and may do some experiments if your type of op amp suits your needs or not. HOPEFULLY w2aew will do some more op amp videos covering that topic too :-P !!
You sir are a fantastic teacher
yes i know. the peal detector got it. but if i would now connect a uA or mA meter directly to its output i would asume it would "drain" the sampling cap more/quicker than someone would like to. so another additional "voltage follower" could buffer the output of the peak detector to drive a needle or something like that without "draining" the sampling cap. that was the idea i mentioned :)
Great Video. In the early part of the video, you show the cap discharging through the resistor (to the left). Wouldn't it discharge to the right - to the output where it would hold up the peak and be seen on the scope? After all, if it discharges to ground, nothing happens at the output.
Great video! One more thing; when you said 'peak detector', and if I want to measure single pulse, then it is not possible to do it with bleeding resistor. My proposal is to use some kind of switch or push-button or NPN transistor (collector to cathode of the diode/capacitor, and emitter to the ground - instead bleeding resistor. To the base of the transistor, short positive current to 'reset' the circuit for next measurement.
What will do this circuit now is wait for positive pulse to arrive. Then it will charge capacitor to the voltage proportional to the input peak voltage, and will STAY there until switch is closed - capacitor quickly 'null' or discharged. For longer period, it will be good to use good capacitor with low self discharge rate. And, another opamp with high impedance and unity gain to provide buffer between capacitor and measuring instrument (load), which may discharge capacitor if load has low resistance.
What this switch/button, or transistor does is 'reset' function after measuring voltage in next sequence order: sample peak and hold, measure, then reset after measurement (or by additional circuit, or manually by push-button).
One of many examples of use of such peak and hold circuit is to measure sound level for sporadic sound occurrence (e.g. thunder, loud bang, etc.), or for many other uses where pulse last very short time.
So, this will be actually upgrade from peak detector to peak and hold detector.
Does this make sense to you?
Cheers,
milan
What you've described makes perfect sense. You'll have to be sure to use a low leakage capacitor, and an op amp buffer with very low input bias current to hold the peak voltage on the capacitor for an extended period of time. The reset circuit should work fine. I used a bleeder resistor purposely to show the peak follow and discharge characteristics more clearly.
***** Thanks. Very useful information.
*****
Hi. I'm having a little trouble with a circuit just like the one described by Milan Karakas, I'm trying to detect and hold peaks from single pulses and buffer them to an ADC, the pulse amplitude is very short (62.5 ns to 125 ns) and TTL +5V level. This is basically a Time to Amplitude Converter, so it's important that the pulse duration and the voltage level at the output of the buffer always be proportional.
I'm using TL081 Op Amp, a 1N4148 and 470 pF Mica capacitor as followed by another Op Amp as a Buffer, but the output is always null (offset voltage or 0).
So can you please give me some hints on How can this circuit be improved for short single pulses?
nature numbers
TL081 has only 4 MHz bandwith, so such short pulses as 62.5 nS to 125 nS are higher than 8 MHz. I don't know what you trying to build (FM detector?), but isn't more convenient to measure time directly? Fast divider(s), use 100 MHz oscillator (really cheap on eBay, cca. $1 US, $5 US - lot of 5), feed it to the divider over the gatting circuit. Gate it with your 62.5 to 125 nS pulses. Then read status after dividers (counter) stop counting (don't forget reset dividers/counter after reading is done). After you get number which should be proportional to the time of counting, then you can do whatsoever you want with this number (with MCU). I think this is more convenient than ADC sampling, which may be pretty slow, depending of ADC chip you use. Some MCUs has pretty fast internal conters, up to 60 MHz or so, then you use 50 MHz oscillator instead.
Can you tell me what you are about to build? Maybe there is another trick(s).
Regards,
milan
---
EDIT: Bandwith of the opamp usually means that amplification (gain) goes to unity (x1) at mentioned frequency of 4 MHz for TL081. Then, it is too slow to forward your pulses to the capacitor in peak and hold circuit. Since your pulses are always +5V, but with different duration, you can use diode-R/C circuit directly as peak and hold circuit, and with addition of transistor for discharging capacitor after ADC done conversation, you can do what you want. Note that RC circuit is not linear, but you have relative narrow choice of pulses (1/2 to 1 ratio), not 0 to 1 ratio. So, that part may be relative linear. Still, if you want to know duration of the pulses, method of direct time measurement is the best and linear.
*****
Hi. Thank you for your time, sorry for not being more specific.. didn't want to extend too much the comment.
I'm doing something call Time to Digital Converter, I'm using a pulse counter running at 16 MHz for the coarse acquisition, and a Time to Amplitude (or Time to Analog) converter as interpolation circuit for the fine acquisition, this I hope will give me 1 nS resolution, this is equivalent to a 1 GHz counter, with the obvious differences in error probability and type of measuring error and drifts.
This interpolation circuit is pretty simple, a constant current source charges the capacitor during the pulse time, this solves the nonlinearity of the capacitor charging, so the time can be calculated from the voltage level of the capacitor. The problem comes when you tray to mantain that voltage level (lets say a 1 to 5 V span) stable for about 2 uS so that the ADC can do the job.
Like you said the problem is the bandwith of the Op Amp, because of the rise time I guess, but besides that, is there any other consideration to take care in this circuits? I mean in order to improve it to the nS pulse region.
Excellent explanation how a peak detector works. It would have been nice to get values of C and R. We know, R shouldn't be too high because of noise, disturbance issues, but what would be a good value for this R?
The capacitor and resistor are generally chosen based on the application. There are no hard and fast rules. The capacitor should be large enough to store the charge (and not be bled off by the load too quickly), but not so large so as to require a very large charging current through the diode. For low frequency/audio applications, a few 10s of uF or more are typical. The parallel "bleeder" resistor may not even be needed, especially if the circuit that follows the peak detector draws off the charge to create the required droop requirements. If you need a faster droop or discharge, then the parallel R can be added for that.
Fabulous. I see piezo shock sensor coming. Thank you.
Excellent presentation!
Im trying to figure out if this is used with audio amplifiers, if so how would this work. I would want a circuit only to detect when the audio signal clips and indicates by lighting one led.
You could take the output from the peak detector into a comparator circuit, whose switching threshold is set just below the clipping level, and have that drive an LED. That'll give you indication when you are near & beyond clipping...
Always enjoy and appreciate your videos. Can or would you do some demonstrations regarding valves/tubes? I've also always been interested in building a solid state circuit that mimics harmonic distorting.
Is there a possibility to fold the negative part of the wave upwards that you can use it aswell in peak detection?
Excellent, thank you! Could you please do a video on the inside of the opamp? How it actually works? Thanks
Awesome video. Thanks
Great Video,Thanks !!!
I wanted to make an Op Amp based peak detector at 20MHz, will this work?? please let me know what are the things I must consider at such frequencies.
Awesome video.Thanks for sharing!
I've always heard that a cap at the ouput of an op-amp will cause stability problems. Is it okay here because of the diode? Or will there be stability problems at certain input frequencies?
Great stuff and also agree MORE on OPAMPS :-) Keep them up!
What is the purpose of the resistor in series with the input?
PLEASE MORE ON OP AMPS! like artificial ground / dual powersupply from a single power supply (also usefull for op amp experimenting i guess)...
Awesome I will implement this into a digital VU meter to make it slow down the response, thanks
Hi Alan - even the old videos are still inspiring - I learns something every time. Can you provide actual representative value for the R and C? I know it is the RC time constant, but have trouble understanding how to get to the flat line DC output for the peak detector. -73 Dean KK4DAS
The thing to think about is *what* is going to discharge the capacitor during it's "hold" time between peaks. What is going to draw current from the capacitor during this time? Increasing the capacitor value and/or decreasing the loading (current draw) will result in less droop, getting closer to the "flat line".
As always thank you very much
I gave you thumbs up! Thanks David Lee
Hey Alan, i didnt get the part when you mentioned what would happen if we pick a resistor thats too large. My best guess would be the capacitor discharges more slowly over the resistor and this flattens our output even more. But you said the opposite, why ?
+dogus ural I don't think I said the opposite. In the case of the "bleeder" resistor in parallel with the peak detector cap, the larger the value, the longer the discharge time of the cap. My "caution" is to be careful when choosing the bleeder value to ensure that the peak detector can properly track the peak of your signal of interest. The idea is make sure the discharge time isn't too short (lot of droop between signal peak), and not too long (holding a peak much longer than necessary, thus missing slow variations of the peak signal changes).
Can you show what output signal looks like for higher frequencies? Can op amp fallow fast input changes?
AWESOME! AWESOME! AWESOME! AWESOME! AWESOME!
THANKS OM! 73!
A great lesson as with all your others! Thank you!
Brilliant as always....
Nice video very informative, Are you using 741 Op amp? also what example RC values would you use for a sharp peak detector, including Input resistor?
Great explanation! Congrats!
As soon as diode is reverse biased, feedback loop is open and the input voltages do not have to match, since it is open loop, am I correct?
yes
@@w2aew thank you
Gotta ask. Do you really love ham radio or is it just a good excuse to use all that really cool test equipment?
;-)
I would be grateful if you could make a video about a voltage controlled amplifier.
Is it possible to detect peak without using diode.as diode will drop some of the voltage across it.if the voltage is in micro or nano Volt then how it can be ready without using diode..
With the diode in the feedback path of the op amp, you eliminate the diode voltage drop. However, measuring the peak of very small signals such as these, you would likely want to amplify the signal first, then peak detect and scale the output.
Good Vid Allen
Hello, thanks for the explanation! I want to make sure if the type of the amplifier affects the performance of the circuit. I tried the Lm741 and the MCP6273 but peak detection didn't work. Any suggestions? Thank you in advance.
You have to be mindful of the power supply requirements, and the permissable input and output voltage ranges of the op amp that you use. The ancient LM741 is VERY different than the MCP6273. The LM741 is designed for larger power supplies, and usually split supply operation (like +/-15V) and the inputs and outputs can't get any closer than a few volts from either supply rail. On the other hand, the MCP6273 is a low voltage op amp with a MAXIMUM supply voltage of 6V and it's inputs/outputs can go to the rails. Very different! If you don't respect the supply and in/out voltage requirements of the particular op amp you're using, it won't work.
@@w2aew Thank you for the quick reply, yes I am using the MCP6273 with 5/-5 Voltage supply. It must work right ?
@@w2aew I also have a concern regarding the basic peak detector circuit (diode, resistor). I am using the 1N4004 diode with a 1K ohm resistor. The voltage drop of the diode must appear consistently when I increase or decrease the Amplitude of the input signal. In my case when I increase the input from 0.7 till max i.e 5 or 4 the potenti difference between the input and the output is increasing.
@@w2aew Okay thank you for the note, I didn't pay much attention to this detail since in my application I need the +/-5 V for other purposes. But now another error I am facing is with the peak detector circuit (simple diode and resistor) I mentioned before. If you can help me understand the problem I will be more than thankful!
@@milanakassab5725 This is basically normal, since the diode has an internal series resistance once it is turned on, so that will create a bit of a voltage divider with your 1k load resistor.
Good video! What frequency does is this method limited to?
The choice of amplifier and diodes used will ultimately determine the frequency response.
We done, thank you.
Thanks ! that was very helpful, except how to choose the values of the resistors and the capacitor and what opamp family are you using? desired frequency is 500 Hz
Hana Sharaf I used an AD8032, but just about any op amp that meets your power supply voltage requirements, and input/output voltage range will work fine. Choose the capacitor and resistor as needed to achieve your required "hold" or bleed-down time.
***** thanks for your reply! I'll try it out to envelope my EMG signal..
Well I tried the circuit in the vid, it shows me the peak and the discharge level only _on the oscilloscope- without any amplitude. In other words it just outputs the difference
Hana Sharaf Without any details on the signal you're trying to measure (peak-peak voltage, output impedance, DC offset, waveform shape, etc., it is impossible to say what might be happening.
***** found out that I didnt choose DC coupling option in the oscilloscope. It worked thanks!
why does having to much THD% in a peak detector will cause problems or what in the peak detector causes THD%?
Since an opamp is a feedback device, are there ever problems with induced oscillations with opamps? or are they just magical devices
Sure, they can oscillate if there is too much phase shift in the feedback path. Worst case is when set for low/unity gain. There are some op amps that are not unity gain stable. However, most modern op amps are compensated to be unity gain stable.
I have tried part of the circuit in the beginning of the video with a really odd result at low signal voltage.
I have a 1khz 0.5v square wave going directly into an IN4001 diode with a 470k resitor to ground on the output. On my oscilloscope there is a NEGATIVE 50millivolt spike, below ground. Is the diode causing a negative charge pump voltage somehow?
Could be that you're storing charge in the diode's junction capacitance which then pushes the cathode below ground momentarily when the squarewave goes low (until the stored charge is dissipated).
Alan, love your videos. Best education on RUclips! I was going to build something like this up for a project in the 100-500kHz range (frequency not critical, could go on the low end). What diode would you recommend for this frequency? I always have trouble trying to spec diodes (might be a good video). Also, do you think an LM324 is up to the task? Thanks so much.
+PelDaddy I'd go with a common switching diode like the 1N914A or 1N4148. The LM324 might be a little slow for the upper end of your frequency range, but give it a go...
***** Thanks. My circuit worked very well. It ended up at only 10kHz, and the LM324 seems to be holding up as well. Always look forward to your videos, especially when they involve vintage Tek scopes (which I use too). Thanks again.
Question. Working on designing my first 78.5 mhz AM receiver. Need a diode detector, but the output from my emitter follower should be 10 ohm... I have a second diode to pull the level up to just below forward bias, so the signal can take it over. My cap i selected to be 10 ohm at 78.5mhz , about 202pF. and 500k bleed resistor for the desired time constant... My signal level is very very low... This is counter intuitive cause a bigger cap would short thr signal to ground even more and kill it? My question is, how critical is ompedance matching st this stage... I.e what are design criteria? Also... My 10 ohm would be reactive... Should i take steps to make it look resistive? Please im trying really hard to learn this stuff but i can only get so far on my own qnd would be great if i could discuss this with someone
Impedance matching is not critical in an AM detector stage. However, a diode detector at 78MHz isn't going to be very efficient because of the junction capacitance of the diode. Be sure to use a low-capacitance type diode, such as a schottky diode.
Great video and good review of an old simple circuit. I am constantly amazed at the quality of yours and other educational videos on youtube. Good for the young guys learning and those of us who have been in the field to review and learn. It's like being back in college without the travel, expense and exams. LOL
Again, thanks for your efforts!
73
Glenn WA4AOS
that is just awesome
very nice. But you don't need a resistor on the +input to the opamp.
You do for some opamps. The nature of the circuit drives a differential voltage between the opamp's two inputs that is as much as the peak-to-peak voltage of the input signal. Some opamps will then draw current through their inputs far greater than the bias current seen when in linear mode. That current must be limited to prevent damage, so a resistor is a sensible precaution in those cases. An LM358 will allow differential input voltages up to the value of the supply rails, so doesn't need the current limit resistor. However, the (expensive) AD8032 being used in the video can be operated with ±5V supplies, but has an absolute maximum differential input voltage of ±3.4V, so needs the resistor in case large signals are applied. Some opamps have internally fabricated diodes across the inputs which limit the differential input to ±0.6V, but will pass excessive current unless a current limiting resistor is used. The AD8032 datasheet recommends such input clamp diodes be added externally if the ±3.4V maximum differential voltage might be exceeded.
The best dude.
W2AEW = ELECTRONICS MASTER CHANEL . period
Pro tip: you can watch movies at flixzone. I've been using it for watching lots of of movies during the lockdown.
@Legend Jimmy Yea, been using flixzone} for since december myself :D
what should be the value of resistor and capacitor?
Ive used another opamp as a high resistoance and 1 micofarad capacitor, which is giving me a 20% error
The values are highly dependent upon the application and what you're trying to achieve in terms of voltage range, frequency range, etc., so it's not possible to give you exact values.
what's the purpose of the resistor on the input?
When the input falls below its peak, the voltage on the inverting input remains clamped to the peak voltage which is held on the capacitor, so the voltage differential between the two inputs will increase as the input voltage falls. We think of that as a comparator mode, and although some opamps are happy with large differential inputs, others are not. In certain opamps, the manufacturers fabricate two diodes across the input terminals in opposite directions, so that the voltage differential across the inputs is limited to 0.6V either way. In that case, there must be a current limiting resistor to prevent excessive current flowing through one of those diodes when the opamp is driven into comparator mode.
i powered the opamp with a 9V battery so in singly supply operating mode. It worked only when the sine wave of the function generator was set in the positive range. I'm not 100% sure why
Because for the op amp to operate properly, the voltages at the inputs have to comply with the input voltage range limits, which rarely included operation outside of the power supply rails. See my video on this topic.
***** oh, this explains why, thank you, you're very kind. i'll check that video on the power supply rails.
One important aspect of this circuit for high frequencies is that it forces the input of the opamp into saturation (because on the negative cycle the positive input can no longer follow the negative one).
Opamps become far far slower than their rated bandwidth when you do that.
Very cool.
good explanation !!
hello how are you, excellent explanation, I want to consult you for a detection circuit from peak to peak but it is to measure the power delivered by an ignition coil, from now thank you
thx from China
Thanks a lot to showing the basing understanding of opr amp but only thinks is pls next time can you go slow down not too slow but just little bit to get the better understanding or result
Hi I follow all your videos. I need a schematic diagram to trigger a handmade oscilloscope .
Will you help me please ?
TNX. Before 😊
Thumbs up from me, that's for sure.
very helpful indeed. More please!
is that mdo of your's ever going to drop in price on the second hand market? haha. i have a tds2002c and i use it more than my rigol mso5354. i'm buying an ex navy friend a cheap scope for xmas and if he likes it i'm gonna give him the tds. we met at a first responder/military ptsd clinic earlier this year. i'm dropping him off a ton of electronics gear to get his bench started today. 5 hour drive but i'm going up anyway for an appointment. he told me all they used in the canadian navy was tek gear exclusively for everything that measured a wave or frequency. he never took the time to understand any of it, his father was an electronic engineer and just passed and left him a life's worth of fluke equipment. no scopes though. he had great taste in tools though. he didnt understand the worth of what was left to him, he and i are going to get a ham licence in nova scotia. i am holding off buying a radio until i get my cert but i've been gathering parts and taking notes to build my own ham radio. i studied for it last year but i went from software engineering into 911/police/fire dispatch after i graduated and never had the stomach for it for the longest time. worst part about living in a rural area are no swap meets. i know one ham in my area. if my wife get's a promotion and we move for a few years i'm going to get an ee degree. i have almost 2 years worth of math credits i can carry over from my other degree. the nearest ee university is dalhousie, may never use it professionally but it's a cool bucket list item i think.
your videos are timeless. keep up the great work. i have a tekdmm 915 if you dont have one (i know you work for them but they're getting rare). i'd gladly send you it as a way of thanking you. i cant afford a new tek scope, so i keep on the look out for a 500mhz/1ghz mdo. i am going to look at a modular tektronics 3 bay mainframe from 1969 next week. has a free bay and 2 channel scope and curve tracer module 800cad seems like a good price, the fella is a retired engineer and has 2 of them he said it weighs like 40kg haha. i forget the model offhand. i've wanted a proper curve tracer for the longest time. i'd go look at the tracer today on the way up but i'm buying a new guitar at a pawn shop, handmade in quebec. well second hand one.
Timeless treasures... Thank you for your excellent videos. Sub'd +1
thanks
Precision amplifier
Great video. Thanks!
Thanks