PAJ7620U2 Gesture Recognition Sensor SKU: CQRSENSS001

From CQRobot-Wiki
Jump to: navigation, search
PAJ7620U2 Sensor


I am a gesture recognition module based on PAJ7620U2, which can directly recognize 9 basic gestures, supports I2C interface, and is compatible with 3.3V/5V level. Compared with APDS-9960 and other solutions, I have faster recognition speed, higher accuracy, more gesture recognition, and stronger anti-interference, which is suitable for low-power application scenarios such as smart home and robot interaction.


3D Gesture Sensor Specifications

  • Operating Voltage: 3.3V/5V
  • Communication Interface: I2C
  • Recognition Distance: 5cm to 15cm
  • Supported Gestures: up, down, left, right, forward, backward, clockwise, anticlockwise, shake.
  • Recognition Rate: 240Hz
  • Recognition Angle: 60 Degree (diagonal)
  • Ambient Light Immunity: Less Than 100k Lux
  • Dimensions: 23.14mm * 27.76mm
  • Mounting Hole Size: 3.0mm

Ocean Interface Cable Specifications

  • Cable specifications: 22AWG
  • Material: Silicone
  • Withstand Voltage: Less Than 50V
  • Withstand Current: Less Than 1000MA
  • Length: 21cm
  • Line Sequence: Black-Negative Power Supply, Red-Positive Power Supply, Green-SDA, Blue-SDA, Yellow-INT.


Media: PAJ7620U2 General Datasheet.pdf

Raspberry Pi Application

  • Insert the Micro SD card of Raspberry Pi to host PC.
  • Copy the Rapberry Pi folder to boot directory of the micro SD card.
  • Start your Raspberry Pi with the Micro SD card
  • You can find that the Raspberry Pi codes are saved in the BOOT directory.


  • Copy the folder to home directory
sudo cp -r /boot/RaspberryPi/ ./
sudo chmod 777 -R RaspberryPi/
cd RaspberryPi


Install libraries

  • BCM2835:
sudo tar zxvf bcm2835-1.64.tar.gz
cd bcm2835-1.64
sudo ./configure
sudo make
sudo make check
sudo make install
  • Install wiringPi
sudo apt-get install git
sudo git clone git://
cd wiringPi
sudo ./build
  • Install python
sudo apt-get install python-pip 
sudo pip install RPi.GPIO
sudo pip install spidev
sudo apt-get install python-imaging
sudo apt-get install python-smbus
sudo apt-get install python-serial

Enable I2C

sudo raspi-config
  • Choose Interfaceing Options -> I2C -> Yes

Hardware Connection

The colors of wires may be different, please connect it according to the silk screen printing.



Download and Run the Test Examples

Media: PAJ7620U2 Gesture Recognition Sensor-Raspberry Pi.rar

Run the codes

  • BCM2835 codes
cd ~/RaspberryPi/bcm2835/
cd Gesture
sudo make
sudo ./PAJ7620U2
  • wiringPi codes
cd ~/RaspberryPi/wiringPi
cd Gesture
sudo make
sudo ./PAJ7620U2
  • Python codes
cd ~/RaspberryPi/python
cd Gesture			
sudo python

Expecture Result

  • Gesture detecting


  • Object detecting


Arduino Application

The demo codes provide is based on the Arduino UNO

Hardware Connection



Download and Run the Test Examples

Media: PAJ7620U2 Gesture Recognition Sensor-Arduino.rar

  • Open the codes by Arduino IDE
  • Compile and upload to Arduino Board

Expected Result

  • Gesture detecting


  • Object detecting


STM32 Application

The STM32 examples are based on Waveshare XNUCLEO-F103RB whose chip is STM32F103RB, HAL libraries.

Hardware Connection

Connect the sensor to the STM32 board according to the table, then connect the USB to UART interface of the XNUCLEO board to the host PC.


Download and Run the Test Examples

Media: PAJ7620U2 Gesture Recognition Sensor-STM32.rar

  • Open the project (STM32 demo codes) with Keil software
  • Compile it and program to board

Expectre Result

  • Run serial assistance software, set baud rate to 115200
  • Gesture Detecting:


  • Obeject detecting: