Grove - Gesture v1.0

The sensor on Grove - Gesture is PAJ7620U2 that integrates gesture recognition function with general I2C interface into a single chip. It can recognize 9 basic gestures ,and these gestures information can be simply accessed via the I2C bus.

Application: You can use Gesture as an input device to control another grove, or a computer, mobile phone, smart car, robot, and more with a simple swipe of your hand.

Features

1 See 9 gestures in the following figure


9 basic gestures Up
Down
Left
Right
Forward
Backward
Clockwise
Count Clockwise
Wave


2 Built-in proximity detection
3 Various main boards support : Arduino UNO/Seeeduino/Arduino Mega2560

Specification

Sensor  PAJ7620U2
Power supply  5V
 Ambient light immunity  < 100k Lux
 Gesture speed in Normal Mode  60°/s to 600°/s
 Gesture speed in Gaming Mode  60°/s to 1200°/s
 Interface type  IIC interface up to 400 kbit/s
 Operating Temperature  -40°C to +85°C
 Dimensions 20 * 20mm
 Detection range 5-15mm

With Arduino/Seeeduino

Suggest Reading for Starter

Download Arduino and install Arduino driver
Getting Started with Seeeduino/Arduino

Hardware Installation

Grove products have a eco system and all have a same connector which can plug onto the Base Shield. Connect this module to the I2C port of Base Shield, however, you can also connect Grove - Gesture to Arduino without Base Shield by jumper wires.

Arduino UNO Base Shield Grove - Gesture
5V I2C port VCC
GND GND
SDA SDA
SCL SCL
Digit 2 Not connected INT (Reserved pad)


INT:Gesture detection interrupt flag mask. You can connect INT pad to digit 2 of Arduino by using jumper wire.

Plug Grove - Gesture onto the I2C port of Base shield


Then plug Base shield onto the Arduino UNO


Gesture Library

We have created a library to help you start playing quickly with the Seeeduino/Arduino, in this section we'll show you how to set up the library and introduce some of the functions.

Setup

  1. Download the library code as a zip file from the Gesture_PAJ7620 github page.
  2. Unzip the downloaded file into your …/arduino/libraries.
  3. Rename the unzipped folder "Gesture"(or:"Gesture_PAJ7620")
  4. Start the Arduino IDE (or restart if it is open).


Simple Demo

The following simple demo will show you a very easy application: When you move up, the red led will be turned on, otherwise the red led will be turned off.

#include <Wire.h>
#include "paj7620.h"
 
void setup()
{
  paj7620Init();
}
 
void loop()
{
	uint8_t data = 0;  // Read Bank_0_Reg_0x43/0x44 for gesture result.
 
	paj7620ReadReg(0x43, 1, &data);  // When different gestures be detected, the variable 'data' will be set to different values by paj7620ReadReg(0x43, 1, &data).
 
	if (data == GES_UP_FLAG) 							// When up gesture be detected,the variable 'data' will be set to GES_UP_FLAG.
		digitalWrite(4, HIGH);   				        // turn the LED on (HIGH is the voltage level)
	if (data == GES_DOWN_FLAG) 						// When down gesture be detected,the variable 'data' will be set to GES_DOWN_FLAG.
        digitalWrite(4, LOW);   					    // turn the LED off by making the voltage LOW
}


Description of functions

These are the most important/useful function in the library, we invite you to look at the .h and .cpp files yourself to see all the functions available.

1. Initialize the gesture sensor chip PAJ7620


void setup()
{
  paj7620Init();
}


This initialization code should be added to each demo.

2. Read data from PAJ7620 register via I2C
Copyright (c) 2008-2016 Seeed Development Limited (www.seeedstudio.com / www.seeed.cc)
This static html page was created from http://www.seeedstudio.com/wiki