Você está na página 1de 30

Project Name

Wall-E Robot Using Arduino

Wall-E Robot Using Arduino UNO

OBJECTIVE: To make a Wall-E look-alike robot using Arduino


which can perform several actions like following your finger
using voice recognition.
Components you need for this project are:

1) Infrared Proximity Sensor

2) Servomotor

3) Continuous Rotation Servomotor

4) Connecting Wires

5) VR Module

6) LED’S

7) Arduino’s Uno

8) Battery

YASHWEEN NIXON 1
1. Learn about Infrared Proximity Sensor !

A proximity sensor is a Sensor able to detect the presence of


nearby objects without any physical contact.
A proximity sensor often emits an electromagnetic field or a
beam of electromagnetic radiation (infrared, for instance), and
looks for changes in the field or return signal. The object being
sensed is often referred to as the proximity sensor's target.
Different proximity sensor targets demand different sensors. For
example, a capacitive proximity sensor or photoelectric
sensor might be suitable for a plastic target; an inductive
proximity sensor always requires a metal target . Proximity
sensors can have a high reliability and long functional life
because of the absence of mechanical parts and lack of physical
contact between the sensor and the sensed object.
Proximity sensors are also used in machine vibration monitoring
to measure the variation in distance between a shaft and its
support bearing. This is common in large
steam turbines,compressors and motors that use sleeve-
type bearings.
International electrotechnical comission (IEC) 60947-5-2 defines
the technical details of proximity sensors.
A proximity sensor adjusted to a very short range is often used as
a touch switch.

2. Servomotor
+
A servomotor is a rotary actuator or linear actuator that allows
for precise control of angular or linear position, velocity and
acceleration.[1] It consists of a suitable motor coupled to a sensor
for position feedback. It also requires a relatively sophisticated
controller, often a dedicated module designed specifically for use
with servomotors.

YASHWEEN NIXON 2
Servomotors are not a specific class of motor although the
term servomotor is often used to refer to a motor suitable for use
in a closed-loop control system.
Servomotors are used in applications such as robotics, CNC
machinery or automated manufacturing.

3. Continuous Rotation Servomotor

The first continuous rotation servos were simply hacked RC


servos. Enterprising hobbyists removed the physical hard-
stops and hard-wired the controller feedback to think it was
always at the middle position. Since the controllers are
'proportional', the motor speed and direction is proportional to
the difference between the command position and the
measured position. This simple hack results in a miniature
self-contained reversible, speed controlled gear-motor!

This modification became so popular, that manufacturers


recognized the demand and started offering them too. Since
they are based on the ubiquitous RC Servo motor case, the
name "Continuous Rotation Servo" stuck.

Continuous rotation servos are handy wherever you need a


compact DC gearmotor with a built-in H-Bridge driver. Like their
RC (true) Servo brethren, the continuous rotation servos are
simple to control. Since they have a built-in H-bridge controller,
you just need to supply them with power and a pulsed signal. The
pulses are easily generated from most any microcontroller GPIO
pin.
Continuous rotation servos can be found in countless small robot
chassis, such as the BoeBot.

4. VR Module

YASHWEEN NIXON 3
This Voice Recognition Module is a compact and easy-control
speaking recognition board.This product is a speaker-dependent
voice recognition module. It supports up to 80 voice commands in
all.Max 7 voice commands could work at the same time. Any sound
could be trained as command. Users need to train the module first
before let it recognizing any voice command. This board has 2
controlling ways: Serial Port (full function), General Input Pins
(part of function). General Output Pins on the board could
generate several kinds of waves while corresponding voice
command was recognized.

Parameters

 Voltage: 4.5-5.5V
 Current: <40mA
 Digital Interface: 5V TTL level UART interface
 Analog Interface: 3.5mm mono-channel microphone connector
+ microphone pin interface
 Size: 30mm x 47.5mm

5. LEDS’

A light-emitting diode (LED) is a semiconductor light source that


emits light when current flows through it.Electrons in the
semiconductor recombine with electron holes, releasing energy in the
form of photons. This effect is called electroluminescence . The color
of the light (corresponding to the energy of the photons) is determined
by the energy required for electrons to cross the band gap of the
semiconductor. White light is obtained by using multiple
semiconductors or a layer of light-emitting phosphor on the
semiconductor device.
Appearing as practical electronic components in 1962, the earliest LEDs
emitted low-intensity infrared light. Infrared LEDs are used in remote-
control circuits, such as those used with a wide variety of consumer
electronics. The first visible-light LEDs were of low intensity and
limited to red. Modern LEDs are available across the visible,
ultraviolet and wavelengths, with high light output.

YASHWEEN NIXON 4
Early LEDs were often used as indicator lamps, replacing small
incandescent bulbs, and in . Recent developments have produced
white-light LEDs suitable for room lighting. LEDs have led to new
displays and sensors, while their high switching rates are useful in
advanced communications technology.
LEDs have many advantages over incandescent light sources, including
lower energy consumption, longer lifetime, improved physical
robustness, smaller size, and faster switching. Light-emitting diodes
are used in applications as diverse as aviation lighting, automotive
headlamps, advertising, general lighting, traffic signals , camera
flashes, lighted wallpaper and medical devices.[9]
Unlike a laser , the color of light emitted from an LED is neither
coherent nor monochromatic, but the spectrum is narrow with respect
to human vision, and functionally monochromatic.

3. Arduino Uno

The Arduino UNO is an open-source microcontroller board based on


the Microchip ATmega328P microcontroller and developed
by Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion
boards (shields) and other circuits. The board has 14 Digital pins, 6
Analog pins, and programmable with the Arduino Uno (Integrated
Development Environment) via a type B USB cable. It can be powered
by a USB cable or by an external 9 volt battery, though it accepts
voltages between 7 and 20 volts. It is also similar to the Arduino Nano
and Leonardo. The hardware reference design is distributed under
a creative commons Attribution Share-Alike 2.5 license and is
available on the Arduino website. Layout and production files for some
versions of the hardware are also available. "Uno" means one in
Italian and was chosen to mark the release of Arduino Software (IDE)
1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the
reference versions of Arduino, now evolved to newer releases. The
Uno board is the first in a series of USB Arduino boards, and the
reference model for the Arduino platform. The ATmega328 on the
Arduino Uno comes preprogrammed with a bootloader that allows
uploading new code to it without the use of an external hardware
programmer. It communicates using the original STK500 protocol. The
Uno also differs from all preceding boards in that it does not use the
FTDI USB-to-serial driver chip. Instead, it uses the Atmega16U2

YASHWEEN NIXON 5
(Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.

Learn How To Make The Wall-E


WALL-E is a famous Disney character from WALL-E, the
animated film. WALL-E, short for Waste Allocation Load Lifter
Earth-class, is the last robot left on Earth. The Pixels team tried
to make a real life-sized, fully functional WALL-E with minimum
costs.

We are able to wirelessly control WALL-E's leg, hand, arms and


head movements. We used voice commands, as well. So we could
say that WALL-E is fully functional. This is our first prototype, so
enjoy our progress and build yours.

WALL-E is a robot, so it consists of two essential parts:

 Mechanical: The mechanical part includes the structure or the


skeleton that allow for movement. Though, it will not be able to
move anything without the control part.

 Control: This is the brain or the nervous system which gives the
power or the energy to move the body structure.

Body

BODY diagram

YASHWEEN NIXON 6
It is shaped like a cube. We made it from aluminum bars and
connected through pins. Note: We used aluminum bars because it
is easier to shape than steel; although the steel is harder, inside
WALL-E, aluminum bars will be lighter on the motors and this
make movement easier. For covering, we used foam board,
printed the design of the body, and then stuck the design into the
foam board.

Head

3D design of the eye

1) Materials:

There are many materials you can use in making the head. We
are going to mention them and the advantages and disadvantages
for each.

 Acrylic: Advantages: very hard, not affected by corrosives or


climate factors, and light in weight. Disadvantages: very
expensive.

 Compressed wood (MDF) Advantages: lower in cost than


acrylic, light in weight. Disadvantages: absorbs moisture from
the air and liquid, therefore that will affect it in two ways.
First, it will develop a very dank smell. Second, it will expand
and breakdown after a while, so this material is not practical
for the head.

YASHWEEN NIXON 7
 Compressed foam board Advantages: very cheap compared to
acrylic and MDF, very light, you can easily shape
it. Disadvantages: It can be eroded by any spray.

2) Design:

If we designed the head as a solid part, it would be very heavy


and this will increase the torque of the head. Therefore, we need
a motor with high torque. And to make the head a solid part, we
had two options: first by a molten cast model (this would be very
expensive and time-consuming), and second by 3D printing
(which also would be very expensive).

To resolve this problem, we made the head from compressed


foam board lamination and glued the lamination together to
make them one part. This method was very exhausting as you
need to glue the lamination by hand. But it is very cheap in
comparison with the two other methods and it will be lighter
than the other two.

We designed the head on SOLIDWORKS and then cut the


compressed foam board via laser cutter machine so it would be
easy and fast. The head consisted of two front parts and two back
parts. We connected them by making small holes in every part
and connected them through with a wooden rod.

We used two servo motors to move the head: one for left and
right, and the other for up and down.

3) The final view:

YASHWEEN NIXON 8
HEAD FINAL VIEW

As previously mentioned about the compressed foam board


disadvantages, it can be eroded by any spray. Therefore, we had
to cover it with paper maché to protect the foam board from
eroding and then painted it with gray spray paint.

Neck

YASHWEEN NIXON 9
the final view of the nick

1) Material:

Acrylic: we used it because we needed material that can handle


the head weight and will not breakdown.

2) Design:

We designed the neck on SOLIDWORK and then cut the acrylic


with a laser cutter. The design is that of a cylindrical-like part
similar to the human neck. We assemble the neck parts and
assemble the neck with the head by using a hot glue gun.

Movement mechanism (Legs)

1
YASHWEEN NIXON
0
Final view

Consists of (materials & components):

 Motors

 Free wheels (pulleys)

 Rubber belt

 Rubber covers

 Aluminium body

1
YASHWEEN NIXON
1
worm gear motor

Steps for assembling the leg parts:

1. Make the structure of the legs with aluminum bars. Connect


three bars: two horizontal and parallel, and the third bar is
vertical between them. It should make a shape like a capital
letter i.

 The horizontal axis: You have to allow one side of the bar to
open to fix motors and make holes in the other side to fix the
free wheels (pulleys).

 The vertical axis: It is the connecting bar between the inclined


and the horizontal bar.

 The inclined axis: You need to make four holes to fix the free
wheels.

2. We used a right angle hollow shaft motor to rotate the wheels


in all directions (forward, reverse, right and left).

3. The wheels are made of artelon material. There are two


different sizes. The larger ones are driven by the motors and the
smaller ones rotate freely.

1
YASHWEEN NIXON
2
4. Put the rubber cover around the wheels to increase the friction
between the wheels and the belt. This will also increase the
friction between the belt and the ground.

5. Put the belt around the wheels.

after connecting

6. Connect two legs together by connecting aluminum bars


between them. These bars act as a suspension system for the
body of WALL-E. And finally, paint the legs with black spray
paint.

1
YASHWEEN NIXON
3
the mechanism

Hand mechanism

We made the structure of the arms by connecting two aluminum


bars. In this part of WALL-E, there are two kinds of motions:
linear and circular.

1
YASHWEEN NIXON
4
hand bar

 Linear motion: In this motion, we can move forward and


backward. You can make this movement by using a drive screw
with DC motor.

 Circular motion: We used it to move WALL-E's arm in a


rounded motion similar to our arms.

linear movement

There are many kinds of motors such as Servo, Stepper, and DC.

 Firstly, we used servo motors with high torque, but it made it


such that the gear box could not stand. There was high stress if
anyone wanted to move the arms when the power is off.

 Therefore, we thought to use stepper motors, but it was very


large with the required torque.

 Finally, we decided to use DC motors and see if it works or not!!

DC motors worked very well as the speed was reduced because


the torque was very high.

We faced some problems:

 Vibration from drive screw. We overcame it by putting a


bearing in the end of the screw to hold it and reduce vibrations.

1
YASHWEEN NIXON
5
 Connection between nut power screw and the arm. We
overcame this by adding a cylindrical part and weld in it the nut
of the power screw on one side, and in the other side, we put
the motor inside it to allow the motor rotation.

Control Parts
Here we go.

 batteries

 Arduino

 1 Shield

 wires

 motors

Of course, we need motor drivers or relays to control the motors'


directions. We used relay modules as the motor drivers cannot
stand the current of our motors.

1
YASHWEEN NIXON
6
too many things in wall-e :D

1shield app

In WALL-E, we used DC motors as we mentioned in the


mechanical part. For controlling Arduino, there were too many
options like using a Bluetooth or WiFi module, or USB or wireless
gamepad.

1
YASHWEEN NIXON
7
motors controlling circuit

 As mentioned, we used 1Shield. It connects with a phone by


Bluetooth and it has many functions or shields inside it. You can
see all its’ features from the 1shield site. We are going to use
Gamepad Shield. It is like a joy stick or Bluetooth module
Android app and you can see more about it from GamePad
Shield. As well, we used Voice Recognition Shield from 1 Shield;
you can also read more about it from Voice Recognition Shield.

HAND

circuit

Wall-E's hands are much like human hands and its movement
will be up and down. We could have used servo motors for this
but there was a problem. The torque on the axes of the motors
was very big. Therefore, there were three options:

 Use a servo motor with the proper torque but it will be


expensive.

 Use a stepper motor but it will be expensive too.

1
YASHWEEN NIXON
8
 Use a DC motor.

We tried the DC motor and it was so perfect; it can stand the


torque. Its rpmwas fine, not too fast, and its cost is acceptable.

And so, we used relays to control the motors as we mentioned in


the movements. But we used a Bluetooth module to control the
arms.

bluetooth rc controller app

After connecting the circuit, you just need to download the app
on your smart phone and start controlling the arms.

1
YASHWEEN NIXON
9
circuit diagram

We did not use the 1Shield to control the arms as there were not
enough buttons on the gamepad. Therefore, we had to make the
hand controls separate from the movement.

Voice
There are many techniques you can use to talk to WALL-E and
making WALL-E reply to you.

You can put a microphone inside the body to talk with Wall-E,
but does not work well because the surrounding environment
must be very quiet for receiving the voices and you should be but
so close to it. That was not working so, we tried to find another
way to solve this issue. We decided to use the phone microphone
and connect it with the Bluetooth module to the Arduino.

There was a voice recognizer shield and a voice shield. The first
one is used to understand the voices and the other is used for
replying. But that was not effective for many reasons; the most
important reasons were that the voice shield had limited voices
to save in it and we will need to connect two shields with the
Arduino, which would be a waste of power.

Therefore, we search for a shield compile between them.

2
YASHWEEN NIXON
0
There was a shield that enabled us to use all sensors in the phone
including a voice recognizer. Its called 1Shield and we mentioned
it in movement section so you can back to it. That was an easier
way. To make WALL-E reply to you, you will need an SD card
module to play the sounds you want. The advantages are you can
play any number of sounds you like and you can make your own
voices. If you connect the SD module directly to the speaker, its
voice will be very low so we searched for a solution.

SD card module

We tried many circuits. Here we mention them:

 The first circuit uses a transistor and bunch of capacitors and


resistors. It did not amplify the output very much so we had to
search for another solution.

2
YASHWEEN NIXON
1
 The second circuit uses an op amp LM386, but there was noise
in the output voice too.

So we decided to use a stereo speaker.

There are some issues in the voice signal itself. You must change
its frequency and the amplitude to a proper number in order to
remove the noise and to make the volume is higher. You can use
this site to change the frequency and the amplitude
(http://audio.onlineconvert.com/convert-to-wav).

If you are going to buy speakers, the smaller your ohms, the
clearer the output voice will be.

2
YASHWEEN NIXON
2
Heart Sensor

pulse circuit

Simply clip the Pulse Sensor to your earlobe or finger tip and
plug it into your 3 or 5 Volt Arduino, and you are ready to read
heart rate! The 24" cable on the Pulse Sensor ends with standard
male headers so there is no soldering needed.

Our goal is to find successive moments of instantaneous heart


beat and measure the time between. The main theory is that
when the heart pumps blood through the body, with every beat
there is a pulse wave (kind of like a shock wave) that travels
along all arteries to the very extremities of capillary tissue
where the Pulse Sensor is attached.

2
YASHWEEN NIXON
3
Pulse Sensor Amped responds to relative changes in light
intensity. If the amount of light incident on the sensor remains
constant, the signal value will remain at (or close to) 512
(midpoint of ADC range). More light and the signal goes up. Less
light, the opposite. Light from the green LED that is reflected to
the sensor changes during each pulse.

For this you need a LCD to show the sensor readings. All you
need to do is attach the Arduino to the LCD and make them
appear on LCD screen.

Finishing
We took the dimensions of WALL-E's body and printed the design
of WALL-E on paper. Then we put on foam and fixed it to WALL-
E’s body by using double-sided tape.

 The front is one part.

 The back are three parts.

 The two sides each side two parts.

 The other parts: the arms and the legs.

We used spray paints with Black, Yellow and Silver colors.

2
YASHWEEN NIXON
4
Custom parts and enclosures
Mechanical components
estimated prices in EGP

Schematics
1shield and motors
a simple diagram on how to control motors using 1shield

2
YASHWEEN NIXON
5
bluetooth and motors
in this diagram showing the circuit of hc05 bluetooth module and motors
connection

SD card and wall-e sound


using sd card to play wav audio files of wall-e

Code

 Legs

 Hand

 Heart sensor code

2
YASHWEEN NIXON
6
Legs
Arduino

this code is for legs part and voice recognition


/*this code for Wall-E movements(legs)and talking with Wall-E.
* 1Shield is our main controller with Arduino in our project, therfore there is a
prif about it:
* 1Shield is multi sheelds, you can connect it with your phone throw bluetooth
and then you can access all your mobile sensors.
All you need the shield, library for programming and you can download it from
thier website(http://1sheeld.com/) and the phone app you can download it from the
play store.
If you opened the 1Shield app on your phone, you'll see the shields that you
can use.
We are going to mention some of the shield we uesd.

movements:
we used gamepad shield from 1shield shields for movements control, it's like
joy-stick except that it is on your phone.

Talking with Wall-E:


For talking with Wall-E there is two things, first how could Wall-E hear and
understand our voices and how he would reply on us!!
We used voice recognizer shield from 1Shield shields, we are going to explain
how did we use it in the code.
For replying, we used SD module for plying spicific voices that Wall-E was
saying in the movie.

Created on 22/02/2017
by Makers team in pixels.
*/

//first you need to include 1Shield library and define the shields you are going
to use, you can know more about this from 1shield examples.
#define CUSTOM_SETTINGS
#define INCLUDE_GAMEPAD_SHIELD
#define INCLUDE_VOICE_RECOGNIZER_SHIELD
#define INCLUDE_TERMINAL_SHIELD
#include <OneSheeld.h>

//include SD library and music library.


#include <SPI.h>
#include <SD.h>
#include <TMRpcm.h>

/*for voice recognizer shield you need to define the word or the sentence that you
want Wall-E to understand it.*/
//wall-e sentence (you can put any sentence or word you want).
const char NameOne[] = "name";
const char NameTwo[] = "what's your name";
const char NameThree[]= "tell me your name";

//eva sentence.
const char EvaOne[] = "what's her name";
const char EvaTwo[] = "eva";
const char EvaThree[] = "do you have a friend";

2
YASHWEEN NIXON
7
//song sentence.
const char SongCommand[] = "song";

/* The circuit for SD Module:


* SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
Pin 4 or 3 used here for consistency with other Arduino examples*/
const int chipSelect = 3;

//define the music pin.


TMRpcm tmrpcm;

//define the Relays pin on Arduino.


#define MOTOR1_RELAY1 4
#define MOTOR1_RELAY2 5
#define MOTOR2_RELAY1 6
#define MOTOR2_RELAY2 7

//movement function.

//Stop moving.
void Stop() {
digitalWrite( MOTOR1_RELAY1, HIGH);
digitalWrite( MOTOR1_RELAY2, HIGH);
digitalWrite( MOTOR2_RELAY1, HIGH);
digitalWrite( MOTOR2_RELAY2, HIGH);}

// Move forward.
void forward () {
digitalWrite( MOTOR1_RELAY1, HIGH);
digitalWrite( MOTOR1_RELAY2, LOW);
digitalWrite( MOTOR2_RELAY1, HIGH);
digitalWrite( MOTOR2_RELAY2, LOW);}

//Move backward.
void backward() {
digitalWrite( MOTOR1_RELAY1, LOW);
digitalWrite( MOTOR1_RELAY2, HIGH);
digitalWrite( MOTOR2_RELAY1, LOW);
digitalWrite( MOTOR2_RELAY2, HIGH);}

//Move right.
void moveRight() {
digitalWrite( MOTOR1_RELAY1,HIGH);
digitalWrite( MOTOR1_RELAY2,LOW);
digitalWrite( MOTOR2_RELAY1,LOW);
digitalWrite( MOTOR2_RELAY2,HIGH);}

//Move left
void moveLeft() {
digitalWrite( MOTOR1_RELAY1, LOW);
digitalWrite( MOTOR1_RELAY2, HIGH);
digitalWrite( MOTOR2_RELAY1, HIGH);
digitalWrite( MOTOR2_RELAY2, LOW);}

void setup() {

2
YASHWEEN NIXON
8
//begine 1Shield.
OneSheeld.begin();
VoiceRecognition.start();
//define the Relays pin as output pin by for loop for reducing the code.
for (int i = 4 ; i < 8 ; i++) {
pinMode(i, OUTPUT);
digitalWrite(i,LOW);}
//define the speaker pin you should put it on pwm pin.
tmrpcm.speakerPin = 9;
//the next steps are just for making sure that the SD card is ready and
initialized.
Serial.begin(115200);
Serial.print("\nInitializing SD card...");

if (!SD.begin(chipSelect)) {
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card is inserted?");
Serial.println("* Is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or
module?");}
else {
Serial.println("card initialized.");}
tmrpcm.play("s.wav");
Serial.print("f");}

void loop() {
//starting the voice recognizer shield to receive commands.
if(VoiceRecognition.isNewCommandReceived())
//making comparing between the sentence you saved and the commands Arduino will
receive from 1Shield.
{if(!strcmp(NameOne,VoiceRecognition.getLastCommand())||
!strcmp(NameTwo,VoiceRecognition.getLastCommand())||
!strcmp(NameThree,VoiceRecognition.getLastCommand())){
tmrpcm.play("Wall16.wav");}

else if
(!strcmp(EvaOne,VoiceRecognition.getLastCommand())||!strcmp(EvaTwo,VoiceRecognitio
n.getLastCommand())||!strcmp(EvaThree,VoiceRecognition.getLastCommand()))
{tmrpcm.play("eva1.wav");}

else if (!strcmp(SongCommand,VoiceRecognition.getLastCommand())){
tmrpcm.play("s.wav");}}

//moving orders using gamepad.


if(GamePad.isUpPressed())
{forward();}
if(GamePad.isDownPressed())
{backward();}
if(GamePad.isLeftPressed())
{moveLeft();}
if(GamePad.isRightPressed())
{moveRight();}
if (GamePad.isRedPressed())
{Stop();}}

2
YASHWEEN NIXON
9
3
YASHWEEN NIXON
0

Você também pode gostar