Adafruit_APDS9960 icon indicating copy to clipboard operation
Adafruit_APDS9960 copied to clipboard

IR Pulse width

Open marekhalmo opened this issue 6 years ago • 3 comments

I'm making a smart node that integrates display, BME280 (temperature/humidity/preassure), TSOP 32238 (38kHz IR sensor) and the apds9960.

When i activate the geasure recognition or proximity sensor using

apds.enableProximity(true);
apds.enableGesture(true);

the APDS sensor starts to send IR pulses. I don't know the exact frequency of the IR pulses but the TSOP 32238 is picking them up.

I found in this datasheet that the pusles should be 62.5 kHz which is well above the range of the TSOP.

In the datasheet there is mentioned that you can influence the signal frequency and in code of this library there is

enum
{
	APDS9960_GPULSE_4US		= 0x00,
	APDS9960_GPULSE_8US		= 0x01,
	APDS9960_GPULSE_16US	= 0x02,
	APDS9960_GPULSE_32US	= 0x03,
};

and

boolean Adafruit_APDS9960::begin(uint16_t iTimeMS, apds9960AGain_t aGain, uint8_t addr) 
.
.
.
 
  _gpulse.GPLEN = APDS9960_GPULSE_32US;
  _gpulse.GPULSE = 9; //10 pulses
  this->write8(APDS9960_GPULSE, _gpulse.get());
.
.
.
}

So if i understand correctly the pulse width of 32US is arround 31kHz.

I will change the value manually in the lib and test later today if the signals collide and if it affects the signal of the IR sensor and let you know.

But could you add a possiblity to change the frequency to APDS9960_GPULSE_4US (250kHz) or a different value when calling begin?

marekhalmo avatar Feb 26 '18 07:02 marekhalmo