Hi all...wondering if anyone has had the same problem I'm having with this sensor. Every example works in both an Uno and Nano (proximity, ambient light/ rgb) flawlessly, but the gesture example returns nothing in Setial Monitor. It says the sensor initializes correctly, begins running. But nothing happens when a gesture is made....any ideas/suggestions?
Which break-out board do you use? How did you connect it to the Arduinos? Post the code you used. The settings of the sensor are relevant. Do you use the sensor behind some kind of glas? BTW, it's called APDS9960 and not APDS9906, I just realized from the context that you're writing about the same sensor I'm using.
Thanks for the correction....late night typo!! I'm using two different boards...one was a GY-9960LLC sensor...it's purple. I'm not sure of the other one, but it is red (if that helps).
The purple one has 5 pins...I have Vin to 3.3, GND to GND, INT to 2. I have SCL and SDA connected to A5 and A4. I don't recall which one to which, as the board is at home and I'm at work. I'm using the Sparkfun library, and using the example sketches included in the library. With the purple board, all the example sketches work flawlessly, except the gesture sensor sketch. I'm not using the board behind anything, it's just put in breadboard with headers I soldered on.
The red board seems to have some other problem, as it won't initialize properly. I could provide more info if needed later, once I return home.
I'm using two different boards...one was a GY-9960LLC sensor...it's purple. I'm not sure of the other one, but it is red (if that helps).
Not really because we need the schematics of that breakout board. I've seen several breakout boards with this sensor and almost all are different regarding the additional components on the board (with/without pull-ups, with/without voltage regulator, with/without level converter, etc.).
I guess you're using a 5V Arduino (p.e. UNO), are you? If so, you might have damaged the red board already by connecting the SCL/SDA directly to the pins on the Arduino because the Arduino Wire library activates the internal pull-ups and the pull the signal to 5V which the sensor do not like. If the board includes pull-ups the resulting voltage is lower and the sensor might survive the bad treatment a bit longer but may fail any time. You should use a level converter when you connect that sensor to a 5V Arduino.
The gesture example of the Sparkfun library expect the Sparkfun breakout board which pulls the INT line high. If your board doesn't do that the example will not work unchanged.
As you can see schematics of the hardware you're using are not nice gimmicks but absolutely necessary. Don't buy Chinese cheap crap that does not offer your schematics because you cannot use it (except you reverse engineer the schematics yourself). That's why a board is available for $2.30 on aliexpress but costs $14 at Sparkfun. The Sparkfun board works. The sensor chips alone costs almost $2.40 if you order over 1000 of them. On many Chinese board the sensors are just fake copies which will never work.
So you have two options: Reverse engineer your board by following every trace and check the result with a multimeter, then draw the resulting schematics. Or invest and buy a board from a dealer that provides the necessary documentation for it.
So both boards were connected to the 3.3v pin on the Arduino's to their respective Vin pins. Are you saying that the SCL and SDA pins need to be adjusted down to 3.3V? Hmm...from everything I've read or seen describing how to use these sensors, it has never been stated to bring those two pins down to 3.3V....wish they would have. I've watched video's with people using these exact boards using the same setup and library I used...and all the other sketches work fine...it's just the gesture example that doesn't work.
Are you saying that the SCL and SDA pins need to be adjusted down to 3.3V?
On the sensor: yes. On the board: it depends on how the board is laid out, on it's schematics. You still didn't provide any information about them except the color I cannot tell you what to do with them. As I wrote in the last post if the board contains pull-ups to 3V3 the sensor might work for some time with that setup although it's above the specification. Without these pull-ups the I2C lines get 5V directly which damages the chip according to the information I have (I never tried that myself).
I've watched video's with people using these exact boards using the same setup and library I used...and all the other sketches work fine...it's just the gesture example that doesn't work.
Depending on the hardware that were used (I mean the boards not the sensors), this might work for some time as I explained above.
The probable reason for the later I gave you in my last post:
The gesture example of the Sparkfun library expect the Sparkfun breakout board which pulls the INT line high. If your board doesn't do that the example will not work unchanged.
This is just a guess but it would explain the symptoms you describe.
same issue here
There are two sensors in the same part. Therefore some functions work correctly but others not. Gesture sensor reads changes in reflected IR light. Iluminating IR LED is missing in some clones and sensor does not see your hand. Solution is to add independent IR lighting. I use IR placed on IR proximity sensor with only GND and +5V connected. This IR LED should illuminate your palm sufficiently. Then try proper distance for gestures because this LED shines pretty much even if it is not visible.
There are two sensors in the same part.
Yes, there are but one is the RGB ambient sensor, the other is a 4 channel IR proximity sensor. If the proximity is read correctly, this usually means that there is an illuminating IR LED. The question is if the sensor works correctly if the surrounding circuitry is changed. I guess the huge capacitor of the Sparkfun breakout board is just there to push up the costs, just one example.