WIRELESS CONTROLLED GYROSCOPIC HAND GESTURE BOT WITH SERVO ROBOTIC ARM
WIRELESS CONTROLLED GYROSCOPIC HAND GESTURE BOT WITH SERVO ROBOTIC ARM
hello, pleasant greetings to all my readers,
I am Anurag,currently studying in ECE Dept. of IIIT ALLAHABAD,
HOPE YOU ALL WILL
ENJOY READING MY BLOG.
Now we are in the age of that innovation which is borne out of blending the technical evolution of each domain. The wonder is now to ponder over the situation when the technology would be omnipresent. The masterpiece of those are the latest inventions that allow us to see and observe the world with the technical eyes full of scope.
I am a beginner and I observed the inclination of my inner interest towards the working and mechanism of wireless devices and there communication-based on some sort of active and passive sensors and all.
What I could do at this time is to absorb into these things and master the basics with the root concept and then follow some illustrations and then give something new to the field of technology and science.
As this is my first ever blog, on tech stuff, which blends the wireless radio wave communication with the electronic module of the gyroscope.
So in this blog, I am about to present this project which is the result of days, which I myself created after mastering all the concepts that lie beneath it.
I will first give you some overview of the technical terms that I came across the arena(LOL):-
SECTION:01 || SOME DETAILS ON COMMUNICATION PROTOCOL INVOLVED:-
Some of the communication protocols that are directly or indirectly related to our projects are: UART, SPI and I2C. I will give a brief knowledge of these protocols and why we used them in our device communication.
I2C (read as I square C): INTER-INTEGRATED CIRCUIT protocols that allow multiple slave integrated circuits to communicate with one or more than one master circuit. It is intended for short distance communication within a single device. they also need only two lines for their communication/information exchange just like asynchronous serial interfaces(like RS-232 and UARTs).
THE I2C COMMUNICATION PROTOCOL
EXAMPLES WITH I2C PROTOCOLS.
IN OUR PROJECT OUR PRIME CHIP i.e., GY521(MPU6050) COMMUNICATES WITH ARDUINO USING THIS COMMUNICATION PROTOCOL.
2.)SPI :- It is short for Serial Peripheral Interface. In our project, our nRF24L01 radio trans-receiver module uses this communication protocol. Unlike I2C it uses four pins to communicate. it also includes some parameters like numbers of channels supported (125), output power and data rate flow, which can be configured with the help of the interface. It also includes the concept of master and slave chips. Our arduino (UNO or NANO) will be the master and nRF24L01 will be the slave. unlike I2C, here we can only attach two slaves.
The SPI communication interface and data lines.
NOW I WILL END THIS SECTION HERE, AS I DON'T WANT THIS SECTION TO BE MUCH LENGTHY.
SECTION:02 || NOW I WILL LIST BELOW THE COMPONENTS USED IN MY PROJECT:-
1.) ARDUINO UNO R3.
2.) ARDUINO NANO.
3.) GY-521(MPU6050) GYROSCOPIC MODULE.
4.) nRF24L01 RADIO TRANS-RECEIVER MODULE(1 PAIR)
5.) CONNECTING WIRES ( FOR GLOVE).
6.) 2 SETS OF BATTERY.
7.) L293D MOTOR DRIVER MODULE.
8.) I HAND GLOVE.
9.) DC GEARED MOTORS.
10.) 1 CASTOR WHEEL.
11.) CAR CHASIS
12.) JUMPER WIRES (FOR BOT).
13.) SERVO MOTORS (SG-90)
14.) ADHESIVE.
15.) PLASTIC STICKS.
16.) DST (DOUBLE SIDED TAPE)
SECTION:03 || NOW I WILL GIVE BRIEF INTRODUCTION TO THE IMPORTANT COMPONENTS USED IN OUR PROJECT:-
1.)GY-521 (MPU6050) ACCELEROMETRIC AND GYROSCOPIC MODULE:-
PINOUT:-
- VCC (the GY-521 board has a onboard voltage regulator therefore either 5v or 3.3v can be connected.)
- GND (Ground pin)
- SCL (Serial clock line for I2C)
- SDA (Serial Data Line for I2C)
- XDA (Auxiliary data)
- XCL (Auxiliary clock)
- AD0 (when this pin set to low the I2C address of the board will be 0x68, when it is set to high the I2C address will be 0x69)
- INT (Interrupt digital output)
2.) nRF24L01 RADIO TRANS-RECEIVER COMMUNICATION MODULE:-
Some Features are:-
- 2.4GHz RF transceiver Module
- Operating Voltage: 3.3V
- Nominal current: 50mA
- Range : 50 – 200 feet
- Operating current: 250mA (maximum)
- Communication Protocol: SPI
- Baud Rate: 250 kbps - 2 Mbps.
- Channel Range: 125
- Maximum Pipelines/node : 6
- Low cost wireless solution
nRF24L01 MODULE
BANDWIDTH AND CHANNEL
nRF24L01 Pin Configuration
Pin Number
|
Pin Name
|
Abbreviation
|
Function
|
1
|
Ground
|
Ground
|
Connected to the Ground of the system
|
2
|
Vcc
|
Power
|
Powers the module using 3.3V
|
3
|
CE
|
Chip Enable
|
Used to enable SPI communication
|
4
|
CSN
|
Ship Select Not
|
This pin has to be kept high always, else it will disable the SPI
|
5
|
SCK
|
Serial Clock
|
Provides the clock pulse using which the SPI communication works
|
6
|
MOSI
|
Master Out Slave In
|
Connected to MOSI pin of MCU, for the module to receive data from the MCU
|
7
|
MISO
|
Master In Slave Out
|
Connected to MISO pin of MCU, for the module to send data from the MCU
|
8
|
IRQ
|
Interrupt
|
It is an active low pin and is used only if interrupt is required
|
STANDARD CONNECTIONS (A KIND NOTE AND IMP. CAUTION) :-
IT IS VERY VERY MUCH IMPORTANT TO NOTE THIS : CE and CSN pins should be connected to the digital pins as defined in the library.I WAS INITIALLY UNKNOWN ABOUT THIS FACT AND WAS SUFFERED FOR MANY DAYS BUT FINALLY GOT TO FIND THIS FACT AND THEN I CHECK OUT MY LIBRARY OF nRF24 WHICH WE WILL INCLUDE IN THE PROGRAMMING AS A HEADER FILE <nRF24.h>, AND FOUND THAT IN MY CASE CE PIN IS MAPPED WITH DIGITAL PIN D7 AND CSN PIN IS MAPPED WITH PIN D8 IN THE LIBRARY.
On Arduino UNO boards SPI pins( MOSI, MISO, SCK) are connected with some digital pins.
- MOSI is connected to digital pin 11
- MISO is connected to digital pin 12
- SCK is connected to digital pin 13
SECTION:04 || PROCEDURES AND STEPS :-
FIRST WE WILL SEE HOW TO MAKE THE TRANSMITTER PART:-
STEP 1.) We have to first make transmitter circuit:-
PIN CONNECTION FOR nRF24L01 :-
CE ------------------> D7
CSN ----------------->. D8
SCK -----------------> D13
MOSI ----------------> D11
MISO ----------------> D12
IQR ------------------> NOT CONNECTED TO ANY OF THE PINS.
PIN CONNECTION FOR GY-521 :-
SCL -------------------> A5 (ANALOG PIN)
SDA -------------------> A4 (ANALOG PIN)
INT --------------------> D2 (DIGITAL PIN)
STEP 2.) Then after we have to take glove and mount the MPU6050 module in a perfect manner, as shown:-
I have ordered two gloves which is basically bike gloves online.
I HAVE MADE A PERFECT PLACE FOR GYRO SENSOR TO MOUNT
AFTER MOUNTING I HAVE CONNECTED ARDUINO NANO WITH NRF24L01 SENSOR WHICH I ADJUSTED ON THE OTHER SIDE OF THE GLOVES.
STEP 3.) THEN WE HAVE TO MAKE A RECEIVER CIRCUIT:-
In this section, we will learn to connect the Arduino UNO R3 with nRF24L01 and motor driver ICs.
I am here below giving the pin to pin connections we will be needing:-
PIN CONNECTIONS FROM ARDUINO UNO R3 TO nRF24L01:-
CE -----------------> D7
CSN ----------------->. D8
SCK -----------------> D13
MOSI ----------------> D11
MISO ----------------> D12
IQR ------------------> NOT CONNECTED TO ANY OF THE PINS.
PIN CONNECTION FROM ARDUINO TO MOTOR DRIVER IC:-
ITS MY CHOICE; YOU CAN TAKE ANY OF YOUR DESIRED PINS THAT ARE AVAILABLE BUT ALSO MAKE CORRESPONDING MAPPING IN THE PROGRAMS.
D2 --------------------> RIGHT MOTOR ( + )
D4 --------------------> RIGHT MOTOR ( - )
D5 --------------------> LEFT MOTOR ( + )
D6 --------------------> LEFT MOTOR ( - )
THE ABOVE CONNECTION AND WIRING IS DONE AS PER AS STATED ABOVE.
STEP 4.) NOW WE HAVE TO MAKE CHASIS AND FIX MOTORS:_
I have made my own chassis using cardboard and fixed the motor wheels and castor wheel with the help of glue gun.
motors and wheels are fixed using glue gun
The front castor wheel.
This is upside down view.
5.) Fixing the nRF24L01 on a stand:-
As nRF24L01 needed to be fixed such that it faces no problem in accepting the radio signal from the transmitter circuit in the gloves.
I have fixed the nRF24L01 tranreceiver sensor on a stand made up of wood.
6.) UPLOADING THE CODE :-
CODE FOR THE RECEIVER CIRCUIT:-
#include <SPI.h> //SPI library for communicate with the nRF24L01+
#include "RF24.h" //The main library of the nRF24L01+
//Define enable pins of the Motors (IN CASE IF YOU WILL USE L293D IC INSTEAD OF MODULE)
const int enbA = 7;
const int enbB = 8;
//Define control pins of the Motors
//If the motors rotate in the opposite direction, you can change the positions of the following pin numbers
const int IN1 = 2; //Right Motor (-)
const int IN2 = 4; //Right Motor (+)
const int IN3 = 5; //Left Motor (+)
const int IN4 = 6; //Right Motor (-)
//Define variable for the motors speeds
//I have defined a variable for each of the two motors
//This way you can synchronize the rotation speed difference between the two motors
int RightSpd = 130;
int LeftSpd = 150;
//Define packet for the direction (X axis and Y axis)
int data[2];
//Define object from RF24 library - 9 and 10 are a digital pin numbers to which signals CE and CSN are connected
RF24 radio(9,10);
//Create a pipe addresses for the communicate
const uint64_t pipe = 0xE8E8F0F0E1LL;
void setup(){
//Define the motor pins as OUTPUT
pinMode(enbA, OUTPUT);
pinMode(enbB, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
Serial.begin(9600);
radio.begin(); //Start the nRF24 communicate
radio.openReadingPipe(1, pipe); //Sets the address of the transmitter to which the program will receive data.
radio.startListening();
}
void loop(){
if (radio.available()){
radio.read(data, sizeof(data));
if(data[0] > 380){
//forward
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
if(data[0] < 310){
//backward
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
if(data[1] > 180){
//left
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
if(data[1] < 110){
//right
analogWrite(enbA, RightSpd);
analogWrite(enbB, LeftSpd);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
if(data[0] > 330 && data[0] < 360 && data[1] > 130 && data[1] < 160){
//stop car
analogWrite(enbA, 0);
analogWrite(enbB, 0);
}
}
}
CODE FOR TRANSMITTER CIRCUIT:-
#include <SPI.h> //SPI library for communicate with the nRF24L01+
#include "RF24.h" //The main library of the nRF24L01+
#include <Wire.h> //For communicate
//#include "I2Cdev.h" //For communicate with MPU6050
#include <MPU6050.h> //The main library of the MPU6050
//Define the object to access and cotrol the Gyro and Accelerometer (We don't use the Gyro data)
MPU6050 mpu;
int16_t ax, ay, az;
int16_t gx, gy, gz;
//Define packet for the direction (X axis and Y axis)
int data[2];
//Define object from RF24 library - 7 and 8 are a digital pin numbers to which signals CE and CSN are connected, IN MY CASE (INSIDE LIBRARY).
RF24 radio(9,10);
//Create a pipe addresses for the communicate
const uint64_t pipe = 0xE8E8F0F0E1LL;
void setup(void){
Serial.begin(9600);
Wire.begin();
mpu.initialize(); //Initialize the MPU object
radio.begin(); //Start the nRF24 communicate
radio.openWritingPipe(pipe); //Sets the address of the receiver to which the program will send data.
}
void loop(void){
//With this function, the acceleration and gyro values of the axes are taken.
//If you want to control the car axis differently, you can change the axis name in the map command.
mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
//In two-way control, the X axis (data [0]) of the MPU6050 allows the robot to move forward and backward.
//Y axis (data [0]) allows the robot to right and left turn.
data[0] = map(ax, -17000, 17000, 300, 400 ); //Send X axis data
data[1] = map(ay, -17000, 17000, 100, 200); //Send Y axis data
radio.write(data, sizeof(data));
}
I HAVE ALSO ATTACHED A SERVO CONTROLLED ROBOTIC ARM IN THAT AND MAKING IT CONTROL THROUGH BLUETOOTH OR WEB SERVER
SO I WILL NOW STATE THE METHODS HOW I ATTACHED IT THROUGH A ROBOTIC WIRELESS CONTROLLED ROBOTIC ARM.
7.)

AFTER THAT I MADE A BLUETOOTH APP USING MIT APP INVENTOR, TO CONTROL THE MOVEMENT OF THE FOUR SERVO MOTORS THAT FORM FOUR DEGREE OF FREEDOM OF MY ROBOTIC ARM.
Following is the code block of my self made blutooth app.
You can download from my bluetooth app from the github repository.
7.) FINAL BOT AND WORKING :-
Following is the video of my project.
THIS IS A BLING OF MY PROJECT WITH SOME EXPLANETARY WORDS
Final model is as follows:-
MY FINAL MODEL LOOK LIKE THIS
CONCLUSION :-
HOPE YOU ALL HAVE FIND THIS BLOG USEFUL AND FULL OF KNOWLEDGE.
IF YOU LIKE AND FIND THAT THIS MIGHT BE HELPFUL TO THOSE WHO MAY NEED THIS THEN, YOU CAN SHARE IT ( BECAUSE IT HAS A OPTION).
ALSO I WILL BE BACK ON THE OTHER COOL AND DEMANDING PROJECTS RELATED TO ROBOTICS , IOT, EDC AND DSD. HOPE YOU WOULD LIKE THIS AND PLEASE PUT ON SOME COMMENTS.
IF YOU FIND THIS ANY DIFFICULTY AT ANY POINT THEN YOU ARE SET FREE TO CONTACT ME ON MY FB PAGE, WHATSAPP, AND CAN ALSO WRITE ME AT MY MAIL.
mail-iec2018094@iiita.ac.in
FB-anurag psilyf
whatsapp-9431670644
SOME OF MY OTHER PROJECTS ARE AS FOLLOWING AND WILL BE WRITE BACK THEIR BLOGS.... STAY TUNED.....










































Awesome man.
ReplyDeleteThanks sushil.
DeleteGood vlog
ReplyDeleteVery informative and interesting at the same time
Thank you very much π
DeleteVery nice update
ReplyDeleteπ It's lovely
Interesting and informative blog π
ReplyDeleteThanks...ππ
DeleteVery detailed and informative
ReplyDeleteThanks ππ
DeleteLove to see this buddy.... awesome ππ
ReplyDeleteThank you very muchπ
DeleteBrilliant man .the stuffs which you had mentioned in this blog are really ...interesting nd it may help many enthusiastic candidates to expand there area of knowledge
ReplyDeleteThanks bro, will be back with some stunning stuffππ
DeleteH
ReplyDeleteThanks π
DeleteGood blog...good job
ReplyDeleteThank youππ
DeleteAmazing project bro !! You have done a great job and thanks a lot for so much detailed and meaningful information!!
ReplyDeleteIt's fantastic bro
ReplyDeleteThanks Vivek.π
DeleteFaadπ€π€©✌π€π€
ReplyDeleteThanks
Delete