Peak detector circuit tutorial for beginners
Вставка
- Опубліковано 11 жов 2024
- A tutorial on peak detectors and an example that uses the clapper circuit from my comparator tutorial video.
Make sure you watch the comparator tutorial first: • Comparator tutorial & ...
Webpage: www.afrotechmod...
#Electronics #Science #Engineering
We miss you man, I hope you are well.
Thanks much for another 'real-world' example again explained so well ATM.
This is just what I was hoping for as a next step. Fantastic work!
You Sir are amazing! You explained this topic in an interesting, fun, but still usefull way. Thank you for makeing so great and understandable videos!
I wish I had had a teach like this when I was in High School... I might had stay with it longer. But these videos make my hobby so much more fun! Nice tutorial. Keep them coming
Oh man You've cleared all of my fucking concept which i couldn't learn Reading the Electronics Books Again and Again
You didn't read it properly then
these videos are just great. this is the way a professor should explain things all the time.
You're like god to me. Now everything I've learned in 4 years college comes back and hit me in the head, and I go Ahhhhhhhhhhh in every single of your video. I wish school adds practical cases like this in teaching, it'd make it so much better.
I find your videos very straight forward and easy to understand!
i really learn a lot from your tutorials man!
You just showed us how we can analogically create the PTT holder that many voice conference programs have, when you have voice activation and you want to make the transmition smooth by not stopping the transmition when you pause your speech for a tiny period.
Very good :D
Great tutorial. And I love the burnt alligator clip ends: Proof Afrotech has a dark side!
Your videos are really helpfully, and your explainations are very easy to understand. Keep making videos and I'll keep watching
@Afrotechmods the best part is that you can trigger it for hours and is an active circuit capable of handling up to 200mA on the output! Not every IC does that.
Excellent friend, you earned a new subscriber from Venezuela. Thanks for sharing.
yes , i enjoyed seeing your video as it is close to something i'm working on.
and am tempted to use your MIC amplifier idea instead of the max4466
and 9814 modules bought on ebay. except the 9814 has AGC which
is a problem solver in itself. for my projec tthe comparator step you do w/ an op amp
is handled in code with an if-then statement
overall it includes taking sounds that are brief and intermittent and capture them
with your circuit plus a Picaxe uC with ADC pins. a 20M2 at this time
lots of new ground to tread . with many interesting challenges along the way .
practically everything is an unknown when doing a big project like this for
the first time. here are some of the problems that have arisen along the way :
a) figuring the gain for stage 1 based on the volume
of the incoming sound
2) determining the R-C values so the cap' voltage fades enough
to be taken as a new sound when the ADC is looping-repeating every 250mS or so
3) test the ADC level output of each sound w/ the uC to be above some threshold in a 0-255 space
and keep track of how many sounds over one second meet a volume spec'. etc.
this is the comparator step mentioned above ... done in code.
4) re-learning the exponential equation for cap's : V=Vc * e ^ t/RC
5) lastly is managing the voltage levels with the FVR2048 voltage reference
directive so the ADC uses its converting voltage space most effectively
a few things yet to learn :
a. how to deal w/ the 9814 and its mid-range DC offset ... what does the ADC do with it ?
b. to store the count of noises in inner 1-dimensional arrays or ext'l EEprom ... ??
another matter is not knowing precisely when the uC samples the ADC pin.
the PIC uC's dont give you access to the inner register bit change when 'GO'
happens. so right now the best i can do is code a 100uS pulse before and
after the readadc command. then , on the scope, the 2 pulses serve to frame
when the adc pin does its sampling. this allows seeing how well the ADC
aligns with the peak detector when the DC voltage is flat
such a simple looking circuit leads to many new directions. and stops your
progress every time you run up against the end of your knowledge.
then you might find yourself searching u-t for others who too have tread this path
i'll be looking thru your other videos to see if you are including uC's ...
Love these videos. I have passed all my tests with perfect scores by watching these videos. Now one request I might make if you have the time, could you show us how to turn schematics into actual componets, like take a simple schematic and translate it into a board. Like componet location, how to ground, ect. The electrical classes I'm in are brief, and messing with this stuff has always interrested me, I just can't figure out how to take a schematic from paper to board.
Thanks.
@coolnitroguy Google "RC time constant" for more information. It takes roughly 5 times the time constant to fully discharge the capacitor.
Thanks Afrotechmod, this is short, concise and really helpful little circuit 😉 .
dnt know its edited or not but i just love ur voice..
gay
+Afrotechmethods
Couldn't you improve the sensitivity of the peak detector by using a germanium diode? I mean, Ge diodes have a forward voltage of around 0.2volts, compared to the typical 0.65 volts of a silicon P-N junction.
That is a great question. I hope someone answers it.
Perfect explanation ... Very clear n concise!!!!
I suppose you could make an over-excessive VU meter with this using a resistive network and several peak detectors. Cool!
That is more or less how a bargraph-meter IC works, i believe.
Take a look at this site, where a more detailed description can be found:
forbharat.wordpress.com/2011/04/30/lm3914-based-voltage-measurement/
Thanks, sir, hope you are happy and healthy!
I built the circuit and it is pretty neat. Thing is it would not work right on 5 volt power (it would stay lit). Running it at 4 volts made it work properly. I used an LM324 chip.
Good one and many thanks. Very short and apt video. Your subscriber base just increased by one.
Thank you so much for these videos, I'm learning so much from you. You make things easy and you teach me stuff I don't get at school. MOAR VIDEOS!:P
only if you were a prof in a university, everybody would become a genius!
This counts as studying for my EE final right?
perfect tutorial video I have watched so far
please make more videos like these... they are so useful... subscribed
glad I found your channel
I used this to make a circuit which i put inside an enclosure that measures the peak voltage coming from motorcycle stator coils which provide the power for the CDI and coil. it plugs into my multimeter which I set to peak mode to record the peak before the resistor drains the capactor. Multimeters don't sample fast enough to record these high voltage pulses.
2 questions:
While elegant in its simplicity, this implementation of the peak detector seems to have a pretty serious flaw. Judging from how long the led stays on at different occasions (i.e. how much the capacitor has charged) even if the first clap is loudest, the consecutive claps seem to still charge the capacitor. If we think about a more useful implementation where some sort of meter would indicate the level of the loudest clap, it would fail by adding a bit to the reading by every clap even if they were preceded with a louder one.
..As I wrote that I did come to think that this might be only a problem due to the charging time of the capacitor (which of course isn't instant even without notable resistance).. So, if we'd imagine the cap could charge instantaneously while maintaining its discharge properties, would it fix the problem?
I mean, as the capacitor charges, the voltage at the capacitor's 'upper' plate rises and so there would not be potential difference over the diode unless the clap would be louder than its predecessors?
Another thing... wouldn't the level of the peak affect also the hold time? I'm not saying this is necessarily a bad feature, it might even be a preferred one but just want to know if what I've understood so far is correct.
You can also use an op-amp as a super diode (google it) to eliminate the diode's voltage drop. Only really an issue for precision circuits though.
love it this is really helping me out with my knowledge of electrical circuits
This an absolutely outstanding channel! ⭐️⭐️⭐️⭐️
Great tutorial as always! Couldn't one use a flip-flop circuit to get the output to switch between on or off with each clap?
Another great video, what frequency is the clap at, maybe a band pass filter could make this like a clap on clap off device that wouldn't be activated by any other sounds (within reason)
Nice tutorial. Keep them coming!
Good Explanation. Great work Keep it up. Thanks for informative work
very nice video well explained, got a question can I use this same circuit as an audio peak led, working with my vu meter, I would remove the mic of course and that would be my audio input, what sort of adjustments would I have to make to the present circuit, and I would like the circuit to have a variable resistor to control the led, and what op amp are being used. Thank you
donald
Great video I want to monitor the output of a am/fm radio and know if the audio goes away for 15 second s or so. I was to trigger an alarm with output of the peak detector. Thanks
Oh my godsh. Your video is super amazing. I need time machine to replace my high school teacher.
+7timesInversed10to11 these things are taught in a university
@Afrotechmods Hook up a big power transistor to the output, connected to that nice bank of ultra capacitors you had earlier.
... clap-based taser :-)
was this schematic built using spiceLT ? also can we use this sim prog to make our own passive components ? sorta like prototyping a new type of component ?
How delightfully simple.
@critiacrof Was thinking this myself. You want current limiting resistors and small capacitance values for this circuit. Make the discharging resistor larger before you increase the capacitor value and using a low leakage metallised foil capacitor is better than using electrolytic types for this.
Great video as always.
Amazing videos! Just a single question on the forula at 1:40. The 5 on the formula becomes from the previous voltage right?
Ah good question! Check out this page for an excellent explanation: www.electronics-tutorials.ws/rc/rc_1.html
If I wanted the LED to slow fade to off instead of a delayed abrupt shutoff,could I place the peak detector after the comparator on the output voltage going into the LED?
Can you move the diode+R+C circuit after the amplifier (before the led basically)? Is there a reason why you put it there?
Could you show how to wire up a logic flip flop to the comparator's output so it becomes a clap on-clap off switch?
Using a 74LS74 D flip-flop, you would use the output of the second opamp as your clock (CLK), the Q output to drive your relay/transistor/etc and finally the Q' output as your D(ata) input. Feeding Q' to the data input is what creates the on-off toggle.
hey man i used a 220uF cap and a 10k resistor . . . it's time to fully discharge is 13.5 seconds. is it good enough?
It does explain clearly what would take hours in books such as op amps for everyone
thank god i needed this so good for my project thankx!!
You are a gem. Keep it up! 👍
How to put in the capacitor? Does the negative end go to the diode, or the positive one? Also, does it matter how you wire up the mic? I'm stuck because when I power this up all I get is a constant faint light on my diode, not the right effect at all. Is it possible that I overheated the amplifier?
@Afrotechmods i dont get this. cant the current go to the ground? Or go up and to the right, not the left, so it doesnt meet the diode? Thanks for all the videos btw.
@pikuorguk clap controlled taser :) 50-100 of those and Afrotechmods could do these experiments with loud and twitchy live audience.
@Afrotechmods Oh ok Thanks. I haven't ever actually read about that when I read about time constants. Good to know.
awesome tutorial!
At 1:40 you mention 5RC as your time to discharge. I know for an RC circuit the time constant is RC and the formula for Voltage given time, and RC is V = Vo*e^(-t/(RC)) How did you solve for T and get the formula provided?
+Kodi Stick 5RC is a generally accepted way of quickly estimating the time to fully charge or discharge an RC circuit. Try doing some example calculations and you will see that it gives you 99% of the final voltage. Also check out www.electronics-tutorials.ws/rc/rc_1.html
nice video :D all of your videos are very educative :D
if you really want to turn something for a long time you can use rs triger after peak detector
and if you want you can use rs triger+timer to turn it off again
Could you please explain why you did not connect the resistor in series with the capacitor instead?
And if you choose your C and R carefully you get a simple envelope detector. For demodulating
some AM signals
How would you make this peak detector with an inverting op amp?
Thank you, love your stuff
1) Wire the non inverting pin to the Positive rail via a 2.4MOhm resistor, and connect the inverting pin to the ETH Positive power supply pin inside your Oscilloscope's CRT Tube Supply .
2) Connect the grounds together and don't forget to put a 1N4007 diode reverse biased across the the output to the Positive pin.
3) Then on the output put a peak detector 100nF and 3kOhm resistor in parallel.
@TheCrocoduck I was thinking that... Well, not so much that it would be fun, but it would pretty much run for like a week...
What is GND on the diagram ? i am trying to build this circuit in Yenka, its a pretty cool program.
The peak voltage has to be around 5V to light an LED with this circuit. I tried it with the input signal biased to the middle of the 0 - 5V range (the typical workaround for using CMOS switches with a single voltage supply), and nothing happened.
i know that the discharge time is about the time constant.
But how about the charging time?? why shouldnt the charging time also equal to discharge time?
please anyone
Basically you have an instantaneus potential on the upper node, connected directly to a capacitor that is grounded. Since there's no resistor inbetween that potential and the capacitor, the cap will be inmmediatly charged. Formally speaking, the charge is not instantaneuos. You can think about it with the given RC equation, but in the charge process R tends to zero (since it's only a wire and the inner resistance of the cap is very small), that means that the time constant for the charge process is very very small.
Esteban González Aaaahh! Clear and straightforward explanation. Thank you both for the question and the answer.
wait but i have a few issues here. if you have a bigger capacitor doesnt it take longer to reach the peak that it is detecting, and the bigger the resistor I would think would dissipate the voltage faster or have some other negative tradeoff effect.....hopefully you get what i am trying to say....I imagine there is some balancing act and other considerations not mentioned here....
Please advise.
Holy shit, this is how a compressor works. The detected peak is used to pulldown the audio signal.
you are an amazing dude
Could you use the clapper circuit and input it to a picaxe 08M an tigger a relay. A picaxe is a microcontroller and are many types.
Nice info, thanks for sharing it:)
Glad to have subscribed to you
this cricuit gives me an idea for something fun!
I'm not ax expert in electronics. can you mention some example of that kind of diode?
Could you replace the LED with a on/off button from you'r remote control to turn the TV on and off?
@pikuorguk Yes, like a clap-controlled light switch.
@Afrotechmods
What would i have to do to have a clap on clap off circuit??
What about triggering an astable 555 after a comparator? (as long as you don't care about the peak voltage and just the presence of the signal).
At 0:45, the video states: because diodes have a small forward voltage drop then the real world voltage will be about a half a volt less.
Why wouldn't the diode voltage drop cause the output signal to be lower and thus the real world voltage to be a half a volt more?
outstanding man
What if you make it that you clap once and it charges the cap, then if you clap again it discharges it immediately
Can you adapt this circuit to read the peak ac current instead of voltage?
I think I will upgrade my home made Geiger counter meter with one of these so it does more than just jerk.
These are real engineering classes. Our university was completely ignoring the labs that I’m still trying to teach myself 12 years after graduation. It means the theory teaching were in vain as well.
hye.normally in real life application,where do we use peak detector
so if you can have a peak detector. can you catch electromagnetic waves such as radio waves with the same design ??????
thx a lot
your video are very usefull
@silverstream314 What, and make a clap controlled light or something?
If the output was 5v, it could be connected to a pin on a microcontroller and used as some sort of sensor, couldn't it?
Where do you connect ground to? would connecting it to the negative terminal work? im not quite familiar with the concept of "ground"
in dc negative is groung whereas in ac there is phase and neutral and no ground
Thank you sir!! very usefull
time to buy some op amps
Afrotechmods recommends the Cuban black market.
For clap-on clap-off could you use a flip flop?
U Are Great......!🙏🙏
Could this be made into a sort of amplitude comparator for a direction finder
Yup. Though I would recommend using a precision rectifier instead.
Could use this to turn the ceiling light on and off, by using a mechanical relay to switch the mains voltage.
Now I only need a "sneeze detector" so the whole house doesn't light up every time I sneeze.