meta data for this page
This is an old revision of the document!
LamaPLC: Pixart gesture recognition sensors/module with I²C communication
The PAJ7620U2 is a sophisticated gesture-recognition sensor module from Pixart that can detect nine or more hand gestures and measure proximity via an I²C interface. It is widely available on breakout boards for integration with microcontrollers such as Arduino or Raspberry Pi.
The sensor module integrates an optical lens and an infrared (IR) LED, enabling effective operation in low-light or dark conditions.
Key Features
- Supported Gestures: 9 basic gestures: Up, Down, Left, Right, Forward, Backward, Clockwise (CW) circle, Counter-clockwise (CCW) circle, and Wave. Some modules support up to 13 gestures in a slower mode.
- Interface: I²C communication interface (up to 400 kbit/s), default address: 0x73
- Operating Voltage: Typically 2.8V to 3.6V (sensor chip); breakout boards often have onboard voltage translators for 3.3V/5V compatibility. If using a basic breakout board without a voltage regulator, provide a 3.3V supply to the VCC pin. If using a module that specifies 5V compatibility (like the Waveshare or Gravity series), you can safely use either 3.3V or 5V.
- Detection Distance: Effective range of 5 cm to 15 cm, but can be up to 20 cm in some setups.
- Ambient Light Immunity: High immunity to ambient light, up to <100k Lux.
- Power Consumption: Designed for low-power operation, suitable for battery-operated devices.
- Array Size: 60×60 pixels
- Gesture speed: 60~600°/s in Normal Mode and 60~1200°/s in Gaming Mode
Pinout
| Pin | Name | Description |
|---|---|---|
| 1 | VCC / VIN | Power supply typically 3.3V, but boards with a regulator support 3.3V–5V * |
| 2 | GND | Ground |
| 3 | SCL | I²C Serial Clock |
| 4 | SDA | I²C Serial Data |
| 5 | INT | Interrupt pin (Active Low): it goes low when a gesture is detected detected |
*: If using a module that specifies 5V compatibility (like the Waveshare or Gravity series), you can safely use either 3.3V or 5V.
Arduino code
A popular and well-documented library for the PAJ7620U2 is the “RevEng PAJ7620” library by Aaron S. Crandall.
#include "RevEng_PAJ7620.h" // Include the library RevEng_PAJ7620 sensor = RevEng_PAJ7620(); // Create a sensor object void setup() { Serial.begin(9600); // Start serial communication at 9600 baud while (!Serial); // Wait for Serial Monitor to open (especially for boards like ESP32) Serial.println("PAJ7620U2 Gesture Sensor Test"); if (!sensor.begin()) { // Initialize the sensor Serial.println("PAJ7620U2 initialization failed"); while(1); // Stop program if initialization fails } Serial.println("PAJ7620U2 initialization successful. Start performing gestures."); } void loop() { Gesture gesture = sensor.readGesture(); // Read the current gesture switch (gesture) { case GES_FORWARD: Serial.println("FORWARD"); break; case GES_BACKWARD: Serial.println("BACKWARD"); break; case GES_LEFT: Serial.println("LEFT"); break; case GES_RIGHT: Serial.println("RIGHT"); break; case GES_UP: Serial.println("UP"); break; case GES_DOWN: Serial.println("DOWN"); break; case GES_CLOCKWISE: Serial.println("CLOCKWISE"); break; case GES_ANTICLOCKWISE: Serial.println("ANTI-CLOCKWISE"); break; case GES_WAVE: Serial.println("WAVE"); break; case GES_NONE: // No gesture detected, do nothing or handle as needed break; } delay(100); // Small delay to prevent excessive serial output }
Example codes
none
I²C topics on lamaPLC
This page has been accessed for: Today: 4, Until now: 4