PAJ7620U2 Gesture Recognition Sensor SKU: CQRSENSS001

From CQRobot-Wiki
Revision as of 16:18, 19 January 2022 by Chenqi (talk | contribs) (STM32 Application)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
PAJ7620U2 Sensor

Description

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.


Specificationn

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.
CQRPAJ7620U2-A-2.jpg

DataSheet

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.

CQRSENSS001-1.jpg

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

CQRSENSS001-2.jpg

Install libraries

  • BCM2835:
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.64.tar.gz
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://git.drogon.net/wiringPi
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.

CQRSENSS001-5.jpg

CQRSENSS001-6.jpg

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 PAJ7620U2.py

Expecture Result

  • Gesture detecting

CQRSENSS001-8.jpg

  • Object detecting

CQRSENSS001-10.jpg


Arduino Application

The demo codes provide is based on the Arduino UNO

Hardware Connection

CQRSENSS001-11.jpg

CQRSENSS001-12.jpg

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

CQRSENSS001-13.jpg

  • Object detecting

CQRSENSS001-15.jpg


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.

CQRSENSS001-16.jpg

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:

CQRSENSS001-17.jpg

  • Obeject detecting:

CQRSENSS001-18.jpg