Tags: RobotDyn, Gesture, Sensor, APDS-9960, digital, RGB, ambient, light, proximity, gesture, sensor

Gesture APDS-9960 RGB digital RGB, ambient light, proximity Sensor (5pin) for Arduino

  • 30.00 AED
    • Ex Tax:30.00 AED
    • Brands RobotDyn
    • Product Code: 284
    • Availability: In Stock
    The Gesture Sensor APDS-9960 is a digital RGB, ambient light, proximity and gesture sensor. The sensor has an I2C compatible interface providing red, green, blue, clear (RGBC), proximity and gesture sensing with IR LED. The RGB and ambient light sensing feature detects light intensity under various ..

    The Gesture Sensor APDS-9960 is a digital RGB, ambient light, proximity and gesture sensor. The sensor has an I2C compatible interface providing red, green, blue, clear (RGBC), proximity and gesture sensing with IR LED. The RGB and ambient light sensing feature detects light intensity under various lighting conditions and through various attentuation materials including darkened glass. In addition, the integrated UV-IR blocking filter enables accurate ambient light and correlated color temperature sensing.

    The proximity and gesture feature is factory-trimmed and calibrated to 100mm proximity detection distance without requiring customer calibrations. Gesture detection utilizes four directional photodiodes, integrated with visible blocking filter, to accurately sense simple UP-DOWN-RIGHT-LEFT gestures or more complex gestures. The addition of micro-optics lenses within the module provides high efficient transmission and reception of infrared energy. An internal state machine allows the device to be put into a low power state between RGBC, proximity and gesture measurements providing very low power consumption.

    Features:

    • RGBC Light Sensor, Proximity and Gesture Detector with IR LED in an Optical Module
    • I2C Interface Compatible with Dedicated Interrupt Pin
    • High Sensitivity Enabling Operation Behind Darkened Glass
    • RGBC Light Sensing with Integrated UV-IR Block Filter
    • Geometrically Arranged RGBC Photodiodes Providing Uniform Angular Response
    • Calibrated to 100mm Detection Distance Eliminating Customer End Product Calibration
    • Four Separate Photodiodes Sensitive to Different Directions
    • Proximity and Gesture Sensing with Integrated Visible Block Filter
    • Patented Shield Design Minimizing Proximity Cross Talk
    • Integrated Optical Lens Collimating IR LED Beam and Improving Photodiode Sensitivity.
    • Low Power Consumption: 1.0 µA typical in Sleep Mode

    Applications:

    • Display Backlight Control
    • Correlated Color Temperature Sensing
    • Cell Phone Touch-screen Disable
    • Digital Camera Touch-screen Disable
    • Mechanical Switch Replacement
    • Gesture Detection
    • this video is about the same sensor but different manufacturer you can use it to learn how to wire and interact with the sensor :
    • his project shows detecting gestures of hand to RIGHT, LEFT, UP, DOWN and also Ambient color and proximity detection using Arduino module APDS-9960


    • APDS-9960 Library (getHub)
    • APDS-9960 Library (from Robojax.com)
    • APDS-9960 Data sheet (pdf)
    • 
       /*
       * Code for APDS-9960 Gesture sensor for Arduino
       * This code is to detect gesture of your hand either moving it up, down, left or right and other gestures
       * can be detected and used to control something else.
      
       * Watch the APDS-9960 Gesture sensor video https://youtu.be/qzSgZV_fbxI
       * get this code from http://robojax.com/learn/arduino/
      
      
       * Code used in video by Ahmad Nejrabi for Robojax.com
       * on Dec 31, 2016 06:53, at Ajax, Ontario, Canada
        * Permission granted to share this code given that this
       * note is kept with the code.
       * Disclaimer: this code is "AS IS" and for educational purpose only.
      */
      
      /****************************************************************
      GestureTest.ino
      APDS-9960 RGB and Gesture Sensor
      Shawn Hymel @ SparkFun Electronics
      May 30, 2014
      https://github.com/sparkfun/APDS-9960_RGB_and_Gesture_Sensor
      
      Tests the gesture sensing abilities of the APDS-9960. Configures
      APDS-9960 over I2C and waits for gesture events. Calculates the
      direction of the swipe (up, down, left, right) and displays it
      on a serial console. 
      
      To perform a NEAR gesture, hold your hand
      far above the sensor and move it close to the sensor (within 2
      inches). Hold your hand there for at least 1 second and move it
      away.
      
      To perform a FAR gesture, hold your hand within 2 inches of the
      sensor for at least 1 second and then move it above (out of
      range) of the sensor.
      
      Hardware Connections:
      
      IMPORTANT: The APDS-9960 can only accept 3.3V!
       
       Arduino Pin  APDS-9960 Board  Function
       
       3.3V         VCC              Power
       GND          GND              Ground
       A4           SDA              I2C Data
       A5           SCL              I2C Clock
       2            INT              Interrupt
      
      Resources:
      Include Wire.h and SparkFun_APDS-9960.h
      
      Development environment specifics:
      Written in Arduino 1.0.5
      Tested with SparkFun Arduino Pro Mini 3.3V
      
      This code is beerware; if you see me (or any other SparkFun 
      employee) at the local, and you've found our code helpful, please
      buy us a round!
      
      Distributed as-is; no warranty is given.
      ****************************************************************/
      
      #include <Wire.h>
      #include <SparkFun_APDS9960.h>
      Servo myservo;  // create servo object to control a servo
      
      // Pins
      #define APDS9960_INT    2 // Needs to be an interrupt pin
      
      // Constants
      
      // Global Variables
      SparkFun_APDS9960 apds = SparkFun_APDS9960();
      int isr_flag = 0;
      
      void setup() {
      
        // Set interrupt pin as input
        pinMode(APDS9960_INT, INPUT);
      
        // Initialize Serial port
        Serial.begin(9600);
        Serial.println();
        Serial.println(F("--------------------------------"));
        Serial.println(F("SparkFun APDS-9960 - GestureTest"));
        Serial.println(F("--------------------------------"));
        
        // Initialize interrupt service routine
        attachInterrupt(0, interruptRoutine, FALLING);
      
        // Initialize APDS-9960 (configure I2C and initial values)
        if ( apds.init() ) {
          Serial.println(F("APDS-9960 initialization complete"));
        } else {
          Serial.println(F("Something went wrong during APDS-9960 init!"));
        }
        
        // Start running the APDS-9960 gesture sensor engine
        if ( apds.enableGestureSensor(true) ) {
          Serial.println(F("Gesture sensor is now running"));
        } else {
          Serial.println(F("Something went wrong during gesture sensor init!"));
        }
      }
      
      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");
          }
        }
      }
         
      You will need to download the Gesture sensor library from GetHub here 

      Source code for controlling Servo with your hand

      
       
      /****************************************************************
      Modified for RoboJax by A.B.S on May 09, 2017
      in Ajax, Ontario, Canada. www.RoboJax.com
      
      
      Original Soruce:
      APDS-9960 RGB and Gesture Sensor
      Shawn Hymel @ SparkFun Electronics
      May 30, 2014
      https://github.com/sparkfun/APDS-9960_RGB_and_Gesture_Sensor
      
      
      Distributed as-is; no warranty is given.
      ****************************************************************/
      
      #include <Wire.h>
      
      // added by RoboJax
      #include <Servo.h>
      
      #include <SparkFun_APDS9960.h>
      
      
      Servo myservo;  // create servo object to control a servo // added by RoboJax
      
      // Pins
      #define APDS9960_INT    2 // Needs to be an interrupt pin
      
      // Constants
      
      // Global Variables
      SparkFun_APDS9960 apds = SparkFun_APDS9960();
      int isr_flag = 0;
      
      void setup() {
       myservo.attach(9);  // attaches the servo on pin 9 to the servo object
        // Set interrupt pin as input
        pinMode(APDS9960_INT, INPUT);
      
        // Initialize Serial port
        Serial.begin(9600);
        Serial.println();
        Serial.println(F("--------------------------------"));
        Serial.println(F("SparkFun APDS-9960 - GestureTest"));
        Serial.println(F("--------------------------------"));
        
        // Initialize interrupt service routine
        attachInterrupt(0, interruptRoutine, FALLING);
      
        // Initialize APDS-9960 (configure I2C and initial values)
        if ( apds.init() ) {
          Serial.println(F("APDS-9960 initialization complete"));
        } else {
          Serial.println(F("Something went wrong during APDS-9960 init!"));
        }
        
        // Start running the APDS-9960 gesture sensor engine
        if ( apds.enableGestureSensor(true) ) {
          Serial.println(F("Gesture sensor is now running"));
        } else {
          Serial.println(F("Something went wrong during gesture sensor init!"));
        }
      }
      
      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");
              myservo.write(180);  // added by RoboJax
              break;
            case DIR_RIGHT:
              Serial.println("RIGHT");
              myservo.write(0);   // added by RoboJax
              break;
            case DIR_NEAR:
              Serial.println("NEAR");
              break;
            case DIR_FAR:
              Serial.println("FAR");
              break;
            default:
              Serial.println("NONE");
          }
        }
      }
      
         

    There are no reviews for this product.

    Write a review

    Please login or register to review