Build it step by step
0 of 7 doneBuild the follower
Wire the op-amp as a follower with the pot as input and check the output tracks it.
Add the diode and capacitor
Place the diode in the loop and the 1 µF capacitor on the hold node.
Raise the pot
The held voltage follows the pot upwards.
Lower the pot
The held voltage stays near the peak and falls slowly through the 100 kΩ.
Press reset
The hold node drops to near zero through the 1 kΩ resistor.
Try a changing input
Turn the pot up and down and note the meter keeps the highest point.
Remove the bleed resistor
See the hold last much longer.
How do you build a peak detector and hold?
An op-amp, diode and capacitor hold the highest voltage seen, with a button to reset. You need LM358 Op-Amp, Signal Diode 1N4148, Electrolytic capacitor 1 µF, Resistor 1 kΩ, Resistor 100 kΩ, Resistor 10 kΩ, Potentiometer 10 kΩ, Tactile push button 6 mm, Digital multimeter, Breadboard 830 Tie Points, 9 V battery and 9 V battery snap with DC jack. It takes 7 steps and about 60 minutes.
- Level
- Intermediate
- Time
- About 60 min
- Parts
- 12
Parts list
- Integrated CircuitsBuyLM358 Op-Amp × 1
- SemiconductorsBuy
- PassivesBuy
- PassivesBuyResistor 1 kΩ × 1
- PassivesBuyResistor 100 kΩ × 1
- PassivesBuyResistor 10 kΩ × 1
- PassivesBuy
- SwitchesBuy
- Tools & InstrumentsBuy
- PrototypingBuy
- BatteriesBuy9 V battery × 1
- PowerBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 9 V battery + | + rail | Supply |
| 9 V battery - | - rail | Ground |
| LM358 pin 8 | + rail | Power |
| LM358 pin 4 | - rail | Ground |
| 10 kΩ resistor | + rail and potentiometer top | Limits the signal to about 4.5 V |
| Potentiometer bottom | - rail | Signal source |
| Potentiometer wiper | LM358 pin 3 (IN+A) | Input signal |
| LM358 pin 1 (OUT-A) | 1N4148 anode | Output to the diode |
| 1N4148 cathode | Hold node H | Hold node, bar on the diode towards H |
| Hold node H | LM358 pin 2 (IN-A) | Feedback from the held voltage |
| 1 µF capacitor | Hold node H and - rail, + on H | Hold capacitor |
| 100 kΩ resistor | Hold node H and - rail | Slow bleed so the hold can fall |
| Button and 1 kΩ resistor in series | Hold node H and - rail | Reset |
| Multimeter | Hold node H and - rail | Read the held voltage |
No code needed
No code. The diode is inside the feedback loop, so the op-amp makes up for the diode drop and the capacitor charges to the true input peak. The diode stops the capacitor discharging back through the op-amp when the input falls. The 100 kΩ resistor lets the hold droop slowly (a time constant of 0.1 s with 1 µF), which is useful for watching it on a meter; remove it if you want the hold to last for many seconds, and it will then droop only through the capacitor and meter leakage. The LM358 input range stops about 1.5 V below the supply, so the series 10 kΩ resistor keeps the pot below 4.5 V.
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Pot raised to 3 V then lowered | Meter stays near 3 V and decays slowly |
| Reset pressed | Hold node drops to near 0 V |
| Without the bleed resistor | Hold stays for tens of seconds |
| Pot raised again after reset | Hold follows up again |
If it does not work
Hold voltage low by 0.6 V
Take the feedback from the cathode side of the diode, not the op-amp output.
Hold voltage does not rise
Check the diode direction and that pin 3 is the signal.
Hold falls too fast
Use a larger bleed resistor or none.
Reset does nothing
Check the button wiring to the hold node.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the peak detector and hold?
LM358 Op-Amp, Signal Diode 1N4148, Electrolytic capacitor 1 µF, Resistor 1 kΩ, Resistor 100 kΩ, Resistor 10 kΩ, Potentiometer 10 kΩ, Tactile push button 6 mm, Digital multimeter, Breadboard 830 Tie Points, 9 V battery and 9 V battery snap with DC jack.
How long does the peak detector and hold take to build?
About 60 minutes for a intermediate maker, in 7 steps.
How do I know the peak detector and hold works?
Pot raised to 3 V then lowered: Meter stays near 3 V and decays slowly. Reset pressed: Hold node drops to near 0 V. Without the bleed resistor: Hold stays for tens of seconds.
Hold voltage low by 0.6 V: what should I check?
Take the feedback from the cathode side of the diode, not the op-amp output.
Hold voltage does not rise: what should I check?
Check the diode direction and that pin 3 is the signal.
Hold falls too fast: what should I check?
Use a larger bleed resistor or none.
Reset does nothing: what should I check?
Check the button wiring to the hold node.
