You are on page 1of 51

ABSTRACT

Mankind has always strived to give life like qualities to its artifacts in an attempt to find
substitutes for himself to carry out his orders and also to work in a hostile environment.
The popular concept of a robot is of a machine that looks and works like a human
being.The industry is moving from current state of automation to Robotization, to
increase productivity and to deliver uniform quality. The industrial robots of today may
not look the least bit like a human being although all the research is directed to provide
more and more anthropomorphic and humanlike features and super-human capabilities in
these.Here is one such robot which performs the operation as that of a fork lift but the
floor space required has been drastically reduced.

CONTENTS

Sr.No.

Heading
I.

Page No.

LIST OF FIGURES......................................................................................

II. LIST OF TABLES........................................................................................

ii

Chapter 1. INTRODUCTION......

1.1. PROJECT OVERVIEW...........................................................................

1.2. OBJECTIVE.............................................................................................

1.3. TECHNOLOGY USED............................................................................

Chapter 2. LITERATURE SURVEY.........................................................................

2.1. LIMITATION OF THE LITERATURE REVIEWED..............................

2.2 SCOPE FOR CONTRIBUTION.................................................................

Chapter 3. SYSTEM MODEL..................................................................................


3.1. PARTS OF THE SYSTEM

......

3.1.1. MICROCONTROLLER (ARDUINO UNO)..................................

3.1.2. RACK AND PINION ASSEMBLY................................................

3.1.3. SENSORS........................................................................................

3.1.4. MOTOR DRIVERS..........................................................................

3.2. STEPS FOLLOWED BY THE SYSTEM..................................................

Chapter 4. SYSTEM HARDWARE DESIGN...........................................................

4.1. ROBOT CHASSIS .........

4.1.1. ACRYLIC SHEET.............................................................................

4.2. ARDUINO UNO R4 SMD..........................................................................

4.2.1. DESCRIPTION..................................................................................

4.2.2. SPECIAL SMD VERSION................................................................

4.2.3. PIN MAPPING OF ATmega428 WITH ARDUINO FUNCTION....


10 4.2.4. FEATURES.........................................................................................

10 4.3. MOTOR DRIVER (L294D).........................................................................


10 4.4.1. DESCRIPTION OF L294D MOTOR
DRIVER..................................10 4.4.2.
CONCEPT.............................................................................................

11 4.4.3.

WORKING OF L294D.........................................................................

12

4.4.4. L294D LOGIC TABLE.............................................................

12

4.4. DC MOTORS..................................................................................................

13

4.4.1. DC MOTORS USED FOR WHEELS...................................................

13

4.4.2. DC MOTORS USED FOR LINEAR MOTION....................................

14

4.5. LINE FOLLOWING ARRAY SENSOR.........................................................

14

4.5.1. DESCRIPTION OF ARRAY SENSOR.................................................

14

4.5.2 FUNCTIONAL BLOCK DIAGRAM


..................................................... 15 4.5.3. PIN

DESCRIPTION............................................................................... 15

4.6.

RACK AND PINION ASSEMBLY.................................................................. 16


4.6.1. GEOMETRIC RELATION..................................................................... 17
4.7. OBJECT SENSOR............................................................................................ 18

Chapter 5. ADOPTED METHODOLOGY...................................................................... 20


5.1. OPERATION...................................................................................................... 21
Chapter 6. SOFTWARE TOOLS USED TO DEVELOP THE SYSTEM..................... 22
6.1. ARDUINO IDE 1.0.5. ..

23

6.1.1. ARDUINO BUILD PROCESS......................................................

23

6.1.1.1. OVERVIEW.........................................................................

23

6.1.1.2. Multi-file sketches...................................................

23

6.1.1.3. Transformations to the main sketch file... 24


6.1.1.4. TARGETS.............................................................................

24

6.1.1.5. Upload process.............................................................

24

6.2. HARDWARE SIMULATOR....................................................................

25

6.2.1. PROTEUS 8.1...................................................................

25

Chapter 7. SYSTEM CODE.................

28

7.1. EMBEDDED C (SPECIAL TOOL FOR ARDUINO).....................................

28

Chapter 8. CONCLUSION AND SCOPE OF FUTURE WORK.......... 43


8.1. ADVANTAGES................................................................................................ 43
8.2. APPLICATIONS................................................................................................ 43
8.3. CONCLUSION................................................................................................... 43
8.4. FUTURE SCOPE................................................................................................ 43
Chapter 9. APPENDIX........................................................................................................... 45
9.1. DATA SHEETS................................................................................................... 45
9.2. COMPONENTS LIST......................................................................................... 50
Chapter 10.

REFERENCES 51

LIST OF FIGURES
FIG. NO.
NO.

HEADING

PAGE

3.1.

BLOCK DIAGRAM.................................................................

4.1.

ACRYLIC SHEET....................................................................

4.2.

ARDUINO UNO BOARD........................................................

4.3.

ATMEGA328 PIN MAPPING..................................................

10

4.4.

PINOUT OF L293D....................................................................

11

4.5.

CIRCUIT DIAGRAM OF L293D................................................

12

4.6.

DC MOTOR..................................................................................

13

4.7.

LINE SENSOR BOARD..................................................................

14

4.8.

SCHEMATIC DIAGRAM OF LINE SENSOR................................ 16

4.9.

RACK AND PINION ASSEMBLY................................................... 17

4.10.

OBJECT SENSOR............................................................................ 18

4.11.

CIRCUIT DIAGRAM OF OBJECT SENSOR................................. 19

5.1.

CIRCUIT DIAGRAM OF THE SYSTEM........................................ 20

6.1.

ARDUINO IDE 1.0.5.......................................................................... 22

6.2.

THE VIRTUAL SYSTEM MODELLING......................................... 25

6.3.

PROTEUS INTERFACE..................................................................... 26

LIST OF TABLES

TABLE NO.

HEADING

PAGE. NO

4.1.

SENSOR READINGS FROM THE ARRAY..................................

15

4.2.

PIN DESCRIPTION OF LINE SENSOR ARRAY...........................

16

9.1.

COMPONENTS LIST.........................................................................
51

1. INTRODUCTION
1.1 PROJECT OVERVIEW
A warehouse management system (WMS) is a key part of the supply chain
and primarily aims to control the movement and storage of materials within a
warehouse and process the associated transactions, including shipping, receiving,
putaway and picking. The systems also direct and optimize stock putaway based
on real-time information about the status of bin utilization.
What we have tried to, is design a robot which comprises of three different
projects altogether clubbed into a single package which can serve a better
purpose. The different projects which are clubbed are Line Follower Bot, Pick and
Place Robot and Warehouse management.
LINE FOLLOWER : The Bot will track its destination with the help of line. It will
return to its original location after the operation is completed.
PICK AND PLACE : The Bot will perform the pick and place operation with the
help
WAREHOUSE MANAGEMENT : The Bot being intelligent will remember the
location where it has placed the package and will avoid that location in future
cases.

1.2. OBJECTIVE
The main purpose of every project is to deliver a product which is better than
or an
current

alternative to the current industry scenario. Our project is better than the
warehouse management tools according to the following points:

Reduce the floor space as not in case of fork lift.


Place the objects to the desired location.
Efficient use of a warehouse.

1.3. TECHONOLOGY USED


Arduino simplifies the process of working with microcontrollers, but also it
offers some advantage for teachers, students, and interested amateurs over other
systems:
Inexpensive - Arduino boards are relatively inexpensive compared to other
microcontroller platforms. The least expensive version of the Arduino module
can be assembled by hand, and even the pre-assembled Arduino modules
cost less than Rs.700/-.
Simple, clear programming environment - The Arduino programming
environment is easy-to-use for beginners, yet flexible enough for advanced
users to take advantage of as well. For teachers, it's conveniently based on
the Processing programming environment, so students learning to program in
that environment will be familiar with the look and feel of Arduino.
Open source and extensible software - The Arduino software is published as
open source tools, available for extension by experienced programmers. The
language can be expanded through C++ libraries, and people wanting to
understand the technical details can make the leap from Arduino to the AVR C
programming language on which it's based. Similarly, you can add AVR-C code
directly into your Arduino programs if you want to.
Open source and extensible hardware - The Arduino is based on Atmel's
ATMEGA8 and ATMEGA168 microcontrollers. The plans for the modules are
published under a Creative Commons license, so experienced circuit designers
can make their own version of the module, extending it and improving it. Even
relatively inexperienced users can build the breadboard version of the module
in order to understand how it works and save money.

2. LITERATURE SURVEY
2.1.LIMITATION IN LITERATURE REVIEWED:

Robotic application in hazardous / narrow field is very efficient, and


economic.We may perform scanning, video photograph, and some physical action
in a narrow or congested space where human eye could not suited. Robot is very
much effective. In same situation, where human hand could not reach, scanning
like radio-graph test, ultrasound tests. Magnetic particle test etc done by robot is
economic and reliable.

The

most

important task in a narrow and hazardous space in industry. Many industrial,


agricultural and medical organisations use hazardous substances. The degree of
hazard depends on the concentration of the chemical.
Common hazardous substances in the workplace include:
Caustic substances
Acids
Disinfectants
Glues
Heavy metals, including mercury, lead, cadmium and aluminium
Paint
Pesticides
Petroleum products
Solvents.
Health effects depend on the type of hazardous substance and the level of
exposure (concentration and duration). A hazardous substance can be
inhaled, splashed onto the skin or eyes, or swallowed. Some of the possible
health effects can include:
3

Poisoning
Nausea and vomiting
Headache
Skin rashes, such as dermatitis
Chemical burns
Birth defects
Disorders of the lung, kidney or liver
Nervous system disorders.
Today, no doubt, forklifts are used in the industry and that too widely. But the
problem is the forklifts used are along with tele-operators. Tele-operators are none
other than the people who control the forklifts and carry out the activities.
But the problem with tele-operators is that
sometimes the activity goes unnoticed and hazards may take place. This may
lead to unwanted consequences.

2.2 SCOPE FOR CONTRIBUTION:


Instead of people such as tele-operators working in hazardous conditions they can work at
some other peaceful and friendly work atmosphere. On the other hand we have thought of a
autonomous robot which will carry out the function on its own. Entire database will be fed in
the robot making it nowhere to depend on humans unless and until there is breakdown.
Many such variations can be carried out. Industry uses one such technology known as
KIVA ROBO SYSTEMS owned by AMAZON.COM. The major drawback about this system
is its cost. We have tried to minimize the cost as much as possible to sustain in the Indian
markets.

3.SYSTEM MODEL

FIGURE 3.1. BLOCK DIAGRAM

3.1 PARTS OF THE SYSTEM


The above figure shows the basic block diagram of the said project. The basic description of
each block is explained as follows :

3.1.1. MICROCONTROLLER : The controller is the heart as well as the brain of the
system. It senses the object if it is placed on the plate. As soon as the object is sensed, the
object (rack) is lifted from its ground position to some height. Then the controller sends
commands to direct the bot the desired location. On reaching the destination, it unloads the
rack and return to its home position.

3.1.2. RACK AND PINION ASSEMBLY : This assembly is also very important in
our project as it is used to lift the objects in a prismatic motion. The detailed specification of
the Rack and Pinion Assembly is explained in section 4.2.
5

3.1.3 SENSORS : Sensors play an important role in our project. There are 2 sensors which
are used. The 1st one is the path array sensor used to detect the line. This sensor gives analog
inputs to the microcontroller according to the light reflected. The 2nd one is the object sensor
which will sense diiferent objects at the start point and then place them at the desired location.

3.1.4 MOTOR DRIVERS: DC motors operate either in clockwise or anti-clockwise


direction. To make them operate in both the direction without changing the polarities, we can
use H-Bridge circuit. Industry nowadays manufacture such ICs which performs this operation.
We have used L293d motor driver IC. Other than providing the H- Bridge operation, it even
isolates the microcontroller from the motor avoiding damage to the circuit.

3.2. STEPS FOLLOWED BY THE SYSTEM:


The tasks performed can be described as follows:
First it needs to sense the object with the help of object sensor.
Raise the object using the rack and pinion assembly.
Track the path where the object has to be placed.
Energize the robot wheels in the desired direction.
Place the object at the desired location.
Return to the home position.

4.SYSTEM HARDWARE DESIGN

4.1. ROBOT CHASSIS: The robot chassis is the body of the robot. In our case the
robot chassis has to lift the weight of its own and also the object. We designed the
robot chassis in sketchup and with little tweaking we arrived at the final model.
FRAME
The frame of the robot is the basic structure to which we attach everything
else. It is probably the largest part of the robot, so we made sure it is made of
a light weight rigid material.
MOUNTING
Mounting is done such a way that the the appearance of the robot is not
suffered. Also while mounting it is kept in notice that it is easy to replace the
wore out parts.
4.1.1. ACRYLIC SHEET

FIGURE 4.1.: ACRYLIC SHEET

The above shown acrylic sheet is used to prepare the chassis for the robot.The
thickness of the acrylic sheet is around 10mm. The reason we chose the acrylic
sheet is because it is sturdy and more firm. Also the transparent acrylic sheet
looks attractive than the wooden counterpart.
4.2 ARDUINO UNO R3 SMD

FIGURE 4.2.: ARDUINO UNO BOARD


4.2.1 DESCRIPTION
This is the new Arduino Uno R3. In addition to all the features of the previous
board, the Uno now uses an ATmega16U2 instead of the 8U2 found on the Uno (or
the FTDI found on previous generations). This allows for faster transfer rates and
more memory. No drivers needed for Linux or Mac (inf file for Windows is needed
and included in the Arduino IDE). The Uno R3 also adds SDA and SCL pins next to
the AREF. In addition, there are two new pins placed near the RESET pin. One is
the IOREF that allow the shields to adapt to the voltage provided from the board.
9

The other is a not connected and is reserved for future purposes. The Uno R3
works with all existing shields but can adapt to new shields which use these
additional pins.
Arduino is an open-source physical computing platform based on a simple i/o
board and a development environment that implements the
Processing/Wiringlanguage. Arduino can be used to develop stand-alone
interactive objects or can be connected to software on your computer (e.g. Flash,
Processing, MaxMSP). The open-source IDE can be downloaded for free (currently
for Mac OS X, Windows, and Linux).

The

Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It


has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with
a AC-to-DC adapter or battery to get started.The Uno differs from all preceding
boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it
features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USBto-serial converter.Revision 2 of the Uno board has a resistor pulling the 8U2 HWB
line to ground, making it easier to put into DFU mode.

Revision 3 of the board has the following new features:


1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two
other new pins placed near to the RESET pin, the IOREF that allow the shields to
adapt to the voltage provided from the board. In future, shields will be compatible
with both the board that uses the AVR, which operates with 5V and with the
Arduino Due that operates with 3.3V. The second one is a not connected pin, that
is reserved for future purposes.

1. Stronger RESET circuit.


2. Atmega 16U2 replace the

8U2.
3.2.2. SPECIAL SMD VERSION
Because Atmel is moving more and more of their production capacity to
surface mount ICs, the DIP packaged ATmega is becoming more and more difficult
to get. To keep up with demand, we now offer the Arduino Uno R3 with an SMD
10

ATmega. The board is identical to the PTH version of the Uno, but you won't be
able to remove the ATmega without some hot-air. This change shouldn't affect
most users.

4.2.3. PIN MAPPING OF ATmega328 WITH ARDUINO FUNCTION


As we know that Arduino-Uno uses ATmega328 the internal pin mapping for the
development board and the microcontroller is shown as follows.

FIGURE 4.3.: ATmega328 PIN MAPPING

4.2.4. FEATURES
Atmega 328 Microcontroller.

Input voltage - 7-12V

14 Digital I/O Pins (6 PWM outputs)


11

6 Analog Inputs.

32k Flash Memory.

16Mhz Clock Speed.

4.3 MOTOR DRIVER(L293d)

FIGURE

4.4.:

PINOUT OF L293d

4.3.1. DESCRIPTION
OF L293D MOTOR
DRIVER
L293D is a typical Motor driver or Motor Driver IC which allows DC motor to
drive on either direction. L293D is a 16-pin IC which can control a set of two DC
motors simultaneously in any direction. It means that you can control two DC
motor with a single L293D IC.The l293d can drive small and quiet big motors as
well
4.3.2. CONCEPT
It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage
to be flown in either direction. As you know voltage need to change its direction
for being able to rotate the motor in clockwise or anticlockwise direction, Hence
H-bridge IC are ideal for driving a DC motor.In a single l293d chip there two hBridge circuit inside the IC which can rotate two dc motor independently. Due its
size it is very much used in robotic application for controlling DC motors. Given
below is the pin diagram of a L293D motor controller.

There are two

Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1
and 9 need to be high. For driving the motor with left H-bridge you need to enable
pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone
of the either pin1 or pin9 goes low then the motor in the corresponding section
will suspend working. Its like a switch.

12

FIGURE 4.5.:
CIRCUIT
DIAGRAM FOR
L293d.

4.3.3. Working of
L293D
There 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as
shown on the pin diagram. Left input pins will regulate the rotation of motor
connected across left side and right input for motor on the right hand side. The
motors are rotated on the basis of the inputs provided across the input pins as
LOGIC 0 or LOGIC 1.

4.3.4. L293D Logic Table.


Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the
motor in clockwise direction the input pins has to be provided with Logic 1 and
Logic 0.
Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
4.4 DC MOTORS
There are 2 different types of motors used in our project. The 1 st one is used for
driving the bot and the 2nd one is used for the pick and place assembly. The
specfications of the motors is given below.

13

FIGURE 4.6.: DC MOTOR


4.4.1. DC MOTORS USED FOR WHEELS:
QUANTITY: 2
OPERATING RANGE: 3.0 to 18V
NOMINAL VOLTAGE: 12V
CURRENT : 0.020 (NO LOAD)
RPM: 100 (NO LOAD)
TORQUE: 1Kg-Cm

14

4.4.2. DC MOTORS USED FOR MECHANISM:


QUANTITY: 2
OPERATING RANGE : 3 to 18V
NOMINAL VOLTAGE: 12V
CURRENT : 0.080 (NO LOAD)
RPM: 50 (NO LOAD)
TORQUE: 3Kg-Cm
4.5. LINE FOLLOWING ARRAY SENSOR

FIGURE 4.7.: LINE SENSOR BOARD

4.5.1. FUNCTIONAL DESCRIPTION:


15

The LINE SENSOR is reflectance sensor array is intended as a line sensor, but
it can be used as a general-purpose proximity or reflectance sensor. The module
is a convenient carrier for five IR emitter and receiver (phototransistor) pairs. With
sensors spaced at intervals of 0.375 (9.525 mm) along of the boards longer axis,
this array works well as a minimal detector for line-following robots, as linefollowing courses are commonly made using 3/4 (19 mm) black electrical tape.
The middle sensor is slightly offset along the short axis of the board.
Each phototransistor is connected to a pull-up resistor to form a voltage divider that
produces an analog voltage output between 0 V and VCC (which is typically 5 V)
as a function of the reflected IR. Lower output voltage is an indication of greater
reflection.
Cases encountered during line following i.e. while traversing from one node to
another
Senso
r

Sensor
2

Sensor
3

Sensor

Sensor
5

Take right turn

Take left turn

Keep going
forward

Take left turn

Take right turn

TABLE 4.1. : SENSOR READINGS FROM THE ARRAY


4.5.2 FUNCTIONAL BLOCK DIAGRAM
The functional block diagram of the line sensor array is shown below. Each sensor
provides with different analog readings as per the light reflected.

16

FIGURE 4.8.: SCHEMATIC DIAGRAM OF LINE SENSOR


4.5.3 PIN DESCRIPTION :
The pin description of the array is as follows.

17

TABLE 4.2.: PIN DESCRIPTION


4.6. RACK AND PINION ASSEMBLY
A rack and pinion is a type of linear actuator that comprises a pair of gears which
convert rotational motion into linear motion. A circular gear called "the pinion"
engages teeth on a linear "gear" bar called "the rack"; rotational motion applied
to the pinion causes the rack to move, thereby translating the rotational motion of
the pinion into the linear motion of the rack.

FIGURE 4.9.:
RACK AND
PINION
ASSEMBLY

4.6.1. GEOMETRIC
RELATION :
Its fairly simple to derive the geometric relation for the rack and pinion assembly.

Let assume:
Round Gear of radius R, and N as the number of teeth.
For rotation of "Alpha = a" deg we have a linear movement of 2*pi*R*a/360=L.

For example:
A pinion gear of R=100mm turns for 60 deg.
What is the linear movement of the rack.
Ans. 2*3.14*100*60/360=104.72mm

4.7. OBJECT SENSOR


An object sensor is used to differentiate as well as to detect the object placed
over the bot.
This is acheived using an IR transmitter-reciever pair.
18

FIGURE 4.10.: OBJECT SENSOR

4.7.1 CIRCUIT DIAGRAM


The ckt. Diagram of the object sensor used is shown below.The reflective switches
consist of an infrared emitting device (LED or VCSEL) and a NPN silicon
phototransistor mounted side-by-side on a parallel axis in a black opaque plastic
housing. All object sensors have an emitting device and a phototransistor that
are encapsulated in a visible filtering epoxy.

The phototransistor responds to

radiation from the emitter only when a reflective object passes within its field of
view.

The phototransistor has enhanced low current roll-off to improve the

contrast ratio and immunity to background irradiance. LED versions are designed
for near-field applications. The VCSEL version is designed for longer distances.

19

FIGURE
4.11.:

CIRCUIT DIAGRAM FOR OBJECT SENSOR

5.ADOPTED METHODOLOGY

FIGURE 5.1.:CIRCUIT DIAGRAM OF THE SYSTEM


5.1 OPERATION:
20

The operation of the pick and place robot is quite simple. Initially the
robot checks for 2 conditions. The first one is whether the rack is present or
not. If the rack is present it will look for the direction to go in. Here the
direction is either left or either right.

Once these two conditions are

met , the 3rd condition it checks for is the node. For example, if the bot wants
to place the object in the 2nd row on the right side. The bot will keep on
tracking the node. After the 1st node is detected it checks with the condition.
If the condition is met with it will take the right turn. If the condition is not
met the robot will keep moving in the forward direction.
Similarly, the arm operation takes place. The arm
initially is in the down position. Once the object is sensed it lifts the object to
a certain height and then performs the line following operation. Once the bot
reaches its destination, the arm is again brought down to its home position.

6.SOFTWARE TOOLS USED TO DEVELOP THE SYSTEM


6.1 ARDUINO IDE 1.0.5

21

FIGURE 6.1.:ARDUINO IDE 1.0.5


The open-source Arduino environment makes it easy to write code and upload
it to the i/o board. It runs on Windows, Mac OS X, and Linux. The environment
is written in Java and based on Processing, avr-gcc, and other open source
software.
6.1.1. ARDUINO BUILD PROCESS
6.1.1.1 OVERVIEW
A number of things have to happen for your Arduino code to get onto the
Arduino board. First, the Arduino environment performs some small
transformations to make sure that the code is correct C or C++ (two common
programming languages). It then gets passed to a compiler (avr-gcc), which
turns the human readable code into machine readable instructions (or object
files). Then, your code gets combined with (linked against), the standard
Arduino libraries that provide basic functions like digitalWrite() or
22

Serial.print(). The result is a single Intel hex file, which contains the specific
bytes that need to be written to the program memory of the chip on the
Arduino board. This file is then uploaded to the board: transmitted over the
USB or serial connection via the bootloader already on the chip or with
external programming hardware.
6.1.1.2. Multi-file sketches
A sketch can contain multiple files (tabs). To manage them, click on the
right-facing arrow just above the scroll bar near the top of the environment.
Tabs have one of four extensions: no extension, .c, .cpp, or .h (if you provide
any other extension, the period will be converted to an underscore). When
your sketch is compiled, all tabs with no extension are concatenated together
to form the "main sketch file". Tabs with .c or .cpp extensions are compiled
separately. To use tabs with a .h extension, you need to #include it (using
"double quotes" not <angle brackets>).
6.1.1.3. Transformations to the main sketch file:
The Arduino environment performs a few transformations to your main
sketch file (the concatenation of all the tabs in the sketch without extensions)
before passing it to the avr-gcc compiler.
First, #include "Arduino.h", or for versions less than
1.0, #include "WProgram.h" is added to the top of your sketch. This header
file (found in <ARDUINO>/hardware/cores/<CORE>/) includes all the
defintions needed for the standard Arduino core.
Next, the environment searches for function
definitions within your main sketch file and creates declarations (prototypes)
for them. These are inserted after any comments or pre-processor statements
(#includes or #defines), but before any other statements (including type
declarations). This means that if you want to use a custom type as a function
argument, you should declare it within a separate header file. Also, this
generation isn't perfect: it won't create prototypes for functions that have
default argument values, or which are declared within a namespace or class.
Finally, the contents of the current target's main.cxx file are
appended to the bottom of your sketch.
6.1.1.4. Targets
23

The Arduino environment supports multiple target boards with different chips
(currently, only AVRs), CPU speeds, or bootloaders. These are defined in a
board preferences file. Relevant variables include:
<BOARD>.name: the name to display in the Boards menu
<BOARD>.build.mcu: the microcontroller on the board (normally
"atmega8" or "atmega168").
<BOARD>.f_cpu: the clock speed at which the microcontroller
operates (normally "16000000L", or, for anATmega168 running on its internal
clock, "8000000L").

<BOARD>.core: which sub-directory of the

hardware/cores/ directory to link sketches against (normally "arduino").


6.1.1.5. Upload process
Sketches are uploaded by avrdude.
The upload process is also controlled by variables in the boards and main
preferences files. Those in the boards file include:
<BOARD>.upload.protocol: the protocol that avrdude should use to talk
to the board (typically "stk500").
<BOARD>.upload.speed: the speed (baud rate) avrdude should use when
uploading sketches (typically "19200").
<BOARD>.upload.maximum_size: the maximum size for a sketch on the
board (dependent on the chip and the size of the bootloader).
6.2. HARDWARE SIMULATOR:

24

Hardware Simulator is wholly unique in offering the ability to co-simulate


both high and low-level micro-controller code in the context of a mixed-mode
SPICE circuit simulation. With this Virtual System Modelling facility, you can
transform your product design cycle, reaping huge rewards in terms of
reduced time to market and lower costs of development.
If one person designs both the
hardware and the software then that person benefits as the hardware design
may be changed just as easily as the software design. In larger organisations
where the two roles are separated, the software designers can begin work as
soon as the schematic is completed; there is no need for them to wait until a
physical prototype exists. In short, Hardware Simulator improves efficiency,
quality and flexibility throughout the design process. FIGURE 6.2.: THE
VIRTUAL SYSTEM MODELLING

6.2.1.PROTEUS_8.1.

25

FIGURE 6.3.: PROTEUS INTERFACE


Proteus Virtual System Modelling (VSM) combines mixed mode SPICE
circuit simulation, animated components and microprocessor models to
facilitate co-simulation of complete microcontroller based designs. For the
first time ever, it is possible to develop and test such designs before a
physical prototype is constructed.

This is possible because you can

interact with the design using on screen indicators such as LED and LCD
displays and actuators such as switches and buttons. The simulation takes
place in real time (or near enough to it): a 1GMHz Pentium III can simulate a
basic 8051 system clocking at over 12MHz. Proteus VSM also provides
extensive debugging facilities including breakpoints, single stepping and
variable display for both assembly code and high level language source.
Proteus VSM includes a number of virtual
instruments including an Oscilloscope, Logic Analyser, Function Generator,
Pattern Generator, Counter Timer and Virtual Terminal as well as simple
voltmeters and ammeters. In addition, we provide dedicated
Master/Slave/Monitor mode protocol analysers for SPI and I2C- simply wire
them onto the serial lines and monitor or interact with the data live during
simulation. A truly invaluable (and inexpensive!) way to get your
communication software right prior to hardware prototyping.

26

7.SYSTEM CODE

int XA = 12;
int YA = 13;
int ENA = 11;
int SA = 255;
int Xl = 4;
int Yl = 5;
int Xr = 6;
int Yr = 7;
int ENl = 9;
int ENr = 10;
int slm = 140;
int srm = 140;
void setup()
{

27

Serial.begin(9600);
pinMode(XA, OUTPUT);
pinMode(YA, OUTPUT);
pinMode(ENA,OUTPUT);
pinMode(8,INPUT);
pinMode(Xl, OUTPUT);
pinMode(Yl, OUTPUT);
pinMode(Xr, OUTPUT);
pinMode(Yr, OUTPUT);
pinMode(ENl, OUTPUT);
pinMode(ENr,OUTPUT);
}
void halt()
{
digitalWrite(Xl,HIGH);
digitalWrite(Yl,HIGH);
analogWrite(ENl,slm);

digitalWrite(Xr,HIGH);
digitalWrite(Yr,HIGH);
analogWrite(ENr,srm);
}
28

void anticlockwise()
{
digitalWrite(Xl,HIGH);
digitalWrite(Yl,LOW);
analogWrite(ENl,slm);
digitalWrite(Xr,LOW);
digitalWrite(Yr,HIGH);
analogWrite(ENr,srm);
}
void clockwise()
{
digitalWrite(Xl,LOW);
digitalWrite(Yl,HIGH);
analogWrite(ENl,slm);
digitalWrite(Xr,HIGH);
digitalWrite(Yr,LOW);
analogWrite(ENr,srm);
}
void forward()
{
digitalWrite(Xl,LOW);
digitalWrite(Yl,HIGH);
29

analogWrite(ENl,slm);
digitalWrite(Xr,LOW);
digitalWrite(Yr,HIGH);
analogWrite(ENr,srm);
}
void backward()
{
digitalWrite(Yl,LOW);
digitalWrite(Xl,HIGH);
analogWrite(ENl,slm);
digitalWrite(Yr,LOW);
digitalWrite(Xr,HIGH);
analogWrite(ENr,srm);
}
void linefollow(int l,int r )
{
if( l<500 && r<500 ) //FORWARD
{
forward();
}
else if( l>500 && r<500 )
{
30

clockwise();
}
else if( l<500 && r>500 )
{
anticlockwise();
}
}
void turn360()
{
halt();
delay(400);
backward();
delay(180);
halt();
delay(400);
anticlockwise();
delay(2000);
halt();
delay(1000);
}
void turnl90()
{
31

halt();
delay(800);
forward();
delay(220);
halt();
delay(600);
clockwise();
delay(1050);
halt();
delay(1000);
}
void turnr90()
{
halt();
delay(800);
forward();
delay(220);
halt();
delay(600);
anticlockwise();
delay(1050);
halt();
32

delay(1000);
}
void haltA()

{
digitalWrite(XA,HIGH);
digitalWrite(YA,HIGH);
analogWrite(ENA,SA);
}
void up(
{
digitalWrite(XA,LOW);
digitalWrite(YA,HIGH);
analogWrite(ENA,SA);
}
void down()
{
digitalWrite(XA,HIGH);
digitalWrite(YA,LOW);
analogWrite(ENA,SA);
}
void loop()
33

{
int ML = digitalRead(8);
int r1 = analogRead(A0);
int m1 = analogRead(A1);
int l1 = analogRead(A2);
int n = 0;
int node = 2;

// node no of address

int d = 0;

// 0 right, 1 left

int r = 1;

//0 norack , 1 rack

int add = 0;

// address

if ((add == 1) || (add == 3) || (add == 5) )


d = 0;
else
d = 1;
if ((add == 1) || (add == 2))
node = 1;
if ((add == 3) || (add == 4) )
node = 2;
if ((add == 5) || (add == 6) )
node = 3;
halt();
haltA();
34

if(r == 1)
{
up();

// lift at root

delay(1100);
haltA();
delay(1200);
follow:

//forward on stem

if (r == 1)
{
int r1 = analogRead(A0);
int m1 = analogRead(A1);
int l1 = analogRead(A2);
linefollow(l1,r1);
if( (l1 > 500) && (m1 > 500) && (r1 > 500))

//check for node

{
n = n+1;
if(n == node)
{
halt();
delay(200);
if(d == 0)

//turn at stem.branch if at correct node

turnr90();
35

if(d == 1)
turnl90();

goto skip;
}
forward();
delay(1000);
goto follow;
}
else
{
goto follow;
}
}
skip:

halt();
delay(200);
follow1:
If

(r

== 1)

//forward on branch

{
36

int r1 = analogRead(A0);
int m1 = analogRead(A1);
int l1 = analogRead(A2);
linefollow(l1,r1);
if( (l1 < 500) && (m1 < 500) && (r1 < 500))

//stop and drop at tips

{
halt();
delay(1000);
down();
delay(1200);
haltA();
delay(1200);
turn360();
goto skip1;
}
else
{
goto follow1;

}
skip1:
halt();
37

delay(20);

follow2:

// return path on branch

if (r == 1)
{
int r1 = analogRead(A0);
int m1 = analogRead(A1);
int l1 = analogRead(A2);
linefollow(l1,r1);
if( (l1 > 500) && (m1 > 500) && (r1 > 500))
{
halt();
if(d == 0)
turnl90();

//turn at stem.branch node

if(d == 1)
turnr90();
goto skip2;
}
else
{
goto follow2;
}
38

}
skip2:

halt();
delay(10);

follow3:
if (r == 1)
{
int r1 = analogRead(A0);

//return path on stem

int m1 = analogRead(A1);
int l1 = analogRead(A2);

linefollow(l1,r1);
if( (l1 < 500) && (m1 < 500) && (r1 < 500))
{
n = n-1;
if (n == 0)

//skip nodes till root

{
halt();
delay(1200);
turn360();

//stop on root
39

goto skip3;
}
forward();
delay(1000);
goto follow3;
}
else
{
goto follow3;
}

skip3:
halt();
haltA();
while(1);
}
}
}

40

8.CONCLUSION AND SCOPE OF FUTURE WORK


8.1. ADVANTAGES

The bot is a smart and an intelligent device. It keeps the record of locations filled

and the locations which are vacant.


There can be no interference as no kind of wired or wireless communication takes

place.
Easy to install.
Cost effective and time efficient.
Provides better use of warehouse.
Consumes less energy and is efficient
Increases the overall efficiency of the system
Works at higher speed.
Has wider range of applications.

8.2. Conclusion
41

As stated this project has a number of applications, from as simple as to simplify a


library warehouse to as complicated as in big industries where automation of multiple
units simultaneously is a necessity. Depending upon the desired intensity or speed of the
device efficient hardware and tight coding with high specification is used. The world of
tomorrow will see a large number of such products in the industry.

8.3. FUTURE SCOPE


There is lot more to explore in this field of research. If cost is not an issue and
industry wants to implement such systems much can be done. The following are some of
the key points which if looked after can give impressive results.

A Barcode Scanner can be introduced instead of object sensor giving infinite

solutions and identity.


The lifting mechanism can be improved by using electromagnetic actuators or

some customized solenoid solution.


Multiple robots can be implemented and using A-Star or Djikstra algorithm, each
bot may find its shortest path to destination avoiding traffic.

42

9. APPENDIX
9.1. DATASHEETS
9.1.1. ARDUINO UNO
Summary
Microcontroller

ATmega168

Operating Voltage

5V

Input Voltage
(recommended)

7-12V

Input Voltage (limits)

6-20V

Digital I/O Pins

14 (of which 6 provide PWM output)

Analog Input Pins

DC Current per I/O Pin

40 mA

DC Current for 3.3V


Pin
Flash Memory

50 mA
16 KB (ATmega168) or 32 KB (ATmega328) of which
2 KB used by bootloader

SRAM

1 KB (ATmega168) or 2 KB (ATmega328)

EEPROM

512 bytes (ATmega168) or 1 KB (ATmega328)

Clock Speed

16 MHz
43

Memory
The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is
used for the bootloader); theATmega328 has 32 KB, (also with 2 KB used for
the bootloader). The ATmega168 has 1 KB of SRAM and 512 bytes of EEPROM
(which can be read and written with the EEPROM library); the ATmega328 has
2 KB of SRAM and 1 KB of EEPROM.
Physical Characteristics
The maximum length and width of the Duemilanove PCB are 2.7 and 2.1
inches respectively, with the USB connector and power jack extending
beyond the former dimension. Three screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins 7
44

and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of the
other pins

9.1.2. L293d

45

You might also like