Infrared proximity sensor sampling time question

Discussion in 'Embedded Systems and Microcontrollers' started by Xkyve, Dec 1, 2012.

  1. Xkyve

    Thread Starter Member

    Nov 30, 2012
    32
    2
    I bought an infrared proximity sensor called Sharp GP2Y0A41SK0F.

    This type of sensor has an analog output and I want to sample that voltage using my ADC at a specified sampling time. My only question is how do I determine the sampling time.

    The datasheet can be found here:
    http://forums.xilinx.com/xlnx/attachments/xlnx/OTHERBRD/661/1/analog-gp2y0a41sk0f.pdf

    From my point of view the datasheet of the sensor isn't very clear to me (page 5). I was able to deduce that the first measurement can be made after a maximum of 25 milliseconds (from the point when the sensor is powered on).
    But what about the other measurements, do they all take 16.5ms +(-) 3.7ms ?

    So is it ok for my sampling time to be 20.2ms, or 20ms just to round the value?
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Unless you can precisely determine (and you can't) the time the sensor takes to update it's output you will either take the same reading twice by sampling too fast, or miss a reading by sampling too slow.

    Neither case is any cause for concern as long as the basic 20.2 ms maximum (slowest) update rate can support your application.

    (Translation: polling once every 20 ms is just fine.)
     
  3. Xkyve

    Thread Starter Member

    Nov 30, 2012
    32
    2
    Thank you for the quick reply. 20ms seems ok to me.
     
Loading...