peak detection using Microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by aniket07, Feb 10, 2011.

  1. aniket07

    Thread Starter New Member

    Jan 8, 2011
    14
    0
    i have written a program in C for peak detection. the program works very well for the positive peak, but it doesn't work for the negative peak detection. it is unable to detect the negative peak.
    please suggest me where m going wrong....
     
  2. guitarguy12387

    Active Member

    Apr 10, 2008
    359
    12
    Try rectifying the signal and just using the pos function
     
  3. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Do you have a schematic?

    For fast varying signals, you may want to use an op-amp based "peak hold" to capture very narrow peaks if needed. It also gives the PIC a little more time to sample and process signals for peaks if the change is over about 10kHz.
     
  4. be80be

    Senior Member

    Jul 5, 2008
    431
    57
    The Op using ADC for this
    Positive your testing for a 1 or better basically

    Negative your testing for 0

    Do you really think that will happen?

    ADC will never read 0 unless you hold it at gnd and it will all ways be higher then 1
     
  5. aniket07

    Thread Starter New Member

    Jan 8, 2011
    14
    0
    hi all...
    it seems that pic microcontroller i m using is not bipolar. Hence the program works well for postive peak detection,but not for the negative. So i am going to clamp the signal first and then apply it to controller. I think it will work.
     
  6. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    Assist the PIC with an external circuit, as has been suggested.
     
Loading...