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

Post here first, or if you can't find a relevant section!
Post Reply
User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by 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

User avatar
zoomx
Posts: 566
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

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

Post by 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.

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by 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.

User avatar
zoomx
Posts: 566
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

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

Post by 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.

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

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

Post by 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

User avatar
zoomx
Posts: 566
Joined: Mon Apr 27, 2015 2:28 pm
Location: Mt.Etna, Italy

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

Post by zoomx » Tue Dec 05, 2017 12:10 pm

Got only one.

stevestrong
Posts: 2049
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

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

Post by 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
Posts: 2049
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany
Contact:

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

Post by 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:

Code: Select all

--------------------------------
  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
For near/far, the hand must not be moved away from the sensor, the detection will be repeated each ~1 second.

Distributed as-is; no warranty is given.
Attachments
APDS9960.zip
(13.33 KiB) Downloaded 3 times

arpruss
Posts: 153
Joined: Sat Sep 30, 2017 3:34 am

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

Post by arpruss » Sat Feb 17, 2018 4:46 pm

Thanks! Nice work! I'm waiting for my APDS9960 in the mail.

Post Reply