

The Adafruit APDS-9960 (Part ID: 3595) is a versatile sensor module that integrates multiple sensing capabilities into a compact design. It features ambient light sensing, proximity detection, RGB color sensing, and gesture recognition, making it ideal for a wide range of interactive projects and applications. This sensor is commonly used in touchless interfaces, robotics, smart lighting systems, and wearable devices.
With its I2C interface and small form factor, the APDS-9960 is easy to integrate into microcontroller-based systems, including Arduino and Raspberry Pi platforms.








Below are the key technical details and pin configuration for the Adafruit APDS-9960:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V (logic level) |
| Supply Voltage Range | 2.4V to 3.6V |
| Interface | I2C |
| I2C Address | 0x39 (default) |
| Proximity Detection Range | Up to 10 cm |
| Gesture Detection Range | 10 cm to 20 cm |
| Ambient Light Sensitivity | 0.01 lux to 10,000 lux |
| RGB Color Resolution | 16-bit per channel |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 20mm x 15mm x 2mm |
The Adafruit APDS-9960 module has the following pinout:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V recommended) |
| GND | Ground |
| SDA | I2C data line |
| SCL | I2C clock line |
| INT | Interrupt output (active low) |
VIN pin to a 3.3V power source and the GND pin to ground.SDA and SCL pins to the corresponding I2C pins on your microcontroller. For Arduino UNO, connect SDA to A4 and SCL to A5.INT pin to a digital input pin on your microcontroller.#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) {
delay(10); // Wait for Serial Monitor to open
}
// Initialize the sensor
if (!apds.begin()) {
Serial.println("Failed to initialize APDS-9960 sensor!");
while (1); // Halt execution if initialization fails
}
Serial.println("APDS-9960 sensor initialized!");
// Enable proximity and gesture detection
apds.enableProximity(true);
apds.enableGesture(true);
}
// Loop function
void loop() {
// Check for gesture detection
if (apds.gestureAvailable()) {
int gesture = apds.readGesture();
switch (gesture) {
case APDS9960_UP:
Serial.println("Gesture: UP");
break;
case APDS9960_DOWN:
Serial.println("Gesture: DOWN");
break;
case APDS9960_LEFT:
Serial.println("Gesture: LEFT");
break;
case APDS9960_RIGHT:
Serial.println("Gesture: RIGHT");
break;
default:
Serial.println("Gesture: UNKNOWN");
break;
}
}
// Read proximity data
uint8_t proximity = apds.readProximity();
Serial.print("Proximity: ");
Serial.println(proximity);
delay(100); // Small delay for stability
}
INT pin is optional but can be used to reduce polling and improve efficiency in gesture detection applications.Sensor Not Detected on I2C Bus:
SDA and SCL lines are correctly connected.Gesture Detection Not Working:
apds.enableGesture(true)).Proximity Readings Are Inaccurate:
Ambient Light or Color Readings Are Incorrect:
Q: Can the APDS-9960 detect multiple gestures simultaneously?
A: No, the sensor detects one gesture at a time. It processes gestures sequentially.
Q: Can I use the APDS-9960 with a 5V microcontroller?
A: Yes, but you must use a logic level shifter to convert the 5V signals to 3.3V for the sensor.
Q: What is the maximum I2C clock speed supported by the APDS-9960?
A: The sensor supports I2C clock speeds up to 400 kHz (Fast Mode).
Q: How do I disable specific features like gesture detection?
A: Use the appropriate library functions (e.g., apds.enableGesture(false)) to disable features.
By following this documentation, you can effectively integrate and utilize the Adafruit APDS-9960 sensor in your projects.