panic mode
- Joined Oct 10, 2011
- 4,990
how do you think he or production service team would feel about troubleshooting hardware solution like peak detectors, sample and hold or whatever? why do you think they would be more skilled or successful in such situation?If you say so!! Not every electronic tech or production line service person is skilled in whatever language that is. Nor would they be able to adjust it or diagnose any problem.
since TS is struggling with circuit design, that is the part i tried to simplify for him. i sure hope he can make up for that with some programming, or he may be looking for a different job.
i am just trying to offer something semi-concrete and let TS decide what works for him. for example he asked for help with this circuit and so far nobody offered anything about it - how it works, how to size the parts to fit his criterias etc.

here is an example that shows both positive and negative peak detectors - it is two slightly different circuits:

one can replace resistors by mosfets. resistors are there to discharge capacitors and without them peak value will have less ripple. then MCU can pulse the mosfets to reset the circuit after measurement is done.
things to watch for - OpAmps need to be sufficiently fast enough (some of the circuit google returned show the old 741...).
negative peak detector should have buffered output. above circuit shows that as inverting amplifier (so output is magnitude). if needed this can be turned into plain voltage follower - as long as one knows how to measure negative voltages using MCU. also whatever OpAmps are used, they need to be powered correctly. this means (depending on choice of OpAmp) one should consider supply voltages that exceed peaks... preferably by 2V or so... so split supply is needed like +20V/Gnd/-5V or +20V/Gnd/-10V
Something like this:


