License

Recommend Projects

Grove - Gesture v1.0 copy

1 year ago 152
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

Grove - Gesture


enter image description here

The sensor on Grove - Gesture is PAJ7620U2 that integrates gesture recognition function with general I2C interface into a single chip. It can recognize 9 gestures including move up, move down, move left, move right, etc with a simple swipe of your hand.

Following is a video which using Gesture sensor with matrix to display the direction of hand.

We can utilize the gesture to adjust the sound volume, control a robot. Or we can make a remote-control unit, which is able to operate many devices at the same time via a gesture sensor.

“Always Believe That Something Wonderful Is About To Happen.”

Features: 9 gesture recognition Built-in proximity detection Various main boards support : Arduino UNO/Seeeduino/Arduino Mega2560

Part list: 1PCBA-Grove - Gesture; 126AWG Grove Cable;SA206120099A.

Specification: Interface:IIC 13gesture recognition Operating Power:5V Dimensions:20*20mm Sensor: PAJ7620U2 Detecting range: 5 – 15cm Ambient light immunity: < 100k Lux Gesture speed mode: Normal and Gaming

/* 
Notice: When you want to recognize the Forward/Backward gestures, your gestures' reaction time must less than GES_ENTRY_TIME(0.8s). 
        You also can adjust the reaction time according to the actual circumstance.
*/

#define GES_REACTION_TIME       500 // You can adjust the reaction time according to the actual circumstance.
#define GES_ENTRY_TIME          800 // When you want to recognize the Forward/Backward gestures, your gestures' reaction time must less than GES_ENTRY_TIME(0.8s). 
#define GES_QUIT_TIME           1000

Following are the main program used in the demo: 
void setup()
{
    uint8_t error = 0;

    Serial.begin(9600);
    Serial.println("\nPAJ7620U2 TEST DEMO: Recognize 9 gestures.");

    error = paj7620Init();          // initialize Paj7620 registers
    if (error) 
    {
        Serial.print("INIT ERROR,CODE:");
        Serial.println(error);
    }
    else
    {
        Serial.println("INIT OK");
    }
    Serial.println("Please input your gestures:\n");
}

void loop()
{
    uint8_t data = 0, data1 = 0, error;

    error = paj7620ReadReg(0x43, 1, &data);             // Read Bank_0_Reg_0x43/0x44 for gesture result.
    if (!error) 
    {
        switch (data)                                   // When different gestures be detected, the variable 'data' will be set to different values by paj7620ReadReg(0x43, 1, &data).
        {
            case GES_RIGHT_FLAG:
                delay(GES_ENTRY_TIME);
                paj7620ReadReg(0x43, 1, &data);
                if(data == GES_FORWARD_FLAG) 
                {
                    Serial.println("Forward");
                    delay(GES_QUIT_TIME);
                }
                else if(data == GES_BACKWARD_FLAG) 
                {
                    Serial.println("Backward");
                    delay(GES_QUIT_TIME);
                }
                else
                {
                    Serial.println("Right");
                }          
                break;
            case GES_LEFT_FLAG: 
                delay(GES_ENTRY_TIME);
                paj7620ReadReg(0x43, 1, &data);
                if(data == GES_FORWARD_FLAG) 
                {
                    Serial.println("Forward");
                    delay(GES_QUIT_TIME);
                }
                else if(data == GES_BACKWARD_FLAG) 
                {
                    Serial.println("Backward");
                    delay(GES_QUIT_TIME);
                }
                else
                {
                    Serial.println("Left");
                }          
                break;
            case GES_UP_FLAG:
                delay(GES_ENTRY_TIME);
                paj7620ReadReg(0x43, 1, &data);
                if(data == GES_FORWARD_FLAG) 
                {
                    Serial.println("Forward");
                    delay(GES_QUIT_TIME);
                }
                else if(data == GES_BACKWARD_FLAG) 
                {
                    Serial.println("Backward");
                    delay(GES_QUIT_TIME);
                }
                else
                {
                    Serial.println("Up");
                }          
                break;
            case GES_DOWN_FLAG:
                delay(GES_ENTRY_TIME);
                paj7620ReadReg(0x43, 1, &data);
                if(data == GES_FORWARD_FLAG) 
                {
                    Serial.println("Forward");
                    delay(GES_QUIT_TIME);
                }
                else if(data == GES_BACKWARD_FLAG) 
                {
                    Serial.println("Backward");
                    delay(GES_QUIT_TIME);
                }
                else
                {
                    Serial.println("Down");
                }          
                break;
            case GES_FORWARD_FLAG:
                Serial.println("Forward");
                delay(GES_QUIT_TIME);
                break;
            case GES_BACKWARD_FLAG:       
                Serial.println("Backward");
                delay(GES_QUIT_TIME);
                break;
            case GES_CLOCKWISE_FLAG:
                Serial.println("Clockwise");
                break;
            case GES_COUNT_CLOCKWISE_FLAG:
                Serial.println("anti-clockwise");
                break;  
            default:
                paj7620ReadReg(0x44, 1, &data1);
                if (data1 == GES_WAVE_FLAG) 
                {
                    Serial.println("wave");
                }
                break;
        }
    }
    delay(100);
}

For more detail, please visit: http://www.seeedstudio.com/item_detail.html?p_id=2463

Documents

Grove - Gesture v1.0 copy

Grove - Gesture v1.0 copy

BOM

ID Name Designator Footprint Quantity
1 SENSOR-PAJ7620U2 U1 LGA13-SMD-L5.2*W3*H2MM 1
2 1uF C1 C0603 1
3 CJ2302 Q1,Q2 SOT-23 2
4 2.2k R1,R2,R3,R4 R0603 4
5 100nF C3,C6,C7,C9 C0603 4
6 10uF C2,C10,C11 C0603 3
7 10k R5 R0603 1
8 22uF C5,C8 C0805 2
9 SEEEDSTUDIO-OPEN-SCH-FRAME U$4 SEEEDSTUDIO-PCB-FRAME 1
10 SMD Grove J1 HW4-SMD-2.0-90D 1
11 DNP INT 1P-8040MIL 1
12 XC6206P332MR-G U4,U3 SOT-23 2

Attachments

None

Members

Success
The owner does not allow comments in this project now

Comments (0)

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.