Gesture-controlled RC Car

Hello my name is Rohan and I am a rising junior at Dougherty Valley High School in San Ramon, CA. I joined BlueStamp this year because I absolutely love engineering and wanted to grow my knowledge in this field to a very high level. For my main project I created a Gesture Controlled RC car with Robot Arm, in which the user’s glove effectively communicates with the robot in a matter that is both seamless and versatile.

Engineer

Rohan V.

Area of Interest

Computer Science and General Engineering

School

Dougherty Valley High School

Grade

Incoming Junior

Reflection on Bluestamp

I believe the BlueStamp program was very influential in growing my passion for engineering. At the start of the camp, I knew in general that I enjoyed problem-solving, however I had never experienced solving such an intense problem in relatively short period of time. I found the independence of BlueStamp to be emancipating in some ways due to the fact that it completely broke the restrictions of traditional education and exposed me to the benefits doing activities hands-on. Furthermore, when I ran into challenges I was not just simply given a lower grade, but asked to dive deeper into the source of issue and review possible solutions step by step. I hope to take the knowledge from this program into the real world and use it keep my work ethic strong and determination to succeed boundless.

Demo Night

Video Of My Demo Night Presentation

Final Milestone

Video Of My Final Milestone

The completion of my final milestone brings together all the components of the prior milestones in a manner that does not leave out any of their functions. Furthermore, the circuit containing all the motors is mounted upon the plywood base and is attached to both a Lithium-Ion battery along with a portable phone charger as an external  power supply. This setup connects wirelessly to the other XBee module attached to the glove. The input setup is made up of two primary portions, the glove and the Arduino wrist band. The glove contains all the flex sensors and wiring that permit it to easily send data with a bend of a combination of fingers. The wristband on the other hand has both a motor shield, Xbee wireless module, and Arduino microcomputer mounted upon it. These two portions of the input communicate with one other through the bundle of cables that flow across their gap. A major feature of this project is the flexibility of repairing the robot if it happens to no longer function as intended. The breadboard circuit and duct tape are in place as opposed to a PCB board or super glue so that if a connection breaks they can be examined and fixed almost immediately.

As I completed this milestone, I learned many valuable concepts and skills that permitted me to complete my project. A major aspect of my project was the extensive usage of the XBee wireless module. I first began my exploration of this innovative technology in milestone 3, where I began to experiment with its functionality in sending data. For my final project, I needed to have a far more detailed and advanced source code to run the several sets of combination of the bending of the flex sensors. I was fortunate enough to have had an initial program written on Arduino IDE provided to me by Robin Andersson’s version of this project. Working off of his source code, I had to modify it a fair amount in order to accomodate for the use of XBees. In his code there was not appearance of XBee, and rather had most functions print to the Serial Monitor rather than the XBee console. Along with this I learned how to work with and create circuits based upon given schematics that I was able to get from Robin Andersson as well. Finally, I learned how to create a mechanical drawing of a given project and use it to help place the locations of the components onto the base.

Along with concepts, I learned many valuable lessons that I hope to carry with me through the completion of similar tasks. Initially, when I back to construct the glove portion of the project I tried to mount the Arduino and Shield onto the glove as well but found that the mess of wires it created was far too disorganized and susceptible to damage. Therefore, I made the modification of introducing a separate arm band that shifts farther down the arm and provides space for the glove and the movement of fingers at its core. Through this change I learned that it is important to space out components of any project so that they can be far more functional by the user. I also learned that it is crucial to secure connections throughout a circuit with materials such as electrical tape, heat shrink, or zip-ties. In my project I found that many of the parts were extremely loose, and so would not remaining in an uniform position over time. Lastly, I also found that when mounting objects onto a base it is important to use a variety of mounting methods. This ensures that versatility while maintaining structural integrity remains the focus of the base.

Overall the conclusion of this project taught me a lot in terms of what is possible with flex sensors and how they can be used to better the current technology we have. In this scenario, remote controlled car that have been controlled with inputs such as joysticks, buttons, etc in the past. Now that control can be shifted to our fingers themselves and be controlled with a system that is far more natural for human usage. In addition, I learned so many concepts that range from all portions of engineering including, electrical, computer, mechanical, and more. However, by far the greatest knowledge I gained was the skills needed to effectively research and complete an intensive project from scratch.

Source Code of the Input With Modifications

// Router!
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3);
int flexSensorPin1 = A0;
int flexSensorPin2 = A1;
int flexSensorPin3 = A2;
int flexSensorPin4 = A3;
int ledPin=13;
int button=8;
int button_read=0;
int b=0;
int k=0;
char s_str1[2];
char s_str2[2];
char s_str3[2];
char s_str4[2];
char command=’e’;
String str1,str2,str3,str4;

void setup(){
pinMode(button,INPUT); // The button is going to control if we are going to control either the robot arm or the motors.
Serial.begin(9600);
XBee.begin(9600);
}

void loop(){

if (digitalRead(button) == LOW) // check if button was pressed
{
b++;
b=b%2;
delay(250);
if (b==0){
command=’s’;
digitalWrite(ledPin,HIGH); // indicator on the hand to know if the motors is going to be controlled or the robot arm
}
else {
command=’e’;
digitalWrite(ledPin,LOW);
}
}

// Read the values
int flexS1 = analogRead(flexSensorPin1);
int flexS2 = analogRead(flexSensorPin2);
int flexS3 = analogRead(flexSensorPin3);
int flexS4 = analogRead(flexSensorPin4);

// Numbers below is individual for each of the flex sensors
if (flexS1 < 485) flexS1 = 485;
else if (flexS1 > 645) flexS1 = 645;
if (flexS2 < 475) flexS2 = 475;
else if (flexS2 > 637) flexS2 = 637;
if (flexS3 < 450) flexS3 = 450;
else if (flexS3 > 655) flexS3 = 655;
if (flexS4 < 500) flexS4 = 500;
else if (flexS4 > 686) flexS4 = 686;

// Mapping all the sensor values down between 0-9. (0 = full bent, 9 = unbent)
int flex_1_0to100 = map(flexS1, 645, 485, 9, 0);
int flex_2_0to100 = map(flexS2, 637, 475, 9, 0);
int flex_3_0to100 = map(flexS3, 655, 450, 9, 0);
int flex_4_0to100 = map(flexS4, 686, 500, 9, 0);

// Converting all strings to a single char
str1=String(flex_1_0to100);
str1.toCharArray(s_str1,2);

str2=String(flex_2_0to100);
str2.toCharArray(s_str2,2);

str3=String(flex_3_0to100);
str3.toCharArray(s_str3,2);

str4=String(flex_4_0to100);
str4.toCharArray(s_str4,2);

if (command==’e’){
// Send all values to coordinator
XBee.write(“e”); // Indicates the start of the message (e=motors, s=robot arm)
XBee.write(s_str4); // Thumb
XBee.write(s_str2); // Index-finger
XBee.write(s_str3); // Middle-finger
XBee.write(s_str1); // Pinky
delay(50);
}
else if (command==’s’){
//Send all values to coordinator
XBee.write(“s”); // Indicates the start of the message (e=motors, s=robot arm)
XBee.write(s_str4); // Thumb
XBee.write(s_str2); // Index finger
XBee.write(s_str3); // Middle finger
XBee.write(s_str1); // Pinky
delay(50);
}
}

Source Code of the Output with Modifications

// Coordinator!
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3);
#include <Servo.h>
#define rightMotor1 8
#define rightMotor2 7
#define leftMotor1 9
#define leftMotor2 10
int claw_ang=0;
int tilt_ang=15;
Servo claw;
Servo tilt;

void setup()
{
claw.attach(5);
tilt.attach(6);
pinMode(rightMotor1, OUTPUT);
pinMode(rightMotor2, OUTPUT);
pinMode(leftMotor1, OUTPUT);
pinMode(leftMotor2, OUTPUT);
Serial.begin(9600);
XBee.begin(9600);
}

void loop()
{

if (XBee.available() >=5 ) {
char incomingByte1 = XBee.read();
char incomingByte2 = XBee.read();
char incomingByte3 = XBee.read();
char incomingByte4 = XBee.read();
char incomingByte5 = XBee.read();

if(incomingByte1==’e’){ // if the first byte is an ‘e’ then we going to control the motors
int val_1 = incomingByte2-‘0’;
int val_2 = incomingByte3-‘0’;
int val_3 = incomingByte4-‘0’;
int val_4 = incomingByte5-‘0′;

// For debugging
/* Serial.println(“Motor mode”);
Serial.println(val_1);
Serial.println(val_2);
Serial.println(val_3);
Serial.println(val_4);
Serial.println();
*/

//Drive forwards
if(val_1==0 && val_2==0 && val_3==0 && val_4==0 ){
digitalWrite(rightMotor1, LOW);
digitalWrite(rightMotor2, HIGH);
digitalWrite(leftMotor2, HIGH);
digitalWrite(leftMotor1, LOW);
}
//Drive backwards
else if(val_1==0 && val_2>0 && val_3>0 && val_4>0){
digitalWrite(rightMotor1, HIGH);
digitalWrite(rightMotor2, LOW);
digitalWrite(leftMotor2, LOW);
digitalWrite(leftMotor1, HIGH);
}
//Drive right
else if(val_1==0 && val_2>0 && val_3>0 && val_4==0){
digitalWrite(rightMotor1, LOW);
digitalWrite(rightMotor2, HIGH);
digitalWrite(leftMotor2, LOW);
digitalWrite(leftMotor1, LOW);
}
//Drive left
else if(val_1==0 && val_2>0 && val_3==0 && val_4==0){
digitalWrite(rightMotor1, LOW);
digitalWrite(rightMotor2, LOW);
digitalWrite(leftMotor2, HIGH);
digitalWrite(leftMotor1, LOW);
}

else if (val_1>0 && val_2>0 && val_3>0 && val_4>0){
digitalWrite(rightMotor1, LOW);
digitalWrite(rightMotor2, LOW);
digitalWrite(leftMotor2, LOW);
digitalWrite(leftMotor1, LOW);
}

}

else if (incomingByte1==’s’){ // if the first byte is ‘s’ then we will control the robot arm
int val_1 = incomingByte2-‘0’; // val_1 corresponds to the thumb
int val_2 = incomingByte3-‘0’; // val_2 corresponds to index finger
int val_3 = incomingByte4-‘0’; // val_3 corresponds to the middle finger
int val_4 = incomingByte5-‘0’; // val_4 corresponds to the pinky

//For debugging
/* Serial.println(“Robot arm mode”);
Serial.println(val_1);
Serial.println(val_2);
Serial.println(val_3);
Serial.println(val_4);
Serial.println();
*/

// Close claw
if(val_1==0 && val_2==0 && val_3==0 && val_4==0){
claw_ang-=5;
}
// Open claw
else if (val_1==0 && val_2>0 && val_3>0 && val_4>0){
claw_ang+=5;
}
// Tilt forward
else if (val_1==0 && val_2>0 && val_3>0 && val_4==0){
tilt_ang+=10;
}
//Tilt backward
else if (val_1==0 && val_2>0 && val_3==0 && val_4==0){
tilt_ang-=10;
}

if(claw_ang<0){
claw_ang=0;
}
if (claw_ang>145){
claw_ang=145;
}
if (tilt_ang<15){
tilt_ang=15;
}
if(tilt_ang>180){
tilt_ang=180;
}

// For debugging
/* Serial.println(“Claw angle:”);
Serial.println(claw_ang);
Serial.println();
Serial.println(“Tilt angle:”);
Serial.println(tilt_ang);
Serial.println();
*/

claw.write(claw_ang);
delay(10);
tilt.write(tilt_ang);
delay(10);

}

}
delay(10);
}

Schematics of Project Sourced from Robin Andersson

Images of My Final Milestone

Third Milestone

Video Of my Third Milestone

The third milestone of my project is the construction of two separate circuits that can communicate wirelessly using the Xbee module technology. The first circuit primarily revolves around the four flex sensors that are attached to the Arduino through a series of wires and resistors. On this circuit there is also a button that, when pushed, switches between the wireless control of the robot’s drive and the robot claw. The second circuit contains all four motors, two of which are 6V DC motors and the other two are servo motors as seen in milestone 2. The Arduinos present in both circuits have a Arduino Shield and XBee module mounted on top of it. These components are configured in a method that allows for a seamless transfer of information between both locations.

As I completed this milestone, I learned a couple of key concepts and crucial skills that enable to further enhance any given circuit. A major skill that I picked up was the ability to use the X-CTU software, which allows a computer to connect two separate modules wirelessly. It is able to do this by giving the developer the option to set the destination of one of the XBees as the serial address of the other and visa versa. Building on top of this skill, I also learned how to use Arduino shields, which bridge the gap between the Xbee and Arduino microcomputer. A useful concept that I picked up was the importance of soldering on headers when connecting two boards due to the fact that without solder both boards would have a very loose connection. This would cause the information to constantly disconnect and be resent ultimately causing the source code to never complete running.

In addition to the skills and concepts I got from completing this milestone, I learned a lot of lessons that I will carry with me as I work on similar tasks. One major lesson I learned that I should always carefully map the flow of current around my circuit. In my case when I first powered on the wirelessly connected system the motors were not turning much, and were moving in a path far more similar to twitching as opposed to rotating. I also learned that I should run simpler programs when trying to send information from one place to another, so that it is easier to pinpoint the error as one makes the program more and more complicated. Finally I learned that Flex Sensors are very delicate instruments and it is crucial to bend them in a very precise manner in order to avoid permanent alterations to the outputted values.

Overall this milestone is a very pivotal moment in the construction of my project because it marks the completion of all internal circuitry and leaves only the the external features remaining. As part of my next steps in this project I hope to decrease the degree to which it is fragile by making the base out of solid metal and using lock nuts that will not loosen over time. This will keep this created circuit enclosed properly and keep all connections stable even when the robot is continuously moving back and forth due to the hand-gesture controls.  

Images of My Third Milestone

Second Milestone

Video of My Second Milestone

My second milestone in the completion of this project was the construction of a single circuit that controls two 6 volt DC motors along with two servo motors. All these four motors follow commands that I programmed in the Arduino IDE software. The core of the circuit is the usage of two H-bridge microcontrollers to help connect the DC motors in an efficient manner to the Arduino microcomputer. Furthermore, both H-bridges provide many ports that the DC motors can utilize to get current and information from the software on how to rotate. More specifically, the H-bridge is logic based, in which it draws information from the digital ports on the Arduino. On the other hand, the servos present in this circuit are directly connected to the same digital ports on the Arduino and do not require and other form of control between itself and the Arduino.

As I completed this device, I learned many useful concepts that added to the knowledge I had already gained from previous steps. Most of these concepts I learned were found as I looked to use new, but more efficient parts in my project.  A major component I learned to use was the H-bridge, which allowed me to freely connect DC motors to the Arduino in an organized manner, whilst not compromising on the functions available. Additionally, I was able to experiment with Lithium-ion batteries and found that the higher density of energy they emitted was useful to improve the performance of motors. The last major component I explored was the voltage regulator which directly helped me decrease the load on parts that are not designed to take in as much voltage compared to others. A final concept I learned aside from the usage of components, was to always use a universal ground across the circuit, so that the value of comparison for voltage always remains constant throughout.

During the completion of this setup, I ran into several challenges that prevented the circuit from running as intended. When I was initially constructing the circuit I used only one H-bridge, which caused it to become extremely overheated and not transfer current through it efficiently. In order to counteract this effect I added another H-bridge, and had one motor on each H-bridge, to help decrease the amount of current flow. However, even after this the two DC motors were only slightly rotating, and so I had to introduce another way of increasing the amount of current flow. For this reason, I used a 7.4 Amp Lithium-ion battery to to increase the continuous discharge to 2.2 Amps as opposed to only 0.5 Amps directly from the Arduino. This problem solved  the issue of my 6V DC motors from turning, but drastically overheated the two servo motors found in my claw. So, I inserted a 5V voltage regulator to help bring down the voltage to 5 volts, making it far more ideal for the two servos.

I hope to add on to the functionality of this circuit by introducing wireless communication through the Xbee wireless module. Afterwards, I hope to have this Xbee communicate with a more advanced version of the flex sensor circuit present in Milestone 1. This will create a very smooth flow of information through an input-output system being present on two separate Arduino microcomputers.

Images of My Second Milestone

First Milestone

Video of My First Milestone

My first major milestone in the development of my main project was the construction of a servo claw that can be controlled through the movements of a flex sensor. More specifically, the circuit on the breadboard is connected to an Arduino microcontroller, which is in turn connected to an external power source. The circuit also uses a 22K Ohm resistor to control the amount current flow, so that sensitive parts including the flex sensor and Arduino do not get damaged through the flow electricity. After the current passes through the organized path of wires on the breadboard, it moves into two servo motors, which are also connected to the arduino through digital ports. These two servos are locked together through a gear ratio established on the claw, forcing it to move along the teeth of the gears.

The completion of this portion of the project directly taught me a lot of useful information about the technology involved. The first major component I extensively researched about were the flex sensors, which work by creating an increased resistance based upon the degree to which they are bent. A greater amount of bending to the flex sensor would cause a greater resistance to be imposed on the circuit, ultimately making the overall voltage also increase. In addition, I also explored the Arduino IDE and how programs can be written on it to create a customized set of controls being sent to the servos in this case. As part of this exploration I learned the standard set of functions present in the Arduino version of C. Afterwards, I wrote code in this language that essentially moved the claw in pre-programmed directions, like picking up and rotating and object. Another major aspect of this claw are the two servo motors that provide it with the ability to move. I researched for a fair bit of time about the limitations and at the same time versatility of servo motors, and found the vast number of ways they can be implemented into any given circuit. A major factor of a servo motor that I found useful was its capability to be very precise in the way that it executes commands.

In addition to the apprehension of many innovative technologies, I also learned many useful lessons that I hope to carry with me throughout the completion of related tasks in the project. One major lesson I learned was the extent to which many of the parts are fragile before they are all attached together in the final version of the project. For example in my first time construction of the claw, I was rushing to code the servos within the claw, and neglected the fact that the gears may not be properly aligned within the system. This along with my effort to release both hands of the claw from one another likely stripped the gears within the servos. This damage prevented motion from being present within the claw, and the code being sent to it was largely being unrecognized. Also, I found that the implementation of software in any given portion greatly enhance the efficiency of the project, and increase the degree to which it can function.

From this point of the project I hope to drastically improve the usability of the claw in many different ways. First, I hope write far more code that will make the actions of the claw more customizable and smooth in the way that it picks up objects. Next, I hope to add the three remaining flex sensors and have it perform far more varied sets of actions based upon the combination the flex sensors are pressed down. Overall, I hope to build upon innovative technology I first began to examine in this claw.

Images of My First Milestone

Bill of Materials for Main Project: https://docs.google.com/spreadsheets/d/1caQI5EG57MJcWrbqwo5S0r83I-JMAdsNsLVaeRR13fI/edit#gid=0

Starter Project

For my starter project, I made the TV-B-Gone gadget. The purpose of this device is to turn off almost all TVs with one simple yet efficient button press. In addition, the device has a fool-proof way of making sure users know whether the circuit on the device is properly connected, by showing a constant flashing indicator light. Overall, the TV-Be-Gone is a tool created with the consumer in mind because it allows all who wish to turn off TVs a simple method to do so.

Before I began assembling the circuit I researched all parts that were involved. The first major part I learned about was the resistor, which regulates the flow of charge so that the correct amount is being passed to other elements like the LEDs. Next, I explored the functionality of transistors, which worked as a switch to turn the IR LEDs on and off with the press of the button. Also, I researched the function of a capacitor, which holds charge at a certain location within the circuit. Another major part I researched was the micro-controller which acts as a mini computer enable the assigned tasks. Finally, I looked into electronic oscillators, which converted the direct current from the power supply into alternating current.

The device turns off TVs by emitting infrared light, similar to that of a standard remote control, from two 2 narrow beam and 2 wide beam Infrared LEDs. In order for these LEDs to properly function many other parts had to be added to the circuit. The current flow starts from the battery, moves into the button, and then flows through a resistor before it reaches the green indicator light bulb. Afterwards, it flows into an electrolytic capacitor and ceramic capacitor before entering the electronic oscillator. Finally the circuit is completed by the current leaving through a micro-controller, into transistors, before it reaches the IR LEDs.

Through the completion of my starter project, I learned many different useful skills. The first of these being the learning of how to solder, which permitted me to efficiently attach all wire connections to the PCB board. Also I learned how to follow a detailed list of steps in order to complete a project in a both accurate and efficient manner. A part of this learning process a major challenge I faced at the end of project. I had soldered all parts onto the PCB and connected the batteries, but was not receiving any sort of response from the indicator LED. After spending a lengthy amount of time testing connections with an electronic multimeter, I realized I had not inserted a micro controller into a 8-pin socket, which had caused the series circuit to not be completed.

Despite these challenges, this project made me realize that many interesting ideas can come to fruition through the very organized yet innovative process that is engineering. I am excited to take this knowledge gained into my main project and future endeavors in this exciting field.

Turning Off a TV

Images of the TV-B-Gone

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering