Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Adafruit APDS-9960: Examples, Pinouts, and Specs

Image of Adafruit APDS-9960
Cirkit Designer LogoDesign with Adafruit APDS-9960 in Cirkit Designer

Introduction

The Adafruit APDS-9960 is a multifunctional sensor that offers digital proximity, ambient light, RGB, and gesture sensing capabilities. This sensor is capable of detecting simple hand gestures, measuring the intensity of ambient light, and identifying colors, making it an ideal choice for a wide range of applications such as gesture-based control systems, automatic screen brightness adjustment, and interactive toys.

Common applications include:

  • Touchless control interfaces
  • Ambient light sensing for display backlight control
  • Color detection and calibration
  • User presence detection

Explore Projects Built with Adafruit APDS-9960

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano Controlled Smart Relay with APDS-9960 Gesture Sensor
Image of contactless smart switch: A project utilizing Adafruit APDS-9960 in a practical application
This circuit features an Arduino Nano microcontroller interfaced with an Adafruit APDS-9960 sensor and a 2-channel relay module. The APDS-9960 sensor, which is capable of gesture detection, is connected to the Arduino via I2C communication lines (SCL, SDA) and powered by the Arduino's 3.3V output. The relay module is controlled by the Arduino through a digital pin (D7) and is used to switch an AC-powered bulb on and off, with the relay's common (COM) terminal connected to the AC source and the normally open (NO1) terminal connected to the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
Image of wearable final: A project utilizing Adafruit APDS-9960 in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP8266 NodeMCU Controlled Smart Light with Gesture Sensing and Relay Switching
Image of Class light fan Automation: A project utilizing Adafruit APDS-9960 in a practical application
This circuit features an ESP8266 NodeMCU microcontroller interfaced with an Adafruit APDS-9960 sensor and a 1-Channel Relay to control a 9W-10W bulb. The APDS-9960 sensor likely provides input to the NodeMCU to trigger the relay, which in turn switches the bulb on or off. A Mini 360 Buck Converter is used to step down voltage for the NodeMCU and sensor, while a pilot lamp indicates the system status.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
Image of 512: A project utilizing Adafruit APDS-9960 in a practical application
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Adafruit APDS-9960

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of contactless smart switch: A project utilizing Adafruit APDS-9960 in a practical application
Arduino Nano Controlled Smart Relay with APDS-9960 Gesture Sensor
This circuit features an Arduino Nano microcontroller interfaced with an Adafruit APDS-9960 sensor and a 2-channel relay module. The APDS-9960 sensor, which is capable of gesture detection, is connected to the Arduino via I2C communication lines (SCL, SDA) and powered by the Arduino's 3.3V output. The relay module is controlled by the Arduino through a digital pin (D7) and is used to switch an AC-powered bulb on and off, with the relay's common (COM) terminal connected to the AC source and the normally open (NO1) terminal connected to the bulb.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of wearable final: A project utilizing Adafruit APDS-9960 in a practical application
Battery-Powered Smart Sensor Hub with Adafruit QT Py RP2040
This circuit features an Adafruit QT Py RP2040 microcontroller interfaced with an APDS9960 proximity sensor, an MPU6050 accelerometer and gyroscope, and an OLED display via I2C communication. It also includes a buzzer controlled by the microcontroller and is powered by a 3.7V LiPo battery with a toggle switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Class light fan Automation: A project utilizing Adafruit APDS-9960 in a practical application
ESP8266 NodeMCU Controlled Smart Light with Gesture Sensing and Relay Switching
This circuit features an ESP8266 NodeMCU microcontroller interfaced with an Adafruit APDS-9960 sensor and a 1-Channel Relay to control a 9W-10W bulb. The APDS-9960 sensor likely provides input to the NodeMCU to trigger the relay, which in turn switches the bulb on or off. A Mini 360 Buck Converter is used to step down voltage for the NodeMCU and sensor, while a pilot lamp indicates the system status.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 512: A project utilizing Adafruit APDS-9960 in a practical application
Battery-Powered Sensor Hub with Adafruit QT Py RP2040 and OLED Display
This circuit features an Adafruit QT Py RP2040 microcontroller interfacing with an MPU-6050 accelerometer, an Adafruit APDS-9960 sensor, and a 0.96" OLED display via I2C communication. It is powered by a 3.7V LiPo battery and includes a green LED with a current-limiting resistor connected to an analog pin of the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Technical Details

  • Voltage Supply: 2.4V to 3.6V
  • Current Consumption: 100 μA (typical)
  • Ambient Light Sensing Range: 0 to 65535 Lux
  • Proximity Sensing Range: Up to 100 mm
  • I2C Interface: 400 kHz (Fast Mode)
  • Interrupt Function: Yes, with programmable upper and lower thresholds
  • Operating Temperature Range: -30°C to +85°C

Pin Configuration and Descriptions

Pin Number Name Description
1 VDD Power supply (2.4V to 3.6V)
2 GND Ground connection
3 SDA I2C Data Line
4 SCL I2C Clock Line
5 INT Interrupt output (active low)

Usage Instructions

Integration with a Circuit

To use the APDS-9960 sensor in a circuit, connect the VDD pin to a 2.4V to 3.6V power supply, the GND pin to the ground, and the SDA and SCL pins to the I2C data and clock lines, respectively. The INT pin can be connected to a microcontroller's external interrupt input to respond to gesture or proximity events.

Best Practices

  • Ensure that the power supply is stable and within the specified voltage range.
  • Use pull-up resistors on the I2C lines as required by the microcontroller's I2C specification.
  • Avoid placing objects very close to the sensor that may obstruct its field of view.
  • Calibrate the sensor for ambient light and color detection according to the specific application environment.

Example Code for Arduino UNO

#include <Wire.h>
#include <Adafruit_APDS9960.h>

Adafruit_APDS9960 apds;

void setup() {
  Serial.begin(9600);
  if (!apds.begin()) {
    Serial.println("Failed to initialize APDS-9960! Please check your wiring.");
    while (1);
  }
  Serial.println("APDS-9960 initialization complete");
  
  // Enable gesture sensing
  if (!apds.enableGestureSensor(true)) {
    Serial.println("Gesture sensor is not enabled!");
  }
}

void loop() {
  // Check if a gesture is available
  if (apds.gestureAvailable()) {
    switch (apds.readGesture()) {
      case APDS9960_DIR_UP:
        Serial.println("Detected UP gesture");
        break;
      case APDS9960_DIR_DOWN:
        Serial.println("Detected DOWN gesture");
        break;
      case APDS9960_DIR_LEFT:
        Serial.println("Detected LEFT gesture");
        break;
      case APDS9960_DIR_RIGHT:
        Serial.println("Detected RIGHT gesture");
        break;
      case APDS9960_DIR_NEAR:
        Serial.println("Detected NEAR gesture");
        break;
      case APDS9960_DIR_FAR:
        Serial.println("Detected FAR gesture");
        break;
      default:
        // No gesture detected
        break;
    }
  }
}

Troubleshooting and FAQs

Common Issues

  • Sensor not responding: Ensure that the sensor is correctly powered and that the I2C lines are properly connected with pull-up resistors.
  • Inaccurate gesture detection: Calibrate the sensor for the specific environment and adjust the gesture detection parameters.
  • No interrupt triggered: Verify the INT pin connection and ensure that the interrupt thresholds are correctly set.

FAQs

Q: Can the APDS-9960 sensor detect gestures in complete darkness? A: Yes, the sensor uses infrared LEDs for gesture detection, which can work in low or no light conditions.

Q: How do I calibrate the sensor for ambient light and color detection? A: Calibration involves reading the sensor values under known lighting conditions and adjusting the readings programmatically to match the known values.

Q: What is the maximum distance for reliable gesture detection? A: The sensor can reliably detect gestures up to approximately 10 cm away, depending on environmental conditions and setup.

Q: Is the APDS-9960 sensor compatible with 5V systems? A: The sensor operates at 2.4V to 3.6V. For 5V systems, level shifters or voltage regulators should be used to ensure compatibility.

For further assistance, consult the Adafruit APDS-9960 datasheet and the Adafruit support forums.