Skip to content

shaui/IOT_Project-Gesture-Control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IOT Final Project: Gesture Control

Demo Video


Precondition (Important!)

  • Make sure that your Raspberry PI has already set up. In the Project, we don’t teach how to do that.
  • Also, you can see the “RPI_INSTALL_DOC.pdf” in the project. That will teach you step-by-step process to set up your Raspberry PI.

Overview

  • This is a magic gloves! You can only use it with corresponding gesture to control all your furniture like music player, fan, air conditioner, robot car…… In this, I use the Robot Car to demonstrate.
  • This Project is for something that you usually do in your life but you need to take some effort to do, just like open the light, close the air conditioner, lock your door…… But if you have the magic glove, you will not need to stand up, go ahead to your light, remote control or something what you use to control your target, you just need to make some gesture toward your target and then everything is wonderful!

Technologies involved

  1. The MPU6050 module which including the “Accelerometer” and “Gyroscope” can use to detect out hand gesture.
  2. Using the python’s “smbus” package to address the MPU6050 data, let us know what gesture we are making.
  3. After getting the gesture’s data, we simply use the Bluetooth, WIFI or RF signal to transmit the data to our Raspberry PI. For this project, we use the Bluetooth.
  4. Address the data to make out item do something what we want.
  5. Return some data of our item and display on our screen to detect.

Component

For hand gesture sensor (Sender):

  1. MPU6050 module or simply an Accelerometer
  2. Raspberry PI Zero which include the Bluetooth module. (You also can use something that can transmit data from your sender to your receiver)
  3. Gloves or something set the MPU6050 and PRI Zero
  4. double-sided tape to stick your item to your gloves.
  5. Power (Maybe a battery or Mobile power) for your RPI Zero

For hand gesture handler (Receiver):

  1. Robot Car or something you want to control
  2. Raspberry PI 3 which include the Bluetooth module (Or something you can receive your data from sender)
  3. Power (Maybe a battery or Mobile power) for your Raspberry PI 3

Technologies implementation

MPU6050 module:

MPU6050 use the I2C interface, so we need to make our raspberry pi enable the I2C interface function.

Part 1: Configure the RPI I2C

  1. Open the configuration interface
  • In your terminal, input the “sudo raspi-config”
  1. Select Interfacing Configurations
  1. Select -> I2C
  1. Enable I2C configuration by press “Yes”
  • Then you can see the picture
  1. Finally, Select Yes if it asks to Reboot or you can reboot your RPI by yourself.
  • After booting raspberry Pi, we can check user-mode I2C port by entering following command.

Part 2: Scan and Test the I2C on RPI

  1. get i2c tools by using apt package manager
  • sudo apt-get install -y i2c-tools
  1. connect you I2C device to your RPI
  • like this “MPU6050”
  1. scan the port using following command
  • sudo i2cdetect -y 1 if success, your will see like this:

Bluetooth module:

We will use the python for control the Bluetooth communication. In the part, you will install the python Bluetooth package and program the python code to control the Bluetooth to transmit data from sender to receiver.

Part 1: Install python-bluezthat for your RPI

  1. sudo apt-get install python-bluez
  • In some condition, you may need to add the command
    • sudo apt-get install libbluetooth-dev libbluetooth3
  1. write a python code that contain the “import Bluetooth”
  • this is to check if you install the package successfully

Part 2: Install “smbus” package for MPU6050 to address the data.

  1. pip3 install smbus
  • If you have already the package, just skip it.
  1. write a python code that contain the “import smbus”
  • this is to check if you install the package successfully

Part 3: Write two code, one for sender and one for receiver

  1. For sender
  • You can get the code by name "client.py" in the project
  1. For Receiver
  • You can get the code by name “server.py” in the project
  1. If you want to test the Bluetooth programming

Robot Car:

Part 1: Configure all components of your car

Part 2: Configure the L298N motor controller

  • This is for logically control you Robot car. L298N contain the four output controlled by Raspberry PI’s GPIO and 2 port for power input.

Code implementation

client.py

  • In the part, you will learn how to get the MPU6050’data and using the smbus package to address it. Finally transmit it to your target.

Part 1: set up the MPU6050

    • Basic parameter set up.
    • Initialize the MPU6050

Part 2: Address the MPU6050 data

    • Get the MPU6050’s data
    • Make the data easy to read

Part 3: Transmit the data to your receiver

    • getDirection: transform the MPU6050’s data to the direction
    • if the direction change, send to data

server.py

  • In the part, you will learn how to get the data from your sender by bluetooth and using the RPi.GPIO package to address it. Finally make your car move!

Part 1: set up the GPIO PIN

Part 2: make your Bluetooth to accept status

Part 3: address the data from your sender, and do the corresponding action


Reference Document:

About

IOT Project for Gesture Control Robot Car

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages