diff --git a/PAJ7620.md b/PAJ7620.md new file mode 100644 index 00000000..e17e2021 --- /dev/null +++ b/PAJ7620.md @@ -0,0 +1,49 @@ +PAJ7620U2 is an integrated gesture recognition sensor from PixArt-Imaging Inc. based on infrared. It also has a built-in proximity detection and can sense various properties like position (x,y,z) and speed. +Compared to the APDS-9960 this sensor is roughly 3-4 times the price, but delivers its data without the need for expensive computations on the ESP8266. Gestures are read from one single I2C-register und only light post-processing is applied. + + +## Usage: +Simple I2C-connection with the usual configuration in Tasmota. + +## Commands: +Sensor50 0…5: + +### 0 - no readings / muted sensor +### 1 - Gesture Mode: +gesture names: Up, Down, Left, Right, Near, Far, CW (clockwise rotation), CCW (counter-clockwise rotation) +TELE-message: …{Up:1} +…{Left:3} -> 3 times „Left“ in a row, without any other gesture in between + +### 2 - Proximity Mode: +Arbitrary value between 0 (far away) and 255 (very near) are given. Exit from the sensor field will always give at least one „zero message“. TELE is only triggered, when the value has changed +TELE-message: …{Proximity:255} - virtually touching the sensor in close proximity +…{Proximity:0} - object has left the sensing volume + +### 3 - Corner Mode: +Quarters of the sensing volume(area) are organised like this: +1|2 +—- +3|4 + +An object in one of the corners will trigger the corresponding number, a bit like a pie menu in a GUI. +TELE-message: …{Corner:2} - upper right corner + +### 4- PIN mode: +Based on the corner mode a fluent movement of an object through a given sequence of corners (e.g. 1,2,3,4 -> begin upper left, move right, move diagonally down left, move right) will trigger a valid „PIN“ +TELE-message: …{PIN:1} - valid PIN + +### 5- cursor mode: +Shows x- and y-coordinates, mainly intended for debugging and „seeing“ the sensing area. This reads only the upper 5-bit-values, which automatically removes much of the jitter, giving values between 0 and 15. +TELE-message: …{x:1, y:15} - upper left corner + + +*** + +Gesture recognition seems to be more stable than on the APDS-9960, which on the other hand is a lot cheaper. +As expected NEAR and FAR gestures are tricky and you have to train your movements to catch them. Sometimes the sensor reports NEAR and FAR at once (which will be discarded). +There is some postprocessing to allow the object (hand or finger) to move into the sensing area and delay the initial direction report (up, down, left, right) to give the chance to trigger (the intended) NEAR or FAR movement. Especially FAR is a bit harder to achieve. + +After restart TASMOTA needs some time to completely configure its state. In this time frame it is likely to miss some gestures. This should stabilize after a few moments. + +The sensor provides some more goodies, like velocity of an object, so if someone has a fancy use case for this, feel free to open a feature request. +Of course it would be possible to mix the modes, but this can produce a lot of TELE-messages. This could be added later upon user request (based on real world use cases).