Electronics

Gesture APDS-9960 Digital RGB, Ambient Light, Proximity Sensor (5pin) RobotDYN

AED 30.45

Low stock
1

Description

The APDS-9960 sensor is a versatile device that detects RGB colors, ambient light levels, proximity, and gestures using I2C. It has a UV-IR blocking filter for accurate monitoring and uses directional photodiodes and micro-optic lenses for gesture detection. It can be used in various applications, including display backlight control, color temperature sensing, touch-screen disable, switch replacement and gesture detection. The sensor has a low-power mode and is factory-trimmed for proximity detection up to 100mm.

 

Package Includes:

  • 1 x RobotDYN APDS-9960 sensor

 

Features:

  1. Digital RGB, ambient light, proximity, and gesture sensor in a single package.
  2. I2C interface for easy integration with microcontrollers.
  3. UV-IR blocking filter for precise ambient light and color temperature monitoring.
  4. Factory-trimmed and calibrated proximity and gesture detection functions with a range of up to 100mm.
  5. Four directional photodiodes with a visible blocking filter for gesture detection.
  6. Micro-optic lenses for efficient infrared energy transmission and reception.
  7. Low-power mode with an internal state machine for energy-efficient operation.
  8. High sensitivity enabling operation behind darkened glass.
  9. Integrated visible block filter for proximity and gesture sensing.
  10. Patented shield design for minimizing proximity interference.
  11. Cross-talk integrated optical lens for improving photodiode sensitivity.
  12. Low power consumption in sleep mode (typically 1.0 µA).
  13. Compatible with a dedicated interrupt pin for efficient signaling.

 

Description:

The APDS-9960 is a multi-functional sensor that is capable of detecting RGB colors, ambient light levels, proximity, and gestures using an I2C interface. It is equipped with an IR LED that enables it to detect RGBC and gestures, even in low-light conditions. The sensor's RGB and ambient light sensing functions allow it to measure light intensity in different lighting environments, including through materials like darkened glass. Additionally, it features an inbuilt UV-IR blocking filter that provides precise ambient light and color temperature monitoring. The proximity and gesture detection functions are factory-trimmed and calibrated to a proximity detection distance of 100mm without requiring client calibrations. Gesture detection uses four directional photodiodes with a visible blocking filter to identify simple UP-DOWN-RIGHT-LEFT movements and more complex gestures. The module includes micro-optic lenses that enable efficient infrared energy transmission and reception. The internal state machine of the sensor allows it to be put into a low-power mode between RGBC, proximity, and gesture measurements, resulting in minimal power usage.

 

Principle of Work:

The APDS-9960 sensor works on the principle of detecting light and proximity using a combination of RGB color filters, IR LED, and photodiodes. The sensor has four separate photodiodes that are sensitive to different directions, and an integrated visible block filter that allows for proximity and gesture sensing. When the sensor is exposed to light, the RGB filters measure the intensity of red, green, blue, and clear light, which allows for accurate color sensing. The IR LED emits infrared light, which bounces off objects and is detected by the photodiodes, allowing the sensor to measure proximity and detect gestures. The use of micro-optic lenses within the module enables efficient infrared energy transmission and reception. The module also has an inbuilt UV-IR blocking filter that allows for precise ambient light and color temperature monitoring. The proximity and gesture functionality is factory-trimmed and calibrated, which means that client calibrations are not required, and the sensor can detect gestures with four directional photodiodes and a visible blocking filter to identify simple UP-DOWN-RIGHT-LEFT movements as well as more sophisticated gestures. The sensor has an I2C interface and can be controlled through a microcontroller or other digital circuitry. Between RGBC, proximity, and gesture measurements, an internal state machine allows the device to be put into a low-power mode, resulting in very low power usage.

 

Pinout of the Module:

  1. VCC - the power supply pin (2.4V to 3.6V)
  2. GND - the ground pin
  3. SDA - the serial data line for I2C communication
  4. SCL - the serial clock line for I2C communication
  5. INT - the interrupt output pin, which indicates when new proximity or gesture data is available

 

Applications:

  1. Display backlight control: The sensor can measure ambient light levels and adjust the brightness of a display accordingly.
  2. Correlated color temperature sensing: The RGB color sensing function can be used to measure the color temperature of light, which is useful in applications such as color calibration.
  3. Cell phone touch-screen disables: The proximity sensing function can be used to disable touch-screen functionality when the phone is held up to the ear during a call.
  4. Digital camera touch-screen disable: Similar to cell phones, the proximity sensing function can be used to disable touch-screen functionality when the camera is brought up to the user's face.
  5. Mechanical switch replacement: The gesture sensing function can be used to replace traditional mechanical switches in various applications.
  6. Gesture detection: The module can detect simple UP-DOWN-RIGHT-LEFT movements as well as more sophisticated gestures, making it useful in applications such as gaming or hands-free control of electronic devices.

 

Circuit:

 

Library:

To download the APDS-9960 library, you can follow these steps:

  1. Go to the official GitHub repository of the library: https://github.com/sparkfun/SparkFun_APDS-9960_Sensor_Arduino_Library
  2. Click on the green "Code" button and select "Download ZIP" to download the library as a ZIP file.
  3. Extract the ZIP file to a location of your choice.
  4. Open the Arduino IDE and go to Sketch > Include Library > Add .ZIP Library.
  5. Navigate to the location where you extracted the ZIP file and select the "SparkFun_APDS9960" folder.
  6. Click "Open" to import the library into the Arduino IDE.

 

Code:

This code initializes the APDS9960 sensor and enables color and gesture sensing. It then continuously reads the RGBC and gesture data and outputs it to the serial monitor. The code uses the SparkFun_APDS9960 library to interact with the sensor. You will need to download and install the library before uploading this code to your Arduino board.

#include "Wire.h"
#include "SparkFun_APDS9960.h"

// Declare a global APDS9960 object
SparkFun_APDS9960 apds = SparkFun_APDS9960();

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  while (!Serial);

  // Initialize I2C communication
  Wire.begin();

  // Initialize APDS9960 sensor
  if (!apds.init()) {
    Serial.println("Error initializing APDS9960 sensor.");
  }

  // Enable color and gesture sensing
  apds.enableColor();
  apds.enableGesture();
}

void loop() {
  // Read RGBC data
  uint16_t r, g, b, c;
  if (apds.readRedLight(r) && apds.readGreenLight(g) && apds.readBlueLight(b) && apds.readClearLight(c)) {
    Serial.print("Red: ");
    Serial.print(r);
    Serial.print(", Green: ");
    Serial.print(g);
    Serial.print(", Blue: ");
    Serial.print(b);
    Serial.print(", Clear: ");
    Serial.println(c);
  } else {
    Serial.println("Error reading RGBC data.");
  }

  // Read gesture data
  if (apds.isGestureAvailable()) {
    switch (apds.readGesture()) {
      case DIR_UP:
        Serial.println("Gesture: UP");
        break;
      case DIR_DOWN:
        Serial.println("Gesture: DOWN");
        break;
      case DIR_LEFT:
        Serial.println("Gesture: LEFT");
        break;
      case DIR_RIGHT:
        Serial.println("Gesture: RIGHT");
        break;
      case DIR_NEAR:
        Serial.println("Gesture: NEAR");
        break;
      case DIR_FAR:
        Serial.println("Gesture: FAR");
        break;
      default:
        break;
    }
  }

  // Delay before next loop
  delay(500);
}

  • The code first includes the SparkFun APDS9960 library and initializes an APDS9960 object. It also defines some constants for the threshold values for proximity and gesture detection.
  • In the setup() function, the APDS9960 is started by calling the enableGestureSensor() function. It also sets the LED brightness to its maximum value using the setLEDBoost() function.
  • In the loop() function, the program checks for gesture events by calling the isGestureAvailable() function. If a gesture is detected, the type of gesture is determined by calling the readGesture() function and its value is printed to the serial monitor.
  • The program also checks for proximity events by calling the readProximity() function. If the proximity value is above the threshold set in the constant PROX_THRESHOLD, the program prints a message to the serial monitor indicating that an object is detected.
  • Finally, the program waits for 100 milliseconds before repeating the loop.

 

Technical Details:

  • Digital RGB, ambient light, proximity, and gesture sensor
  • Operating voltage: 3.3V
  • Communication interface: I2C
  • Detection range:
    • Proximity: up to 100mm
    • Gesture: up to 200mm
  • Four separate photodiodes sensitive to different directions
  • Integrated visible light blocking filter for proximity and gesture sensing
  • Integrated UV-IR blocking filter for ambient light and color temperature sensing
  • Cross-talk compensation for proximity and gesture sensing
  • Low power consumption: 1.0µA in sleep mode
  • Package dimensions: 18.3mm x 16.4mm x 0.6mm
  • Operating temperature range: -40°C to +85°C

 

Resources:

Datasheet

 

Comparison:

The APDS9960 and APDS9930 are both digital sensors developed by Broadcom for use in consumer electronics and other applications. Here are some of the differences between the two sensors:

  1. RGB sensing: The APDS9960 can detect red, green, blue, and clear (RGBC) light, while the APDS9930 can only detect ambient light.
  2. Proximity sensing: Both sensors can detect proximity, but the APDS9960 is factory-trimmed and calibrated to a proximity detection distance of 100mm, while the APDS9930 is not.
  3. Gesture sensing: The APDS9960 has a built-in gesture engine that can recognize simple UP-DOWN-RIGHT-LEFT movements as well as more complex gestures, while the APDS9930 does not have this feature.
  4. Operating voltage: The APDS9960 can operate at a voltage range of 2.4V to 3.6V, while the APDS9930 has a wider voltage range of 2.0V to 3.6V.

The APDS9960 is a more advanced sensor than the APDS9930, with additional features such as RGB sensing and gesture recognition. However, the APDS9930 is a smaller sensor that can operate at a wider voltage range. The choice between the two sensors would depend on the specific needs of the application.