This is the touch-less gestures sensor a HMI (Human Machine Interface) by swiping your hand over the sensor, which controls a computer, microcontroller, robots or home, automotive, industrial gesture switching or ambient light and color measuring and proximity detections. The Avago / Broadcom APDS 9930 / 9960 RGB and Gesture Sensor board break out pins so you can easily use it in variety of projects together with your SBC and MCU.
The APDS-9930
APDS 9930 provides a digital ambient light sensing, IR LED and a complete proximity detection system in a single chip. The proximity function offers plug and play detection to 100mm without front glass. The proximity detection feature operates well from bright sunlight to dark area. The wide dynamic range also allows for operation in the ability to put the device into a low power mode between ALS (Ambient Light Sense) and proximity measurement. The APDS 9930 is particularly useful for display management with purpose of extending battery life and providing optimum viewing is diverse lightning conditions.
The APDS-9960
APDS 9960 is an advance Gesture Detection Sensor together with proximity, Ambient Light Sense, and RGBC (Color Sense). The gesture detection utilizes four directional photo-diodes to sense reflected IR energy (Source by the integrated LED) to convert physical motion information example are velocity, direction and distance) to a digital data. The architecture design of the gesture engine features automatic activation based on proximity engine that results an ambient light subtraction, cross-talk cancellation, dual-8bit data converters, power saving inter-conversion delay, 32 data-set FIFO, and interrupt driven i2C bus communication. The gesture engine accommodates a wide range of mobile device that has a gesturing equipment to control UP-DOWN-RIGHT-LEFT feature or more complex gesture can be accurately sensed.
Required Component
- Arduino Microcontrollers, Teensy (Teensyduino Integrated), ESP8266 (ESP8266 Arduino IDE Integrated), DigiSpark, STM32, AVR
- APDS-9930 / APDS-9960 Breakout Board / Chip (See the Schematics Diagram)
- Jumper Wire / DuPont Wire
- Solder-less Breadboard
Wiring Diagram
Schematics Diagram
Source Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
#include <Wire.h> #include <APDS9960.h> //Download Code Library Below #define APDS9960_INT 2 // Needs to be an interrupt pin APDS9960 apds = APDS9960(); int isr_flag = 0; void setup() { pinMode(APDS9960_INT, INPUT); // Set interrupt pin as input Serial.begin(9600); //Initialize Serial Port Serial.println(); Serial.println("--------------------------------"); Serial.println("14CORE | GESTURE TEST W/D APDS-9960"); Serial.println("--------------------------------"); attachInterrupt(0, interruptRoutine, FALLING); // Initialize interrupt service routine if ( apds.init() ) { Serial.println("APDS-9960 initialization complete"); // Initialize APDS-9960 (configure I2C and initial values) } else { Serial.println("Error APDS Initialization"); } if ( apds.enableGestureSensor(true) ) { Serial.println("Gesture sensor is now running"); } else { Serial.println("Error APDS Initialization"); } } void loop() { if( isr_flag == 1 ) { detachInterrupt(0); handleGesture(); isr_flag = 0; attachInterrupt(0, interruptRoutine, FALLING); } } void interruptRoutine() { isr_flag = 1; } void handleGesture() { if ( apds.isGestureAvailable() ) { switch ( apds.readGesture() ) { case DIR_UP: Serial.println("UP"); break; case DIR_DOWN: Serial.println("DOWN"); break; case DIR_LEFT: Serial.println("LEFT"); break; case DIR_RIGHT: Serial.println("RIGHT"); break; case DIR_NEAR: Serial.println("NEAR"); break; case DIR_FAR: Serial.println("FAR"); break; default: Serial.println("NONE"); } } } |
Downloads
- Download ADPS-9930 Code Libraries | Zip
- Download ADPS-9960 Code Libraries | Zip
- Download ADPS-9930 Datasheet | PDF
- Download ADPS-9960 Datasheet | PDF