You are on page 1of 22

1 | P a g e

PROJECT OUTLINE
The main objective is to control the motion of a robot using wrist
movements. If we move our arm towards right, then the robot would move towards
right, if we move our wrist towards left, then the robot would move left, the same
case in moving front or backwards.
This is done by using an accelerometer. The device consists of a surface
micro machined capacitive sensing cell (g-cell) and a signal conditioning ASIC
contained in a single package. The sensing element is sealed hermetically at the
wafer level using a bulk micro machined cap wafer. An accelerometer has fixed and
movable capacitances in it. When shifted from its initial position, the movable
capacitances are displaced which lead to a change in the value of the capacitance.
The value of the robot velocity changes in accordance with this changed
capacitance as we move the accelerometer attached to a glove on our hand.

An Ultrasonic sensor is used for proximity detection. If there is any obstacle
within 30cm of the robots path, then the motors would stop, halting all movement.
A vibrator attached to the users glove would vibrate in this case, thereby telling the
user to move backwards.
DC motors are used to move the wheels of the robot. A DC motor is a
mechanically commutated electric motor powered from direct current (DC). The
stator is stationary in space by definition and therefore so is its current. The current
in the rotor is switched by the commutator to also be stationary in space. This is
how the relative angle between the stator and rotor magnetic flux is maintained
near 90 degrees, which generates the maximum torque.
A wired camera is placed on top of the robot which sends live footage back to
the laptop.
Arduino is used to run the whole project. Arduino is a single-board
microcontroller designed to make the process of using electronics
in multidisciplinary projects more accessible. The hardware consists of a
simple open source hardware board designed around an 8-
bit Atmel AVR microcontroller, though a new model has been designed around a
32-bit Atmel ARM. The software consists of a standard programming language
compiler and a boot loader that executes on the microcontroller.
It is also note worthy that we use an external chip (motor driver) to
drive the DC motors because an arduino board can only supply voltage up to
5V while the dc motors used in the robot work at 12 V.

2 | P a g e


COMPONENTS REQUIRED

1 Arduino board
1 Ultrasonic Sensor
1 serial USB cable
1 mobile vibrator
1 accelerometer
Chassis
1 adapter
2 DC motors
Connecting wires
1 caster wheel

DESCRIPTION OF COMPONENTS USED
ARDUINO BOARD
Arduino is an open-source electronics prototyping platform based on
flexible, easy-to-use hardware and software. Arduino can sense the
environment by receiving input from a variety of sensors and can affect its
surroundings by controlling lights, motors, and other actuators. The
microcontroller on the board is programmed using the Arduino programming
language (based on Wiring) and the Arduino development environment
(based on Processing). It has an ATmega AT168 microcontroller that has a
pre-installed bootloader, so one can download code to the board using only a
USB-serial connection. Arduino projects can be stand-alone or they can
communicate with software running on a computer.
3 | P a g e














Figure 2(Arduino Board)


Figure 3(Arduino Board)


4 | P a g e

1. USB Jack
2. Power Jack
3. Voltage Regulator
4. Digital Input Pins
5. Analog Input Pins
6. Power Pins
7. Reset Button
USB CABLE
The Arduino Duemilanove connects to a host PC with a simple USB
cable. The Duemilanove comes with an FTDI USB-serial converter chip, so
the device mounts as a "virtual COM" port from the perspective of the host
PC.
Figure 4 (USB cable)
MOTORDRIVER BOARD(L293D)
The bot runs on two dc motors these DC motors work on a 12 Volt DC
supply. The problem here is evident. The Arduino Board has an output signal
of 5V. So to run the motors a Motor Driver Board is used. This board uses
the IC L293D.The board is powered by a 12V Adapter which is plugged into
an electrical output. Using this board the input to the motors is controlled
through inputs from the arduino which itself is being powered by the Motor
Driver,by Monitoring the potential difference between the two terminals if
the motor the board also enable us to vary the speed of the motors and
hence the bot.
Therefore the motor Driver is used to operate the motors using an
arduino without connecting the two, and simultaneously allows us to control
their speeds.

5 | P a g e

ULTRASONIC DISTANCE SENSOR

Figure 5 (Working of Ultrasonic Sensor)


Figure 7 (Ultrasonic Sensor)


Figure 8 (Connections of Ultrasonic Sensor to Arduino)
6 | P a g e

An Ultrasonic sensor has two transducers: an ultrasonic speaker and a
matching microphone. When triggered by a digital signal, the speaker emits
a modulated burst (or "ping") of ultrasonic sound. This sound then travels
through the air; if it hits a nearby object, it is reflected back to the
microphone. The microphone has a circuit to amplify and detect the reflected
ping, and the device signals a digital "true" if it receives the reflected sound.
By measuring the interval between the transmitted pulse and the
received signal, the Arduino can determine distance to the object, by using a
simple formula based on the speed of sound (approximately, one foot or 30
cm per millisecond).

MOBILE VIBRATORS



Figure 10 (Mobile Vibrator)

7 | P a g e


Figure 11 (Connections of a buzzer/vibrator with Arduino)

A mobile vibrator is a device used to generate vibrations, generally of
high frequency such that the user is able to perceive them. Its connections
to the arduino are identical to that of the buzzer, that is, a vibrator is also
attached to a digital pin of the arduino.

ACCELEROMETER
We are using the pololu 0J2300 which is a capacitive type low current
accelerometer.
A capacitive accelerometer uses a sensing mechanism, known as a
capacitive acceleration sensor, to measure both static acceleration and
dynamic acceleration forces. With consideration to all accelerometers, there
typically is some sort of electrical circuitry wired to the sensing mechanism
in order to portray the output, or voltage, of its measurements.

Static acceleration force is generated by a gravitational pull. When
measuring static acceleration with a capacitive accelerometer, the
measurements would portray the angle of tilt at which the device is being
held or suspended in relation to the Earth's gravitational pull. A common
capability of many modern cell phones, smart phones and personal digital
8 | P a g e

assistants (PDAs) is that
the orientation of the
screen changes in
relation to the angle at
which the device is
being held.

Dynamic
acceleration force is generated by vibrations from movement. Measuring
vibrations allows a capacitive accelerometer to determine in which direction
the device is moving and at what speed. Additionally, dynamic acceleration
can be measured to track the impact that an object encounters.












9 | P a g e


10 | P a g e

ARDUINO CODE


#include<math.h>

const int ping = 12;
int vib=13;
//int buzz=2;


int lp=4;
int ln=5;
int rp=8;
int rn=9;
int speedl=255;
int speedr=255;
int sensex=A0;
int sensey=A1;
int debug =1;
int handle;
int c=0;
double theetax,theetay;
const double precision = 255;
double meanx,meany;
void setup(){
11 | P a g e

Serial.begin(9600);
handle=Serial.read();
pinMode(lp,OUTPUT);
pinMode(ln,OUTPUT);
pinMode(rp,OUTPUT);
pinMode(rn,OUTPUT);

pinMode(vib,OUTPUT);
// pinMode(buzz,OUTPUT);
Serial.begin(9600);

calib();
}
void loop(){

if(handle !=1)
{
int valx = analogRead(sensex);
int valy = analogRead(sensey);
speedl = theetax*(meanx - valx);
speedr = theetay*(meany - valy);
Serial.print(meanx);
Serial.print(" ");
Serial.print(meany);
Serial.print(" ");
12 | P a g e

Serial.print(valx);
Serial.print(" ");
Serial.println(valy);
if(valx<meanx-10){
if(valy>meany+50){
speedl=speedl*(-10);
verify();
left();
}
else if(valy<meany-50){
speedr=speedr*(-10);
verify();
right();
}

else
{
verify();
forward();

}
}
if(valx>meanx+20){
if(valy>meany+50){
speedl=speedl*(-10);
13 | P a g e

verify();
left();
// right();
}
else if(valy<meany-50){
speedr=speedr*(-10);
verify();
right();
// left();
}

else
{
verify();
back();

}
}


//delay(100);
}
else{
c=Serial.read();
if(c =='f')
14 | P a g e

forward();
if(c == 'b')
back();
if(c == 'l')
left();
if(c == 'r')
right();
}

long duration, cm;

// The PING))) is triggered by a HIGH pulse of 2 or more
microseconds.
// Give a short LOW pulse beforehand to ensure a clean HIGH
pulse:
pinMode(ping, OUTPUT);
digitalWrite(ping, LOW);
delayMicroseconds(2);
digitalWrite(ping, HIGH);
delayMicroseconds(5);
digitalWrite(ping, LOW);
pinMode(ping, INPUT);
duration = pulseIn(ping, HIGH);

// convert the time into a distance
cm = microsecondsToCentimeters(duration);
15 | P a g e



if(cm<30)
{
digitalWrite(vib,HIGH);
// digitalWrite(buzz,HIGH);
stop();

}

else
{
digitalWrite(vib,LOW);
// digitalWrite(buzz,LOW);

}

}

long microsecondsToCentimeters(long microseconds)
{
// The speed of sound is 340 m/s or 29 microseconds per
centimeter.
// The ping travels out and back, so to find the distance of
the
// object we take half of the distance travelled.
16 | P a g e

return microseconds / 29 / 2;
}


void verify(){
if(speedl<0)
speedl=0;
if(speedr<0)
speedr=0;
if(speedr>255)
speedr=255;
if(speedl>255)
speedl=255;
}
void calib(){
int i=0;
int valx,valy,minx=1023,miny=1023,maxx=0,maxy=0;
while(i<1000){
valx=analogRead(sensex);
valy=analogRead(sensey);
maxx=fmax(maxx,valx);
maxy=fmax(maxy,valy);
minx=fmin(minx,valx);
miny=fmin(miny,valy);
i++;
17 | P a g e

delay(10);
}
theetax = (maxx-minx)/precision;
theetay = (maxy-miny)/precision;
meanx = 0.5*(maxx + minx);
meany = 0.5*(maxy + miny);
if(debug == 1){
Serial.print(maxx);
Serial.print(" ");
Serial.println(maxy);
Serial.print(" ");
Serial.print(minx);
Serial.print(" ");
Serial.println(miny);
Serial.print(" ");
Serial.print(theetax);
Serial.print(" ");
Serial.println(theetay);
Serial.print(meanx);
Serial.print(" ");
Serial.println(meany);
}

}
void back(){
18 | P a g e

digitalWrite(lp,LOW);
analogWrite(ln,(255));
digitalWrite(rp,LOW);
analogWrite(rn,(255));
}
void forward(){
digitalWrite(lp,HIGH);
analogWrite(ln,0);
digitalWrite(rp,HIGH);
analogWrite(rn,0);
}
void right(){
digitalWrite(lp,LOW);
analogWrite(ln,255);
digitalWrite(rp,HIGH);
analogWrite(rn,0);
}
void left(){
digitalWrite(lp,HIGH);
analogWrite(ln,0);
digitalWrite(rp,LOW);
analogWrite(rn,255);
}
void stop(){
digitalWrite(lp,LOW);
19 | P a g e

analogWrite(ln,0);
digitalWrite(rp,LOW);
analogWrite(rn,0);
}






20 | P a g e

RESULT

The walking stick is equipped with 4 ultrasonic sensors to tell the user
if there are any obstructions on his right, left, front or if there is a potholes
or stair in front. It was observed that 1 Arduino board drawing power
through the USB cable from a laptop is not enough to power 4 ultrasonic
sensors, 2 buzzers and 2 mobile vibrators. An adaptor should be used in
such a case to power the arduino board. Due to unavailability of an adapter
at the present moment 2 Arduino boards have been used to power the cane
properly.
The water sensor made using IC NE555 is working successfully.



APPLICATIONS

This walking stick can bring a new lease of life for blind and old people.
It is a means of independence for them. It will prove to be a useful tool to
millions of blind people in navigating their environment with confidence and
safety. It will allow then to travel where and when they want, and as such
leads to self sufficiency. Independence and freedom to travel are so
important to the quality of life of blind people that every blind person should
have this cane.




21 | P a g e


PRECAUTIONS

1. Connections should be tight.
2. Make sure that all the components are getting the required amount of
voltage so that they function properly.
3. The ultrasonic sensors must face the obstructions head on and not at an
angle or they would not give correct values of distance.


LEARNING OUTCOME

I learnt how to use the Arduino board and program sensors, buzzers
and vibrators using it. I also learnt the mechanism as to how the ultrasonic
sensor works.
It was also observed that 1 arduino board cannot power multiple
ultrasonic sensors as one ultrasonic sensor requires 15mA when active, and
Arduino can supply a maximum of 40mA current through each pin and a
total of 200mA through all pins. Even then the sensor shows the correct
value of distance in the serial monitor, but could not power the buzzer or
vibrator properly, defeating the purpose for which it is being used.
It was learnt how to make a simple water sensor using household
components.





22 | P a g e

BIBLIOGRAPHY


1. Getting Started with Arduino by Massimo Banzi

2. Introduction to Arduino by Alan G. Smith

3. www.arduino.com

4. www.google.com

5. www.wikipedia.org