meta data for this page
  •  

This is an old revision of the document!


LamaPLC: Pixart gesture recognition sensors/module with I²C communication

PAJ7620U2 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

PinNameDescription
1VCC / VINPower supply typically 3.3V, but boards with a regulator support 3.3V–5V *
2GNDGround
3SCLI²C Serial Clock
4SDAI²C Serial Data
5INTInterrupt 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
}

I²C topics on lamaPLC

PageDateTags
2025/05/31 21:56, , , , , , ,
2025/09/23 19:25, , , , , ,
2025/10/10 08:37, , , , , , , , ,
2026/02/10 16:02, , , , , , , , , , , , ,
2026/02/08 21:45, , , , , , , , , , ,
2026/02/08 21:45, , , , , , , , , ,
2026/02/08 21:45, , , , , , , ,
2025/05/31 21:32, , , , , , , ,
2026/02/08 21:45, , , , , , ,
2025/11/21 23:07, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2023/07/01 15:29, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2026/02/03 20:22, , , , , , , , ,
2026/02/08 21:45, , , , , , , ,
2025/11/22 21:26, , , ,
2026/02/08 21:45, , , , , , , ,
2025/09/23 19:08, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
2025/10/09 21:58, , , , , ,
2025/12/04 00:34, , , , , , ,
2026/02/10 13:47, , , , , , , ,
2026/02/08 21:45, , , , , , , , ,
2026/02/08 21:45, , , , , , , , , , , , , ,
2025/11/22 19:12, , , ,
2025/11/22 18:48, , , , , ,
2025/10/09 16:03, , , ,
2026/02/09 16:05, , , , , , , , , , , , ,
2026/02/09 15:35, , , , , , , , , , ,
2026/02/09 15:48, , , , , , , ,
2026/02/06 16:40, , , , , , ,



This page has been accessed for: Today: 4, Until now: 4