Has anyone tried using the APDS-9960 gesture sensor modules ?

RogerClark
Mon Dec 04, 2017 6:37 am
I came across these today

https://www.ebay.com.au/itm/GY-9960LLC- … 2389420885

and wondered if anyone had used them ?

Sparkfun have a datasheet

https://cdn.sparkfun.com/datasheets/Sen … ds9960.pdf

Which seems to suggest they can measure distance , as well as colour.

At $3 they seem cheaper than Time of Flight distance sensors, and I suspect they use time of flight even though I cant see it called that in the datasheet


zoomx
Mon Dec 04, 2017 9:23 am
Never used.

Comparing the datasheet to the VL53L0x one
http://www.st.com/content/ccc/resource/ … 279086.pdf
it seems they works in different way.
APDS-9960 uses an IR LED and a series of light sensors.
VL53L0x uses a very low power ir laser and a sort of photomultiplier (a Single-photon avalanche diode) to detect the small light reflected.
Maybe APDS-9960 hardware can be used to calculate a TimeOfFlight but the circuit or the little firmware inside, if there is one, is not capable of that. Maybe because the IR LED is not able to turn on and off in very short time or can’t be modulated. Maybe I am wrong.
Datasheet says
Proximity Operation
The Proximity detection feature provides distance measurement by photodiode detection of reflected IR energy sourced by the integrated LED. The following registers and control bits govern proximity operation and the operational flow is depicted in Figure 8

but it seems that you can only detect that an object is in view and if this object is closer or farther using the light values.
In Figure 13a you can see that the distance depends on reflectivity.


RogerClark
Mon Dec 04, 2017 9:50 am
I agree it doesnt say how it works

In this video it seems to show it somehow gives a distance, but its probably not a calibrated value,
https://youtu.be/M8grYX_JHPM?t=60

The Time Of Flight sensors, have very similar disclaimers about the reflectivity of the object making a difference to the range of the device.
Which as what made me think potentially its using the same technology, but it could just be using the intensity of the reflected light

But as they are half the price of the Time Of Flight devices, they may be useful for some application.


zoomx
Tue Dec 05, 2017 11:01 am
Today on… hackaday I read this post
Gesture Control for Lunch Money
https://hackaday.com/2017/12/03/gesture … nch-money/
that talk about this project
https://www.instructables.com/id/Nevma- … he-Masses/
where an APDS-9960 is used, mounted on a particular Arduino Micro (the one with ATMega32U4 like a Leonardo board)
Image
He translates some simple gestures in mouse movement.
The code works on all ATMega32U4 boards, I believe.

RogerClark
Tue Dec 05, 2017 11:13 am
I have seen it on Hackaday

Today, I ordered 3 modules from China, but they will not arrive for several weeks


zoomx
Tue Dec 05, 2017 12:10 pm
Got only one.

stevestrong
Mon Feb 12, 2018 6:32 pm
I got my APDS9960 module and tried the ProximitySensor and GestureSensor examples.

Used the Sparkfun lib.

My module has the ID 0xA8.
It detects (reasonable) proximity in the 5cm..20cm interval. The more distant the hand the more noisy the measurement. AT 5cm it is saturated (255).

The gesture example mostly works (without using interrupts), except the NEAR gesture. That will be only detected when I move my hand from far position close to the sensor and then move it away in the horizontal plane (the sensor lying on the table oriented upwards). Without moving away it won’t detect NEAR.
It turned out to be the default behavior coded in the lib.

Also, it sometimes detects NONE gestures :shock:

I turned debug on, but I cannot (yet) interpret the huge amount of displayed data.
Anyone familiar with the theory behind detecting gestures with this module?

Anyone had similar experience?

EDIT
I realized that the FIFO reading is somehow limited to max. 8 records (8*4 bytes) within the data block read routine, even when more than 8 records are available in FIFO. Hmm.


stevestrong
Sat Feb 17, 2018 2:40 pm
I reworked the Sparkfun lib to allow detection of more directions, as well as detecting approach/depart dynamic, not only static position near/far.
Also, the user can select the connected I2C interface in the example sketch without changing something in the lib.

Typical serial output from the gesture sensor example:
--------------------------------
APDS9960 - GestureTest demo
--------------------------------
APDS-9960 initialization complete
Detected ID: 0xA8
Gesture sensor is now running

Detected gesture: UP RIGHT
Detected gesture: DOWN LEFT
Detected gesture: UP LEFT
Detected gesture: DOWN LEFT
Detected gesture: UP RIGHT
Detected gesture: DOWN LEFT
Detected gesture: DOWN RIGHT
Detected gesture: LEFT
Detected gesture: RIGHT
Detected gesture: LEFT
Detected gesture: RIGHT
Detected gesture: LEFT
Detected gesture: UP
Detected gesture: DOWN
Detected gesture: UP
Detected gesture: DOWN
Detected gesture: FAR APPROACHING
Detected gesture: NEAR APPROACHING
Detected gesture: NEAR
Detected gesture: NEAR
Detected gesture: NEAR
Detected gesture: NEAR DEPARTING
Detected gesture: FAR
Detected gesture: FAR
Detected gesture: NEAR APPROACHING
Detected gesture: NEAR
Detected gesture: NEAR DEPARTING
Detected gesture: FAR
Detected gesture: FAR
Detected gesture: FAR APPROACHING
Detected gesture: NEAR APPROACHING
Detected gesture: NEAR
Detected gesture: FAR DEPARTING
Detected gesture: FAR
Detected gesture: FAR APPROACHING
Detected gesture: NEAR DEPARTING


arpruss
Sat Feb 17, 2018 4:46 pm
Thanks! Nice work! I’m waiting for my APDS9960 in the mail.

arpruss
Sat Mar 17, 2018 1:24 pm
I wonder if the module I got from Aliexpress isn’t defective.

ID = 0x30. The ProximitySensor example always gives zero. GestureTest only gives UP no matter what I do. I get ColorSensor readings like:
Ambient: 8926 Red: 3795 Green: 65535 Blue: 0
Ambient: 8933 Red: 3797 Green: 65535 Blue: 0


stevestrong
Sat Mar 17, 2018 1:44 pm
It seems that you got an ADPS9930 (not a 9960).
For that, you need a different library, see here: http://www.instructables.com/id/Wiring- … APDS-9960/

arpruss
Sat Mar 17, 2018 2:08 pm
[stevestrong – Sat Mar 17, 2018 1:44 pm] –
It seems that you got an ADPS9930 (not a 9960).
For that, you need a different library, see here: http://www.instructables.com/id/Wiring- … APDS-9960/

Yup, that’s embarrassing. I bought the wrong sensor. Well, I’m only out a dollar.

A direct link for the 9930 library: https://github.com/Depau/APDS9930
And the 9930 library does work with it.


RogerClark
Mon Mar 19, 2018 2:05 am
BTW. I’ve pulled Steve’s I2C fix into my repo, but I’ll need to double check if the fix was for this or another device

Edit.

I see the fix was not for this device, and as the fix came from Steve , there should be no problem with this device and the change to the I2C library


zmemw16
Wed Mar 21, 2018 11:05 am
so if waving two hands around, anyone thinking or building a theremin ?
srp

arpruss
Sat Apr 07, 2018 7:57 pm
[stevestrong – Sat Feb 17, 2018 2:40 pm] –
I reworked the Sparkfun lib to allow detection of more directions, as well as detecting approach/depart dynamic, not only static position near/far.
Also, the user can select the connected I2C interface in the example sketch without changing something in the lib.

I tried the library, and I get NEAR almost all the time. Sometimes when I run a finger very close to the sensor (about 5-10 mm), I can get LEFT or RIGHT, but I can’t get FAR, APPROACHING, etc. Any suggestions?

The color and proximity sensor examples work fine.


Leave a Reply

Your email address will not be published. Required fields are marked *