Connect with us

Fast Counter Design

Discussion in 'General Electronics Discussion' started by hami1101, Jan 30, 2012.

Scroll to continue with content
  1. hami1101

    hami1101

    1
    0
    Jan 30, 2012
    Hello Everyone

    I have a question regarding counter design, actually I have analog signal which has a positive and negative peaks of only 10 micro second duration. I wanted to detect those positive peaks only using arduino microcontroller and then displaying the detected peak values as well but since the adc of arduino is slow and takes about 100 micro second to read an analog input so its not possible by using adc of arduino and I am now required to use some fast counter which can count these positive peaks and then the arduino can be used to display the number of counts.

    I hope I have explained my work in a good way and look forward to get support on this :)

    Thanks in advance to everyone
     
  2. Laplace

    Laplace

    1,252
    184
    Apr 4, 2010
    Have you considered using one of the arduino external interrupts? Then just have the interrupt handler increment a register. When you say the signal has positive and negative peaks of 10 usec duration, it suggests there may need to be some signal conditioning for the input.
     
  3. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,477
    2,820
    Jan 21, 2010
    I was thinking peak and hold too.

    allow a window to find a peak, disable the input, read, reset and re-enable.
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    11,012
    2,506
    Nov 17, 2011
    You can use a zero crossing detector (comparator) to generate a digital trigger signal from the analog input. The digital signal can be used to
    1) control a sample and hold to store the level of the analog input during the peak.
    2) trigger the µC to start a conversion of the analog signal from the sample and hold

    Harald
     
  5. BobK

    BobK

    7,682
    1,687
    Jan 5, 2010
    Don't know whether this would work or not, but I think it might be worth trying. I am more familiar with PIC, so I am not sure you could do the same with an Arduino.

    The Arduino ADC certainly has a sample and hold circuit. So why not use it to accumulate the peak? Just use a long sample time and connect to the signal through a diode so that the sample and hold inside the ADC will charge to the peak value over multiple samples. Then do a conversion.

    Bob

    Edit: For more accuracy you could use an opamp circuit that simulates an ideal diode and elminates the voltage offset you wuold get with a real diode. I forget what this circuit is called, but I have seen it before.
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,477
    2,820
    Jan 21, 2010
    The problem with just using a diode may be that the signal source may have an impedance which prevents the capacitor from being charged during a single peak.

    It may be sensible to have a buffer and an external capacitor. I believe (but I'm not entirely certain) that these ADC's have some small amount of series resistance which creates a time constant that may be too long for these very short duration pulses (not to mention the capacitance of the diode).

    I guess that 10uS isn't particularly short, but a lot depends on the shape of the pulse.
     
  7. BobK

    BobK

    7,682
    1,687
    Jan 5, 2010
    I don't know anything about AVR but, for the low end PICs the acqusition time is about 20uS, so a single pulse cannot fully charge the capacitor, which is why I reccommeded a long charge time over many pulses. If there was zero leakage in the diode or hold capacitor circuit, the cap would eventually charge to the highest peak in the sampling period minus the diode drop. The actual leakage may make this too inaccurate.

    Bob
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-