Arduino Wiring & Test

You can easily wire this breakout to any microcontroller, we'll be using an Adafruit Metro (Arduino compatible) with the Arduino IDE. But, you can use any other kind of microcontroller as well as long as it has I2C clock and I2C data lines.

Note this chip uses address 0x39 and that you cannot change addresses!

I2C Wiring

  • Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V
  • Connect GND to common power/data ground
  • Connect the SCL pin to the I2C clock SCL pin on your Arduino. 
    On an UNO & '328 based Arduino, this is also known as A5, on a Mega it is also known as digital 21 and on a Leonardo/Micro, digital 3
  • Connect the SDA pin to the I2C data SDA pin on your Arduino. 
    On an UNO & '328 based Arduino, this is also known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2

Download Adafruit_APDS9960 library

To begin reading sensor data, you will need to download Adafruit_APDS9960 from our github repository. You can do that by visiting the github repo and manually downloading or, easier, just click this button to download the zip:

Rename the uncompressed folder Adafruit_APDS9960 and check that the Adafruit_APDS9960 folder contains Adafruit_APDS9960 .cpp and Adafruit_APDS9960 .h

Place the Adafruit_APDS9960 library folder your arduinosketchfolder/libraries/ folder. 
You may need to create the libraries subfolder if its your first library. Restart the IDE.

We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

Load Gesture Sensor Example

Open up File->Examples->Adafruit_APDS9960->gesture_sensor and upload the code to your microcontroller wired up to the sensor. This example connects to the sensor and starts interpreting gestures.

Once uploaded to your Adruino, open up the serial console at 115200 baud speed. Put your hand close to the front of the sensor to activate gesture mode. Then make your directional gestures 3 or 4 inches from the sensor. You should see directional arrows appear in the serial console corresponding to the gesture you've made.

make sure to put your hand close (a few centimeters) to the sensor first to enable gesture mode before making gestures.
This guide was first published on Sep 06, 2017. It was last updated on Sep 06, 2017. This page (Arduino Wiring & Test) was last updated on Sep 06, 2017.