1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Peak Detectors for inputs to microcontrollers, what do they do?

Discussion in 'General Electronics Chat' started by Billy Mayo, Jun 22, 2013.

  1. Billy Mayo

    Billy Mayo Member

    Joined:
    Mar 24, 2013
    Messages:
    825
    Likes:
    2
    At my work , I see peak detector circuits for each input pin on the microcontroller chip. My Manger said the peak detector circuits are to average or do averaging, what does he mean? why do you need to average the voltage before the input pins to the microcontroller?
     
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Where do you work? Sounds more like you're doing school assignments.
     
  3. Billy Mayo

    Billy Mayo Member

    Joined:
    Mar 24, 2013
    Messages:
    825
    Likes:
    2
    I'm not doing school assignments
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada

    Okay, where do you work? Why does your manager just wander by your desk dropping random tidbits of tech info yet never seems to explain it. Have you ever asked him? More importantly WHY does he do this?
     
  6. Billy Mayo

    Billy Mayo Member

    Joined:
    Mar 24, 2013
    Messages:
    825
    Likes:
    2
    He doesn't like teaching or training , plus he is on field service for weeks , so I get very little info, that why I ask people on forums to help me out
     
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    What sort of devices are these that appear on your desk, why do they appear on your desk? Are you a technician or a student?
     
  8. Billy Mayo

    Billy Mayo Member

    Joined:
    Mar 24, 2013
    Messages:
    825
    Likes:
    2
    Test Technicians

    The Microcontroller is MC68HC11E9BCFN2

    There is multiple Peak detector op amp circuits for each input going to the Microcontroller, My manager said the peak detector circuits are for averaging the voltage because it goes to the microcontroller input pins.

    What does he mean and why would you need to average the voltage for the microcontroller inputs?
     
  9. dougy83

    dougy83 Well-Known Member

    Joined:
    May 18, 2008
    Messages:
    2,677
    Likes:
    215
    Location:
    Brisbane, Australia
    A peak detector doesn't average the voltage. Do you have a schematic or partial schematic?
     
  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,238
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Billy,

    Not wishing to sound picky, but as your manager seems to know so much about most of the questions you keep posting, WHY don't you ask your manager the answer to these questions.???

    E.
     
  11. Diver300

    Diver300 Well-Known Member

    Joined:
    Oct 19, 2007
    Messages:
    3,090
    Likes:
    102
    Location:
    England
    Microcontroller typically sample ADC inputs very quickly, but there is not enough processing time or power to sample very often. There is often a risk that very fast signals can be missed, or aliasing with repetitive signals can give false readings.

    Analogue circuits are often used to average signals before they are presented to the ADC.

    If a peak signal is important, but it would be difficult to get the ADC to measure often enough to spot the peak, then an analogue peak detector circuit would be a solution.

    Also peak detectors are often used to measure AC voltages. Of course, the peak voltage may not be the measurement that is wanted, but it is a lot easier than measuring the mean or the RMS.
     
  12. Billy Mayo

    Billy Mayo Member

    Joined:
    Mar 24, 2013
    Messages:
    825
    Likes:
    2
    My manager doesn't explain much, either he is guessing or doesn't know or doesn't want to teach

    So a analog op amp peak detector circuit averages the Logic signals? or just analog signals?

    How does an analog op amp peak detector do the averaging?
     
  13. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    Did you not read post #8? You question has been answered. :rolleyes:
     
  14. ChrisP58

    ChrisP58 Well-Known Member

    Joined:
    Apr 27, 2012
    Messages:
    1,081
    Likes:
    131
    Location:
    Provo, Utah, USA
    A true peak detector does exactly what the name implies. It detects and holds the highest voltage that a signal has ever been. It does not average the signal. Even if the voltage was at that point for only a microsecond once, that is the peak voltage that will be detected and held. The cap is charged to the peak voltage, but the diode prevents any discharge.

    Fundamentally, a peak detector is a diode and a capacitor. Quite often, the diode gets wrapped in an op-amp circuit resulting in what is called a precision rectifier. What the op-amp does is offset the voltage drop of the diode so that it can be used with sub millivolt signals.

    To get an average of a voltage, you would use a resistor and a capacitor. then the cap charges and discharges based on the time and magnitude of the signal input signal.


    Note: The description above is assuming an ideal circuit. In reality, series inductance and resistance can inhibit the ability of a cap to capture very short peaks. And leakage currents in the cap, diode and other components can cause the peak voltage to drift over time. Nevertheless, practical detectors can be built to hold a peak voltage for a few seconds. In many cases, a resistor will be places in parallel with the cap to drop the peak over time. Or, a switch may be placed across the cap to reset the peak value to zero.
     
  15. Mosaic

    Mosaic Well-Known Member

    Joined:
    Jun 3, 2010
    Messages:
    2,617
    Likes:
    129
    Location:
    Caribbean
    Also you'll want to use a smallish cap with LOW ESR to get a decent peak reading if your transients are short.
    Similarly, short transients call for a fast switching diode.
     

Share This Page