The PAJ7620 is a hand gesture sensor. The sensor contains a 30x30 infrared sensor matrix, which can pick up changes in light intensity. By measuring the time differences between these light changes in the matrix the device can estimate the gesture being made, somewhat similar to an optical mouse used upside down. To enable operation in the dark there is a small IR light souce. It uses the I²C bus to communicate with the microcontroller.
The PAJ7620 is capable of recognising 9 different gestures: up, down, left, right, forward, backward, clockwise, counter-clockwise, and wave. It recognises gestures between 5cm to 15cm with a view angle of 60° and its detection rate is 120 times per second.
Usage Guide
The official Arduino library is available either in the Arduino IDE Library Manager as “Gesture Paj7620” or can be downloaded from here.
Example Code
A minimal program recognizing the gestures is listed below. For reliable recognition it might be useful to repeat the reading. For instance, if a FORWARD gesture is not exactly aligned with the sensor it might be first recognized as a LEFT gesture. The next reading of the sensor can be used to determine the correct gesture.
Troubleshooting
I don't see anything printed in the Serial Monitor
See the section on UART for information about serial communication. You might need to change the data rate in your Serial Monitor to correspond to the rate set in the
Serial.begin()
function, or vice versa.
The gestures do not correspond to the output in the Serial Monitor
When the responses on the serial port does not correspond to the actual gestures you might consider turning the breadboard carrying the sensor.