Anda di halaman 1dari 67

COMPANY PROFILE

IRIS LEARNINGS

Iris is an initiative by Thapar Universitys alumnus to impart practical knowledge to


the young minds in the field of robotics, 3D animation and ethical hacking with a
vision to bring the new generation one step closer to technology and widening their
horizons. Iris is a plethora of events where budding minds will learn through hands on
development of live projects ranging from technical workshops, seminars, guest
lectures and competitions.
Iris is an endeavor of engineering students who had no clue why they choose
engineering and had no knowledge about how stuff works until they thought they are
not the only ones who thinks the same..... As a result Iris was born to help students
know how practically things work and how to apply science and maths taught in
classes, in the real world...Thus making the budding minds technically strong,
diversifying their horizons and helping them choose their career in a better way...
The soul of Iris lies in providing implementation of technical knowledge. In
order to reach the student fraternity in each corner of the country, Iris organizes
plethora of workshops in different parts of the country.
Iris workshops provide participants with a unique opportunity to gain hands-on
experience in specialized fields, meet the experts in these fields, question them, and
clarify doubts. And quench the thirst of knowledge.

This workshop basically deals with designing various kinds of electronic


sensors and circuits and their use in making autonomous robots without using a
microcontroller.After the workshop students come up with a Wired Robot,Line
tracking robot and how to make Sound operated robot and Computer Controlled.
In collaboration with Kennedy Space Center we organize Camp@KSC program for
Indian students. It is an 10-day educational and cultural tour to USA and an
opportunity for students to work together, gain & share knowledge and get trained in
worlds best possible infrastructure and facilities under the supervision of eminent
scientists and educators. The tour includes travel to Kennedy Space Center and
Orlando.
Camp@KSC is an endeavor to provide an opportunity for the students to learn about
space activities and a chance to live the astronaut within them. During the camp,
young people experience, imagine and interact through space shuttle mission
simulations, tours of Kennedy Space Center and the chance to witness firsthand the
everyday challenges faced by astronauts. The camp provides young people the
opportunity to perform mission simulations, meet astronaut heroes and tour behind the
scenes of Americas busiest spaceport; campers will discover the sights sounds and
feelings of a space shuttle launch on Shuttle Launch Experience. Campers are divided
into different teams based on their grade level and interest. The teams are specially
designed for Camp KSC program, interested in robotics and computer programming

CHAPTER-1
INTRODUCTION
1.1 ROBOTICS
Robotics is the branch of technology that deals with the design, construction,
operation, and application of robots, as well as computer systems for their control,
sensory feedback, and information processing. These technologies deal with
automated machines that can take the place of humans in dangerous environments or
manufacturing processes, or resemble humans in appearance, behavior, and/or
cognition

Robotics is the branch of technology that deals with the design, construction,
operation, structural disposition, manufacture and application of robots.

Roboics is the sciences of electronics, engineering, mechanics, and software.

Robot and Robotics technologies represented a practical applications of


physics, computer science, engineering and mathematics.

1.2 LAWS OF ROBOTICS


By Isaac Asimovs

A robot may not injure a human being or, through inaction, allow a human
being to come to harm.
3

A robot must obey any orders given to it by human beings, except where such
orders would conflict with the First Law.

A robot must protect its own existence as long as such protection does not
conflict with the First or Second Law.

1.3 ROBOT

A robot is a mechanical device that has decision making power according to


the environment it senses and can perform mechanical task automatically or
with guidance. Robot eases the task by speeding up and can perform the task
repeatedly.

In practice it is usually an electro-mechanical machine which is guided by


computer and electronic programming.

We can not exactly define that what robot is, but we can say that A robot can be electrical, mechanical or elctro-mechnical setup.
It can be programmable or non- programmable.
It can be Manual or automated controlled.

It can be use to move parts and help human beings

1.4 TYPESOF ROBOTS

Basic-wired control robots.

Autonomous robots- can act on their own, independent of any controller. The
basic idea is to program the robot to respond a certain way to outside stimuli.

Swarm-A group of robots interacting with each other.

1.5 ESSENTIAL CHARACTERISTICS

Mobility: It possesses some form of mobility.

Programmability: It can be programmed to accomplish a large variety of tasks.


After being programmed, it operates automatically.
4

Sensors: On or around the device that are able to sense the environment and
give useful feedback to the device.

Mechanical capability: Enabling it to act on its environment rather than merely


function as a data processing or computational device (a robot is a machine);
and

Flexibility: It can operate using a range of programs and manipulates in a


variety of ways.

1.6 INTRODUCTION TO EMBEDDED SYSTEM

An Embedded system is combination of computer hardware and software, and


perhaps additional mechanical or others parts, designed to perform a specific
task.

An embedded system is a computer system designed to do one or a few


dedicated and/or specific functions often with real-time computing constraints

Example:microwave oven, AC etc

1.7 CHARACTERISTICS

Embedded systems are designed to do some specific task, rather than be a


general-purpose computer for multiple tasks.

Embedded systems are not always standalone devices.

The program instructions written for embedded systems are referred to as


firmware, and are stored in read-only memory or Flash memory chips. They
run with limited computer hardware resources.

1.8 INTRODUCTION TO EMBEDDED C

Embedded C is nothing but a subset of C language which is compatible with


certain microcontrollers.
5

Some features are added using header files like <avr/io.h>, <util/delay.h>.

scanf() and printf() are removed as the inputs are scanned from the sensors and
outputs are given to the ports.

Control structures remain the same like if-statement, for loop, do-while etc.

1.9 MICROCONTROLLER

A microcontroller (sometimes abbreviated C or MCU) is a small computer


on a single IC containing a processor core, memory, and programmable
input/output peripherals.

It is a decision making device used widely in embedded systems and all


intelligent devices.

1.10 BASIC BLOCK DIAGRAM OF MICROCONTROLLER

Figure 1.1 Block Diagram of Microcontroller

1.11 DIFFERENCE BETWEEN MICROCONTROLLER AND


MICRPROCESSOR

Microcontroller has I/O ports, Memory, timers etc all integrated on chip itself

In Microprocessors, I/O ports, memory, timer etc are to be connected


externally

Figure 1.2 Block Diagram to Show Difference Between Microcontroller And


Microprocessor.

CHAPTER 2
INTRODUCTION TO COMPONENTS
2.1 DC GEARED MOTORS

Motors having external gear arrangement attached with motor.

It has a gearbox that increases torque and decreases speed.

Most commonly used in robotics as they are having considerable torque.

Figure 2.1 DC Geared Motor

2.2 STEPPER MOTOR


7

Motor which takes DC pulse input and gives rotating motion in steps, rather
than turning smoothly as a conventional motor does.

They are of two types :

Unipolar : which moves in one direction only.


Bipolar : which moves in both directions.

Inside the motor, coils are switched on and off in a specific sequence to cause
the motor shaft to turn through the desired angle.

Figure 2.2 Stepper Motor

2.3 SERVO MOTORS

These motors shaft are used to be positioned to specific angular positions by


sending the servo a coded signal.

Used in radio controlled airplanes to position control like the elevators.

Extremely useful in robotics.

Comes in both variants , AC and DC.

Change the angular rotation with same direction supply .

Figure 2.3 Servo Motor

2.4 RESISTOR

A resistor is a two-terminal passive electronic component. It is an electrical


component that limits or regulates the flow of electrical current in an
electronic circuit.

Figure 2.4 Resistor


TYPES OF RESISTORS
1 FIXED TYPE RESISTOR

2 VARIABLE TYPE RESISTOR

Figure 2.5 Fixed Type Resistor

Figure 2.6 Variable Type Resistor

Table 2.1 Resistance Calculation


9

2.5 CAPACITORS
A capacitor is a device for storing electric charge. A capacitor is a passive electronic
component consisting of a pair of conductors separated by a dielectric (insulator).
This is a measure of a capacitor's ability to store charge. A large capacitance means
that more charge can be stored. Capacitance can be measured using formula:
q=C
where
C = capacitance,
q= charge
V = potential difference.
Unit of Capacitance is Farads(F).

Types of capacitor :
Polarized capacitor
Non polarized capacitor

10

Figure 2.7 Polarized Capacitor

Figure 2.8 Non Polarized Capacitor

2.6 DIODES :
Diode is an electronic component which permits the flow of current in one direction
only. Today diodes are made up of semiconductor material; therefore they are often
called semiconductor diodes or crystal diodes. They have a number of uses like:

Diodes are used for rectification.

Diodes are used in electrical meters for their protection.

Diodes are used in wave shaping circuits.

Diodes (LED) are used in display.

PN junction diode :

Fig 2.9 PN Junction Diode

Zener Diode :
Zener Diode works in reverse bias.
11

Symbol of zener diode:

Figure 2.10 Zenar Diode


Light Emitting Diode (LED) :
This diode emits light when current passes through it. We also use IR LED in the
project which emits only.
Symbol of LED:

Figure 2.11 Light Emitting Diode


Photo Diode :
This diode can detect any light falling on it and sends an electrical signal back on
receiveing light.

2.12 Photo Diode

2.7 TRANSISTORS :
A transistor is a semiconductor device used to amplify and
switch electronic signals. It is made of a solid piece of semiconductor material,
with at least three terminals for connection to an external circuit.
12

Device with three terminals where one terminal can be use to control the flow
of current through the other two terminals.
Transistor are of two types:
1. n-p-n( A straight switch )

Figure 2.13 n-p-n Transistor


2. p-n-p ( A inverted switch )

Figure 2.14 P-N-P Transistor


n-p-n as a switch :

When base of n-p-n is connected with logic high voltage then it short
circuit emitter and collector (SWITCH ON).

When base of n-p-n is connected with logic low voltage then it open
circuit both emitter and collector (SWITCH OFF).

p-n-p as an inverted switch :

When base of p-n-p is connected with logic high voltage then it open
circuit emitter and collector (SWITCH OFF).

When base of p-n-p is connected with logic low voltage then it short
circuit both emitter and collector (SWITCH ON).

2.8 LDR (LIGHT DEPENDENT RESISTOR)

13

A light dependent resistor is a semiconductor electrical device that has a very high
resistance to the flow of electrical current in the absence of light.
When light strikes the device, it lowers its resistance, allowing electrical current to
flow through it and on to other devices or electrical circuits.

Figure 2.15 Light Dependent resistor

2.9 SWITCH

Figure 2.16 DPDT Switch

SPST

SPDT

DPST

DPDT

S- Single D-Double
14

P-Pole T-Throw

CHAPTER 3
SENSORS
3.1 SENSOR
A device that sense a change in any physical quantity like heat, light, sound, pressure,
magnetism, or a particular motion and responds by sending a signal in the form of
electrical quantity(e.g voltage)
Application includes automobiles, aero space, machines, medical, manufacturing and
robotics

3.2 TYPES OF SENSORS


IR Sensor
Light Sensor
Sound Sensor
Touch Sensor
Temperature Sensor

3.3 IR SENSOR

15

Figure 3.1 IR Sensor


WORKING
IR sensor works on the principle of emitting IR rays and receiving the reflected ray by
a receiver (Photo Diode)
IR source (LED) is used in forward bias.
IR Receiver (Photodiode) is used in reverse bias.

Figure 3.2 Working Principle Of IR Sensor

16

Figure 3.3 IR Sensor Circuit

3.4 SOUND SENSOR

Figure 3.4 Sound Sensor


The sound sensor provides an output voltage signal that responds to sound detected by
a microphone.
Sound sensor consists of Microphone and 555 Timer IC.

17

Figure 3.5 Circuit Diagram For Sound sensor

3.5 LIGHT SENSOR


A light sensor is a electronic device that measures maximum intensity of light that is
falling on two different photodiodes
Light sensors can be implemented using Photodiode or LDR (light dependent resistor)

Figure 3.6 Circuit Diagram For Light Sensor

3.6 TEMPERATURE SENSOR


A temperature sensor is a device that measures the temperature from the surrounding
and gives output in the form of electrical quantity(e.g voltage).
18

Figure 3.7 Temperature Sensor

CHAPTER 4
INTEGRATED CIRCUITS
4.1 ICS USED IN ROBOTICS

L293D

555

LM358

IC 7805(voltage controlled)

4.2 L293D IC

19

Figure 4.1 L293D IC


L293D is a dual H-Bridge motor driver.
So with one IC we can interface two DC motors which can be controlled in both
clockwise and counter clockwise direction
If you have motor with fix direction of motion then you can make use of all the four
I/Os to connect up to four DC motors.
L293D has output current of 600mA.
Moreover for protection of circuit from back EMF output diodes are included within
the IC.
CONTROLLING MOTOR USING H BRIDGE

Switches settings for rotation:

S1&S4: ON and S2&S3: OFF (for one direction).

S2&S3: ON and S1&S4: OFF (for other direction).

S1-S2: ON or S3&S4: ON (can be used to stop the motor).

20

Figure 4.2 H Bridge

Figure 4.3 H Bridge Operation

21

Figure 4.4 Interface motor with IC L293D

4.4 555 IC

Figure 4.5 555IC


The 555 Timer IC is an integrated circuit (chip) used in a timer application, pulse
generation and oscillator applications.
It works only on falling edge of the incoming signal

4.5 LM 358
The LM358 IC consists of two independent operational amplifiers which were
designed specifically to operate from a single power supply over a wide range of
voltages. It have two op-amp

22

Figure 4.6 LM358


INTERNAL CKT

Figure 4.7 Internal Circuit Of LM358


FEATURES
It have two op-amp
Single power supply
Supply range 3v-32v
Eliminate need of dual supply

4.6 IC 7805
It is a voltage regulator integrated circuit.
It designed to automatically maintain a constant voltage level
23

It works on a negative feedback

Figure 4.8 IC 7805

FEATURES
Output current range up to 1A
Output voltage 5V
Input voltage range up to 12V
Short circuit protection

CHAPTER 5
MICROCONTROLLER ATmega8

24

Figure 5.1 Microcontroller ATmega8

5.1 INTRODUCTION :
ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR
RISC architecture.
By executing powerful instructions in a single clock cycle, the ATmega8
achieves throughput approaching 1 MIPS per MHz
In order to maximize performance and parallelism, the AVR uses a Harvard
architecture.

5.2 HOW AVR ATmega8 GOT ITS NAME ?


It was developed by Atmel Corporation
AVR implies it belongs to AVR family.
8 in Atmega8 means this microcontroller has 8Kb of flash memory

5.3FEATURES OF ATmega8 :
The main features of ATmega8 microcontroller are:
High-performance, Low-power AVR 8-bit Microcontroller
25

Up to 16 MIPS Throughput at 16 MHz


32 x 8 General Purpose Working Registers
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Data retention: 20 years at 85C/100 years at 25C.
8K Bytes of In-System Self-programmable Flash program memory
512 Bytes EEPROM (Electrically Erasable Programmable Read Only
Memory)
1K Byte Internal SRAM (Static Random Access Memory)

5.4 MEMORY SEGMENTS


8K Bytes of In-System Self-programmable Flash program memory
512 Bytes EEPROM (Electrically Erasable Programmable Read Only
Memory)
1K Byte Internal SRAM (Static Random Access Memory)

5.5What is AVR?

AVR is a modified Harvard architecture , 8-bit RISC single chip


microcontroller.

It was developed in the year 1996 by Atmel Corporation.

5.6 Special about AVR

They are fast.

AVR Microcontroller executes most of the instructions in single execution


cycle.
26

AVRs are about 4 times faster than PIC.

They consume less power and can be operated in different power saving
modes.

5.7 RISC

RISC stands for Reduced Instruction Set Computer.

It is a very fast architecture which executes one instruction per clock cycle.

RISC contains very small instruction set.

Programming is easy, but code length increases.

5.8 Harvard and Von Neumann Architecture

Figure 5.2 Von Neumann and Harward Architecture


HARVARDARCHITECTURE

Harvard architecture has separate data and instruction buses.

This allows transfers to be performed simultaneously on both buses.

VON NEUMANN ARCHITECTURE

27

A Von Neumann architecture has only one bus which is used for both data
transfers and instruction fetch

Data transfers and instruction fetches must be scheduled as they cannot be


performed at the same time

5.9PIN OUT OF ATmega8

Figure 5.3 PIN Diagram Of ATmega8

5.10 PIN DESCRIPTION

VCC: Digital supply voltage 5V.

GND: Ground.
28

RESET: A low level on this pin for longer than the minimum pulse length will
generate a reset, even if the clock is not running.

AREF: The analog reference pin for the A/D Converter.

AVCC : The supply voltage pin for the A/D Converter, Port C (3..0).It should
be externally connected to VCC, even if the ADC is not used. If the ADC is
used, it should be connected to VCC through a low-pass filter.

5.11

PORTS

There are 3 ports in ATmega8: Port B, Port C, Port D.

Three registers are associated with every port

DDRx Data Direction Register

PINx Port input

PORTx- Port output

Where x would be either B,C or D.

PORT B (PB 7-PB 0)


It is a 8-bit bi-directional I/O port.
It has internal pull up resistors(selected for each bit).
It can be used either as a input port or as output port ( direction must be
specified in programming)
PORT C (PB 6-PB0)

It is a 7-bit bi-directional I/O port.

It has internal pull up resistors(selected for each bit).

It can be used either as a input port or as output port ( direction must be


specified in programming).

PORT D (PD7-PD0)
29

It is a 8-bit bi-directional I/O port.

It has internal pull up resistors(selected for each bit).

It can be used either as a input port or as output port ( direction must be


specified in programming).

5.12 Registers to Communicate with I/O Ports

To communicate with the ports of Atmega8, we use three registers:

PINx

PORTx

DDRx

Where x would be either B,C or D.

DDRx Register

It stands for Data Direction Register.

It is used to define Port as Input or Output.

In order to make Port as Input Port: DDRx=0x00 (In Hexadecimal)

DDRx=0b00000000(In Binary)

In order to make Port as output Port: DDRx=0xFF (In Hexadecimal)

DDRx=0b11111111(In Binary)

PORTx Register

If DDRx=0xFF(Output port)

Writing logic 1 to PORTx will make output high i.e 5v for that particular pin.

Writing 0 to PORTx will make output low i.e 0v for that particular pin.

If DDRx=Ox00(Input port):

30

If corresponding PORTx bit is set to 1, Internal pull up resistors are enabled i.e
if we do not connect this pin to anything it still reads as 1.

If corresponding PORTx bit is set to 0, internal pull up resistors are disabled


i.e the pin will enter a high impedance

state and will become unpredictable.

PINx Register

It reads data from the port pins.

If any/all bits of DDRx is set to 0(input)for a particular pin, we can read data
from PINx

If any/all bits of DDRx is set to 1(output), then reading PINx register gives the
same data which has been output on that particular pin.

5.13 PROGRAMMING ENVIRONMENT AND PROGRAMMER :


Formerly, programmers used machine language for coding. A machine language is a
program that consists of 0s and 1s which was very dreary for the humans program any
computer. In due course of time, assembly language was developed in order to speed
up the programming and make it error-free. Assembly language is a low level
language which uses an assembler to translate the program into machine code. The
high level programming languages such as BASIC, Pascal, Forth, C, C++, and Java
are available to code the program for ATmega8. These high level languages make use
of a Compiler to translate into machine code. For example, when a program is written
in C, the program needs to be translated into machine language using C compiler.
Usually, Assembly and C language is widely used for ATmega8 programs as
compared to the other high level languages.
The ATmega8 provides a total of three ports for I/O operations. ATmega8 has 28 pins,
of which 24 pins are set aside for the three ports. Port B, Port C, and Port D each have
8 pins and can be used for either input or output. The remaining pins are designated as
Vcc, GND, AREF, and GND.
ATmega8 allows you to manipulate one or all of the bits of a port, thus providing
programmers with a unique and powerful feature.

31

CHAPTER 6
SOFTWARES USED
6.1 DEVELOPMENT PROCESS OF EMBEDDED C PROJECTS :
Write C programs in AVR Studio IDE(Integrated Development Environment)
Compile them into a .hex file using the AVR-GCC compiler (which integrates
into AVR Studio)
Simulate the target AVR program and debug the code within AVR Studio
Program the actual chip using the USBasp device, which is attached to our
target board with a special 6-pin cable
Once programmed, the chip runs the program in your circuit

6.2 Home screen of AVR studio :

32

Figure 6.1 Home Screen Of AVR Studio

6.3 New project window :

Figure 6.2 New Project Window


Then Click On Next. And Make sure that Create folder check box is always checked.

6.4 Selecting platform and device :

33

Figure 6.3 Selecting Platform Device

Then choose AVR Simulator from the debug platform and ATmega8
from device list.

Click finish.

6.5 Coding Window :

Figure 6.4 Coding Window


Start writing the program in the coding area and then save it.

6.6 Building the code :

34

Figure 6.5 Building The Code


After finishing writing the program click on built from the menu bar or press F7 to
build the .hex file

6.7 EXECUTION OF AVR PROJECTS USING AVR LOADER

Figure 6.6 Execution Of AVR Projects Using AVR Window


1. Open the AVR Loader.
2. Select the Microcontroller AT mega8 from the list.
3. In the flash, browse the .hex file of the project which lies in the default folder
of the project.
4. Now click on the Write button to burn the program.
5. Make sure that before all these steps of AVR Loader, the programmer should
be connected with the system.

35

CHAPTER 7
BASIC ROBOTS
7.1 LINE FOLLOWING ROBOT
This simple robot is designed to be able to follow a black or white line on the ground
without getting off the line too much. The robot has four sensors installed underneath
the front part of the body, and two DC motors drive wheels moving forward. This
robot uses a comparator chip as its brains, which makes it a relatively easy first robot
to build
A circuit inside takes input signal from four sensors and controls the speed of wheels
rotation. The control is done in such a way that when a sensor senses a black line, the
motor slows down or even stops. Then the difference of rotation speed makes it
possible to make turns.

Working Principle:
This Robot follows the black line which is drawn over the white surface or it follows
the white line which is drawn over the black surface. The LDRS (Light Dependent
Resistors) are used to sense the line. When the light from the LEDS fall on the white
surface, it gets reflected and if it falls on the black surface, it is not reflected this
principle is used to scan the Lines for the Robot.

36

Figure 7.1 Working Principle Of Line Following Robot

Figure 7.2 General Block Diagram Of Line Following Robot

Circuit Explanation:
Step 1: Let us assume that the switch is on the black line position and black line to be
followed is on the white surface.
Step 2: When the robot is turned ON the LEDs on the LDR module will turn ON and
the LDRs mounted beneath the robot will start getting reflections from the surface
due to the light emitted by the LEDs on the surface.
Step 3: for black color there would not be any reflection from the surface and the
resistance of the LDR will remain high, producing large voltage drop across the
respective LDR pair which has detected the black color.
Step 4: On the other hand the voltage drop across the other pair of LDR will be less as
white surface reflects light emitted from the LEDs back to the LDR because of which
its resistance reduces thus producing less voltage drop across the LDR pair which is
on the white surface.
Step 5: These two voltage levels from the two LDR pairs will be fed as an input to the
comparator.
37

Step 6: The comparator then compares these inputs and gives out two outputs at pin
no.1 and pin no. 7
Step 7: Out of these two outputs one will be low and the other will be high always.
Step 8: These two outputs are then given to the NPN transistors
Step 9: The NPN transistors are responsible to drive the motors and they will conduct
only after getting a high signal at its base terminal.
Step 10: Thus the high output from the comparator will turn ON the corresponding
transistor while the other transistor will remain OFF as it gets low signal at its base
terminal from the comparators output which is low.
Thus, the LDRs will keep on scanning the track and ultimately following black/white
line in a ZIG-ZAG fashion.

7.2 OBSTACLE DETECTION ROBOT


This is an autonomous robot that stops whenever it faces any obstacle. The module
consists of an IR emitter and IR receiver pair. The high precision IR receiver always
detects IR signal.
Working Principle:
1. The basic concept of IR (infrared) obstacle detection is to transmit the IR signal
(radiation) in a direction and a signal is received at the IR receiver when the IR
radiation bounces back from a surface of the object.
Here in the figure the object can be any thing which has certain shape and size, the IR
LED transmits the IR signal on to the object and the signal is reflected back from the
surface of the object. The reflected signal is received by an IR receiver. The IR
receiver is a photodiode which decodes the signal.

38

Figure 7.3

Working Principle Of Obstacle

Detection Robot
2. Two 100rpm motors are used to rotate the 2 wheels. Motor take the electrical
energy from the battery and converts it to mechanical energy by rotating the
wheel.

7.3 ROBOTIC ARM


INTRODUCTION

This robot can pick and place objects from one location to another.

It is a wired control robot.

It can move in forward, backward, left and right directions.

It can pick and drop objects.

39

Figure 7.4 Robotic Arm


WORKING PRINCIPLE
Four 30rpm motors are used to rotate the 4 wheels. Motor take the electrical energy
from the battery and converts it to mechanical energy by rotating the wheel.

One 30rpm motor is used to rotate the gear, which in-turn rotates the second
gear attached to it. This moves the robotic arm up and down.

One 30rpm motor is used to pull the gripper outwards which opens and closes
the gripper to pick and drop things.

Four DPDT switches are used to control the movement of the robotic arm.

Two switches are used to move the robot in the forward, backward, left
and right directions

Third switch is used to pick and drop objects

Forth switch is used to move the object up and down.

PARTS OF ROBOT

Sensor

Controller

Actuator

End-effectors

Power source

ASSEMBLING

Fix the four clamps below the chassis with the help of screws.

40

Insert the two 30rpm motors into the clamps and attach it with the two wheels
by inserting the motor shafts into the wheels

Attach the two L-clamps on top of the chassis with the help of screws

Attach the two 30rpm motors with the L-clamp using nuts and bolts

Assemble the arm chassis with the help of screws

Attach one 10rpm motor with 1 gear and interlink it with the other gear. The
second gear is to be placed inside the arm chassis.

Assemble the gripper chassis, spring and hinge using nuts and bolts.

Attach one end of the plastic wire to the second 10rpm motor and the other end to
gripper side having the spring.

41

CHAPTER 8
PROGRAMMING ON PROJECTS FOR ATmega8

8.1 PHOTOTROPIC ROBOT


#include<avr/io.h>
void main()
{
int left_sensor,right_sensor;
DDRB=0xff;//port B as a output port
DDRC=0x00;//port c as a input port
while(1)
{
left_sensor=PINC&0b0001000;
right_sensor=PINC&0b0010000;
if(right_sensor==0b0010000 && left_sensor==0b0000000)//right sensor is on
PORTB=0b00000100;//right turn
if(right_sensor==0b0000000 && left_sensor==0b0001000)//left sensor is on
PORTB=0b00000010;//left turn

42

if(right_sensor==0b0010000 && left_sensor==0b0001000)//both the sensor are on


PORTB=0b00000110;//move straight
if(right_sensor==0b0000000 && left_sensor==0b0000000)//both the sensor are off
PORTB=0b00001111;//stop
}
}

8.2 PHOTOPHOBIC ROBOT

#include<avr/io.h>
void main()
{
int left_sensor,right_sensor;
DDRB=0xff;
DDRC=0x00;
while(1)
{
right_sensor=PINC&0b0010000;//right sensor on pc5
left_sensor=PINC&0b0001000;//left sensor on pc4
if(right_sensor==0b0010000 && left_sensor==0b0000000)
PORTB=0b00000010;//turn left
if(right_sensor==0b0000000 && left_sensor==0b0001000)
43

PORTB=0b00000100;//turn right
if(right_sensor==0b0000000 && left_sensor==0b0000000)
PORTB=0b00000110;//move forward
if(right_sensor==0b0010000 && left_sensor==0b0001000)
PORTB=0b00000000;//stop
}
}

8.3 OBSTACLE AVOIDER ROBOT


#define F_CPU 1000000UL

//set your clock speed

#include <avr/io.h>
#include <util/delay.h>
int move_backward=0b00001001;
int right_turn=0b00000101;
int move_forward=0b00000110;
int left_turn=0b00001010;
int left_sensor_on=0b0000001;
int right_sensor_on=0b0000010;
int front_sensor_on=0b0000100;
int left_sensor_off=0b0000000;
int right_sensor_off=0b0000000;
int front_sensor_off=0b0000000;
void wait(float x)
44

{
for(int i=0;i<(int)(1302*x);i++)
_delay_loop_1(0);
}
void main ()
{
DDRB = 0xFF; //Output port
DDRC = 0b0000000; //input port
int left_sensor = 0;
int right_sensor = 0;
int front_sensor = 0;
while(1) //create an infinite loop
{
left_sensor = (PINC & 0b0000001);
right_sensor = (PINC & 0b0000010);
front_sensor = (PINC & 0b0000100);
if(( left_sensor==left_sensor_off) & (right_sensor==right_sensor_off) &
(front_sensor==front_sensor_on))
{
PORTB = move_backward;

//move backward

wait(2.0);
PORTB=right_turn;

//take a right turn

wait(1.0);
45

}
if((left_sensor==left_sensor_off) & (right_sensor==right_sensor_off) &
(front_sensor==front_sensor_off))
{
PORTB=move_forward;

//move forward

}
if(( left_sensor==left_sensor_on) & (right_sensor==right_sensor_off) &
(front_sensor==front_sensor_off))
{
PORTB=move_backward;
wait(2.0);
PORTB=right_turn;
wait(1.0);
}
if(( left_sensor==left_sensor_off) & (right_sensor==right_sensor_on) &
(front_sensor==front_sensor_off))
{
PORTB=move_backward;
wait(2.0);
PORTB=left_turn;
wait(1.0);
}
if(( left_sensor==left_sensor_off) & (right_sensor==right_sensor_on) &
(front_sensor==front_sensor_on))
46

{
PORTB=move_backward;
wait(2.0);
PORTB=left_turn;
wait(1.0);
}
if(( left_sensor==left_sensor_on) & (right_sensor==right_sensor_on) &
(front_sensor==front_sensor_off))
{
PORTB=move_forward;
}
if(( left_sensor==left_sensor_on) & (right_sensor==right_sensor_off) &
(front_sensor==front_sensor_on))
{
PORTB=move_backward;
wait(2.0);
PORTB=right_turn;
wait(1.0);
}
if((left_sensor==left_sensor_on) & (right_sensor==right_sensor_on) &
(front_sensor==front_sensor_on))
{
PORTB=0b00000000;

//move forward

}
47

}
}

8.4 LINE FOLLOWING ROBOT

#define F_CPU 1000000UL // define cpu frequency for delay function


#include <avr/io.h> // includes input/output header file
#include <util/delay.h> // includes delay header file
int main(void)
{
DDRB=0b11111111; //PORTB as output Port connected to motors
DDRC=0b0000000; //PORTC Input port connected to Sensors

//lcd_init(LCD_DISP_ON); //uncomment it if using LCD Display


//lcd_puts("Line Follower\n"); //uncomment it if using LCD Display
//lcd_puts("By Vivek"); //uncomment it if using LCD Display

int left_sensor=0, right_sensor=0;


while(1) // infinite loop
{
left_sensor=PINC&0b0010000; // mask PC4 bit of Port C
right_sensor=PINC&0b0100000;// mask PC5 bit of Port C

48

if((left_sensor==0b0000000) & (right_sensor==0b0000000)) //if both sensors "off"


{
PORTB=0b00000110; // move straight
}
if((left_sensor==0b0010000) & (right_sensor==0b0100000)) //if both sensors "on"
{
PORTB=0b00000101; // move right
}
if((left_sensor==0b0000000)&(right_sensor==0b0100000))
{
PORTB=0b00001110; // turn left
}
if((left_sensor==0b0010000)&(right_sensor==0b0000000))
{
PORTB=0b00000111; // turn right
}
}
}

8.5 EDGE AVOIDER ROBOT

#define F_CPU 1000000UL

//set MCU clock speed

#include <avr/io.h>
49

#include <util/delay.h>

int move_backward=0b00001001;
int right_turn=0b00000101;
int move_fordward=0b00000110;
int left_turn=0b00001010;
int left_sensor_on=0b0010000;
int right_sensor_on=0b0100000;
int left_sensor_off=0b0000000;
int right_sensor_off=0b0000000;

void wait(float x)
{
for(int i=0;i<(int)(x*1302);i++)
_delay_loop_1(0);
}
int main (void)
{
DDRB = 0xFF; //Output port
DDRC = 0b0000000; //input port

int left_sensor = 0;
50

int right_sensor = 0;

while(1) //create an infinite loop


{
left_sensor = (PINC & 0b0010000);
right_sensor = (PINC & 0b0100000);
if(( left_sensor==left_sensor_off) & (right_sensor==right_sensor_off))
{
PORTB = move_backward;

//move backward

wait(1.5);
PORTB=right_turn;

//take a right turn

wait(.5);
}
if((left_sensor==left_sensor_on) & (right_sensor==right_sensor_on))
{
PORTB=move_fordward;

//move forward

}
if(( left_sensor==left_sensor_off) & (right_sensor==right_sensor_on))
{
PORTB=move_backward;
wait(1.5);
PORTB=right_turn;
wait(.5);
51

}
if(( left_sensor==left_sensor_on) & (right_sensor==right_sensor_off))
{
PORTB=move_backward;
wait(1.5);
PORTB=left_turn;
wait(.5);
}
}
}

8.6 DISPLAYING NAME ON 2x16 LCD

#define F_CPU 1000000UL // defines the clock speed


#include <avr/io.h> // includes input/output header file
#include <util/delay.h> // includes delay header file
#include"lcd.h" //include lcd.h
#include"lcd.c" //include lcd.c
int main (void)
{
lcd_init(LCD_DISP_ON);
lcd_puts("Hello Vivek");
}
52

8.7 BLINKING LED

#include<avr/io.h>
#include<util/delay.h>
#define F_CPU 1000000UL
main()
{
DDRD=0xFF; //PORTD as output port
while(1)
{
PORTD=0b11111111;
_delay_ms(255);
PORTD=0b00000000;
_delay_ms(255);
}
}

53

CHAPTER 9
PROJECT COVERED

9.1 GSM OPERATED ROBOT OR MOBILE CONTROLLED ROBOT

This is a robot which can be controlled by using cell phone.

GSM Controlled Robot is automatic robots which capable of receiving


instructions in the form of binary bits and performs the necessary actions.

GSM controlled robots based on the DTMF (dual tone multiple frequency)
technology.

9.2 DTMF (dual tone multiple frequency)

DTMF signaling is used for telecom signaling over analog telephone lines in
the voice frequency band between telephone handsets and other
communication devices and the switching centre.

In other words DTMF is a method of instructing switching system of the


telephone numbers to be dialed, or to issue commands to switching systems.
54

9.3 How to control a robot using DTMF?

Robotic control using the DTMF is achieved when the user at the transmitting
side pressed mobile phone keypad buttons and at the remote location receiver
receive the signal so that robots takes corresponding actions.

9.4 DTMF KEYPAD TABLE

DTMF table is laid out in 4*4 matrix.

Row represents low frequency .

Column represents high frequency.

The multiple tones are the reason for calling the system multi frequency.

Tones are then decoded by switching centers to determine which keys are
pressed.

Table 9.1 DTMF Table description

9.5 DTMF DECODER IC IC (HT9170)


55

Operating voltage : 2.5V 5.5V

Minimal external components

No external filter required

Excellent performance

3.58 crystal or ceramic resonator

18 pin package

9.6 PIN DISCRIPTION


Table 9.2 Pin Description

56

9.7 WORKING OF THE IC

Tone is attached to 0.1 micro F capacitor on the top corner.

Mount the circuit on the robot with auto answer mode on.

Connect one wire of the headphone to the wire and other to the ground.

The tone is then passed to amplifier for filtering.

OE is the output enable pin, high on this pin will enable the output.

D0,D1,D2 and D3 are the decoded output of the IC

57

DV is data valid pin, its a output pin, Set to high itself by IC when valid data
is available on these bits.

RT/GT and EST are pins for setting effective time duration of tone to check
for authenticity.

9.8 APPLICATION CIRCUIT

Figure 9.1 IC 8870

9.9 DTMF DATA OUTPUT TABLE


Table 9.3 DTMF Data Output Table

58

9.10 Interfacing HT9170 with ATMEGA8 kit

Connect d0,d1,d2,d3 pins of IC (HT9170) to any Port of the microcontroller.

Now we can check respective bits with programming and respond based on
the bit pattern received.

Now based on the input pattern we can instruct the motor with specific
commands and make the robot move in different directions.

9.11 PROGRAMMING AND CODING


#define F_CPU 1000000UL
#include <avr/io.h>
#include <util/delay.h>
Void main()

59

{
int DTMF=0;
DDRB=0xFF;
DDRC=0b0000000;
while(1)
{
DTMF=PINC;
DTMF=DTMF&0b0001111;
if(DTMF==2)
{
PORTB=0b00000101;
}
if(DTMF==4)
{
PORTB=0b00001010;
}
if(DTMF==6)
{
PORTB=0b00000101;
}
if(DTMF==8)
{
PORTB=0b00001001;
60

}
if(DTMF==11)
{
PORTB=0b00001111;
}
}
}

9.12 ASSEMBLING THE PARTS

Figure 9.2 Assembling The Parts


INSERT MOTORS IN C CLAMPS

61

Figure 9.3 Inserting Motors In C Clamps

FIX CLAMPS WITH CHASSIS

Figure 9.4 Fixing The Clamps With Chassis


FIX CIRCUIT WITH CHASSIS

62

Figure 9.5 Fixing Circuit With Chassis

ATTATCH THE TWO CHASSIS TOGETHER

Figure 9.6 Attatching Two Chassis Together

ATTATCH THE CASTER WHEEL WITH LOWER CHASSIE

63

Figure 9.7 Attatching Caster Wheel With Lower Chassie

ATTATCH THE MOTORS WITH WHEELS

Figure 9.8 Attatching Motors With Wheels

ALGORITHM

Algorithm for my Project:


64

Connect the cell phone to circuit.

Call the cell phone from a remote phone

Now press the keys on the remote phone and you will see the LEDs blinking.

CONCLUSION
Although most robots in use today are designed for specific tasks, the goal is to make
universal robots, robots flexible enough to do just about anything a human can do.
65

Finally after having completed this project I would like to state that the field of
robotics is infinite. With every small circuit or every small component we can do a lot
of things.
What I have done is a very nominal project as compared to the field of robotics. But I
have learnt a lot from this and hope to use this newly gained knowledge in future not
only in projects but in day to day life as well. Starting with this project I would like
continue developing other different projects in the future.
Being knowledgeable is very good quality and I would like to dwell that quality in
me. I hope that the work on robotics that I have done would help me and others in
future as well.

LIST OF REFERENCES

www.wikipedia.org/wiki/Asimov
66

www.extreamelectronic.com
www.google.com

BIBLIOGRAPHY

ELECTRONICS FOR YOU MAGZINE (2012 EDITION)


ROBOSAPIENS INDIA PUBLICATION BOOK ON AVR
Datasheet,
PPTs for Intermediate Level, Iris Learnings
Lawrence Harte, Introduction to Robotics
Book by MAJIDI

67

Anda mungkin juga menyukai