Interfacing proximity sensor with PIC microcontroller

Discussion in 'General Electronics Chat' started by RG23, Apr 20, 2011.

  1. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    Initially I connected mechanical switch directly to port of the microcontroller PIC 16f887 to act as digital input.

    Now in place of that switch I need to use proximity sensor
    Avago’s APDS-9120 (integrated optical proximity sensor)

    Does anyone have an idea how to interface this sensor with the pic?

    Please let me know
    Thanks
     
    Last edited: Apr 20, 2011
  2. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    I just looked at the data sheet http://www.avagotech.com/docs/AV02-1937EN and it has analog and digital outputs. The digital output can connect direct to a PIC digital input. The datasheet recommends a pull-up resistor of 10K. The internal pull-up on the PIC is weaker than this but will probably work. Depends how fast it is going to switch. The analog output needs an integration capacitor and could be connected to a PIC ADC input direct. Or use an external comparator. Some PICs have comparators built-in.

    Note. This sensor has a recommended supply voltage of 2.4V to 3.6V but the PIC will also work at this voltage.

    Can't see a problem really.
     
  3. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    Digital output of that sensor is max 0.3V

    whereas the voltage on the pin of PIC16f887 is max Vdd+0.3

    I think some signal conditioning circuit will be required if I have to use that digital output of sensor as digital input to pic

    Also I would like to know if I need to provide the burst pulse continuously to drive LEDON(pin5)

    Thanks
     
Loading...