A Gesture Sensor AP05-9960 module is a nifty device that has 4 integrated sensors : RGB, Ambient Light, Proximity ,and Gesture.

For this first mini-project, 4 LEDs will be switched on via SWIPE UP, DOWN, LEFT, RIGHT gestures.

Hardware Used

Software Used

  • Arduino IDE

Libraries Used

Adafruit Gesture Sensor Library is used for ease of implementation.

Application Description

For this particular Gesture model, A Bi-directional Logic Level Converter is not needed since it has a built-in 3.3V Regulator, 662k. Double check your Gesture Sensor datasheet if it has an onboard regulator, otherwise you might end up damaging the module.

If you are using the standard Arduino Uno R3, the SDA is connected to the A5 pin, SCL is connected to the A4 pin. In this particular project, the Robotdyn has a dedicated SDA and SCL pin above the AREF pin.

  • VCC = Voltage
  • GND = Ground
  • INT = External Interrupt pin. Usually Active LOW.
  • SDA = I2C Data
  • SCL = I2C Clock

To enable the gesture sensing, put your hand close the sensor (atleast a few centimeters)  for a few seconds. Gesture sensing is limited to swipes in four major directions : up, down, left, and right.

Set-up the Hardware


Code Breakdown

The code starts off importing the “Adafruit_APDS9960.h” library to be used in this mini-project. After importing, the library will be declared. The last line initializes the LED pins to be lit up when it registers a gesture.

As the name implies, it enables the proximity and gestures sensors. The proximity sensor is needed to enter gesture mode.

When there is a gesture being made, it is converted into a value which is recognizable by the microcontroller. In this case, readGesture() fetches the gestured being made and stores it into the variable “gesture”.  Basically, the IF ELSE statements checks whether the variable “gesture” is equal to the gesture being made, and lights the pin accordingly.


The Gesture sensor can sense motion and interpret them as gestures. It works by a using four directional photodiodes to sense the reflected IR light (the violet light shown in the picture below!) to convert gestures into computer readable information.


Tags : APDS-9960arduinocolor sensorGestureGesture Sensorlight sensorProximity Sensor

Leave a Response