3D_Gesture_Sensor_mini_SKU_SEN0202 - jimaobian/DFRobotWiki GitHub Wiki

3D Gesture Sensor mini

Introduction

The so-called 3D means three-dimensional, three dimensionalities, three coordinates, that is, there is length, width and height, simply say is stereoscopic. The sensor can realize gesture recognition in three-dimensional space. It uses electric near field sensing technology and we can put the sensor into the plastic box to realize gesture recognition and distance induction.

Specification

  • Working voltage: 3.3 to 5 v
  • Interface type: IIC
  • Gesture induction: 5 cm
  • Distance induction: 10 cm
  • Size: 72x54

Board Overview

style="padding: 5px;" 3D Gesture Sensor mini style="padding: 10px;"
                                                                                                                      |---------|-----------|----------------------------|
                                                                                                                      | **Num** | **Label** | **Description**            |
                                                                                                                      | 1       | GND       | GND                        |
                                                                                                                      | 2       | VCC       | VCC(5V)                    |
                                                                                                                      | 3       | MCLR      | Sensor Reset(Low Level On) |
                                                                                                                      | 4       | SCL       | I2C clock signal           |
                                                                                                                      | 5       | SDA       | I2C data signal            |
                                                                                                                      | 6       | D         | Digital IO                 |
                                                                                                                      ||

                                                                                                                      Sensor address:0X42                                  |

Tutorial

Requirements

  • Hardware
    • DFRduino UNO x1
    • 3D Gesture Sensor mini x1
    • Dupont

Connection Diagram

3D Gesture Sensor mini

Sample Code

Click to download the librarysample and libraryhow to intall library? Code function: to realize gesture recognition in the direction of the up and down or so and clockwise and counterclockwise circle with fingers.

#include <Gesture.h>
#include <Wire.h>

int testPin= 7;
unsigned char cmd;

Gesture myGesture;

void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
 pinMode(testPin, INPUT);
 Serial.write("3D Gesture sensor is now running....\r\n");
}

void loop()
{
  if(digitalRead(testPin)==0)
  {
   myGesture.I2C1_MasterRead(md.buf,26,0x42); //The address is:0x42
   cmd = myGesture.mgcProcMsg();     //process the message
          if(cmd != GI_NOGESTURE )
            {
                switch(cmd)
                {
                    case GI_FLICK_R:
                      Serial.println("RIGHT");
                        break;
                    case GI_FLICK_L:
                        Serial.println("LEFT");
                        break;
                    case GI_FLICK_D:
                     Serial.println("DOWN");
                        break;
                    case GI_FLICK_U:
                       Serial.println("UP");
                        break;
                    case GI_AIRWHEEL_CW://Clockwise in circles
                     Serial.println("CW");
                        break;
                    case GI_AIRWHEEL_CCW://Counterclockwise circles
                       Serial.println("CCW");
                        break;

                    default: break;
                }
            }
  }
 else  {};
}

Results

When using hand moving up and down or so and clockwise and counterclockwise circle, the serial port output the corresponding string.

FAQ

More questions or interesting projects, you can Visit the forum To check or post!

More

[Schematic] [Layout] [SVG files] link=http://www.dfrobot.com/ shopping from [link dfrobot store] or dfrobot distributor.

⚠️ **GitHub.com Fallback** ⚠️