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

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

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

Introduction

The APDS-9960 V2 is a highly versatile sensor that integrates multiple functionalities, including ambient light sensing, proximity detection, RGB color sensing, and gesture recognition, into a single compact package. This sensor communicates via the I2C protocol, making it easy to interface with microcontrollers and development boards such as the Arduino UNO.

Common applications of the APDS-9960 V2 include:

  • Smartphones and tablets for gesture-based user interaction
  • Smart home devices for ambient light adjustment and proximity detection
  • Robotics for gesture-controlled interfaces
  • Wearable devices for environmental awareness and user interaction

Explore Projects Built with APDS-9960 V2

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP8266 NodeMCU Controlled Smart Light with Gesture Sensing and Relay Switching
Image of Class light fan Automation: A project utilizing APDS-9960 V2 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
ESP32-Based Smart Weighing System with GPS and Accelerometer
Image of fogbag: A project utilizing APDS-9960 V2 in a practical application
This circuit is designed for data acquisition and processing, featuring an ESP32 microcontroller interfaced with two load cells via HX711 bridge sensor interfaces, a GPS module for location tracking, and an ADXL345 accelerometer for motion sensing. The ESP32 collects data from the sensors and can transmit it for further processing or storage.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Ambient Light Sensing System
Image of color sensor interfacing: A project utilizing APDS-9960 V2 in a practical application
This circuit integrates an ESP32 Wroom microcontroller with an APDS-9930 Proximity and Ambient Light Sensor. The ESP32 provides power to the sensor and communicates with it via I2C, using its GPIO21/SDA and GPIO22/SCL pins for data transfer. The circuit is designed to measure proximity and ambient light levels, which can be processed and utilized by the ESP32 for various applications.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Controlled Smart Relay with APDS-9960 Gesture Sensor
Image of contactless smart switch: A project utilizing APDS-9960 V2 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

Explore Projects Built with APDS-9960 V2

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 Class light fan Automation: A project utilizing APDS-9960 V2 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 fogbag: A project utilizing APDS-9960 V2 in a practical application
ESP32-Based Smart Weighing System with GPS and Accelerometer
This circuit is designed for data acquisition and processing, featuring an ESP32 microcontroller interfaced with two load cells via HX711 bridge sensor interfaces, a GPS module for location tracking, and an ADXL345 accelerometer for motion sensing. The ESP32 collects data from the sensors and can transmit it for further processing or storage.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of color sensor interfacing: A project utilizing APDS-9960 V2 in a practical application
ESP32-Based Ambient Light Sensing System
This circuit integrates an ESP32 Wroom microcontroller with an APDS-9930 Proximity and Ambient Light Sensor. The ESP32 provides power to the sensor and communicates with it via I2C, using its GPIO21/SDA and GPIO22/SCL pins for data transfer. The circuit is designed to measure proximity and ambient light levels, which can be processed and utilized by the ESP32 for various applications.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of contactless smart switch: A project utilizing APDS-9960 V2 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

Technical Specifications

The APDS-9960 V2 is designed to provide reliable and accurate sensing capabilities. Below are its key technical specifications:

Parameter Value
Operating Voltage 2.4V to 3.6V
I/O Voltage 1.8V to 3.6V
Communication Interface I2C (7-bit address: 0x39)
Proximity Detection Range Up to 100 mm
Gesture Sensing Range 10 mm to 150 mm
Ambient Light Sensitivity 0.01 lux to 10,000 lux
RGB Color Sensing Range 0 to 65,535 counts per channel
Operating Temperature -40°C to +85°C
Power Consumption (Active) 1.0 mA (typical)
Power Consumption (Sleep) 2.2 µA (typical)

Pin Configuration and Descriptions

The APDS-9960 V2 has a total of 6 pins. Below is the pinout and description:

Pin Name Description
1 VDD Power supply input (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)
6 LDR LED driver pin for external IR LED (optional use)

Usage Instructions

The APDS-9960 V2 is straightforward to use in a circuit, especially with microcontrollers like the Arduino UNO. Below are the steps to get started:

Connecting the APDS-9960 V2 to an Arduino UNO

  1. Power the Sensor: Connect the VDD pin to the 3.3V pin on the Arduino UNO and the GND pin to the Arduino's GND.
  2. I2C Communication: Connect the SDA pin to the Arduino's A4 pin and the SCL pin to the A5 pin (for older Arduino boards) or the dedicated SDA and SCL pins on newer boards.
  3. Interrupt Pin: Optionally, connect the INT pin to a digital input pin on the Arduino for interrupt-based gesture detection.
  4. Optional LED Driver: If using an external IR LED, connect it to the LDR pin.

Example Arduino Code

Below is an example Arduino sketch to read proximity data from the APDS-9960 V2:

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

// Create an instance of the APDS-9960 sensor
Adafruit_APDS9960 apds;

// Setup function
void setup() {
  Serial.begin(9600); // Initialize serial communication
  while (!Serial);    // Wait for the serial monitor to open

  // Initialize the APDS-9960 sensor
  if (!apds.begin()) {
    Serial.println("Failed to initialize APDS-9960 sensor!");
    while (1); // Halt execution if initialization fails
  }
  Serial.println("APDS-9960 initialized successfully!");

  // Enable proximity sensing
  apds.enableProximity(true);
}

// Loop function
void loop() {
  uint8_t proximity = apds.readProximity(); // Read proximity value

  // Print proximity value to the serial monitor
  Serial.print("Proximity: ");
  Serial.println(proximity);

  delay(500); // Wait for 500ms before the next reading
}

Important Considerations and Best Practices

  • Power Supply: Ensure the sensor is powered with a stable voltage between 2.4V and 3.6V. Using 5V may damage the sensor.
  • I2C Pull-Up Resistors: If your microcontroller does not have built-in pull-up resistors on the I2C lines, add external 4.7kΩ resistors between SDA/SCL and VDD.
  • Interrupt Pin: Use the INT pin for efficient gesture detection to avoid continuously polling the sensor.
  • Ambient Light Interference: Avoid placing the sensor in direct sunlight or near strong light sources, as this may affect its performance.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Sensor Not Detected on I2C Bus

    • Ensure the SDA and SCL lines are correctly connected to the microcontroller.
    • Verify that the I2C address (0x39) matches the one used in your code.
    • Check for proper pull-up resistors on the I2C lines.
  2. Proximity Readings Are Inaccurate

    • Ensure there are no obstructions or reflective surfaces too close to the sensor.
    • Verify that the sensor is not placed in direct sunlight or near strong IR sources.
  3. Gesture Recognition Not Working

    • Ensure the sensor is within the recommended gesture sensing range (10 mm to 150 mm).
    • Verify that the INT pin is connected and properly configured in your code.
  4. Ambient Light or Color Readings Are Incorrect

    • Calibrate the sensor in the intended environment to account for ambient light conditions.
    • Avoid placing the sensor near flickering light sources, such as fluorescent lamps.

FAQs

Q: Can the APDS-9960 V2 be used with 5V microcontrollers?
A: Yes, but you must use a logic level shifter to step down the I2C signals to 3.3V, as the APDS-9960 V2 operates at 3.3V logic levels.

Q: How do I enable gesture recognition?
A: Use the appropriate library (e.g., Adafruit_APDS9960) and call the enableGesture() function. Ensure the INT pin is connected for interrupt-based gesture detection.

Q: What is the maximum I2C clock speed supported?
A: The APDS-9960 V2 supports I2C clock speeds up to 400 kHz (Fast Mode).

Q: Can I use the sensor without an external IR LED?
A: Yes, the APDS-9960 V2 has a built-in IR LED, but using an external IR LED may improve performance in low-light conditions.

By following this documentation, you can effectively integrate the APDS-9960 V2 into your projects and take advantage of its powerful sensing capabilities.