Source: https://mokxi.com/parts/apds9960
Updated: 2026-11-19

Part

# APDS-9960 gesture sensor

Light, color, proximity and hand swipes from one little chip, over I2C.

See every part

- 6 pins
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The APDS-9960 gesture sensor in brief

What it is, and where it sits on the bench.

The APDS-9960 is Broadcom’s all-in-one optical sensor, usually on the GY-9960 board and also built into the Arduino Nano 33 BLE Sense. Behind its small window sit four photodiodes, one on each side, and an infrared LED. Together they measure ambient light and its red, green and blue parts, how close something is, and which way a hand swipes across it, judged by the order in which the four diodes see the reflection. It is a 3.3 V part on I2C at 0x39. In Mokxi sliders set the room’s light and how near a hand is, arrows swipe a hand over the sensor, and a button steps the light’s color. The model follows the datasheet’s enable bits, so nothing measures until the chip is powered and each engine switched on, along with the color integration and gain, proximity with thresholds, and the 32-set gesture FIFO that the libraries read.

Family

Sensors

Pins

6

Pins

## 6 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

VL

The IR LED's supply. The board's jumper ties it to VCC; leave it open.

GND

Ground.

VCC

Supply, 2.4 to 3.6 V. It is a 3.3 V part: use the Uno's 3.3 V pin.

SDA

The I2C bus, address 0x39. The board has the pull-ups, to VCC.

SCL

The I2C bus, address 0x39. The board has the pull-ups, to VCC.

INT

Interrupt output, open drain: low while an enabled interrupt is set.

How to use it

## How to read APDS-9960 gestures with an Arduino

VCC goes to the Uno’s 3.3 V pin, not 5 V, and GND to ground; SDA and SCL go to A4 and A5. The board’s pull-ups go to its own 3.3 V supply. In the swipe lamp project an LED on pin 9, through 220 ohms, is the lamp the gestures control.

SparkFun’s library does the decoding. apds.init() checks the chip, enableLightSensor(false) and enableGestureSensor(true) switch on the engines without interrupts, and in the loop isGestureAvailable() and readGesture() return DIR_UP, DIR_DOWN, DIR_LEFT or DIR_RIGHT. The project brightens the lamp on up, dims it on down, and turns it off and on with left and right. Every two seconds it also prints the clear, red, green and blue counts; press the C button on the part to change the light’s color and watch them shift.

Part pin

Board pin

VCC

3.3 V

GND

GND

SDA

A4

SCL

A5

VL

Not wired (the board’s jumper ties it to VCC)

INT

Not wired

On an ESP32 or a Pico, the board’s 3.3 V and default I2C pins suit it directly, with no level concerns.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

Reading a swipe, from the swipe lamp sketch

Common errors

## Common APDS-9960 gesture sensor errors and fixes

What goes wrong

The fix

The sensor was wired to 5 V.

It is a 3.3 V chip, rated to 3.6 V, and most GY-9960 boards have no regulator. Use the board’s 3.3 V pin.

Adafruit’s library never reports a gesture.

The gesture engine starts when a hand comes close, which the proximity engine detects. Enable proximity before gestures, as Adafruit’s examples do.

Color and light readings are all zero.

Nothing measures until the chip is powered and the light engine is on. Call enableLightSensor() before reading the counts.

init() reports a failure.

Check SDA, SCL and the 3.3 V supply. The address is fixed at 0x39, so an I2C scanner should find it there.

Questions

## Questions and answers

### What can the APDS-9960 sense?

Four things from one chip: ambient light, red, green and blue light, proximity, and swipes up, down, left and right.

### Which library reads the APDS-9960 here?

SparkFun’s, as SparkFun_APDS9960.h, is the one the swipe lamp uses. Adafruit_APDS9960.h works too.

### How does the APDS-9960 tell which way a hand moved?

Its four photodiodes face up, down, left and right. A swipe lights the near side first and the far side last, and the library reads that order from the gesture FIFO.

### Does the APDS-9960 need the INT pin?

No. The swipe lamp polls with isGestureAvailable(). INT is an open-drain output for sketches that would rather be told; it is low while an enabled interrupt is set.

How it is modeled

## What is true about the APDS-9960 gesture sensor, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

From the APDS-9960 datasheet:

Nothing until it is powered: no reading lands until PON is set in ENABLE,
and each engine runs only while its own bit is on.

Color: the integration time from ATIME, 2.78 ms a step, the gain from 1x to
64x, the most a channel can count, and the four little-endian words with AVALID.

Proximity scales with its gain and LED drive, with thresholds that raise an
interrupt.

Gestures: a 32-set FIFO of up, down, left and right readings, its level, the
valid and overflow flags, and the engine that runs while a hand is over it and
exits when it leaves. A swipe lights the near side's photodiode first and the far
side's last, which is what the libraries look for.

### Not modeled

The light is a level in lux and a color, counted at a round 2.5 a lux for each
100 ms at 1x; Broadcom gives each channel's response per microwatt a square
centimeter, with spectral curves and infrared leakage this leaves out. Gesture
gain, wait time and thresholds hold what is written but any swipe passes, and the
interrupts have no persistence filter.

From APDS-9960 gesture sensor, in full.

Projects

## See the APDS-9960 gesture sensor in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the APDS-9960 gesture sensor in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the APDS-9960 gesture sensor

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- SparkFun APDS9960 RGB and Gesture Sensor

Keep going

## Keep going

- I2C Scanner for Arduino and ESP32, and Fixes
- Color sensor, TCS34725
- Light sensor, BH1750
- Touch sensor, TTP223

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the APDS-9960 gesture sensor

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
