meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sensor:paj [2026/02/10 13:57] vamsansensor:paj [2026/02/10 18:52] (current) vamsan
Line 1: Line 1:
 ====== LamaPLC: Pixart gesture recognition sensors/module with I²C communication ====== ====== LamaPLC: Pixart gesture recognition sensors/module with I²C communication ======
-{{ :sensor:paj7620.png?150|PAJ7620U2}} +{{ :sensor:paj7620.png?180|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 PAJ7620U2 is a highly integrated gesture-recognition sensor module from Pixart that detects up to nine hand gestures and proximity via an I²C interface. It is commonly available on breakout boards for use 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.+The sensor module integrates an optical lens and an infrared (IR) LED to function even in low-light or dark environments.
  
 **Key Features** **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. +  * **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 +  * **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. +  * **Operating Voltage:** Typically 2.8V to 3.6V (sensor chip); breakout boards often include onboard voltage translators for 3.3V/5V compatibility. If using a basic breakout board without a voltage regulator, connect a 3.3V supply to the VCC pin. If using a module that specifies 5V compatibility (such as 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.+  * **Detection Distance:** Effective range of 5 cm to 15 cm, with some setups reaching up to 20 cm.
   * **Ambient Light Immunity:** High immunity to ambient light, up to <100k Lux.   * **Ambient Light Immunity:** High immunity to ambient light, up to <100k Lux.
   * **Power Consumption:** Designed for low-power operation, suitable for battery-operated devices.   * **Power Consumption:** Designed for low-power operation, suitable for battery-operated devices.
Line 16: Line 16:
   * **Gesture speed:** 60~600°/s in Normal Mode and 60~1200°/s in Gaming Mode   * **Gesture speed:** 60~600°/s in Normal Mode and 60~1200°/s in Gaming Mode
  
-==== Pinout ==== +==== Arduino wiring ==== 
-^Pin^Name^Description| +  SCL: A5 
-|1|VCC / VIN|Power supply typically 3.3V, but boards with a regulator support 3.3V–5V *| +  * GND: GND 
-|2|GND|Ground| +  SDA: A4 
-|3|SCL|I²C Serial Clock| +  * Vdd5V 
-|4|SDA|I²C Serial Data| +==== Arduino code ====
-|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. 
 <code c> <code c>
-#include "RevEng_PAJ7620.h" // Include the library +sample
- +
-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 +
-}+
 </code> </code>