You are on page 1of 201

Design

&
Implementation
of
An Autonomous Forklift
BY

ARJOO SHANEESH

Submitted as part fulfillment for the degree of

BEng (Hons) Mechatronics

University of Mauritius

Faculty of Engineering

March 2012
Autonomous Forklift

TABLE OF CONTENTS
Table of Contents
CHAPTER 1 : INTRODUCTION ............................................................................. 1
1.1 Advantages of AGVs........................................................................................ 2
1.2 Problem Definition & Aims.............................................................................. 2
1.3 System Description .......................................................................................... 3
1.4 Thesis Structure................................................................................................ 4
CHAPTER 2 : LITTERATURE OVERVIEW ........................................................... 5
2.1 Introduction ................................................................................................. 5
2.2 Industrial Forklifts ....................................................................................... 5
2.3 Autonomous Navigation .............................................................................. 5
2.4 Sorting......................................................................................................... 7
2.5 Guide Tape AGV......................................................................................... 7
2.6 Trailer Loading AGV .................................................................................. 8
CHAPTER 3 : CONCEPTUAL DESIGN ................................................................ 10
3.1 Introduction.................................................................................................... 10
3.2 System Block Diagram ................................................................................... 10
3.2.1 Central PC........................................................................................................... 10
3.2.2 Autonomous Forklift ........................................................................................... 11
3.3 System Flow Chart ......................................................................................... 13
3.4 Conceptual Design ......................................................................................... 15
3.5 Central PC Design .......................................................................................... 16
3.5.1 Sorting ................................................................................................................ 16
3.5.2 Barcode Reader .................................................................................................. 19
3.5.3 Wireless Communicator...................................................................................... 20
3.6 Autonomous Forklift Design .......................................................................... 24
3.6.1 Obstacle Detection ............................................................................................. 24
3.6.2 Navigation System .............................................................................................. 27
3.6.3 Steering System .................................................................................................. 29
3.6.4 Motor Selection .................................................................................................. 34
3.6.5 Microcontroller Selection ................................................................................... 36
3.6.6 Material Selection............................................................................................... 40

Page | i
Autonomous Forklift

CHAPTER 4 : MECHANICAL DESIGN ................................................................ 42


4.1 Introduction.................................................................................................... 42
4.2 Mechanical Structure...................................................................................... 42
4.3 3D Design ...................................................................................................... 42
4.4 Structural Construction ................................................................................... 44
4.4.1 Design of Parts.................................................................................................... 44
4.5 Construction of Base ...................................................................................... 46
4.6 Assembly of Gearbox ..................................................................................... 48
4.7 Construction of Top Part ................................................................................ 49
4.8 Assembly of Tracks and Wheels ..................................................................... 50
4.9 Assembly of Forks ......................................................................................... 50
CHAPTER 5 : ELECTRONIC DESIGN.................................................................. 52
5.1 Introduction.................................................................................................... 52
5.2 Forklift Electronic Design .............................................................................. 52
5.2.1 Ultrasound Sensor .............................................................................................. 52
5.2.2 Battery ............................................................................................................... 53
5.2.3 Line Following Sensor ......................................................................................... 56
5.2.4 Voltage Regulators ............................................................................................. 59
5.2.5 L293D Dual H-Bridge........................................................................................... 63
5.2.6 Shift Register ...................................................................................................... 65
5.2.7 Transceiver ......................................................................................................... 71
5.2.8 Limit Switch ........................................................................................................ 73
5.2.9 Microcontroller .................................................................................................. 73
5.3 Central PC Electronic Design ......................................................................... 75
5.3.1 LCD ..................................................................................................................... 75
5.3.2 Nordic Transceiver .............................................................................................. 77
5.3.3 Push Buttons Switches ........................................................................................ 77
5.3.4 Microcontroller .................................................................................................. 78
CHAPTER 6 : SOFTWARE DESIGN ..................................................................... 81
6.1 Introduction.................................................................................................... 81
6.2 Central PC Software Design ........................................................................... 81
6.2.1 Machine Vision ................................................................................................... 81
6.2.2 Arduino Nano ..................................................................................................... 82
6.3 Forklift Software Design ................................................................................ 84

Page | ii
Autonomous Forklift

6.3.1 Setup Program .................................................................................................... 84


6.3.2 Main Loop Program ............................................................................................ 86
CHAPTER 7 : IMPLEMENTATION AND TESTING .......................................... 105
7.1 Introduction.................................................................................................. 105
7.2 Problems and Solutions ................................................................................ 105
7.3 Central PC .................................................................................................... 106
7.3.1 Machine Vision ................................................................................................. 106
7.3.2 Arduino Nano ................................................................................................... 107
7.4 Forklift ......................................................................................................... 108
CHAPTER 8 : CONCLUSION AND FUTHER WORKS ...................................... 109
8.1 Conclusion ................................................................................................... 109
8.2 Further Works .............................................................................................. 110
REFERENCES ...................................................................................................... 111
APPENDIX A ....................................................................................................... 114
APPENDIX B ....................................................................................................... 116
APPENDIX C ....................................................................................................... 118
APPENDIX D ....................................................................................................... 119
APPENDIX E........................................................................................................ 124
APPENDIX F ........................................................................................................ 129
APPENDIX G ....................................................................................................... 130
APPENDIX H ....................................................................................................... 168
APPENDIX I ......................................................................................................... 169

Page | iii
Autonomous Forklift

LIST OF TABLES
Table 3.1: Decision matrix for Sorting. .................................................................... 18
Table 3.2: Decision matrix for Wireless Communicator. .......................................... 23
Table 3.3: Decision matrix for Steering System ....................................................... 33
Table 3.4: Motor Torque Calculation ....................................................................... 34
Table 3.5: Components of Central PC ...................................................................... 36
Table 3.6: Components of AGV .............................................................................. 37
Table 3.7: Decision matrix for Microcontroller Selection ......................................... 40
Table 3.8: Decision matrix for Material Selection .................................................... 41
Table 4.1: Dimension of Parts.................................................................................. 45
Table 5.1: HC-SR04 Port Allocation ........................................................................ 52
Table 5.2: Voltage Regulators.................................................................................. 59
Table 5.3: L293D Features ...................................................................................... 64
Table 5.4: L293D Logic........................................................................................... 65
Table 5.5: Motor Driver IC Features ........................................................................ 66
Table 5.6: ShiftOut Numbers ................................................................................... 66
Table 5.7: Motor Driver IC Features ........................................................................ 67
Table 5.8: Motor Direction Relative to ShiftOut ...................................................... 70
Table 5.9: Nordic Transceiver Connections. ............................................................ 72
Table 5.10: Different Connections of Arduino ......................................................... 74
Table 5.11: Different Connections of Arduino Nano ................................................ 79
Table 6.1: Typical LDR Values ............................................................................... 86
Table 7.1: Problems and Solutions ......................................................................... 105

LIST OF FIGURES
Figure 2.1: Forklift Overview .................................................................................... 6
Figure 2.2: Barcode Sorting ....................................................................................... 7
Figure 2.3: Line Following AGV ............................................................................... 8
Figure 2.4: AGV Loading Trailer............................................................................... 9
Figure 2.5: Loading Pattern ....................................................................................... 9
Figure 3.1: Central PC Block Diagram..................................................................... 11
Figure 3.2: AGV Block Diagram ............................................................................. 12
Figure 3.3: PC Flowchart ......................................................................................... 13
Figure 3.4: AGV Flowchart ..................................................................................... 15
Figure 3.5: Typical Barcode..................................................................................... 17
Figure 3.6: Typical RFID Tag .................................................................................. 18
Figure 3.7: Handheld Barcode Scanner .................................................................... 19

Page | iv
Autonomous Forklift

Figure 3.8: Wi-Fi Module ........................................................................................ 21


Figure 3.9: XBee Module ........................................................................................ 22
Figure 3.10: nRF24L01+ Wireless Module .............................................................. 23
Figure 3.11: AGV Measuring Distance .................................................................... 24
Figure 3.12: Infrared Proximity Sensor .................................................................... 25
Figure 3.13: Graph of Analog Voltage against Distance ........................................... 26
Figure 3.14: HC-SR04 Module ................................................................................ 26
Figure 3.15: Direction of Motion Relative Wheels ................................................... 30
Figure 3.16: Ackerman Steering .............................................................................. 31
Figure 3.17: Forklift with Mecanum Wheels ............................................................ 32
Figure 3.18: Direction of Motion Relative to Wheels ............................................... 32
Figure 3.19: Tamiya Tracks and Wheels .................................................................. 33
Figure 3.20: Forces Exerted on a Wheel................................................................... 34
Figure 3.21: Tamiya Double Gearbox ...................................................................... 35
Figure 3.22: Olimex Board ...................................................................................... 37
Figure 3.23: Arduino Duemilanove Board ............................................................... 39
Figure 4.1: 3D Design Side View ............................................................................ 43
Figure 4.2: 3D Design Back View ........................................................................... 43
Figure 4.3: 3D Design Front View ........................................................................... 44
Figure 4.4: HDPE Cutting Board ............................................................................. 45
Figure 4.5: Unglued Base of AGV ........................................................................... 46
Figure 4.6: Base with Hinge .................................................................................... 46
Figure 4.7: Battery and Sonar Sensor ....................................................................... 47
Figure 4.8: 3D Design Battery and Sonar Sensor ..................................................... 47
Figure 4.9: Unassembled Tamiya Double Gearbox .................................................. 48
Figure 4.10: Assembled Tamiya Gearbox ................................................................ 48
Figure 4.11: Top Side AGV ..................................................................................... 49
Figure 4.12: Top Side with Holes ............................................................................ 49
Figure 4.13: 3D Design AGV Top Side ................................................................... 50
Figure 4.14: Forks ................................................................................................... 51
Figure 5.1: HC-SR04 Module .................................................................................. 52
Figure 5.2: Schematic of HC-SR04 and Arduino ..................................................... 53
Figure 5.3: Dismantled Charging Dock .................................................................... 54
Figure 5.4: Battery Components Re-soldered ........................................................... 54
Figure 5.5: Battery with Two-way Switch................................................................ 55
Figure 5.6: Schematic of Battery Circuit .................................................................. 55
Figure 5.7: LDR and Led Pairs ................................................................................ 57
Figure 5.8: Line Sensor on AGV.............................................................................. 57
Figure 5.9: Path of Light .......................................................................................... 58
Figure 5.10: Schematic of LDRs and Leds ............................................................... 58
Figure 5.11: AGV Different Levels.......................................................................... 59
Figure 5.12: Schematic of Voltage Regulator 1 ........................................................ 60
Figure 5.13: Schematic of Voltage Regulator 2 ........................................................ 61
Figure 5.14: LM317 Voltage Regulator ................................................................... 61

Page | v
Autonomous Forklift

Figure 5.15: Schematic of LM317 ........................................................................... 62


Figure 5.16: L293D Pin Layout ............................................................................... 63
Figure 5.17: 74HC595 Pin Layout ........................................................................... 65
Figure 5.18: Schematic of 74HC595 and L293D (steering) ...................................... 68
Figure 5.19: Schematic of L293D and Steering Motors ............................................ 68
Figure 5.20: Schematic of 74HC595 and L293D (fork) ............................................ 69
Figure 5.21: Schematic of L293D and Fork Motor ................................................... 70
Figure 5.22: Schematic of Arduino and Shift Register ............................................. 71
Figure 5.23: Transceiver Module and Schematic ...................................................... 71
Figure 5.24: Schematic of Arduino and Transceiver................................................. 72
Figure 5.25: Schematic of Arduino and Limit Switches ........................................... 73
Figure 5.26: Different Connections of Arduino ........................................................ 75
Figure 5.27: LCD Module........................................................................................ 76
Figure 5.28: Schematic of Arduino and LCD ........................................................... 76
Figure 5.29: Schematic of Arduino and Transceiver................................................. 77
Figure 5.30: Schematic of Push Buttons and Arduino ............................................. 78
Figure 5.31: Different Connections of Arduino Nano ............................................... 80
Figure 6.1: Machine Vision Flowchart ..................................................................... 82
Figure 6.2: Arduino Nano Flowchart ....................................................................... 83
Figure 6.3: Setup Program Flowchart....................................................................... 85
Figure 6.4: Main Loop Flowchart ............................................................................ 88
Figure 6.5: Stop Flowchart ...................................................................................... 88
Figure 6.6: Radio Availability Flowchart ................................................................. 89
Figure 6.7: Radio Package Flowchart....................................................................... 90
Figure 6.8: Forward Flowchart................................................................................. 91
Figure 6.9: Obstacle Detection Flowchart ................................................................ 93
Figure 6.10: Forward Junction Flowchart ................................................................. 94
Figure 6.10: Lower Fork Flowchart ......................................................................... 95
Figure 6.12: Forward No Ultrasound Flowchart ....................................................... 96
Figure 6.13: Raise Fork Flowchart ........................................................................... 97
Figure 6.14: Turn Clockwise Flowchart ................................................................... 98
Figure 6.15: Target Flowchart.................................................................................. 99
Figure 6.16: Turn Anticlockwise Flowchart ........................................................... 100
Figure 6.17: Sonar Delivery Flowchart .................................................................. 101
Figure 6.18: Forward Delivery Flowchart .............................................................. 102
Figure 6.19: Reverse Flowchart ............................................................................. 103
Figure 6.20: Location Flowchart ............................................................................ 104
Figure 7.1: Trailer A Barcode ................................................................................ 106
Figure 7.2: Results of Roborealm........................................................................... 106
Figure 7.3: Nano Interfaced with LCD and Transceiver ......................................... 107
Figure 7.4: Autonomous Forklift............................................................................ 108

Page | vi
Autonomous Forklift

LIST OF ABBREVIATIONS
AGV..Autonomous Guided Vehicle

GPS....Global Positioning System

IC..Integrated Circuit

PC..Personal Computer

LCD.Liquid Crystal Display

LDR....Light Dependent Resistor

PWM.Pulse Width Modulation

RF.Radio Frequency

RFID.Radio Frequency Identifier

USBUniversal Serial Bus

Page | vii
Autonomous Forklift

ACKNOWLEDGEMENTS

First and foremost, I would like to express my deepest thanks to my supervisors; Mr.
V. Oree and especially Mrs. R. Ramjug-Ballgobin for her constant help, guidance and
assistance throughout the year without whom, I would have been unable to
successfully complete my project.

I would also like to thank Mr. Rioux, the robotics lab technician for his help and
precious advice.

Lastly, I would thank my friends that have made my four years at the university very
memorable and thrilling.

Im furthermore very grateful to my mother, uncle and family who have always been
there for me as moral support and also lending me a helping hand when necessary.

Page | viii
Autonomous Forklift

UNIVERSITY OF MAURITIUS

Project/Dissertation Declaration Form

Name: ARJOO shaneesh

Student ID: 0810877


Programme of Studies: BEng (Hons) Mechatronics
Module Code/Name: MECH 4000(5) - Degree Project
Title of Project/Dissertation: Design and implementation of an Autonomous
Forklift

Name of Supervisor(s): Mrs. R. Ramjug-Ballgobin & Mr. V. Oree

Declaration:

In accordance with the appropriate regulations, I hereby submit the above dissertation for
examination and I declare that:

(i) I have read and understood the sections on Plagiarism and Fabrication and
Falsification of Results found in the Universitys General Information to Students
Handbook (20. /20.) and certify that the dissertation embodies the results of my
own work.

(ii) I have adhered to the Harvard system of referencing or a system acceptable as per
The University of Mauritius Referencing Guide for referencing, quotations and
citations in my dissertation. Each contribution to, and quotation in my dissertation
from the work of other people has been attributed, and has been cited and referenced.

(iii) I have not allowed and will not allow anyone to copy my work with the intention of
passing it off as his or her own work.

(iv) I am aware that I may have to forfeit the certificate/diploma/degree in the event that
plagiarism has been detected after the award.

(v) Notwithstanding the supervision provided to me by the University of Mauritius, I


warrant that any alleged act(s) of plagiarism during my stay as registered student of
the University of Mauritius is entirely my own responsibility and the University of
Mauritius and/or its employees shall under no circumstances whatsoever be under any
liability of any kind in respect of the aforesaid act(s) of plagiarism.

Signature: Date:

Page | ix
Autonomous Forklift

ABSTRACT

Automation is the only means of effectively increasing the productivity of an


industry. One of the key components of automation is autonomous guided vehicles.
During the past ten years there have been major developments in this field but
unfortunately the AGVs developed are only capable of specific tasks and work in
restricted zones.

The aim of the project was to devise a system capable of performing multi-tasks, that
is; sorting of loads and loading of trailers in an environment shared with workers.

The project dealt with the design and implementation of a whole system comprising
of a central PC and an autonomous forklift in response to the above problem. The
central PC sorts out loads and transmits the corresponding wireless data to the forklift.
The latter follows a predefined path and loads the appropriate trailer whilst not
affecting the safety of workers.

The central PC makes use of Roborealm, the machine vision software to differentiate
the trailers into which loading has to be done based on barcodes. The information
obtained is then transferred to a microcontroller connected to the PC via USB. The
latter communicates the data to the forklift via wireless communication for it to act
accordingly.

The electronic and mechanical parts of both the sub-systems were implemented. A
great deal of work was involved in the conceptual and software design so that the
system could perform effectively. Tests were carried out to show that the whole
system operated exactly as desired.

Page | x
Autonomous Forklift

CHAPTER 1 : INTRODUCTION

Autonomous Guided Vehicles most commonly known as AGVs are increasingly


popular in industrial environments. Since the creation of the first AGV in 1953 by the
Berrett Electronics Company [1], AGVs have highly evolved, from simple line
following to hundreds of AGVs working in cooperation for the automation of whole
industrial processes.

The first AGV was a simple tow truck that followed a wire track that was
embedded in the factory floor. Sensors under the truck detected the magnetic field,
produced by current passing through the wire and the former guided the tow truck
around the factory. With the development of Integrated Circuits (ICs) in the mid
1970s the popularity of AGV was greatly increased due to the fact that ICs have
better capabilities and flexibilities. A good example of the success of AGVs in 1973 is
the Volvo car manufacturer in Sweden that replaced its typical conveyor assembly
line with no less that 280 AGVs controlled by a computer.

The definition of modern AGVs according to Mikell P. Groover is a follows:


Automated guided vehicles (AGVs). AGVs are battery-powered, automatically
steered vehicles that follow defined pathways in the floor. The pathways are
unobtrusive. AGVs are used to move unit loads between load and unload station in
facility. Routing variations are possible, meaning that different loads move between
different stations. They are usually interfaced with other systems to achieve the full
benefits of integrated automation. (Groover, 2001)[2] . Today modern AGVs are more
sophisticated and present in practically every industry and warehouse. They have
become a key component in flexible manufacturing systems, where they are typically
used for the interconnection of work cells. AGVs nowadays are not only controlled by
a central system but they are able to communicate between themselves for smoother
operations. Twenty four hours non-stop operations has also been made possible with
new battery charging solutions, where the battery is either swapped with a charged
one or simply charged when the AGV is idle. The latter are not anymore confined to
cells or human free zones, with advancement in safety features such as electronics
laser bumpers. These bumpers are a foolproof 360o obstacle detection system that
allows the AGVs to stop or slow down in case of an obstacle. This allows the latter to
operate safely among workers or other vehicles as it is a non-contact type of obstacle
detection [3]. Even if the initial cost of automating an industry with automated guided
vehicles is very high, the return on investment is usually rapid.

AGVs can be classified into categories based on the kind of load they are able to
transport, the type of navigation system they use to move around or the tasks they
perform. The latter is the most common type of classification. Automated Guided
Vehicles are used in a wide range of tasks. They are extensively used in the handling
of work-in-process goods in the manufacturing and automotive industries where they
move materials form one process to another throughout the manufacturing process.

Page | 1
Autonomous Forklift

The advantage of using AGVs for this type of handling is that the movements of
goods between workstations are independent. Another example is the handling of
finished goods where they are used in the automatic storage and retrieval of goods in
food, beverage and pharmaceutical warehouses, where goods have to be classified by
the warehousing software according to date of manufacture. AGV forklifts are most
suitable for these applications as the goods are usually packed into unit loads found on
pallets [4] . Nowadays they are also being used for more complex processes like
automatic trailer loading where pallets are picked up from staging lanes and loaded
into standard trailers using specific loading patterns for improved goods safety and
trailer stability. Secondly in the healthcare industry where AGVs move linens,
regulated medical waste, patient meals and surgical case carts. The main advantage is
that as they move through the hospital they can automatically operate doors, elevators
and even trash dumpers. And lastly also for outer space exploration, the Mars Rovers
Spirit and Opportunity are two specially designed AGVs used for the exploration of
Mars in an attempt to find traces of water. Originally designed to work for only 90
days on the Martian soil, they outperform every expectation by still being in activity
since their landing in January 2004.

1.1 Advantages of AGVs

The advantages offered by AGVs which have contributed to their increased popularity
are mainly: [5]

1. Improvement in safety with AGVs that move in a controlled and predictable


manner with safety sensors for obstacle detection.
2. Reduction of labor costs with fewer people to manoeuver forklifts and on the
loading dock.
3. Reduction in product damage with gentle and precise handling of loads.
4. Reduction in trailer waiting times with safe, reliable, and timely loading of
trailers.
5. Improvement of material tracking with computer controlled vehicles which
communicate with plant controls
6. No plant modifications or bulky conveyors needed as it accommodates standard,
over-the-road trailers and standard loading docks.

1.2 Problem Definition & Aims

Nowadays AGVs are being used in every aspect of the manufacturing process from
the handling of material, sorting, storage and retrieval and trailer loading. But most
AGVs today can perform only one of the above mentioned tasks. The rare AGVs that

Page | 2
Autonomous Forklift

can accomplish multitasking are very expensive. So the main idea behind the project
is to design and implement an overall system consisting of a central PC and an
autonomous forklift that can sort out crates and also load the latter into trailers
according to a specific loading pattern.

The challenge of this project is to design an overall system that can operate safely in
an existing human work place where other vehicles and workers on foot are present.
To meet the challenge the following aims should be met:

1. Sorting of loads for delivery in specific trailer.


2. RF communication between central PC and forklift.
3. Ability of autonomous forklift to navigate through a predefined path.
4. Obstacle avoidance along path, through use of non-contact sensor for
increased security.
5. Loading of standard trailers in a specific pattern.

1.3 System Description

To be able to meet the above aims the proposed methodology was to develop a system
in two parts.

The first one would be sorting part, which would consist of a PC equipped with the
appropriate hardware and software. The PC would normally be found in the loading
area, with loads in close proximity so as to be able to perform its required task.
Whereas the AGV would be in the parking zone found at a remote location.

The PC would sort out the loads base on an algorithm and determine the trailers into
which each would be loaded. For the sake of the project three different trailers
mainly: A, B & C would be implemented. After having received confirmation about
the availability of the forklift, the information of the trailer to be loaded would be
communicated to the latter via wireless communication.

The second part would be the implementation of the autonomous forklift itself. The
forklift would initially be found at the parking zone, where it would inform the PC
about its availability and wait for any load to be present at the loading area.

After having received confirmation of the presence and the specific trailer to be
loaded, the forklift would follow a predefined marked path towards the loading area.
Along the path the latter would use its sensor as a non-contact form of obstacle
detection. In case of any obstacle present for a prolonged time the PC would be
informed of the situation by wireless.

Page | 3
Autonomous Forklift

At the loading area, the forklift would lower its forks, load the pallet and continue
motion along the path towards the trailers. While being on the path the AGV would
continue to monitor any obstacle.

On reaching the junction to the specific trailer, the forklift would do a 90 0 turn on
itself and enter. This time the latter would use its sensor as a distance measuring
device. The sensor would measure the distance between the forklift and the walls of
the trailer or that between the forklift and any previous load already present in the
trailer. The AGV would continue to move forward until the measured distance would
be equal to that of the sum of the width of the pallet and the minimum clearance
required between pallets or pallets and trailer wall.

At this moment the forklift would lower its forks and reverse until it reaches the
junction again. The AGV would then send an RF message to the PC, informing the
latter that it has successfully delivered the load. Then after a 900 turn the former
would continue along the path while detecting obstacles as mentioned above.

On reaching the parking zone, the forklift would stop and inform the PC via RF about
its availability for any further task. The AGV would continue to wait until a message
about any new load is received. On reception of the message the above loop would be
repeated until the trailers are full.

1.4 Thesis Structure

Chapter 2: The literature review is a summarization of the different researches done


in the field of autonomous guided vehicles. Discussions are also made about how the
various features of AGVs already implemented can be applied to the project.

Chapter 3: The conceptual design deals with the selection of the various components,
microcontroller and material that would be used to implement the whole system. The
characteristics and features of each component are discussed and selection is mostly
done by the decision matrix method.

Chapter 4: The mechanical design is a step-by-step process showing the building of


the AGV based on 3D Designs and components selected from chapter 3.

Chapter 5: The electronic design deals with the implementation and interfacing of
the various ICs, sensors, motors and transceiver with the Arduino boards for both the
forklift and central PC.

Chapter 6: The software design gives an in depth explanation of the function of the
different programs by use of flowcharts, that would be run on the AGV and PC.

Chapter 7: The implementation and testing details the various problems faced after
having completely built the system and what specific solution was found for each one.

Page | 4
Autonomous Forklift

CHAPTER 2 : LITTERATURE OVERVIEW

2.1 Introduction

This chapter enumerates the key points on current knowledge that have been
published by scholars and researches in the specific field of autonomous guided
forklifts and how these research work can be applied to the project.

2.2 Industrial Forklifts

A forklift is a powered truck that is used for lifting and transportation of materials.
The latter developed since 1920s has become an indispensable piece of equipment in
all manufacturing and warehousing companies. Forklifts are rated for specific weights
and centre of gravity. One of the main advantages of forklifts is their increase
manoeuvrability in making tight corners, which is due to rear wheel steering.

Instability is the main problem concerning forklifts. The latter and a load are
considered as a unit which has continuous varying centre of gravity for every
movement of the load. Tip-over accidents is another concern that usually occurs when
forklifts negotiate turns with raised loads, it's the combination of the centrifugal and
gravitational forces that combine to cause these accidents [6].

Forklifts can be categorized according to the Industrial Truck Association, using


this mode of classification the forklifts can be grouped into eight distinct classes.

The most common type of forklifts is the counterbalanced ones. They use a heavy
iron mass found at the rear that servers as a counterweight to compensate for the load.
In the case of electric ones the large lead-acid battery is sufficient to counterweight
the load.

2.3 Autonomous Navigation

The means of guidance for AGVs can be of many different types mainly:

Wired which is the oldest means of guidance where a current carrying wire
track is embedded into the floor. The Automated guided vehicle equipped
with a magnetic sensor, senses the magnetic field generated by the current and
the data obtained is used to navigate the robot along the path.

Page | 5
Autonomous Forklift

Laser navigation, that uses retro reflective tape mounted on poles or


machines at strategic locations. The AGV is equipped with a laser mounted on
a turret, the laser is transmitted and the time for the reflected signal to reach
the AGV is calculated. By taking into account the time and angle of the
transmitter the position of the latter is determined.
Inertial navigation, which uses small magnetic rods buried into the floor of
the factory. By detecting the magnetic field and the spacing between the rods
the position of the AGV is determined. The latter is also equipped with
gyroscopes to detect slight changes in direction which are then corrected.
Guide tape navigation, which makes use of magnetic or coloured tape. Using
the appropriate sensor the AGV can be guided along the path. One of the main
advantages of this type of navigation is that the track can be easily modified
and the latter does not require to be energized.

Guide tape was the type of navigation selected for the project of the
Autonomous Forklift as it is simple and can be easily implemented.

Figure 2.1: Forklift Overview

(Source: Figure 6 in [Wikipedia Forklift Truck, 2011])

Page | 6
Autonomous Forklift

2.4 Sorting

Sorting machines found in industries are usually large conveyor-based systems like
the one developed by the SDI group in Holland [7] . The boxes found on the conveyor
are sorted by reading the barcodes or RFID tags found on them and they are
discharged along chutes into respective areas.

[8]

Figure 2.2: Barcode Sorting

(Source: Figure 4 in [Keyence, 2011])

They are later collected by AGVs and transported to the appropriate areas for storage
or loaded into trucks. Using the same principle a PC equipped with a webcam would
sort the packages by decoding the barcode found on them. After decoding the
information extracted from the barcode will indicate into which trailer the package
shall be loaded. This information will then be transmitted to the forklift via RF signal.

2.5 Guide Tape AGV

The E-Jet is an AGV developed by the S-Elektronik company found in Germany [9]. It
uses black coloured tape to guide itself along the path. Although the guide tape
method of navigation suffers from some drawbacks like, tape being easily damaged or
covered with dirty. Its main advantage is that the course of the track can be easily
modified and it is a cost efficient way compared to the other methods.

The same method of navigation was selected for the project. The guide tape used was
standard black adhesive electrical tape, which has a width of approximately 2.7 cm.
The tape was glued on a white background for increased contrast. The sensors used
for the detection of the line were light dependent resistors.

Page | 7
Autonomous Forklift

[10]

Figure 2.3: Line Following AGV

(Source: Figure 1 in [S-Elektronik, 2011])

2.6 Trailer Loading AGV

Modern and more sophisticated AGVs recently developed by companies like Egemin
and Daifuku Webb Company are now even capable of loading and unloading of over-
the-road trailers [11]. The AGVs can move loads found on pallets in warehouse to
trailer and vice versa. The main advantage is that the former can load and unload
conventional trailers so the company does not need to buy specialized ones. One
example of a trailer loading AGV is the Egemin Trailer Loader, shown in figure 2.4.

The Egemin is capable of optimizing the space available in the trailer by leaving
minimal clearances between pallets. And it is also able to load trailers using different
loading patterns which are made possible by its guidance system that adapts itself to
the length and width of each trailer. Being equipped with the latest security features
the AGV is capable of working with both personnel and other manual forklifts
without representing a risk for them [12].

The same concept of trailer loading was used for the project. But this time the sensor
used was the ultrasonic sensor. The latter is used in two different ways, first to detect
the distance between the wall of the container and the Autonomous forklift. Secondly
it is used to detect obstacles such as personnel or other vehicles along the path. Upon
detection the AGV would instantly come to a halt. As the type of microcontroller used
for the project has low processing capabilities, only the single loading pattern would
be implemented.

Page | 8
Autonomous Forklift

Figure 2.4: AGV Loading Trailer

(Source: Figure 1 in [Egemin Trailer loading Brochure, 2011])

Figure 2.5: Loading Pattern

(Source: Figure 10 & 11 in [Egemin Trailer loading Brochure, 2011])

Page | 9
Autonomous Forklift

CHAPTER 3 : CONCEPTUAL DESIGN

3.1 Introduction

The conceptual design of the complete system to be implemented will be discussed in


this chapter. It will encompass all the various functions that should be performed by
the system, and the most appropriate parts will be chosen using the decision matrix
method.

It should be kept in mind that the system should meet certain specific requirements
that will greatly affect the choice and design of the components of the forklift. The
requirements are as follows:

1. The obstacle sensor on the AGV should not be blocked by the forks of the
latter. The sensor should be relatively accurate so as to be able to effectively
measure distance between AGV and any obstacle.

2. The central PC should not only decode loads present in the loading area. But it
should be able to differentiate whenever a load is present or absent.

3. Two-way communication should be possible between PC and AGV. So that


the latter could inform the PC about its availability, tasks being performed and
any obstacle present on path. The PC on its part should be able to inform the
forklift about the presence of loads and the specific trailer into which loading
should be done.

3.2 System Block Diagram

The system block diagrams for both the PC and the autonomous forklift were
realized after the determination of the essential components required. The block
diagrams realized provide a clear view of the overall system.

3.2.1 Central PC

The Figure 3.1 shows the various inputs and outputs that will be present in the
decoding section of the project.

Page | 10
Autonomous Forklift

WEBCAM

BARCODE MACHINE VISION

MICROCHIP

PUSH PUSH PUSH


BUTTON BUTTON BUTTON
A B C

LCD DISPLAY

WIRELESS
TRANSMITTER

Figure 3.1: Central PC Block Diagram

3.2.2 Autonomous Forklift

All the different inputs, outputs and ICs related to the conception of the AGV are
detail in the following block diagram.

Page | 11
Autonomous Forklift

ULTRASOUND LINE FOLLOWER LIMIT


SENSOR SENSOR SWITCH

MICROCHIP

TRANSCEIVER SHIFT
MODULE REGISTER

MOTOR MOTOR
DRIVER IC DRIVER IC

FORK DC
MOTORS MOTORS

BUZZER

Figure 3.2: AGV Block Diagram

Page | 12
Autonomous Forklift

3.3 System Flow Chart

The system flow charts represent the basic steps through which the PC and Forklift
programs must undergo respectively so as to be able to complete their respective
functions.

START

SET
TRANSCEIVER
TO RECEIVER

N IS FORKLIFT
DELAY
AVAILABLE?

IS PACKAGE
DELAY
AVAILABLE?
N

Y
DECODE

SEND INFORMATION
TO MICROCONTROLLER

SET TRANSCEIVER
TO TRANSMITTER

TRANSMIT INFORMATION
TO FORKLIFT

Figure 3.3: PC Flowchart

Page | 13
Autonomous Forklift
START

SET TRANSCEIVER
TO TRANSMITTER

TRANSMIT
AVAILABILTY

SET TRANSCEIVER
TO RECEIVER

N IS PACKAGE
DELAY AVAILABLE?

SET
DESTINATION

LINE
FOLLOWER

IS LOADING
AREA REACHED?

LOAD
PALLETE

LINE
FOLLOWER

IS DESTINATION
REACHED?
Page | 14
Autonomous Forklift

TURN LEFT ENTER


TRAILER

LINE
FOLLOWER

MIN.CLEARANCE
REACHED?

UNLOAD
PALLETE

EXIT TRAILER
TURN RIGHT

LINE
FOLLOWER

IS PARKING
AREA REACHED?

STOP

Figure 3.4: AGV Flowchart

3.4 Conceptual Design

The selection process of the different parts forming the whole automated system will
be described in the following section. The selection will be based on the advantages

Page | 15
Autonomous Forklift

offered by each component but mainly on their ability to be easily integrated in the
design.

3.5 Central PC Design

When considering the design of the central PC part it should be taken into account
that the latter will perform two main functions mainly:

1. The differentiation between the presence and absence of loads, and their
sorting.
2. The establishment of two-way communication between PC and AGV.

3.5.1 Sorting

The different loads present at the loading area would have to be sorted in order to be
successfully loaded in to the specific trailer. To be able to accomplish this task the
sorting system would have to meet certain requirements:

Accurate: The system must be able to differentiate between the loads


without making errors.
Fast and reliable: The information found on the pallet should be obtainable
instantly to be transmitted to the AGV.
Reconfigurable: Reprogramming of the system should be possible to include
more trailers and loads.
Low cost: The method of sorting should be relatively cheap as it would be
included to thousands of pallets.
Track of inventory: A record of the loads leaving the warehouse should be
easy to keep.

The different systems of sorting available are discussed below and based on the
decision matrix method the best choice was made.

3.5.1.1 Barcode

Barcoding is a popular type of sorting used in industries to differentiate loads and


keep track of inventory [13]. In our system, barcodes can be easily glued to pallets and
using an appropriate barcode reader the loads can be easily sorted. The information
obtained by the reader would be decoded and transmitted to the AGV.

Page | 16
Autonomous Forklift

Advantages of barcoding :
1. Inexpensive to design and print.
2. Fast and reliable.
3. Accurate.
4. Improves inventory control.

Disadvantages of barcoding:
1. Label prone to damages.
2. Reader requires direct line of sight to decrypt barcode.

Figure 3.5: Typical Barcode

3.5.1.2 RFID Tags

Radio frequency identifiers also known as RFID are being developed as a new form
of sorting. This kind of method uses radio waves to establish communication between
the tags and the reader [14]. In context with the project the tags could be incorporated
to the pallets and decoded using appropriate equipment.

Advantages of RFID:
1. Modification of data present on tag.
2. Higher data holding capacity.
3. Accurate.
4. Fast and reliable.
5. Improves inventory control.
6. Reader can read multiple tags and does not require direct line of sight.

Disadvantages of RFID:
1. Very high cost of tags and appropriate reader.
2. Radio waves may pose problem with certain materials.
3. Tags can fail.

Page | 17
Autonomous Forklift

[15]

Figure 3.6: Typical RFID Tag

(Source: Figure 2 in [Small Business Trends, 2012])

3.5.1.3 Selection for Sorting

After having performed a thorough search on the above types of sorting Pughs
method was used as a means of comparison.

Table 3.1: Decision matrix for Sorting.

Barcodes RFID
Accuracy ++ ++
Reliability ++ +
Modifications + ++
Reading Speed + ++
Price ++ --
Pluses 8 7
RESULTS
Minuses 0 2

Barcoding was found to be the most appropriate system to be used for the sorting
process, as it meets all the requirements and has a very low cost of implementation.

Page | 18
Autonomous Forklift

3.5.2 Barcode Reader

After the selection of barcoding as the method of sorting, a question about the type of
reader to be used arises. There are two types of barcode reading devices available, a
typical barcode reader or machine vision software.

3.5.2.1 Typical Barcode Reader

The laser barcode readers are the most common variety used. They provide fast and
accurate information which can be easily transferred to a PC for processing. If
implemented for the project the reader would be connected to the PC most likely via
USB. The information obtained would then be shifted to the microcontroller, for the
latter to take the required actions.

Advantages of barcode reader:


1. Fast and accurate.
2. Easily interfaced with PC.

Disadvantages of barcode reader:


1. Have to be used in conjunction with other sensor to detect presence of
load.
2. Barcode has to be in motion for reader to pick up information.

[16]

Figure 3.7: Handheld Barcode Scanner

(Source: Figure 1 in [Buzzle, 2012])

Page | 19
Autonomous Forklift

3.5.2.2 Machine Vision

A PC equipped with a camera and the appropriate software can easily perform the
decoding of barcodes. The software Roborealm would most likely be selected for the
task, as the latter can perform the decrypting process and identify the presence of
loads without the need of external sensors [17]. The decrypted information would then
be transmitted to the microcontroller.

Advantages of Roborealm:
1. Very fast decoding.
2. Can support 9 types of barcodes.
3. Does not require pallets to be in motion to decrypt the information.
4. Can be easily interfaced with microcontrollers.
5. Does not require additional sensors to detect presence of loads.

Disadvantages of Roborealm:
1. Prone to errors in low light conditions.
2. A license has to be purchased yearly for its use.

3.5.2.3 Selection for Barcode Reader

For the determination of the most appropriate piece of equipment, the use of the
decision matrix was not required. As one of the major drawbacks of a typical barcode
reader is that the pallet should be in motion, most likely on a conveyor. Whereas in
the context of this project the load would simply be place on the loading area,
therefore the most suitable method would be the machine vision.

3.5.3 Wireless Communicator

Two-way wireless communication should be possible between PC and AGV. The PC


should be able to transmit information about the trailer to be loaded whenever a pallet
is present. In the same manner the forklift should be able to send data every time it is
available and to inform the PC about any obstacle present on the path.

The most appropriate means of wireless communication are discussed below.

Page | 20
Autonomous Forklift

3.5.3.1 Wi-Fi Module

Wi-Fi is a widely used communication protocol in industries as it can be easily


implemented. The Wi-Fi modules such as the GainSpan WiFi Breakout could be
interfaced with the AGV and as most computers are now equipped with Wi-Fi, there
would be no need to purchase further equipment [18].

Advantages of GainSpan WiFi:


1. Ability to integrate with existing infrastructure.
2. Very long range (300 m).
3. Low battery consumption.

Disadvantages of GainSpan WiFi:


1. Expensive.
2. Lack of libraries present for implementation.

Figure 3.8: Wi-Fi Module

(Source: Figure 1 in [Sparkfun, 2011])

3.5.3.2 ZigBee

ZigBee is a type of wireless protocol designed to transmit data through RF signals


especially in harsh manufacturing environments. The XBee is a module based on the
ZigBee protocol using a frequency of 2.4GHz to transmit data [19]. For the project two
XBee modules could be used, one would be connected to the PC and the other one to
the forklift.

Advantages of XBee:
1. Supports multiple network topologies.
2. Low battery consumption.

Page | 21
Autonomous Forklift

3. Low latency.
4. 128-bit encryption.
5. Easy implementation.

Disadvantages of XBee:
1. Medium range (100 m).
2. Modules relatively expensive.

[20]

Figure 3.9: XBee Module

(Source: Figure 1 in [Sparkfun, 2011])

3.5.3.3 Nordic Transceiver

The nRF24L01+ wireless module developed by the Nordic Semiconductors company


is an ultra-low power RF transceiver [21]. As the XBee modules, it uses a frequency of
2.4 GHz to send information. Two of these modules could be included in the system
so as to establish communication between the PC and AGV.

Advantages of Nordic transceiver:


1. Ultra-low power.
2. Fast transmission of data.
3. Supports multiple topologies.
4. Low cost.

Disadvantages of Nordic transceiver:


1. Low range.
2. Lack of libraries present for implementation.

Page | 22
Autonomous Forklift

[22]

Figure 3.10: nRF24L01+ Wireless Module

(Source: Figure 1 in [Iteadstudio, 2012])

3.5.3.4 Selection for Wireless Communicator

A decision matrix was built so as to compare the different types of communication


available and select the most appropriate one for the project.

Table 3.2: Decision matrix for Wireless Communicator.

Wi-Fi XBee Nordic


Range ++ + -
Power Consumption -- + ++
Ease of + ++ +
Implementation
Support of Networks + ++ ++
Cost -- - ++
Pluses 4 6 7
RESULTS
Minuses 4 1 1

Based on the above table the nRF24L01+ Nordic wireless module was selected as the
most suitable transceiver for the system.

Page | 23
Autonomous Forklift

3.6 Autonomous Forklift Design

Before starting the selection of components for the AGV, it should be kept in mind
that there are certain key functions that the forklift should be able to perform mainly:

1. Establishing two-way communication, so as to be able to inform the central


PC about its current status.
2. Following a predefined path for delivery of pallet in appropriate trailer.
3. Accurate detection of obstacle along path.
4. Precise determination of distance for unloading of pallet in trailers.

For wireless communication the Nordic transceiver selected was used.

3.6.1 Obstacle Detection

For increased security the forklift would have to be equipped with a non-contact form
of obstacle detection sensor while moving on the predefined path. The sensor should
also be able to measure distances accurately so that the AGV can precisely deliver the
load in the trailer. The latter would measure the distance between the forklift and the
walls of the trailer or that between the forklift and any previous load already present
in the trailer as shown in the Figure 3.11.

Figure 3.11: AGV Measuring Distance

The AGV would continue to move forward, until the measured distance would be
equal to that of the sum of the width of the pallet and the minimum clearance required
between pallets or pallet and trailer wall.

Page | 24
Autonomous Forklift

The two means of obstacle detection considered were the infrared proximity sensor
and ultrasound sensor.

3.6.1.1 Infrared Proximity Sensor

The sensor works on the simple principle that an IR light is emitted and on hitting an
object the latter is reflected back to the receiver. Depending on the angle between the
emitted and reflected light an analog voltage is output. [23]

Figure 3.12: Infrared Proximity Sensor

(Source: Figure 2 in [Acroname, 2011]) (Source: Figure 1 in [Sparkfun, 2012])[24]

Advantages of infrared sensor:


1. Cheap.
2. Can be easily interfaced.

Disadvantages of infrared sensor:


1. Low range from 10 to 80 cm only.
2. Low accuracy.
3. The relationship between analog voltage and distance is non-linear.
4. If the distance to the obstacle is less than 10 cm, the output voltage from
the sensor corresponds to that of a longer range. (refer to Figure 3.13)

Page | 25
Autonomous Forklift

Figure 3.13: Graph of Analog Voltage against Distance

(Source: Figure 5 in [Acroname, 2011])

3.6.1.2 Ultrasound Sensor

The ultrasound sensor considered was the HC-SR04 Ultrasonic Range Finder. The
principle of operation of the sensor is that, a sound wave is generated by applying
logic 1 to the Trigger pin on the latter for a few milliseconds. On hitting the obstacle
the wave is reflected back to the sensor. When the reflected wave is detected, the
Echo pin generates a logic output of 1. To measure the distance between the obstacle,
the time in-between the Trigger and Echo is calculated. Then using the relationship
between speed, time and distance, the value of distance is calculated. [25]

Figure 3.14: HC-SR04 Module

(Source: Figure 1 in [Jaktek, n.d])

Page | 26
Autonomous Forklift

Advantages of HC-SR04:
1. Cheap.
2. Can be easily interfaced.
3. Very large range from 2 to 400 cm.
4. Extremely accurate. (0.3 cm)

Disadvantage of HC-SR04:
1. Effective angle of detection is limited to 15o

3.6.1.3 Selection of Obstacle Detector

The HC-SR04 Ultrasonic Range Finder was the obvious choice to be made due to the
numerous advantages it offers but also due to the fact that the Infrared Proximity
Sensor cannot be used for ranges below 10 cm. Measuring distances below 10 cm will
be imperative, especially for the trailer loading function.

3.6.2 Navigation System

In this section the numerous types of navigation available for robots will be discussed
and a choice about the most appropriate form will be made.

The requirements that should be met by the navigation system are as follows:

It should be relatively cheap.


The track should be easily modifiable to accommodate new trailers.
The AGV should be able to follow the predefined path accurately.

The systems that meet the above requirements are the line following and autonomous
navigation by use of GPS.

3.6.2.1 Line Following

The easiest way to implement line following for the project would be to use black
electrical tape. The black tape would be used to define the path that the forklift would
need to follow. The specific places where the AGV would need to load, unload or
perform turns would be defined by junctions. To detect the junctions and the line the

Page | 27
Autonomous Forklift

forklift would either be equipped with LDR and led pairs or IR emitter and receiver
pairs.

Advantages of line following:


1. Very cheap.
2. Path can be easily altered.
3. Easy implementation.

Disadvantage of line following:


1. Tape can be easily damaged or covered with dirt.

3.6.2.2 Autonomous Navigation

The global positioning system (GPS) is a satellite based system that provides
accurate information about the location of any device. This information provided is in
the form of longitudinal and latitudinal values. The AGV would be given specific
points through which it should navigate. The latter should be equipped with a GPS
and compass module to be able to operate properly. [26]

Advantages of GPS navigation:


1. Ability to work in any condition.
2. Path can be easily altered.
3. Easy implementation.

Disadvantages of GPS navigation:


1. Costs of modules are high.
2. Low precision with a maximum deviation of 5m from targeted
location.

3.6.2.3 Selection of Navigation System

The selected form of navigation was the line following method; the choice was made
clear by the low precision of the GPS modules considered. As in an industry a
difference of 5m from the designated position would be troublesome.

Page | 28
Autonomous Forklift

3.6.3 Steering System

The different types of steering available for robots will be considered in this segment.
But before starting it should be kept in mind that the forklift would have to follow
certain requirements based on the project design:

Ability to rotate on itself 360o.


Relatively stable.
Precision turning.
Easily programmable.

The different types of steering are argued below and a choice for the best alternative
was made.

3.6.3.1 Differential Steering

Differential steering is the most common form of steering used for robots. The term
differential comes from the fact that the direction of motion of the robot is affected by
the speed and direction of rotation of each wheel. Two independent wheels driven by
motors would be placed on each side of the forklift. Alterations in the speed of
rotation of the motors by PWM and direction of rotation, would affect the direction of
motion. [27]

Advantages of differential steering:


1. Ability to spin on its own axis by reversing one wheel relative to the
other.
2. Easily programmable.

Disadvantage of differential steering:


1. While making turns the speed of rotation of each wheel should be
precisely controlled.

Page | 29
Autonomous Forklift

Figure 3.15: Direction of Motion Relative Wheels

(Source: Figure 2 in [Robotoid, n.d])

3.6.3.2 Ackerman Steering

The Ackerman steering is a type of steering initially developed for horse drawn
carriages that was later adapted to cars. It avoids tires to slip sideways while doing a
curved path as all the wheels have their axes set on the radius of a circle with a
common center. The rear wheels would be controlled by a single motor, which would
control the forward and backward motion. While the direction of the front ones,
would be controlled by a servo or stepper motor. [28]

Advantages of Ackerman steering:


1. Easily programmable.
2. Most appropriate for high speed robots.

Page | 30
Autonomous Forklift

Disadvantages of Ackerman steering:


1. Unable to spin on its own axis.
2. Increases wear on wheels.
3. Difficult to implement.

Figure 3.16: Ackerman Steering

(Source: Figure 11 in [Beam-wiki, 2012])

3.6.3.3 Omnidirectional Steering

This type of steering makes use of the mecanum wheels. Each of the wheels is
connected to a separate motor and depending on the speed and direction of rotation of
each motor the forklift would move in any direction. This type of steering has already
been implemented on certain real size forklifts as shown in Figure 3.17. [29]

Advantages of omnidirectional steering:


1. Exceptional maneuverability.
2. Low torque of motors is needed and minimum friction is generated
while performing a 360o rotation.

Disadvantages of omnidirectional steering:


1. High cost.
2. Difficult to program.

Page | 31
Autonomous Forklift

Figure 3.17: Forklift with Mecanum Wheels

(Source: Figure 2 in [Gizmodir, 2012]) [30]

Figure 3.18: Direction of Motion Relative to Wheels

(Source: Figure 3 in [Humanoid-robotics, 2012]) [31]

Page | 32
Autonomous Forklift

3.6.3.4 Selection of Steering System

Table 3.3: Decision matrix for Steering System

Differential Ackerman Omnidirectional


Maneuverability + - ++
Stability + ++ ++
Ease of Programing ++ + +
In-place Rotation + -- ++
Cost ++ + -
Pluses 7 4 7
RESULTS
Minuses 0 3 1

The differential steering was the perfect choice for the AGV. Normally casters are
used to balance the system but due to their high price and the fact that they have to be
used in pairs for a stable structure. A more adapted system of tracks and wheels from
Tamiya was preferred, as show in Figure 3.19. One of the main advantages of the
latter is that it can be easily adapted to any kind of robot.

Figure 3.19: Tamiya Tracks and Wheels

(Source: Figure 1 in [Superdroidrobots, 2012]) [32]

Page | 33
Autonomous Forklift

3.6.4 Motor Selection

After the selection of the steering system, the required torque that should be
developed by each motor was calculated based on the following features.

The mass of the forklift together with the load was evaluated to be 2 Kg.
The radius of the driving wheel is equal to 1.5cm.
The AGV would normally operate on a flat surface but for the project an
inclination of 5o was considered.
The efficiency of motors was approximated to 65%.
A travelling speed of 5cm/s was chosen for the forklift. [33]

Figure 3.20: Forces Exerted on a Wheel

(Source: Figure 4 in [Robotshop, 2008])

For calculations refer to Appendix B. The results obtained were as follows:

Table 3.4: Motor Torque Calculation

Mass of Forklift 2 Kg
Radius of Wheel 0.015 m
Travelling Speed 5 cm/s
Rotations of Wheel 31.83 rpm
Acceleration 0.1 m2/s
Inclination 5o
Efficiency of Motors 65%

Page | 34
Autonomous Forklift

Torque Required by AGV 0.44 Nm


Torque Required per Wheel 0.22 Nm
Torque Required per Wheel 2243.37 gf.cm

The Tamiya Double Gearbox was preferred against geared motors due to the
numerous advantages it offers.

Advantages:
1. Can be built in numerous configurations depending on Torque and
speed requirements.
2. It consists of two dc motors whose speed and direction of rotation can
be altered independently.
3. Very low price compared to geared motors.

According to Tamiyas specification sheet the gear ratio selected for the AGV was
344.2:1. This type of configuration offers a Torque of 2276 gf.cm and a Rotational
speed of 38 rpm. This is more than sufficient to drive the forklift.

Figure 3.21: Tamiya Double Gearbox

(Source: Figure 1 in [Tamiya, 2008]) [34]

Page | 35
Autonomous Forklift

3.6.5 Microcontroller Selection

After the selection of all the components making up the AGV and the central PC a
clear idea about the different components and number of inputs and outputs needed
was made. Both the central PC and the Autonomous Forklift would be using a
microcontroller, which should be able to perform certain tasks.

3.6.5.1 Central PC Microcontroller

They requirements that should be met by the microcontroller connected to the PC are
as follows:

1. It should be an interface between the machine vision software and the


transceiver.
2. It should be able to present data on a LCD for the user. (HD44780)
3. It should have the ability to be re-actualized by the user. (push buttons)

To act as interface the controller should either be connected via USB or serial port.
An analysis of the different types of inputs needed was made and is shown in the
Table 3.5.

Table 3.5: Components of Central PC

Components Num. of ports Type


Nordic Transceiver 5 Digital Output
LCD 6 Digital Output
Push Buttons 3 Analog Input

A total of 11 digital outputs and 3 analog inputs were required.

3.6.5.2 Autonomous Forklift Microcontroller

The number of inputs and outputs required for each of the selected components
composing the forklift are detailed in the Table 3.6.

Page | 36
Autonomous Forklift

Table 3.6: Components of AGV

Components Num. of ports Type


Nordic Transceiver 5 Digital Output
Motor Driver (2) 12 Digital Output
Ultrasound Sensor 2 Digital Input & Output
LDR (4) 4 Analog Input
Limit Switch (2) 2 Analog Input
Buzzer 1 Analog Input

A total of 18 digital outputs, 6 analog inputs and 1 digital input would be required
for the AGV. Out of the 18 digital outputs, 2 need to be capable of pulse width
modulation (PWM).

Two different types of microcontrollers were considered and based on their respective
advantages a decision was made.

3.6.5.3 PIC 16F877A

The popular microcontroller PIC16F877A together with the development board from
Olimex was investigated as an option.

Figure 3.22: Olimex Board

(Source: Figure 1 in [Sparkfun.com, 2011])

Page | 37
Autonomous Forklift

The properties of the PIC16F877A chip are as follows:

14KB Flash program memory.


256 byte EEPROM Data.
368 bytes RAM.
8 Analog inputs.
35 Digital Inputs or Outputs.
2 PWM ports out of the 35.

Advantages of PIC16F877A:
1. Widely used.
2. Huge number of ports available.

Disadvantages of PIC16F877A:
1. Limited library available for implementation with components.
2. Limited number of PWM outputs.
3. No online reference available.
4. Can only be programmed through serial RS 232 port. (Most modern PCs
are equipped with only USB).
5. Cost of PIC and development board relatively high.
6. Difficult to program.

3.6.5.4 ATmega 328

The second microcontroller that was considered was the ATmega 328 that comes with
the Arduino Duemilanove Board. The Duemilanove is a modern development board
that is becoming increasing popular among hobbyist.

The properties of the ATmega 328 chip are as follows:

32KB Flash program memory.


1KB EEPROM Data.
2KB RAM.
6 Analog Inputs.
14 Digital Inputs or Outputs.
6 PWM ports out of the 14.

Page | 38
Autonomous Forklift

Figure 3.23: Arduino Duemilanove Board

(Source: Figure 1 in [Arduino.cc, 2009])

Advantages of Arduino Duemilanove:


1. Huge library available online for implementation with various
components.
2. Can be easily programmed via USB.
3. Relatively cheap.
4. Huge number of PWM ports.
5. Can be easily interfaced with software.

Disadvantage of Arduino Duemilanove:


1. Limited number of digital input or output ports.

3.6.5.5 Selection of Microcontroller

To select the most appropriate microcontroller for the project a decision matrix was
used.

Page | 39
Autonomous Forklift

Table 3.7: Decision matrix for Microcontroller Selection

PIC 16F877A ATmega 328


Ease of Programing -- ++
Num. of Ports ++ --
Interface with -- ++
components
Connectivity - ++
Cost + ++
Pluses 3 8
RESULTS
Minuses 5 2

The Arduino Duemilanove was the microcontroller carefully chosen even if the latter
has only 14 digital input or output ports and the required number for the project was
18. To increase the number of ports a shift register was used.

3.6.6 Material Selection

Different materials have been considered for the construction of the robot. The main
requirements of the material are:

1. Durability.
2. Good machinability.
3. Corrosion resistant.
4. Light weight.
5. Good toughness.

Page | 40
Autonomous Forklift

Table 3.8: Decision matrix for Material Selection

High-density
Stainless Steel Plywood polyethylene
(HDPE)
Durability ++ + ++
Machinability -- + ++
Light weight + ++ ++
Toughness ++ -- ++
Cost -- ++ +
Pluses 5 6 9
RESULTS
Minuses 4 2 0

It was clear from the decision matrix that HDPE is the most appropriate material.
HDPE can be easily found in kitchen cutting boards and it possesses all the required
characteristics.

Page | 41
Autonomous Forklift

CHAPTER 4 : MECHANICAL DESIGN

4.1 Introduction

After the selection of the components and the material from which the AGV would be
build, this chapter will address the building of the different sub-systems that would
compose the forklift.

4.2 Mechanical Structure

Before starting the construction of the structure, there were certain requirements that
should be met for the good functioning of the whole system.

Requirements:
1. The ultrasound sensor should not be blocked by the forks.
2. The height of the line following sensor should be adjustable.
3. The width of the forklift should not exceed 7 cm as this corresponds to the
width of the Tamiya Double Gearbox.

4.3 3D Design

Based on the above considerations a 3D design of the AGV was made using Google
SketchUp to get a better understanding of the structure.

Page | 42
Autonomous Forklift

Figure 4.1: 3D Design Side View

Figure 4.2: 3D Design Back View

Page | 43
Autonomous Forklift

Figure 4.3: 3D Design Front View

4.4 Structural Construction

The following section encompasses the building process of the forklift based on
the 3D designs.

4.4.1 Design of Parts

The different parts that would form part of the structure of the AGV were drawn on a
piece of HDPE of thickness 0.4 cm.

Page | 44
Autonomous Forklift

Figure 4.4: HDPE Cutting Board

The dimension of each part is as follows:

Table 4.1: Dimension of Parts

Part Length /cm Width /cm Thickness /cm


TOP 12 7 0.4
BOTTOM 10 7 0.4
SIDE A 12 4 0.4
SIDE B 12 4 0.4
FORKS 7 2 0.4

Page | 45
Autonomous Forklift

The height of the base of the forklift would be 4 cm which would be enough to
accommodate the ultrasound sensor.

4.5 Construction of Base

After the parts were cut apart, they were glued together to form the base of the AGV
as shown below in Figure 4.5.

Figure 4.5: Unglued Base of AGV

A hinge was integrated on the bottom part so as to be able to control the height of the
line following sensor.

Figure 4.6: Base with Hinge

Page | 46
Autonomous Forklift

The battery and sonar sensor were then glued into place as show in Figure 4.7.

Figure 4.7: Battery and Sonar Sensor

Figure 4.8: 3D Design Battery and Sonar Sensor

Page | 47
Autonomous Forklift

4.6 Assembly of Gearbox

The Tamiya Double Gearbox selected in the motor selection unit, was mounted
according to the selected ratio of 344.2:1 by using the instruction sheet from the
supplier.

Figure 4.9: Unassembled Tamiya Double Gearbox

(Source: Figure 1 in [TowerHobbies, 2012]) [35]

Figure 4.10: Assembled Tamiya Gearbox

Page | 48
Autonomous Forklift

4.7 Construction of Top Part

The top side of the AGV was sectioned into two parts so that the wires from the line
sensors, ultrasound and battery could be connected to the microcontroller and other
components found on the upper levels.

Figure 4.11: Top Side AGV

Holes were also drilled so as to incorporate two switches.

Figure 4.12: Top Side with Holes

Page | 49
Autonomous Forklift

4.8 Assembly of Tracks and Wheels

Two holes were drilled on to each of the sides of the base (SIDES A & B). The
wheels together with the tracks were then screwed into place. Wall plugs were also
glued on the top of the structure, so as to serve as support for the perfboards.

Figure 4.13: 3D Design AGV Top Side

4.9 Assembly of Forks

The requirements that should be met by the lifting mechanism are as follows:

1. Simple mechanism.
2. Light weight so as not to destabilize the AGV.
3. Easily programmable.

For lifting mechanisms usually the ball screw method is used but due to its heavy
weight and complexity it was not chosen.

Page | 50
Autonomous Forklift

A simpler alternative was selected; a modest CD drive. The latter was dismantled and
the tray mechanism removed. The mechanism was then glued vertically to the front of
the forklift.

Limit switches were also glued to the forks so as to detect the position of the latter,
whether they were up or down.

Figure 4.14: Forks

Page | 51
Autonomous Forklift

CHAPTER 5 : ELECTRONIC DESIGN

5.1 Introduction

The electronic design of the forklift and the central PC will be reviewed in this
chapter. The different connections and functions of the various ICs and equipment
will be discussed thoroughly.

5.2 Forklift Electronic Design

The following section will deal with only the electronic part of the AGV.

5.2.1 Ultrasound Sensor

The ultrasound sensor, HC-SR04 consists of four pins. Two of which are connected to
the power source while the rest are connected to two digital ports on the
microcontroller for normal functioning. The Table 5.1 shows the ports allocation.

Table 5.1: HC-SR04 Port Allocation

HC-SR04 Port Allocation


Vcc +5V source
Gnd Ground
Echo Arduino digital pin 5
Trig Arduino digital pin 6

Figure 5.1: HC-SR04 Module

(Source: Figure 1 in [Jaktek, n.d]) [25]

Page | 52
Autonomous Forklift

The schematic in Figure 5.2 shows the HC-SR04 connected to the Arduino ATmega
328.

Figure 5.2: Schematic of HC-SR04 and Arduino

5.2.2 Battery

There were certain requirements that were taken into account while selecting the
appropriate battery for the AGV.

Requirements:

1. Rechargeable.
2. Width less than 7cm.
3. Relatively heavy so as to counter balance the weight of the forklift.
4. Minimum voltage of 5V which is the rated voltage of the motors.

The battery selected was a rechargeable 6V NiCd. The battery normally processes an
external recharge dock, but for better convenience the latter was dismantled. And the
recharging circuit integrated into the forklift itself.

Page | 53
Autonomous Forklift

Figure 5.3: Dismantled Charging Dock

After being dismantled all the components were de-soldered. The terminals were
connected to the battery and the other components re-soldered on a perfboard as
shown in Figure 5.4.

Figure 5.4: Battery Components Re-soldered

A two-way switch was also integrated, so that by controlling its position we can
control whether the battery is charging or delivering power to the motors. To
differentiate between the two functions status two leds were used.

Page | 54
Autonomous Forklift

Figure 5.5: Battery with Two-way Switch

The Figure 5.6 shows the whole schematic diagram of the battery circuit.

Figure 5.6: Schematic of Battery Circuit

Page | 55
Autonomous Forklift

5.2.3 Line Following Sensor

The method of navigation selected was the line following, this would normally consist
of a strip of black tape glued onto a white background for an increased contrast. To
differentiate between the black and white areas two types of sensors were investigated
mainly:

Light Dependent Resistors (LDRs) working together with leds.


Infrared detectors and emitters.

5.2.3.1 LDRs and Leds

The leds when turned ON will emit light which on striking the surface will be
reflected back. This reflected light is then detected by the LDRs. The intensity of the
light reflected will greatly depend on the type of surface it stroke. The resistances of
the LDRs will then vary according to the intensity of the reflected light. By
monitoring these resistances the AGV will discern its position.

Advantages of LDRs:
1. Can be easily implemented.
2. Cheap.
3. Easily programed.

Disadvantages of LDRs:
1. Affected by ambient light condition.
2. Must be close to the surface for optimum result.

5.2.3.2 IR Emitters and Detectors

The IR emitter emits infrared light that will strike the surface. If the latter is white the
light is reflected back and is detected by the detector. But if it is black the infrared
light is absorbed and none is reflected. Again by monitoring the detectors the position
of the forklift is known.

Advantages of IR:
1. Less affected by ambient light.

Page | 56
Autonomous Forklift

Disadvantages of IR:
1. Expensive.
2. Not easy to implement and program.

5.2.3.3 Implementation of Sensor

After a quick comparison the LDR and led pair was the type of sensors selected due to
their easy implementation and programming. To overcome the problem caused by
ambient light a simple program was implemented, refer to Software Design.

Figure 5.7: LDR and Led Pairs

The choice made was to have two LDRs on each side so as to be able to detect
junctions in the path. And two other LDRs were centered in the middle so as to be
able to detect the dark line. Figure 5.8 shows the line sensor soldered on a perfboard.

Figure 5.8: Line Sensor on AGV

Page | 57
Autonomous Forklift

Figure 5.9: Path of Light

The Figure 5.9 shows the path taken by light to reach the LDRs. Whenever the forklift
goes off centered, the intensity of the light being reflected to one of the LDRs
increases dramatically. And based on the readings obtained from the latter, corrective
actions are taken by the microcontroller.

Figure 5.10: Schematic of LDRs and Leds

Page | 58
Autonomous Forklift

5.2.4 Voltage Regulators

To power up the different components and ICs, the forklift would incorporate three
voltage regulators that would be found on the first level.

Figure 5.11: AGV Different Levels

Table 5.2: Voltage Regulators

Voltage Regulator Input Voltage Output Voltage Use

LM7805 6V +5V Motors


(NiCd Battery)
LM7805 9V +5V ICs, LDRs, Limit
(Battery) switch & Ultrasound
LM317 5V +3.3V Transceiver
(from LM7805)

Page | 59
Autonomous Forklift

5.2.4.1 LM7805

The first voltage regulator would be used to power the three motors (2-differential
steering, 1-forks). Its schematic is shown in Figure 5.12.

Figure 5.12: Schematic of Voltage Regulator 1

The first capacitor C8 ensures that there are no ripples in the voltage being supplied
from the 6V battery. The second capacitor C9, on its part acts as a load balancer to
ensure a smooth output voltage of +5V from the regulator. Whenever the regulator is
supplying current to the motors LED5 will be ON. [36]

The second voltage regulator would be used to power up the ICs and various
components. Again LED13 this time will light up when it is delivering power. Its
schematic is shown in Figure 5.13.

Page | 60
Autonomous Forklift

Figure 5.13: Schematic of Voltage Regulator 2

5.2.4.2 LM317

The LM317 is a variable output voltage regulator, where the value of the output
voltage depends on the values of the resistance R1 and R2.

Figure 5.14: LM317 Voltage Regulator

(Source: Figure 1 in [WhatCircuits, 2012]) [37]

Page | 61
Autonomous Forklift

Using the formula:

Vout = 1.25(1 + R2/R1)

And the fact that Vout should be equal to 3.3V and that R1 was chosen as 1K, the
value of R2 was calculated as follows.

R2= (0.8 Vout-1) R1

= (0.83.3 1) 1000

= 1.64 K

As it is impossible to have a resistor of 1.64 K, a 10 K potentiometer was chosen


instead. The Figure below shows the schematic diagram of the circuit.

Figure 5.15: Schematic of LM317

Page | 62
Autonomous Forklift

5.2.5 L293D Dual H-Bridge

The L293D Dual H-Bride is a motor driver that was used to control the three motors
present on the AGV. It was selected mainly because of the following features [38]:

1. It can supply motors with voltages in the range of 4.5 to 36V.


2. It can provide a maximum of 1A to each motor.
3. It has two enable pins that can be used for PWM.
4. It can be easily interfaced with the Arduino.

The Figure 5.16 shows the pin layout of the L293D motor driver IC.

Figure 5.16: L293D Pin Layout

The Table 5.3 gives an idea of the different pins present on the IC and their different
functions.

Page | 63
Autonomous Forklift

Table 5.3: L293D Features

Pin Number Name Function


1 Enable 1 To control motor 1 by
PWM
2 Input 1 To control direction of
rotation of motor 1
3 Output 1 Connected to terminal of
motor 1
4 0V Connected to GND or
heat sink
5 0V Connected to GND or
heat sink
6 Output 2 Connected to terminal of
motor 1
7 Input 2 To control direction of
rotation of motor 1
8 +V motor Connected to motor
supply voltage
9 Enable 2 To control motor 2 by
PWM
10 Input 3 To control direction of
rotation of motor 2
11 Output 3 Connected to terminal of
motor 2
12 0V Connected to GND or
heat sink
13 0V Connected to GND or
heat sink
14 Output 4 Connected to terminal of
motor 2
15 Input 4 To control direction of
rotation of motor 2
16 +V Connected to +5V IC
supply

By changing the logic at the inputs 1 and 2, the direction of rotation of motors 1
would be altered. The same would happen with motor 2 once the logic at inputs 3 and
4 were changed. The Table 5.4 shows the different logics and their results on the
motors.

Page | 64
Autonomous Forklift

Table 5.4: L293D Logic

Enable Input 1/3 Input 2/4 Function


( EN1/EN2)
High Low High Clockwise
High High Low Anti-clockwise
High Low Low Stop
High High High Stop
Low Not applicable Not applicable Stop

Two L293D ICs were required by the AGV, one to control the two motor for the
steering and the other one to control the motor of the forks.

5.2.6 Shift Register

Due to the fact that the Arduino possesses only 14 digital Input/ Output pins and 18
were required to control the forklift, a shift register was used.

The shift register used is the 74HC595, it was used to increase the number of output
ports on the microcontroller. The 74HC595 needs to be connected to 3 digital pins
from the Arduino and it provides 8 digital output pins. Several shift registers can be
interconnected together so as to provide more output pins to the microcontroller,
without utilizing any more than the initial 3 pins. The Figure5.17 shows the pin layout
of the shift register.

Figure 5.17: 74HC595 Pin Layout

Page | 65
Autonomous Forklift

The Table 5.5 gives an idea of the different pins present on the IC and their different
functions.

Table 5.5: Motor Driver IC Features

Pin Name Function


1 Q1 Output 1
2 Q2 Output 2
3 Q3 Output 3
4 Q4 Output 4
5 Q5 Output 5
6 Q6 Output 6
7 Q7 Output 7
8 GND Ground
9 Q7 Serial Out
10 MR Master Reclear
11 SH_CP Shift register clock pin
12 ST_CP Storage register clock pin
13 OE Output Enable
14 DS Serial data input
15 Q0 Output 0
16 Vcc IC power supply

The shift register 74HC595 uses the shiftOut function of the Arduino to control which
output pins to activate and which one to deactivate. The Arduino simply shifts out
numbers to the chip that corresponds to each pin as shown in the Table 5.6.

Table 5.6: ShiftOut Numbers

Output Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
Pin
Number
to be 1 2 4 8 16 32 64 128
shifted

Page | 66
Autonomous Forklift

So for example to activate output pin Q2 with logic 1, we shiftOut 4 and for pin Q6
we shiftOut 64. But to activate two pins at the same time for example Q0 and Q4, we
shiftOut 17 which corresponds to: 1+16.Using this simple principle multiple pins can
be activated.

The Table 5.7 shows the different connections of the 74HC595.

Table 5.7: Motor Driver IC Features

Pin on 74HC595 Connected to Pin Connected to IC

Q1 Input 2 L293D (steering motors)

Q2 Input 3 L293D (steering motors)

Q3 Input 4 L293D (steering motors)

Q4 Input 1 L293D (fork motor)

Q5 Input 2 L293D (fork motor)

Q6 Buzzer -

Q7 - -

GND Ground supply -

Q7 - -

MR +5V -

SH_CP Digital Output 4 ATmega chip

ST_CP Digital Output 2 ATmega chip

OE Ground supply -

DS Digital Output 3 ATmega chip

Q0 Input 1 L293D (steering motors)

Vcc +5V -

The Figure 5.18 shows the connections between the shift register and the L293D IC
used for the differential steering. It can be noted that EN1 and EN2 would be
connected to the Arduino pins 9 and 10 respectively. They will be used to control the
motors via PWM. While the other pins found on the motor IC would be controlled via
the shift register, which will control the direction of rotation of each motor.

Page | 67
Autonomous Forklift

Figure 5.18: Schematic of 74HC595 and L293D (steering)

The Figure 5.19 shows the connections between the L293D and the two steering
motors.

Figure 5.19: Schematic of L293D and Steering Motors

A 0.1F capacitor was included across each motor to act as a short circuit for high-
frequency electrical noises. This reduces the unwanted fluctuations in voltage along
the motor wiring, especially at start up. [39]

Page | 68
Autonomous Forklift

The Figure 5.20 shows the connections between the shift register and the L293D used
to control the fork motor.

This time it can be noted that the enable pin EN1 would be directly connected to a
+5V source as PWM is not required for the fork motor. The outputs Q4and Q5 of the
shift register would control the direction of rotation of the fork motor via the pins IN1
and IN2 respectively.

Figure 5.20: Schematic of 74HC595 and L293D (fork)

The Figure 5.21 represents the connections between the L293D and the fork motor.

Page | 69
Autonomous Forklift

Figure 5.21: Schematic of L293D and Fork Motor

The Table 5.8 shows the different numbers that are shifted out and their consequences
on the different motors.

Table 5.8: Motor Direction Relative to ShiftOut

Steering Motors Fork


Number to be Motor Buzzer
shifted M1 M2
(Right) (Left)
0 STOP STOP STOP OFF
1 FORWARD STOP STOP OFF
4 STOP FORWARD STOP OFF
5 FORWARD FORWARD STOP OFF
6 BACKWARD FORWARD STOP OFF
9 FORWARD BACKWARD STOP OFF
10 BACKWARD BACKWARD STOP OFF
16 STOP STOP DOWN OFF
32 STOP STOP UP OFF
64 STOP STOP STOP ON

Page | 70
Autonomous Forklift

Figure 5.22: Schematic of Arduino and Shift Register

5.2.7 Transceiver

The Nordic transceiver selected would be found on the third level of the AGV
together with the microcontroller. The transceiver module and its schematic are
shown in Figure 5.23.

Figure 5.23: Transceiver Module and Schematic

The Table 5.9 gives a description of the different pins on the Nordic and the digital
pins to which they are connected.

Page | 71
Autonomous Forklift

Table 5.9: Nordic Transceiver Connections.

Pin Number Name Connect to


1 GND Ground
2 3.3V +3.3V (LM317)
3 CE Arduino digital pin 7
4 CSN Arduino digital pin 8
5 SCK Arduino digital pin 13
6 MOSI Arduino digital pin 11
7 MISO Arduino digital pin 12

The Figure 5.24 shows the connections between the Arduino and the Transceiver.

Figure 5.24: Schematic of Arduino and Transceiver

Page | 72
Autonomous Forklift

5.2.8 Limit Switch

Limit switches were integrated into the forks mechanism so as to be able to identify
when the latter has reached the required height. They were connected to the Arduinos
Analog input 4 and 5, as shown in the Figure 5.25.

Figure 5.25: Schematic of Arduino and Limit Switches

5.2.9 Microcontroller

The Arduino microcontroller would be found on the third level of the AGV. A
summarization of the different allocated ports is shown in Table 5.10 and in Figure
5.26 respectively.

Note that the digital pins D0 and D1 were not used to connect components, as they are
used for serial communication between PC and the Arduino via USB.

Page | 73
Autonomous Forklift

Table 5.10: Different Connections of Arduino

Arduino Pin Connected To Pin Component


D0 -
D1 -
D2 ST_CP (12) 74HC595
D3 DS (14) 74HC595
D4 SH_CP (11) 74HC595
D5 Echo Ultrasound
D6 Trig Ultrasound
D7 CE (3) Transceiver
D8 CSN (4) Transceiver
D9 EN 1 (1) L293D
D10 EN 2 (9) L293D
D11 MOSI (6) Transceiver
D12 MISO (7) Transceiver
D13 SCK (5) Transceiver
A0 - Left LDR
A1 - Center Left LDR
A2 - Center Right LDR
A3 - Right LDR
A4 - Limit Switch
A5 - Limit Switch

Page | 74
Autonomous Forklift

Figure 5.26: Different Connections of Arduino

5.3 Central PC Electronic Design

An Arduino Nano which is a variant and breadboard friendly version of the Arduino
Duemilanove would be used to implement display of information and wireless
communication between PC and AGV.

5.3.1 LCD

To display information about the status of the forklift and the type of load available, a
204 character LCD with HD44780 parallel interface chipset was used [40].

Page | 75
Autonomous Forklift

Figure 5.27: LCD Module

(Source: Figure 1 in [Sparkfun, 2010])

The LCD was connected to the Arduino Nano as show in the Figure 5.28.

Figure 5.28: Schematic of Arduino and LCD

A 10 K potentiometer was also included so as to control the brightness of the


display.

Page | 76
Autonomous Forklift

5.3.2 Nordic Transceiver

The Transceiver connected to the central PC is the same as the one used for the AGV.
Except that different ports on the Arduino Nano were used, as shown in Figure 5.29.

Figure 5.29: Schematic of Arduino and Transceiver

5.3.3 Push Buttons Switches

Three push button switches were also integrated into the system so as to re-initialize
the count of the pallets whenever a new trailer would be available. The buttons were
connected to the microcontroller via the analogue input pins 0, 1 and 2 as shown in
Figure 5.30.

Page | 77
Autonomous Forklift

Figure 5.30: Schematic of Push Buttons and Arduino

5.3.4 Microcontroller

The Arduino Nano would be found on a breadboard and the latter would be connected
via jumper wires to the various components. A summarization of the different
allocated ports is shown in Table 5.11 and in Figure 5.31 respectively.

Note that digital pins D0 and D1 would be used as serial communication between the
PC and the Arduino Nano. They are used to transfer data from the machine vision
software to the microcontroller.

Page | 78
Autonomous Forklift

Table 5.11: Different Connections of Arduino Nano

Arduino Pin Connected To Pin Component

D0 - -

D1 - -

D2 DB7 LCD

D3 DB6 LCD

D4 DB5 LCD

D5 DB4 LCD

D6 E LCD

D7 RS LCD

D8 - -

D9 CE (3) Transceiver

D10 CSN (4) Transceiver

D11 MOSI (6) Transceiver

D12 MISO (7) Transceiver

D13 SCK (5) Transceiver

A0 - Switch 1

A1 - Switch 2

A2 - Switch 3

A3 - -

A4 - -

A5 - -

Page | 79
Autonomous Forklift

Figure 5.31: Different Connections of Arduino Nano

Page | 80
Autonomous Forklift

CHAPTER 6 : SOFTWARE DESIGN

6.1 Introduction

The software design chapter will deal with the different programs used for the
programming of each part. The functions of each key component will be explained in
detail by the use of flowcharts. The chapter will be divided into two parts, mainly the
software design of the central PC and that of the forklift respectively.

6.2 Central PC Software Design

There are various tasks that have to be completed by the PC in a stepwise way, each
of them are discussed in greater detail in the following sections.

6.2.1 Machine Vision

The first process would involve the decoding of the barcodes found on the pallets. As
selected in the conceptual design chapter, the machine vision technique was preferred.
The software used is Roborealm, which is a powerful image analysis and processing
program [41]. The flowchart below describes how the software will process the data.
The complete program is shown in Appendix G.

START

CAPTURE
IMAGE

IS LOAD
PRESENT?

Page | 81
Autonomous Forklift

DECODE

IMAGE

SEND TRAILER
INFO TO ARDUINO
NANO VIA SERIAL

Figure 6.1: Machine Vision Flowchart

6.2.2 Arduino Nano

After having received information about the presence of a new load, the
microcontroller will then wait until it receives confirmation from the forklift that the
latter is available. The Arduino will also access its database to see if the trailer into
which the pallet has to be deposited is full (A trailer can contain only a maximum of
three pallets). If the AVG is available and the trailer is empty, information is sent to
the forklift for it to come and collect the load. The push buttons implemented are
used to re-actualize the pallet count whenever a new trailer is available.

START

IS INFO
DELAY
AVAILABLE?
N

Y
DISPLAY TO
Y LCD

Page | 82
Autonomous Forklift

N
IS AGV
DELAY
AVAILABLE?

IS COUNTER
< 4?
Y

N
INCREMENT
COUNTER

CHECK PUSH- SEND INFO TO


BUTTON STATUS FORKLIFT

IS BUTTON
DELAY
HIGH? N

RE-ACTUALIZE
COUNTER

Figure 6.2: Arduino Nano Flowchart

Page | 83
Autonomous Forklift

6.3 Forklift Software Design

The program uploaded to the AGV is explained in more detail in the section below.
The program consists of two main parts the setup program and the main loop.

6.3.1 Setup Program

The setup program defines all the input and output ports associated with the different
components. But a sub-program was also included, so as to calibrate the center LDRs.
As it was discussed in the Electronic Design section LDRs are affected by ambient
light conditions. To calibrate the latter, the AGV is first place in the middle of the
path and then the sub-program explained in Figure 6.3 is run.

Note that the typical values of the LDRs under any light condition, is less than 4.

START

COUNTER = 0

REF_LDR_CR=5
REF_LDR_CL=5

IS COUNTER
>30 ? Y

N
STOP

Page | 84
Autonomous Forklift

READ LDR_CR
READ LDR_CL

IS REF_LDR_CL >
LCDR_CL?

Y N

SET REF_LDR_CL
= LDR_CL

IS REF_LDR_CR >
LCDR_CR?

Y N

SET REF_LDR_CR
= LDR_CR

INCREMENT
COUNTER

DELAY

Figure 6.3: Setup Program Flowchart

Page | 85
Autonomous Forklift

The Table 6.1 shows the shows the values of the LDRs in different conditions, after
having run the sub-program.

Table 6.1: Typical LDR Values

LDRs Position
LDR value
LEFT CENTER-LEFT CENTER-RIGHT RIGHT
On Black
Surface 1 REF_LDR_CL REF_LDR_CR 1
On White
Surface 6 > REF_LDR_CL > REF_LDR_CR 5

6.3.2 Main Loop Program

After having run the setup program, the main loop program would be run indefinitely
on the microcontroller. The main loop would go through the following steps
explained in Figure 6.4. Each of the steps would be discussed in greater detail in the
following sections.

The main loop program will be based on the predefined path in Appendix F.

START

STOP

RADIO
AVAILABILITY

RADIO
PACKAGE

FWD

Page | 86
Autonomous Forklift

FWD_JUNCTION

LOWER FORK

FWD NO
ULTRASOUND

RAISE FORK

TURN
CLOCKWISE

FWD

TARGET

TURN ANTI-
CLOCKWISE

FWD
DELIVERY

LOWER FORK

Page | 87
Autonomous Forklift

REV

TURN
CLOCKWISE

LOCATION

TURN
CLOCKWISE

Figure 6.4: Main Loop Flowchart

6.3.2.1 Stop

The stop function is used to set the inputs of the H-bridges and buzzer with the logic 0
via the shift register.

START

SET DIR=0

SHIFTOUT DIR

STOP

Figure 6.5: Stop Flowchart

Page | 88
Autonomous Forklift

6.3.2.2 Radio Availability

This function informs the central PC that the forklift is available for operation.

START

SET TRANSCEIVER
TO TRANSMITTER
MODE

TRANSMIT
AVAILABILITY

STOP

Figure 6.6: Radio Availability Flowchart

6.3.2.3 Radio Package

The following loop is repeated until information about the presence of a load and the
specific trailer into which it has to be loaded is available.

Page | 89
Autonomous Forklift

START

SET TRANSCEIVER
TO RECEIVER
MODE

N
IS LOAD
AVAILABLE?

TRAILER TO
BE LOADED

TRAILER A TRAILER B TRAILER C

SET SET SET


DESTINATION=1 DESTINATION=2 DESTINATION=3
LOCATION=1 LOCATION=2 LOCATION=3

STOP

Figure 6.7: Radio Package Flowchart

Page | 90
Autonomous Forklift

6.3.2.4 Forward
The control of the forward drive of the robot is based on the readings obtained from
the central LDRs.
START

SET DIR=5

SHIFTOUT DIR

Y
STOP IS LDR
LEFT =1?

N
OBSTACLE
DETECTION
FUNCTION

Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = PWM
N MOTOR
RIGHT=0

IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
N LEFT = 0
MOTOR
SET MOTOR RIGHT=PWM
LEFT = PWM
MOTOR
RIGHT=PWM
Figure 6.8: Forward Flowchart

Page | 91
Autonomous Forklift

6.3.2.5 Obstacle Detection

It is used to detect any obstruction found within 25cm of the AGV. In case of an
obstacle the latter stops immediately and if the path is not cleared within a predefined
time period the central PC is informed and a buzzer is sounded.

START

TRIGGER
SOUNDWAVE

LISTEN FOR
ECHO

CALCULATE
DISTANCE

Y
RETURN IS DISTANCE
PWM =200 >25 CM?

N
START
COUNTER

RETURN
PWM =0

DELAY

Page | 92
Autonomous Forklift

INCREMENT
COUNTER

IS DISTANCE Y
>25 CM?

DELAY

N
IS COUNTER
> 30?

SET RADIO TO
TRANSMITTER
MODE

TRANSMIT
OBSTACLE
INFO TO PC

BUZZER

DELAY
Figure 6.9: Obstacle Detection Flowchart

Page | 93
Autonomous Forklift

6.3.2.6 Forward Junction

The forklift detects the junctions in the line so that it becomes aware of its position.
But for the latter not to detect the same junction twice the Forward Junction function
is used.

START

SET MOTOR
LEFT =225
MOTOR
RIGHT=225

DELAY

SET MOTOR
LEFT =0
MOTOR
RIGHT=0

STOP

Figure 6.10: Forward Junction Flowchart

Page | 94
Autonomous Forklift

6.3.2.7 Lower Fork

START

SET DIR=16

SHIFTOUT DIR

IS LIMIT SWITCH
1 CLOSED?

Y
SET DIR=0

SHIFTOUT DIR

STOP

Figure 6.10: Lower Fork Flowchart

6.3.2.8 Forward No Ultrasound

This is simply a forward function without ultrasound, so that the AGV does not detect
the load as an obstacle.

Page | 95
Autonomous Forklift

START

SET DIR=5

SHIFTOUT DIR

Y
STOP IS LDR
LEFT =1?

Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = PWM
N MOTOR
RIGHT=0

IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
LEFT = 0
MOTOR
N
RIGHT=PWM

SET MOTOR
LEFT = PWM
MOTOR
RIGHT=PWM

Figure 6.12: Forward No Ultrasound Flowchart

Page | 96
Autonomous Forklift

6.3.2.9 Raise Fork

START

SET DIR=32

SHIFTOUT DIR

N IS LIMIT SWITCH
2 CLOSED?

Y
SET DIR=0

SHIFTOUT DIR

STOP

Figure 6.13: Raise Fork Flowchart

Page | 97
Autonomous Forklift

6.3.2.10 Turn Clockwise

START

SET DIR=6

SHIFTOUT DIR

SET MOTOR
LEFT =200
MOTOR
RIGH=200

DELAY

Y IS LDR_CL>
REF_LDR_CL
?

N
SET MOTOR
LEFT =0
MOTOR
RIGHT=0

STOP

Figure 6.14: Turn Clockwise Flowchart

Page | 98
Autonomous Forklift

6.3.2.11 Target

The target function is used as a counter so that the AGV knows which trailer to load.
The junctions in the path, is used as a means to increment the function. The value set
for DESTINATION in the Radio Package function is used for comparison.

START

SET
JUNCTION=1

IS JUNCTION= Y
DESTINATION?

STOP
N

CALL
FORWARD
JUNCTION
FUNCTION

CALL
FORWARD
FUNCTION

INCREMENT
JUNCTION

Figure 6.15: Target Flowchart

Page | 99
Autonomous Forklift

6.3.2.12 Turn Anticlockwise

START

SET DIR=9

SHIFTOUT DIR

SET MOTOR
LEFT =200
MOTOR
RIGH=200

DELAY

Y
IS LDR_CR>
REF_LDR_CR

SET MOTOR
LEFT =0
MOTOR
RIGHT=0

STOP

Figure 6.16: Turn Anticlockwise Flowchart

Page | 100
Autonomous Forklift

6.3.2.13 Sonar Delivery

The sonar delivery function is used to monitor distance inside the trailer.

START

TRIGGER
SOUNDWAVE

LISTEN FOR
ECHO

CALCULATE
DISTANCE

IS DISTANCE
>15 CM?
N Y

RETURN RETURN
MOTION =0 MOTION=1

Figure 6.17: Sonar Delivery Flowchart

6.3.2.14 Forward Delivery

The forward delivery function makes use of the sonar sensor as a distance measuring
device. The forklift continues to move forward until the required distance between
itself and the walls of the container or a previous load is not reached.

Page | 101
Autonomous Forklift

START

SET DIR=5

SHIFTOUT DIR

CALL SONAR
DELIVERY FUNCTION

STOP IS MOTION
N =1?

Y
IS LDR_CL>
REF_LDR_CL
? SET MOTOR
LEFT =150
N MOTOR
RIGHT=0

IS LDR_CR>
REF_LDR_CR Y
?
SET MOTOR
N LEFT = 0
MOTOR
SET MOTOR RIGHT=150
LEFT =150
MOTOR
RIGHT=150
Figure 6.18: Forward Delivery Flowchart

Page | 102
Autonomous Forklift

6.3.2.15 Reverse

START

SET DIR=10

SHIFTOUT DIR

Y
STOP IS LDR
LEFT =1?

Y
IS LDR_CL>
REF_LDR_CL
?
SET MOTOR
LEFT = 0
N MOTOR
RIGHT=175

IS LDR_CR> Y
REF_LDR_CR
?
SET MOTOR
N LEFT = 175
MOTOR
RIGHT=0
SET MOTOR
LEFT=175
MOTOR
RIGHT=175

Figure 6.19: Reverse Flowchart

Page | 103
Autonomous Forklift

6.3.2.16 Location

The location is similar to the target function, but instead of detecting the trailer to be
loaded. The location function is used to return the AGV to its initial position (parking
area).

START

SET
PARKING = 4

IS PARKING = Y
LOCATION?

STOP
N

CALL
FORWARD
JUNCTION
FUNCTION

CALL
FORWARD
FUNCTION

INCREMENT
LOCATION

Figure 6.20: Location Flowchart

Page | 104
Autonomous Forklift

CHAPTER 7 : IMPLEMENTATION AND TESTING

7.1 Introduction

After having completed the mechanical, electronic and software design of both the
central PC and forklift, they were both implemented and tested. The different
problems encountered and solutions found are described in detail in Table 7.1 after
the system was tested as a whole unit.

7.2 Problems and Solutions

Table 7.1: Problems and Solutions

Components or Problems Causes Solutions


Functions
The readings obtained The current being
from the LDRs were supplied to the LDRs Instead of connecting
LDR fluctuating too much from the voltage the supply to the
in constant light regulator was too low. voltage regulator it
intensity was connected to the
The sensor indicated Again the current being +5V output pin on the
Ultrasound obstacles found at 0cm supplied to the sensor microcontroller
form the AGV was too low.
As the 9V battery
Due to the fact that the could not supply the
Arduino Battery Microcontroller had Arduino had now to Arduino with enough
low current problem. power the LDRs and current, it was
ultrasound. replaced with four
1.5V batteries in
series.
The black tape was Instead of using a
The AGV could not glued on white paper paper background, a
Line Follower follow the black tape and the latter was not white melamine board
path. reflecting enough light which is more
to the LDRs. reflective was used.
The tracks kept The orientation was
Wheels and Track coming off the wheels, The bad orientation of changed and a fourth
when the AGV was the wheels and lack of pair of wheels was
performing turns. tension in the tracks. added to the AGV.

All of the above problems were successfully solved and no further ones were found
when the AGV was tested around the predefined path.

Page | 105
Autonomous Forklift

7.3 Central PC

7.3.1 Machine Vision

The Roborealm program that was implemented was tested with barcodes generated
using the code 128 barcode symbology. The program performed as intended by
successfully being able to sort between the three different types of barcodes. The
decode information was then passed to the Arduino Nano via USB.

Figure 7.1: Trailer A Barcode

Figure 7.2: Results of Roborealm

Page | 106
Autonomous Forklift

7.3.2 Arduino Nano

The Nanos program worked flawlessly, it was able to establish wireless


communications with the forklift and display essential information about the current
status of the system via the 204 LCD. The data displayed by the LCD were the
statuses of the AGV, the load present and the count of pallets already loaded in the
trailers. Push buttons were also implemented to re-actualize the count as shown in
figure 7.3.

Figure 7.3: Nano Interfaced with LCD and Transceiver

Page | 107
Autonomous Forklift

7.4 Forklift

After its complete construction the forklift was tested as a whole system. The software
and electronic part worked faultlessly even if some slight minor modifications in the
software were required.

The connections between the shift register and the two motor ICs work as anticipated
allowing a change in direction of the wheels, the upward and downward motion of the
forks and finally the operation of the buzzer also.

The AGV was able to follow the predefined path (Appendix F) and detect the
junctions in the line to identify its position based on the readings obtained from the
LDRs.

The ultrasound sensor on board detected obstacles within a range of 25cm, which
proved efficient along the path. But for better results while performing the trailer
loading function this was reduced to 15cm, that corresponds to the sum of the width
of the pallet and the minimum clearance required.

The Nordic transceiver implemented on the first level of the AGV, operated as
anticipated allowing the latter to establish two-way communication. The figure 7.4
shows the forklift after complete implementation with the fourth pair of wheels added.

Figure 7.4: Autonomous Forklift

Page | 108
Autonomous Forklift

CHAPTER 8 : CONCLUSION AND FUTHER WORKS

8.1 Conclusion

The aim set for this project was the design and implementation of a system capable of
sorting loads and loading them into specific trailers by observing a loading pattern.
Since the system is meant to operate in a human environment the design includes the
necessary features to ensure the safety of any person who may be in the proximity of
the forklift.

To be able to meet the set aim a system comprising of two sub-systems mainly a
central PC and forklift were investigated in the conceptual design. Where the problem
of the selection of the most appropriate parts were addressed using the decision matrix
method.

A 3D design of the AGV was also prepared so as to a have better understanding of the
mechanical design, which had to meet certain requirements such as preventing the
forks from blocking the ultrasound sensor used for obstacle detection and trailer
loading.

The electronic design forms the major part of this thesis, here a problem of lack of
output ports on the microcontroller selected; Arduino Duemilanove was encountered
and solved by the use of a shift register. The latter was used to control the direction of
rotation of the steering motors, forks motor and buzzer. This chapter also
encompasses the implementation of the battery recharging circuit, sonar sensor,
transceiver, motor ICs and line sensor (led and LDRs) for the AGV. For the central
PC the electronic design on its part, involved the implementation of the transceiver
and LCD module with the Arduino Nano.

The software design consisted of three main programs, mainly; the machine vision
used for the sorting process, the Arduino Nano (microcontroller connected to PC) for
wireless communication and information display and that of the Arduino
Duemilanove used for controlling the AGV.

After implementation of the whole system, tests were carried to check whether the
system was able to carry out all the required tasks successfully.

The central PC is capable to sort out loads by use of machine vision and transmit the
required data via RF. While on its part the, forklift designed is a line following robot
that on reception of the information moved from its parking to the loading zone,
where the latter collected the load. Along the way a non-contact form of obstacle
detection using ultrasound was used for increased safety. After having loaded the
pallet, the AGV continued on its path towards the specific trailer. This time, the

Page | 109
Autonomous Forklift

forklift used the ultrasound sensor to measure distance, so as to precisely load the
trailer according to a predefined loading pattern. Having successfully delivered the
load the forklift returned to its parking zone to wait for further instructions from the
central PC.

The testing of the system concluded the successful realization of all the aims and
objectives set in the introductory chapter.

8.2 Further Works

After completion of the project and having a clear idea of how the present system
works, some of the new ways suggested to improve the system are as follows:

1. Design and implementation a charging area at the parking zone so that the
AGVs can recharge their batteries without human intervention.
2. Use of wireless camera instead of LDRs for line following purposes.
3. Construction of more similar AGVs so that they can share the work load.
4. Substitution of track and wheels system by Omni directional wheels even if
they are a lot more expensive.
5. Design of a graphical user interface for the operator to control the sorting
process more efficiently.

Page | 110
Autonomous Forklift

BIBLIOGRAPHY
REFERENCES

1. Wikipedia (2011) Automated Guided Vehicle, [online] Available at:


http://en.wikipedia.org/wiki/Automated_guided_vehicle [Accessed: 27th Aug
2011].
2. Groover, M. (2001) Automation, Production Systems, and Computer-
Integrated Manufacturing, 2nd ed. New Jersey: Prentice Hall, p.282-283.
3. JBT Corporation (2011) AGV safety, [online] Available at: http://www.jbtc-
agv.com/en/knowledge/safety [Accessed: 28th Nov 2011].
4. Wikimheda (2011) Automated Guided Vehicles, [online] Available at:
http://www.wikimheda.org/wiki/AGV [Accessed: 27th Aug 2011].
5. JBT Corporation (2011) AGV safety, [online] Available at: http://www.jbtc-
agv.com/en/knowledge/safety [Accessed: 28th Nov 2011].
6. Wikimheda (2011) Forklift Truck, [online] Available at:
http://www.wikimheda.org/wiki/Forklift_truck [Accessed: 25 Aug 2011].
7. SDI (2011) Carton and box sorter machine, [online] Available at:
http://www.sdipromech.com/index.php/sorting_systems/carton_box_sorting%
20machine [Accessed: 28th Nov 2011].
8. Keyence Corporation (2011) Card Box Conveyors, [online]. Available at:
http://www.keyence.co.uk/products/barcode/barcode/bl700/bl700_applications
_1_1.php [Accessed: 29 November 11].
9. S-Elektronik (2011) E-Jet, [online] Available at: http://www.s-
elektronik.de/77-0-E-JET+english.html [Accessed: 29th Nov 2011].
10. S-Elektronik, (2011), E-Jet [online]. Available at: http://www.s-
elektronik.de/77-0-E-JET+english.html [Accessed: 29 November 11].
11. Daifuku Webb Company (2009) SmartLoader, [online] Available at:
http://www.jervisbwebb.com/Products/automatic_trailer_loading.aspx?pid=19
0&qs=1_3 [Accessed: 29th Nov 2011].
12. Egemin (2011) Automatic Trailer Loading Solutions, [online] Available at:
http://www.egeminusa.com/pages/solutions/agv_solutions_atl.html [Accessed:
29th Nov 2011].
13. Verifiedlabel (2012) Top Eight Benefits of Barcodes - Verified, Inc.. [online]
Available at:
http://www.verifiedlabel.com/knowledgecenter/know_barcodes.aspx
[Accessed: 22 Feb 2012].
14. Bin95.com (2012) RFID Training Download (RFID Training Technology
course download). [online] Available at:
http://www.bin95.com/BarCode_RFID.htm [Accessed: 22 Feb 2012].

Page | 111
Autonomous Forklift

15. Small Business Trends (2012) QR Codes, Barcodes and RFID: Whats the
Difference? [image online] Available at:
http://smallbiztrends.com/2011/02/qr-codes-barcodes-rfid-difference.html
[Accessed: 22 Feb 2012].
16. Buzzle (2012) What is Barcode Scanner. [image online] Available at:
http://www.buzzle.com/articles/what-is-barcode-scanner.html [Accessed: 22
Feb 2012].
17. Roborealm (2005) Barcode Reader. [online] Available at:
http://www.roborealm.com/help/Barcode.php [Accessed: 22 Feb 2012].
18. Sparkfun (2011) GainSpan WiFi Breakout - SparkFun Electronics. [online]
Available at: http://www.sparkfun.com/products/10505 [Accessed: 22 Feb
2012].
19. Digi (2003) ZigBee Wireless Standard - Technology - Digi International.
[online] Available at: http://www.digi.com/technology/rf-articles/wireless-
zigbee [Accessed: 22 Feb 2012].
20. Sparkfun (2011) XBee 1mW Wire Antenna - Series 1 (802.15.4) - SparkFun
Electronics. [online] Available at: http://www.sparkfun.com/products/8665
[Accessed: 22 Feb 2012].
21. Nordicsemi (2000) nRF24L01+ - 2.4GHz RF - Products - Nordic
Semiconductor. [online] Available at:
http://www.nordicsemi.com/kor/Products/2.4GHz-RF/nRF24L01P [Accessed:
22 Feb 2012].
22. Iteadstudio (2012) 2.4G Wireless nRF24L01+ Module. [image online]
Available at:
http://iteadstudio.com/store/index.php?main_page=product_info&cPath=7&pr
oducts_id= [Accessed: 22 Feb 2012].
23. Acroname.com (2011) Sharp IR Rangers Information. [online] Available at:
http://www.acroname.com/robotics/info/articles/sharp/sharp.html [Accessed: 7
Mar 2012].
24. Sparkfun.com (2012) Infrared proximity sensor. [image online] Available at:
http://dlnmh9ip6v2uc.cloudfront.net/images/products/00242-1_i_ma.jpg
[Accessed: 7 Mar 2012].
25. Jaktek.com (n.d.) HC-SR04 Ultrasonic Sensor | JAKTEK. [online] Available
at: http://jaktek.com/?wpsc-product=hc-sr04-ultrasonic-sensor [Accessed: 8
Mar 2012].
26. En.wikipedia.org (2012) Global Positioning System - Wikipedia, the free
encyclopedia. [online] Available at:
http://en.wikipedia.org/wiki/Global_Positioning_System [Accessed: 9 Mar
2012].
27. Robotoid.com (n.d.) My First Robot - Getting Started with Robotics. [online]
Available at: http://www.robotoid.com/my-first-robot/rbb-bot-phase1-
part1.html [Accessed: 9 Mar 2012].

Page | 112
Autonomous Forklift

28. Beam-wiki.org (2012) Steering Techniques - BEAM Robotics Wiki. [online]


Available at: http://www.beam-wiki.org/wiki/Steering_Techniques [Accessed:
10 Mar 2012].
29. En.wikipedia.org (2011) Mecanum wheel - Wikipedia, the free encyclopedia.
[online] Available at: http://en.wikipedia.org/wiki/Mecanum_wheel
[Accessed: 10 Mar 2012].
30. Gizmodir (2012) Airtrax Sidewinder Omni. [image online] Available at:
http://www.gizmodir.com/wp-content/uploads/2011/05/Directional-Lift-
Trucks.jpg [Accessed: 10 Mar 2012].
31. Humanoid-robotics (2012) Robot Kit with Mecanum Wheels. [image online]
Available at: http://www.humanoid-
robotics.com/product_images/uploaded_images/mechanum3.jpg [Accessed:
10 Mar 2012].
32. Superdroidrobots (2012) Track and Wheel Set. [image online] Available at:
http://www.superdroidrobots.com/images/TAM-008-000.gif [Accessed: 10
Mar 2012].
33. Robotshop.com (2008) Drive Motor Sizing Tutorial - RobotShop Learning
Center. [online] Available at: http://www.robotshop.com/ca/drive-motor-
tutorial.html [Accessed: 10 Mar 2012].
34. Tamiya (2012) Double Gearbox. [image online] Available at:
http://www.tamiyausa.com/images/product/430/89918/header_89918.jpg
[Accessed: 10 Mar 2012].
35. TowerHobbies (2012) Tamiya Double Gearbox. [image online] Available at:
http://pics.towerhobbies.com/image/t/tamx8118.jpg [Accessed: 11 Mar 2012].
36. Brain, M. (2000) HowStuffWorks "How Electronic Gates Work". [online]
Available at: http://electronics.howstuffworks.com/digital-electronics4.htm
[Accessed: 12 Mar 2012].
37. WhatCircuits (2012) LM317 calculator. [image online] Available at:
http://www.whatcircuits.com/online_tools/images/lm317.png [Accessed: 12
Mar 2012].
38. Sparkfun.com (n.d.) H-Bridge Motor Driver 1A - SparkFun Electronics.
[online] Available at: http://www.sparkfun.com/products/315 [Accessed: 12
Mar 2012].
39. Beam-wiki.org (2012) Reducing Motor Noise - BEAM Robotics Wiki. [online]
Available at: http://www.beam-
wiki.org/wiki/Reducing_Motor_Noise#Single_Capacitor_Filtering [Accessed:
13 Mar 2012].
40. Sparkfun.com (2010) Basic 20x4 Character LCD - Black on Green 5V -
SparkFun Electronics. [online] Available at:
http://www.sparkfun.com/products/256 [Accessed: 13 Mar 2012].
41. Roborealm.com (2000) Robotic Machine Vision Software. [online] Available
at: http://www.roborealm.com/ [Accessed: 14 Mar 2012].
42. Arduino.cc (n.d.) Arduino - PWM. [online] Available at:
http://arduino.cc/it/Tutorial/PWM [Accessed: 25 Mar 2012].

Page | 113
Autonomous Forklift

APPENDIX
APPENDIX A

Page | 114
Autonomous Forklift

Class 1 forklift - Electric Motor Rider Trucks

Lift Code 1 - Counterbalanced rider type, stand up

Lift Code 4 - Three wheel electric truck, sit down

Lift Code 5 - Counterbalanced rider type, cushion tires, sit down

Lift Code 6 - Counterbalanced rider, pneumatic or either tire type, sit down,
high or low platform

Class 2 forklift - Electric Motor Narrow Aisle Trucks

Lift Code 1 - High lift straddle

Lift Code 2 - Order picker

Lift Code 3 - Reach type outrigger

Lift Code 4 - Side loaders, turret trucks, swing mast and convertible
turret/stock pickers

Lift Code 6 Low lift pallet and platform (rider)

Class 3 forklift - Electric Motor Hand Trucks

Lift Code 1 - Low lift platform

Lift Code 2 - Low lift walkie pallet

Lift Code 3 - Tractors (draw bar pull under 999 lbs.)

Lift Code 4 - Low lift walkie/center control

Lift Code 5 - Reach type outrigger

Lift Code 6 - High lift straddle

Lift Code 7 - High lift counterbalanced

Lift Code 8 - Low Lift Walkie/Rider Pallet

Class 4 forklift - Internal Combustion Engine Trucks - Cushion Tires Only

Lift Code 3 - Fork, counterbalanced (cushion tire)

Class 5 forklift - Internal Combustion Engine Trucks - Pneumatic Tires Only

Lift Code 4 - Fork, counterbalanced (pneumatic tire)

Class 6 forklift - Electric and Internal Combustion Engine Tow Tractors

Page | 115
Autonomous Forklift

Lift Code 1 - Sit-down rider (draw bar pull over 999 lbs.)

Class 7 forklift - Rough Terrain Fork Lift Trucks

Lift Code 1 - All rough terrain lift trucks

Class 8 forklift - Personnel and Burden Carriers

Lift Code 1 - All personnel and burden carriers

APPENDIX B
MOTOR TORQUE CALCULATION

Resolving the forces in the X-Y plane.

m.gx=mg sin ()
= 2 9.81 sin (5o)
=1.710 N

m.gy=mg cos ()
= 2 9.81 cos (5o)
=19. 55 N
For the forklift not to slide down the incline there must be friction between the wheel
and surface.

Page | 116
Autonomous Forklift

Rotations of wheel = (speed 60) / circumference of wheel

= (0.05 60) / 0.0152

= 31.83 rpm

Torque = Force due to friction radius of wheel

T =fR

Resolution of forces along the X plane.

Fx = M.a = M. gx + f

M.a = M.g sin () + T/R

T = {a + g sin ()} M R

= {0.1 + 9.81 sin (5o)} 2 0.015

= 0.0286 Nm (for 2 motors)

Torque required by each motor is: T/2 = 0.0143 Nm

Considering that each motor would have an efficiency of 65%

Require Torque by each motor = (100 /65) 0.0143

= 0.0220 Nm

Page | 117
Autonomous Forklift

APPENDIX C
PWM

Pulse width modulation (PWM) was the method used for the project to control the
cruising speed of the AGV. The latter was required to have a relatively fast travelling
speed while moving along the path and a slow one while performing turns and
delivering pallets in the trailers. PWM is a technique used to alter the voltage
delivered to the motors, by supplying the latter with an average voltage generated
from a fixed one (5V).

Digital control is used to create a square wave, a signal switched between on and off.
This on-off pattern can simulate voltages in between full on (5 Volts) and off (0
Volts) by changing the portion of the time the signal spends on versus the time that
the signal spends off. The duration of "on time" is called the pulse width.

For the Arduino the function that is used to generate the PWM is called analogWrite.
A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a
100% duty cycle (always on), and analogWrite(127) is a 50% duty cycle (on half the
time). [42]

Page | 118
Autonomous Forklift

APPENDIX D
ELECTRONIC CIRCUITS

Central PC:

Page | 119
Autonomous Forklift

Forklift:

Page | 120
Autonomous Forklift

Page | 121
Autonomous Forklift

Page | 122
Autonomous Forklift

Page | 123
Autonomous Forklift

APPENDIX E
3D DRAWINGS & PICTURES

TOP VIEW

Page | 124
Autonomous Forklift

BOTTOM VIEW

Page | 125
Autonomous Forklift

SIDE VIEW

Page | 126
Autonomous Forklift

BACK VIEW

Page | 127
Autonomous Forklift

FRONT VIEW

Page | 128
Autonomous Forklift

APPENDIX F
PREDEFINED PATH

Page | 129
Autonomous Forklift

APPENDIX G
PROGRAMMING

Central PC:

Roborealm:

Arduino Nano:

#include <SPI.h>

#include "nRF24L01.h"

#include "RF24.h"

#include "printf.h"

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

RF24 radio(9,10);

const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

char val;

int availability=0;

int numA=0; // number of pallets

int numB=0;

Page | 130
Autonomous Forklift

int numC=0;

int present =0;

void setup()

lcd.begin(20,4);

Serial.begin(9600);

printf_begin();

radio.begin();

radio.setRetries(15,15);

radio.setPayloadSize(8);

radio.openWritingPipe(pipes[0]);

radio.openReadingPipe(1,pipes[1]);

lcd.setCursor (0,1);

lcd.print("PALLETE:");

lcd.setCursor (0,2);

lcd.print("TRAILER:");

lcd.setCursor (8,2);

lcd.print("A");

lcd.setCursor (14,2);

lcd.print("B");

lcd.setCursor(19,2);

lcd.print("C");

Page | 131
Autonomous Forklift

radio.startListening();

radio.printDetails();

void loop()

if ( radio.available() )

unsigned long package;

bool done = false;

while (!done)

done = radio.read( &package, sizeof(unsigned long) );

switch (package)

case 80 ://P

Serial.println("FORKLIFT AVAILABLE");

lcd.setCursor (0,0);

lcd.print("FORKLIFT AVAILABLE ");

availability =1;

break;

Page | 132
Autonomous Forklift

case 68://D

Serial.println("PALLETE DELIVERED");

lcd.setCursor (0,0);

lcd.print("PALLETE DELIVERED ");

break;

case 79://O

Serial.println("OBSTACLE DETECTED");

lcd.setCursor (0,0);

lcd.print("OBSTACLE DETECTED ");

break;

case 88://X

Serial.println("PERFORMING ACTION");

lcd.setCursor (0,0);

lcd.print("PERFORMING ACTION ");

break;

delay(20);

if ( Serial.available() >0)

val = Serial.read();

Page | 133
Autonomous Forklift

switch (val)

case 'A':

numA++;

Serial.print(numA);

Serial.println("\t Pallet A ");

lcd.setCursor (8,1);

lcd.print("A ");

present =65;

break;

case 'B':

numB++;

Serial.print(numB);

Serial.println("\t Pallet B");

lcd.setCursor (8,1);

lcd.print("B ");

present =66;

break;

case 'C':

numC++;

Serial.print(numC);

Serial.println("\t Pallet C");

lcd.setCursor (8,1);

lcd.print("C ");

Page | 134
Autonomous Forklift

present =67;

break;

case 'U':

Serial.println("Pallet UNAVAILABLE");

lcd.setCursor (8,1);

lcd.print("UNAVAILABLE");

present =0;

break;

if ( availability ==1 && numA >=1 && numA <=3 && present==65)

delay(500);

Serial.println("message sent to forklift");

radio.stopListening();

unsigned long pallete = 65; //A

bool ok = radio.write( &pallete, sizeof(unsigned long) );

availability =0;

present =0;

radio.startListening();

if ( availability ==1 && numB >=1 && numB <=3 && present==66)

Page | 135
Autonomous Forklift

delay(500);

Serial.println("message sent to forklift");

radio.stopListening();

unsigned long pallete = 66; //B

bool ok = radio.write( &pallete, sizeof(unsigned long) );

availability =0;

present=0;

radio.startListening();

if ( availability ==1 && numC >=1 && numC <=3 && present==67)

delay(500);

Serial.println("message sent to forklift");

radio.stopListening();

unsigned long pallete = 67; //C

bool ok = radio.write( &pallete, sizeof(unsigned long) );

availability =0;

present=0;

radio.startListening();

Page | 136
Autonomous Forklift

lcd.setCursor(8,3);

lcd.print(numA);

lcd.setCursor(14,3);

lcd.print(numB);

lcd.setCursor(19,3);

lcd.print(numC);

int sensorA= analogRead (A1);

int sensorB= analogRead (A2);

int sensorC= analogRead (A0);

if (sensorA > 1000) {

numA=0;

delay (1000);

if (sensorB > 1000) {

numB=0;

delay (1000);

if (sensorC > 1000) {

numC=0;

delay (1000);

Page | 137
Autonomous Forklift

Forklift:

#include <SPI.h>

#include "nRF24L01.h"

#include "RF24.h"

#include "printf.h"

//Pin connected to ST_CP of 74HC595

int latchPin = 2;

//Pin connected to SH_CP of 74HC595

int clockPin = 4;

////Pin connected to DS of 74HC595

int dataPin = 3;

//Direction

int dir=0;

int pwm=255;

int timer=0;

//SONAR

int Trig=6;

int Echo=5;

long duration,cm;

//LDR

int LDR_R=0;

int LDR_L=0;

int LDR_CL=0;

Page | 138
Autonomous Forklift

int LDR_CR=0;

//

int referenceCL=5;

int newval_CL;

int referenceCR=5;

int newval_CR;

//

int destination=0;

int package2=0;

int junction=0;

int motion=0;

int locations=0;

int parking;

int obstacle=0;

int message_sent=0;

int counter=0;

int Limit_S=0;

RF24 radio(7,8);

const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

Page | 139
Autonomous Forklift

void setup(void)

Serial.begin(9600);

pinMode(clockPin, OUTPUT);

pinMode(dataPin, OUTPUT);

pinMode(latchPin, OUTPUT);

pinMode(9,OUTPUT); //motor right

pinMode(10,OUTPUT); //motor left

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

printf_begin();

radio.begin();

radio.setRetries(15,15);

radio.setPayloadSize(8);

radio.openWritingPipe(pipes[1]);

radio.openReadingPipe(1,pipes[0]);

Page | 140
Autonomous Forklift

radio.startListening(); // radio listen

radio.printDetails();

while (counter !=30)

newval_CL = analogRead(A1);

newval_CR = analogRead(A2);

newval_CL=map( newval_CL,0,1023,0,10);

newval_CR=map( newval_CR,0,1023,0,20);

if (referenceCL > newval_CL)

referenceCL = newval_CL;

if (referenceCR >newval_CR)

referenceCR = newval_CR;

delay(500);

counter++;

Page | 141
Autonomous Forklift

Serial.print("centre_left=");

Serial.print(referenceCL);

Serial.print("centre_right=");

Serial.print(referenceCR);

delay(2000);

void loop(void)

Stp();

radio_Availability();

radio_Package();

radio_Action();

Setfwd();

Fwd(); //w ultra

Fwd_Junction();

Stp();

Lower();

delay(2000);

Stp();

Setfwd();

Fwd_noultra(); //without ultra

Stp();

delay(2000);

Page | 142
Autonomous Forklift

Raise();

delay(2000);

Stp();

Setturn_cw();

Turn_cw();

Stp();

delay(2000);

Setfwd();

Fwd();

Target();

fwd_1();

Stp();

Setturn_acw();

Turn_acw();

Stp();

delay(1000);

Setfwd();

Fwd_Delivery();

Stp();

delay(2000);

Lower();

delay(2000);

Stp();

radio_Delivery();

Stp();

delay(1000);

Setrev();

Page | 143
Autonomous Forklift

Rev();

Stp();

Raise();

delay(2000);

Stp();

Setfwd();

fwd_2();

Stp();

Setturn_cw();

Turn_cw_left();

Stp();

Setfwd();

Fwdclear();

Fwd();

Location();

Stp();

Setturn_cw();

Turn_cw();

Stp();

void Stp()

dir =0;

digitalWrite(latchPin, LOW);

Page | 144
Autonomous Forklift

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void radio_Availability()

radio.stopListening();

unsigned long stat = 80 ;

bool ok = radio.write( &stat, sizeof(unsigned long) );

delay (20);

radio.startListening();

void radio_Package()

while ( package2==0)

if ( radio.available() )

unsigned long package;

bool done = false;

while (!done)

Page | 145
Autonomous Forklift

done = radio.read( &package, sizeof(unsigned long) );

switch (package)

case 65:

destination=1;

locations=1;

package2++;

break;

case 66:

destination=2;

locations=2;

package2++;

break;

case 67:

destination=3;

locations=3;

package2++;

break;

void radio_Action()

Page | 146
Autonomous Forklift

radio.stopListening();

unsigned long stat = 88 ;

bool ok = radio.write( &stat, sizeof(unsigned long) );

delay (20);

radio.startListening();

package2=0;

void Setfwd()

dir =5;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Fwd()

LDR_L = analogRead(A0);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_R=map( LDR_R,0,1023,0,50);

Page | 147
Autonomous Forklift

while ( LDR_L !=1)

timer= millis()%2000;

if( timer==0)

{ sonar();

LDR_L = analogRead(A0);

LDR_CL = analogRead(A1);

LDR_CR = analogRead(A2);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_CL=map( LDR_CL,0,1023,0,10);

LDR_CR=map( LDR_CR,0,1023,0,20);

LDR_R=map( LDR_R,0,1023,0,50);

if (LDR_CL > referenceCL)//2//3

analogWrite(10,pwm);

analogWrite(9,0);

// sonar();

else if ( LDR_CR > referenceCR)//3//2

Page | 148
Autonomous Forklift

analogWrite(9,pwm);

analogWrite(10,0);

// sonar();

else

{ analogWrite(10,pwm);

analogWrite(9,pwm);

//sonar();

analogWrite(9,0);

analogWrite(10,0);

void sonar()

pinMode(Trig,OUTPUT); //sending of soundwave

digitalWrite(Trig,LOW);

delayMicroseconds(2);

digitalWrite(Trig,HIGH);

Page | 149
Autonomous Forklift

delayMicroseconds(10);

digitalWrite(Trig,LOW);

pinMode(Echo,INPUT);// reflected sondwave

duration =pulseIn (Echo,HIGH); // time duration in between

cm = microsecondsToCentimeters(duration);

if (cm > 25 || cm ==0)

pwm = (225);

if (message_sent==1)

radio_Action();

message_sent=0;

else

pwm=0;

obstacle++;

if (obstacle==30)

radio.stopListening();

unsigned long stat = 68 ;

bool ok = radio.write( &stat, sizeof(unsigned long) );

delay (20);

Page | 150
Autonomous Forklift

radio.startListening();

buzzer();

obstacle=0;

message_sent=1;

long microsecondsToCentimeters(long microseconds)

return microseconds / 29 / 2;

void buzzer ()

Stp();

dir =64;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

delay (5000);

Stp();

Page | 151
Autonomous Forklift

Setfwd();

void Fwd_Junction()

analogWrite(9,225);

analogWrite(10,225);

delay(500);

analogWrite(9,0);

analogWrite(10,0);

void Lower()

dir =16;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

delay(300);

Page | 152
Autonomous Forklift

Limit_S=analogRead(A5);

while (Limit_S <500)

Limit_S=analogRead(A5);

dir =0;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Fwd_noultra()

LDR_L = analogRead(A0);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_R=map( LDR_R,0,1023,0,50);

while ( LDR_L !=1)

LDR_L = analogRead(A0);

LDR_CL = analogRead(A1);

LDR_CR = analogRead(A2);

LDR_R = analogRead(A3);

Page | 153
Autonomous Forklift

LDR_L=map( LDR_L,0,1023,0,10);

LDR_CL=map( LDR_CL,0,1023,0,10);

LDR_CR=map( LDR_CR,0,1023,0,20);

LDR_R=map( LDR_R,0,1023,0,50);

if (LDR_CL > referenceCL)//2//3

analogWrite(10,225);

analogWrite(9,0);

// sonar();

else if ( LDR_CR > referenceCR)//3//2

analogWrite(9,225);

analogWrite(10,0);

// sonar();

else

{ analogWrite(10,225);

analogWrite(9,225);

//sonar();

Page | 154
Autonomous Forklift

analogWrite(9,0);

analogWrite(10,0);

void Raise()

dir =32;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

delay(300);

Limit_S=analogRead(A5);

while (Limit_S <500)

Limit_S=analogRead(A5);

Page | 155
Autonomous Forklift

dir =0;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Setturn_cw() //cw

delay(250);

dir =6;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Turn_cw()

analogWrite(9,200);

analogWrite(10,200);

delay (2000);

LDR_CR = analogRead(A2);

Page | 156
Autonomous Forklift

LDR_CR=map( LDR_CR,0,1023,0,20);

while (LDR_CR >referenceCR) //2//3 here:2

analogWrite(9,175);

analogWrite(10,175);

LDR_CR = analogRead(A2);

LDR_CR=map( LDR_CR,0,1023,0,20);

analogWrite(9,0);

analogWrite(10,0);

void Target()

junction++;

while ( junction != destination)

Fwd_Junction();

Fwd(); //w ultra

junction++;

Page | 157
Autonomous Forklift

void Setturn_acw() //acw

delay(250);

dir =9;

digitalWrite(latchPin, LOW);

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Turn_acw()

analogWrite(9,200);

analogWrite(10,200);

delay (800);

LDR_CL = analogRead(A1);

LDR_CL=map( LDR_CL,0,1023,0,10);

while ( LDR_CL >referenceCL) //3//2

LDR_CL = analogRead(A1);

LDR_CL=map( LDR_CL,0,1023,0,10);

analogWrite(9,200);

analogWrite(10,200);

Page | 158
Autonomous Forklift

delay(300); //

analogWrite(9,0);

analogWrite(10,0);

void Fwd_Delivery()

sonar_d();

while ( motion ==1)

timer= millis()%750;

if( timer==0)

{ sonar_d();

LDR_L = analogRead(A0);

LDR_CL = analogRead(A1);

LDR_CR = analogRead(A2);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_CL=map( LDR_CL,0,1023,0,10);

Page | 159
Autonomous Forklift

LDR_CR=map( LDR_CR,0,1023,0,20);

LDR_R=map( LDR_R,0,1023,0,50);

if (LDR_CL > referenceCL)//2//3

analogWrite(10,150);

analogWrite(9,0);

// sonar();

else if ( LDR_CR > referenceCR)//3//2

analogWrite(9,150);

analogWrite(10,0);

// sonar();

else

{ analogWrite(10,150);

analogWrite(9,150);

//sonar();

Page | 160
Autonomous Forklift

analogWrite(9,0);

analogWrite(10,0);

void sonar_d()

pinMode(Trig,OUTPUT); //sending of soundwave

digitalWrite(Trig,LOW);

delayMicroseconds(2);

digitalWrite(Trig,HIGH);

delayMicroseconds(10);

digitalWrite(Trig,LOW);

pinMode(Echo,INPUT);// reflectedd sondwave

duration =pulseIn (Echo,HIGH); // time duration in between

cm = microsecondsToCentimeters(duration);

if (cm > 14)

motion = 1;

Page | 161
Autonomous Forklift

else

motion =0;

//Serial.println(duration);

Serial.println(cm);

//delay(300);

void radio_Delivery()

radio.stopListening();

unsigned long stat = 68 ;

bool ok = radio.write( &stat, sizeof(unsigned long) );

delay (20);

radio.startListening();

void Setrev()

delay(250);

dir =58;

digitalWrite(latchPin, LOW);

Page | 162
Autonomous Forklift

shiftOut(dataPin, clockPin, MSBFIRST, dir);

digitalWrite(latchPin, HIGH);

void Rev ()

LDR_L = analogRead(A0);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_R=map( LDR_R,0,1023,0,50);

while ( LDR_L !=1)

analogWrite(10,175);

analogWrite(9,175);

LDR_L = analogRead(A0);

LDR_L=map( LDR_L,0,1023,0,10);

analogWrite(9,0);

analogWrite(10,0);

Page | 163
Autonomous Forklift

void Location()

parking=4;

locations++;

while ( locations!= parking)

Fwd_Junction();

Fwd(); //w ultra

locations++;

void Turn_cw_left()

analogWrite(9,175);

analogWrite(10,175);

delay (1500);

LDR_CR = analogRead(A2);

LDR_CR=map( LDR_CR,0,1023,0,20);

while (LDR_CR >referenceCR) //2//3 here:2

analogWrite(9,175);

analogWrite(10,175);

Page | 164
Autonomous Forklift

LDR_CR = analogRead(A2);

LDR_CR=map( LDR_CR,0,1023,0,20);

analogWrite(9,0);

analogWrite(10,0);

void Fwdclear()

LDR_L = analogRead(A0);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_R=map( LDR_R,0,1023,0,50);

while ( LDR_L ==1)

LDR_L = analogRead(A0);

LDR_CL = analogRead(A1);

LDR_CR = analogRead(A2);

LDR_R = analogRead(A3);

LDR_L=map( LDR_L,0,1023,0,10);

LDR_CL=map( LDR_CL,0,1023,0,10);

LDR_CR=map( LDR_CR,0,1023,0,20);

Page | 165
Autonomous Forklift

LDR_R=map( LDR_R,0,1023,0,50);

if (LDR_CL > referenceCL)//2//3

analogWrite(10,200);

analogWrite(9,0);

// sonar();

else if ( LDR_CR > referenceCR)//3//2

analogWrite(9,200);

analogWrite(10,0);

// sonar();

else

{ analogWrite(10,200);

analogWrite(9,200);

//sonar();

Page | 166
Autonomous Forklift

analogWrite(9,0);

analogWrite(10,0);

void fwd_1()

analogWrite(9,200);

analogWrite(10,200);

delay(250);

analogWrite(9,0);

analogWrite(10,0);

void fwd_2()

analogWrite(9,175);

analogWrite(10,175);

delay(800);

analogWrite(9,0);

analogWrite(10,0);

Page | 167
Autonomous Forklift

APPENDIX H
COST OF MATERIALS

Component Quantity Cost/Rs


Arduino Duemilanove 1 540.00
Arduino Nano 1 600.00
HD44780 204 LCD 1 315.00
Toggle switch 3 60.00
Push button switch 7 35.00
Ultrasonic HC-SR04 1 180.00
Tamiya double gearbox 1 420.00
Tamiya track & wheel set 1 210.00
USB PC webcam 1 135.00
NRF24L01 (transceiver) 2 210.00
IC L293D 2 120.00
IC 74HC595 1 45.00
10K potentiometer 10 60.00
LM7805 2 55.00
LM317 1 30.00
LDR 5 90.00
PCB 90mm70mm 4 100.00
PCB 90mm12mm 1 30.00
Capacitors, Resistors & - 150.00
Resonators
Led 10 50.00
HDPE board 1 90.00
Buzzer 1 15.00
TOTAL/Rs 3540.00

Page | 168
Autonomous Forklift

APPENDIX I
DATASHEETS

Page | 169
Tech Support: services@elecfreaks.com

Ultrasonic Ranging Module HC - SR04

Product features:

Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact


measurement function, the ranging accuracy can reach to 3mm. The modules
includes ultrasonic transmitters, receiver and control circuit. The basic principle
of work:
(1) Using IO trigger for at least 10us high level signal,
(2) The Module automatically sends eight 40 kHz and detect whether there is a
pulse signal back.
(3) IF the signal back, through high level , time of high output IO duration is
the time from sending ultrasonic to returning.
Test distance = (high level timevelocity of sound (340M/S) / 2,

Wire connecting direct as following:

 5V Supply
 Trigger Pulse Input
 Echo Pulse Output
 0V Ground

Electric Parameter

Working Voltage DC 5 V
Working Current 15mA
Working Frequency 40Hz
Max Range 4m
Min Range 2cm
MeasuringAngle 15 degree
Trigger Input Signal 10uS TTL pulse
Echo Output Signal Input TTL lever signal and the range in
proportion
Dimension 45*20*15mm
Vcc Trig Echo GND

Timing diagram

The Timing diagram is shown below. You only need to supply a short 10uS
pulse to the trigger input to start the ranging, and then the module will send out
an 8 cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a
distance object that is pulse width and the range in proportion .You can
calculate the range through the time interval between sending trigger signal and
receiving echo signal. Formula: uS / 58 = centimeters or uS / 148 =inch; or: the
range = high level time * velocity (340M/S) / 2; we suggest to use over 60ms
measurement cycle, in order to prevent trigger signal to the echo signal.
Attention:

 The module is not suggested to connect directly to electric, if connected


electric, the GND terminal should be connected the module first, otherwise,
it will affect the normal work of the module.
 When tested objects, the range of area is not less than 0.5 square meters
and the plane requests as smooth as possible, otherwise ,it will affect the
results of measuring.

www.Elecfreaks.com
A7800 SERIES
POSITIVE-VOLTAGE REGULATORS
SLVS056J MAY 1976 REVISED MAY 2003

D 3-Terminal Regulators D High Power-Dissipation Capability


D Output Current up to 1.5 A D Internal Short-Circuit Current Limiting
D Internal Thermal-Overload Protection D Output Transistor Safe-Area Compensation
KC (TO-220) PACKAGE KTE PACKAGE
(TOP VIEW) (TOP VIEW)
COMMON

OUTPUT

COMMON
COMMON OUTPUT
INPUT
COMMON
KCS (TO-220) PACKAGE INPUT
(TOP VIEW)
COMMON

OUTPUT
COMMON
INPUT

description/ordering information
This series of fixed-voltage integrated-circuit voltage regulators is designed for a wide range of applications.
These applications include on-card regulation for elimination of noise and distribution problems associated with
single-point regulation. Each of these regulators can deliver up to 1.5 A of output current. The internal
current-limiting and thermal-shutdown features of these regulators essentially make them immune to overload.
In addition to use as fixed-voltage regulators, these devices can be used with external components to obtain
adjustable output voltages and currents, and also can be used as the power-pass element in precision
regulators.

ORDERING INFORMATION
VO(NOM) ORDERABLE TOP-SIDE
TJ PACKAGE
(V) PART NUMBER MARKING
POWER-FLEX (KTE) Reel of 2000 A7805CKTER A7805C
5 TO-220 (KC) Tube of 50 A7805CKC
A7805C
TO-220, short shoulder (KCS) Tube of 20 A7805CKCS
POWER-FLEX (KTE) Reel of 2000 A7808CKTER A7808C
8 TO-220 (KC) Tube of 50 A7808CKC
A7808C
TO-220, short shoulder (KCS) Tube of 20 A7808CKCS
POWER-FLEX (KTE) Reel of 2000 A7810CKTER A7810C
10
TO-220 (KC) Tube of 50 A7810CKC A7810C
0C to 125C
POWER-FLEX (KTE) Reel of 2000 A7812CKTER A7812C
12 TO-220 (KC) Tube of 50 A7812CKC
A7812C
TO-220, short shoulder (KCS) Tube of 20 A7812CKCS
POWER-FLEX (KTE) Reel of 2000 A7815CKTER A7815C
15 TO-220 (KC) Tube of 50 A7815CKC
A7815C
TO-220, short shoulder (KCS) Tube of 20 A7815CKCS
POWER-FLEX (KTE) Reel of 2000 A7824CKTER A7824C
24
TO-220 (KC) A7824C
Tube of 50 A7824CKC
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available at
www.ti.com/sc/package.

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

PRODUCTION DATA information is current as of publication date. Copyright 2003, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 1


A7800 SERIES
POSITIVE-VOLTAGE REGULATORS
SLVS056J MAY 1976 REVISED MAY 2003

APPLICATION INFORMATION

+V A78xx +VO

0.33 F 0.1 F

Figure 1. Fixed-Output Regulator

IN OUT
+ A78xx G

VI IL
COM
VO

Figure 2. Positive Regulator in Negative Configuration (VI Must Float)

Input A78xx Output

R1
IO

0.33 F 0.1 F
R2

VO +V )
xx )
NOTE A: The following formula is used when Vxx is the nominal output voltage (output to common) of the fixed regulator:
V xx
R1
I Q R2

Figure 3. Adjustable-Output Regulator

Input A78xx

R1
0.33 F VO(Reg)

Output

IO
IO = (VO/R1) + IO Bias Current

Figure 4. Current Regulator

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 7


LM317
3-TERMINAL ADJUSTABLE REGULATOR
SLVS044O SEPTEMBER 1997 REVISED JULY 2003

D Output Voltage Range Adjustable From D Internal Short-Circuit Current Limiting


1.25 V to 37 V D Thermal Overload Protection
D Output Current Greater Than 1.5 A D Output Safe-Area Compensation

KC (TO-220) PACKAGE KTE PACKAGE


(TOP VIEW) (TOP VIEW)
OUTPUT

INPUT
INPUT

OUTPUT
OUTPUT
ADJ
OUTPUT
ADJUST

KCS (TO-220) PACKAGE DCY (SOT-223) PACKAGE


(TOP VIEW) (TOP VIEW)
OUTPUT

INPUT
INPUT

OUTPUT
OUTPUT
ADJ OUTPUT

ADJUST

description/ordering information
The LM317 is an adjustable three-terminal positive-voltage regulator capable of supplying more than 1.5 A over
an output-voltage range of 1.25 V to 37 V. It is exceptionally easy to use and requires only two external resistors
to set the output voltage. Furthermore, both line and load regulation are better than standard fixed regulators.

ORDERING INFORMATION
ORDERABLE TOP-SIDE
TJ PACKAGE
PART NUMBER MARKING
POWER-FLEX (KTE) Reel of 2000 LM317KTER LM317
Tube of 80 LM317DCY
SOT 223 (DCY)
SOT-223 L3
0C to 125C Reel of 2500 LM317DCYR
TO-220 (KC) Tube of 50 LM317KC
LM317
TO-220, short shoulder (KCS) Tube of 20 LM317KCS
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design guidelines are available
at www.ti.com/sc/package.

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

PRODUCTION DATA information is current as of publication date. Copyright 2003, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 1


LM317
3-TERMINAL ADJUSTABLE REGULATOR
SLVS044O SEPTEMBER 1997 REVISED JULY 2003

APPLICATION INFORMATION
D1 (Note E)
1N4002

Input Output
VI LM317 VO (Note C)

Adjust R1
240
D2 (Note E)
Vref = 1.25 V 1N4002
IAdj
Ci (Note A) CO (Note B)
0.1 F 1.0 F

R2 CADJ (Note D)

NOTES: A. Ci is not required, but is recommended, particularly if the regulator is not in close proximity
to the power-supply filter capacitors. A 0.1-F disc or 1-F tantalum provides sufficient
bypassing for most applications, especially when adjustment and output capacitors are
used.

B. CO improves transient response, but is not needed for stability.

) )
C. VO is calculated as shown:

VO +V ref 1
R2
R1
(I Adj R 2)

Because IAdj typically is 50 A, it is negligible in most applications.

D. CADJ is used to improve ripple rejection; it prevents amplification of the ripple as the output voltage
is adjusted higher. If CADJ is used, it is best to include protection diodes.

E. If the input is shorted to ground during a fault condition, protection diodes provide measures to
prevent the possibility of external capacitors discharging through low-impedance paths in the IC.
By providing low-impedance discharge paths for CO and CADJ, respectively, D1 and D2 prevent
the capacitors from discharging into the output of the regulator.

Figure 1. Adjustable Voltage Regulator

4 POST OFFICE BOX 655303 DALLAS, TEXAS 75265


L293, L293D
QUADRUPLE HALF-H DRIVERS
SLRS008B SEPTEMBER 1986 REVISED JUNE 2002

D Featuring Unitrode L293 and L293D N, NE PACKAGE


Products Now From Texas Instruments (TOP VIEW)

D Wide Supply-Voltage Range: 4.5 V to 36 V 1,2EN 1 16 VCC1


D Separate Input-Logic Supply 1A 2 15 4A
D Internal ESD Protection 1Y 3 14 4Y
D Thermal Shutdown HEAT SINK AND 4 13 HEAT SINK AND
GROUND
D High-Noise-Immunity Inputs
GROUND
2Y
5
6
12
11 3Y
D Functional Replacements for SGS L293 and 2A 7 10 3A
SGS L293D VCC2 8 9 3,4EN
D Output Current 1 A Per Channel
(600 mA for L293D) DWP PACKAGE
D Peak Output Current 2 A Per Channel (TOP VIEW)
(1.2 A for L293D)
1,2EN VCC1
D
1 28
Output Clamp Diodes for Inductive 1A 2 27 4A
Transient Suppression (L293D) 1Y 4Y
3 26
NC 4 25 NC
description
NC 5 24 NC
The L293 and L293D are quadruple high-current NC 6 23 NC
half-H drivers. The L293 is designed to provide HEAT SINK AND
7 22
HEAT SINK AND
bidirectional drive currents of up to 1 A at voltages GROUND 8 21 GROUND
from 4.5 V to 36 V. The L293D is designed to 9 20
provide bidirectional drive currents of up to NC 10 19 NC
600-mA at voltages from 4.5 V to 36 V. Both NC 11 18 NC
devices are designed to drive inductive loads such 2Y 12 17 3Y
as relays, solenoids, dc and bipolar stepping 2A 13 16 3A
motors, as well as other high-current/high-voltage VCC2 14 15 3,4EN
loads in positive-supply applications.
All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor
sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and
drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled and their
outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled and
their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms
a full-H (or bridge) reversible drive suitable for solenoid or motor applications.
On the L293, external high-speed output clamp diodes should be used for inductive transient suppression.
A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation.
The L293and L293D are characterized for operation from 0C to 70C.

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

PRODUCTION DATA information is current as of publication date. Copyright 2002, Texas Instruments Incorporated
Products conform to specifications per the terms of Texas Instruments
standard warranty. Production processing does not necessarily include
testing of all parameters.

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 1


L293, L293D
QUADRUPLE HALF-H DRIVERS
SLRS008B SEPTEMBER 1986 REVISED JUNE 2002

block diagram
VCC1

1
0 1 16

2 15 M
1 1
0 0
1 4
3 14

4 13

M 5 12

6 11

2 3
1 1
7 10 0
0
9 1 M
8
0

VC

NOTE: Output diodes are internal in L293D.

TEXAS INSTRUMENTS
AVAILABLE OPTIONS
PACKAGE

TA PLASTIC
DIP
(NE)
L293NE
0C to 70C
L293DNE

AVAILABLE OPTIONS
PACKAGED DEVICES

TA SMALL PLASTIC
OUTLINE DIP
(DWP) (N)
L293DWP L293N
0C to 70C
L293DDWP L293DN
The DWP package is available taped and reeled. Add
the suffix TR to device type (e.g., L293DWPTR).

2 POST OFFICE BOX 655303 DALLAS, TEXAS 75265


L293, L293D
QUADRUPLE HALF-H DRIVERS
SLRS008B SEPTEMBER 1986 REVISED JUNE 2002

FUNCTION TABLE
(each driver)
INPUTS OUTPUT
A EN Y
H H H
L H L
X L Z
H = high level, L = low level, X = irrelevant,
Z = high impedance (off)
In the thermal shutdown mode, the output is
in the high-impedance state, regardless of
the input levels.

logic diagram


2 3
1A 1Y

1,2EN
1

7
6


2A 2Y

10
11


3A 3Y


9
3,4EN


15 14
4A 4Y

schematics of inputs and outputs (L293)

EQUIVALENT OF EACH INPUT TYPICAL OF ALL OUTPUTS

VCC1 VCC2

Current
Source

Input
Output

GND

GND

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 3


L293, L293D
QUADRUPLE HALF-H DRIVERS
SLRS008B SEPTEMBER 1986 REVISED JUNE 2002

APPLICATION INFORMATION
VCC2
SES5001
M1
SES5001
M2

3A 4A EN 3A M1 4A M2
10 11 15 14 H H Fast motor stop H Run
16 H L Run L Fast motor stop
VCC1
8 Free-running motor Free-running motor
L X X
stop stop
1/2 L293 9
EN L = low, H = high, X = dont care
4, 5, 12, 13
GND

Figure 4. DC Motor Controls


(connections to ground and to
supply voltage)

VCC2
2 SES5001

2 SES5001 EN 1A 2A FUNCTION
H L H Turn right
2A 1A
7 6 3 2 H H L Turn left
16 H L L Fast motor stop
VCC1
8 H H H Fast motor stop
1/2 L293 1 L X X Fast motor stop
EN
L = low, H = high, X = dont care
4, 5, 12, 13
GND
Figure 5. Bidirectional DC Motor Control

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 9


  

    
      
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004

D 8-Bit Serial-In, Parallel-Out Shift SN54HC595 . . . J OR W PACKAGE


SN74HC595 . . . D, DB, DW, N, OR NS PACKAGE
D Wide Operating Voltage Range of 2 V to 6 V (TOP VIEW)
D High-Current 3-State Outputs Can Drive Up
To 15 LSTTL Loads QB 1 16 VCC
D Low Power Consumption, 80-A Max ICC QC 2 15 QA
QD SER
D Typical tpd = 13 ns
3 14
QE 4 13 OE
D 6-mA Output Drive at 5 V QF 5 12 RCLK
D Low Input Current of 1 A Max QG 6 11 SRCLK
D Shift Register Has Direct Clear QH 7 10 SRCLR
GND 8 9 QH
description/ordering information
The HC595 devices contain an 8-bit serial-in, SN54HC595 . . . FK PACKAGE
parallel-out shift register that feeds an 8-bit D-type (TOP VIEW)

VCC
storage register. The storage register has parallel

QC

NC
QB

QA
3-state outputs. Separate clocks are provided for
both the shift and storage register. The shift 3 2 1 20 19
register has a direct overriding clear (SRCLR) QD 4 18 SER
input, serial (SER) input, and serial outputs for QE 5 17 OE
cascading. When the output-enable (OE) input is NC 6 16 NC
high, the outputs are in the high-impedance state. QF 7 15 RCLK
QG 8 14 SRCLK
Both the shift register clock (SRCLK) and storage 9 10 11 12 13
register clock (RCLK) are positive-edge triggered.

QH
GND
NC

SRCLR
Q H
If both clocks are connected together, the shift
register always is one clock pulse ahead of the
storage register.
NC No internal connection

ORDERING INFORMATION
ORDERABLE TOP-SIDE
TA PACKAGE
PART NUMBER MARKING
PDIP N Tube of 25 SN74HC595N SN74HC595N
Tube of 40 SN74HC595D
SOIC D Reel of 2500 SN74HC595DR HC595
Reel of 250 SN74HC595DT
40C to 85C
Tube of 40 SN74HC595DW
SOIC DW HC595
Reel of 2000 SN74HC595DWR
SOP NS Reel of 2000 SN74HC595NSR HC595
SSOP DB Reel of 2000 SN74HC595DBR HC595
CDIP J Tube of 25 SNJ54HC595J SNJ54HC595J
55C
55 C to 125
125C
C CFP W Tube of 150 SNJ54HC595W SNJ54HC595W
LCCC FK Tube of 55 SNJ54HC595FK
SNJ54HC595FK
Package drawings, standard packing quantities, thermal data, symbolization, and PCB design
guidelines are available at www.ti.com/sc/package.

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of
Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

   !" # $%&" !#  '%()$!" *!"&+ Copyright 2004, Texas Instruments Incorporated
*%$"# $ " #'&$$!"# '& ",& "&#  &-!# #"%&"#  '*%$"# $')!" " 1 2  
 !)) '!!&"&# !& "&#"&*
#"!*!* .!!"/+ *%$" '$&##0 *&# " &$&##!)/ $)%*& %)&## ",&.#& "&*+  !)) ",& '*%$"# '*%$"
"&#"0  !)) '!!&"&#+ '$&##0 *&# " &$&##!)/ $)%*& "&#"0  !)) '!!&"&#+

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 1


  

    
      
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004

FUNCTION TABLE
INPUTS
FUNCTION
SER SRCLK SRCLR RCLK OE
X X X X H Outputs QAQH are disabled.
X X X X L Outputs QAQH are enabled.
X X L X X Shift register is cleared.
First stage of the shift register goes low.
L H X X
Other stages store the data of previous stage, respectively.
First stage of the shift register goes high.
H H X X
Other stages store the data of previous stage, respectively.
X X X X Shift-register data is stored in the storage register.

2 POST OFFICE BOX 655303 DALLAS, TEXAS 75265


  

    
      
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004

logic diagram (positive logic)

13
OE
12
RCLK
10
SRCLR
11
SRCLK
14
SER 1D 3R 15
C1 C3 QA
R 3S

2S
2R 3R 1
C2 C3 QB
R 3S

2S
2R 3R 2
C2 C3 QC
R 3S

2S
2R 3R 3
C2 C3 QD
R 3S

2S
2R 3R 4
C2 C3 QE
R 3S

2S
2R 3R 5
C2 C3 QF
R 3S

2S
2R 3R 6
C2 C3 QG
R 3S

2S
2R 3R 7
C2 C3 QH
R 3S
9
QH
Pin numbers shown are for the D, DB, DW, J, N, NS, and W packages.

POST OFFICE BOX 655303 DALLAS, TEXAS 75265 3


  

    
      
SCLS041G DECEMBER 1982 REVISED FEBRUARY 2004

timing diagram

SRCLK

SER

RCLK

SRCLR

OE



QA



QB



QC



QD



QE



QF



QG



QH


QH

NOTE:
implies that the output is in 3-State mode.

4 POST OFFICE BOX 655303 DALLAS, TEXAS 75265


HD44780U (LCD-II)
(Dot Matrix Liquid Crystal Display Controller/Driver)

ADE-207-272(Z)
'99.9
Rev. 0.0

Description

The HD44780U dot-matrix liquid crystal display controller and driver LSI displays alphanumerics,
Japanese kana characters, and symbols. It can be configured to drive a dot-matrix liquid crystal display
under the control of a 4- or 8-bit microprocessor. Since all the functions such as display RAM, character
generator, and liquid crystal driver, required for driving a dot-matrix liquid crystal display are internally
provided on one chip, a minimal system can be interfaced with this controller/driver.

A single HD44780U can display up to one 8-character line or two 8-character lines.

The HD44780U has pin function compatibility with the HD44780S which allows the user to easily replace
an LCD-II with an HD44780U. The HD44780U character generator ROM is extended to generate 208 5
8 dot character fonts and 32 5 10 dot character fonts for a total of 240 different character fonts.

The low power supply (2.7V to 5.5V) of the HD44780U is suitable for any portable battery-driven product
requiring low power dissipation.

Features

5 8 and 5 10 dot matrix possible


Low power operation support:
2.7 to 5.5V
Wide range of liquid crystal display driver power
3.0 to 11V
Liquid crystal drive waveform
A (One line frequency AC waveform)
Correspond to high speed MPU bus interface
2 MHz (when VCC = 5V)
4-bit or 8-bit MPU interface enabled
80 8-bit display RAM (80 characters max.)
9,920-bit character generator ROM for a total of 240 character fonts
208 character fonts (5 8 dot)
32 character fonts (5 10 dot)

1
HD44780U

Pin Functions
No. of Device
Signal Lines I/O Interfaced with Function
RS 1 I MPU Selects registers.
0: Instruction register (for write) Busy flag:
address counter (for read)
1: Data register (for write and read)
R/W 1 I MPU Selects read or write.
0: Write
1: Read
E 1 I MPU Starts data read/write.
DB4 to DB7 4 I/O MPU Four high order bidirectional tristate data bus
pins. Used for data transfer and receive between
the MPU and the HD44780U. DB7 can be used
as a busy flag.
DB0 to DB3 4 I/O MPU Four low order bidirectional tristate data bus pins.
Used for data transfer and receive between the
MPU and the HD44780U.
These pins are not used during 4-bit operation.
CL1 1 O Extension driver Clock to latch serial data D sent to the extension
driver
CL2 1 O Extension driver Clock to shift serial data D
M 1 O Extension driver Switch signal for converting the liquid crystal
drive waveform to AC
D 1 O Extension driver Character pattern data corresponding to each
segment signal
COM1 to COM16 16 O LCD Common signals that are not used are changed
to non-selection waveforms. COM9 to COM16
are non-selection waveforms at 1/8 duty factor
and COM12 to COM16 are non-selection
waveforms at 1/11 duty factor.
SEG1 to SEG40 40 O LCD Segment signals
V1 to V5 5 Power supply Power supply for LCD drive
VCC V5 = 11 V (max)
VCC, GND 2 Power supply VCC: 2.7V to 5.5V, GND: 0V
OSC1, OSC2 2 Oscillation When crystal oscillation is performed, a resistor
resistor clock must be connected externally. When the pin input
is an external clock, it must be input to OSC1.

8
nRF24L01+
Single Chip 2.4GHz Transceiver

Product Specification v1.0

Key Features Applications


Worldwide 2.4GHz ISM band operation Wireless PC Peripherals
250kbps, 1Mbps and 2Mbps on air data Mouse, keyboards and remotes
rates 3-in-1 desktop bundles
Ultra low power operation Advanced Media center remote controls
11.3mA TX at 0dBm output power VoIP headsets
13.5mA RX at 2Mbps air data rate Game controllers
900nA in power down Sports watches and sensors
26A in standby-I RF remote controls for consumer electronics
On chip voltage regulator Home and commercial automation
1.9 to 3.6V supply range Ultra low power sensor networks
Enhanced ShockBurst Active RFID
Automatic packet handling Asset tracking systems
Auto packet transaction handling Toys
6 data pipe MultiCeiver
Drop-in compatibility with nRF24L01
On-air compatible in 250kbps and 1Mbps
with nRF2401A, nRF2402, nRF24E1 and
nRF24E2
Low cost BOM
60ppm 16MHz crystal
5V tolerant inputs
Compact 20-pin 4x4mm QFN package

All rights reserved.


Reproduction in whole or in part is prohibited without the prior written permission of the copyright holder.
September 2008
nRF24L01+ Product Specification

1.1 Features
Features of the nRF24L01+ include:

Radio
X Worldwide 2.4GHz ISM band operation

X 126 RF channels

X Common RX and TX interface

X GFSK modulation

X 250kbps, 1 and 2Mbps air data rate

X 1MHz non-overlapping channel spacing at 1Mbps

X 2MHz non-overlapping channel spacing at 2Mbps

Transmitter
X Programmable output power: 0, -6, -12 or -18dBm

X 11.3mA at 0dBm output power

Receiver
X Fast AGC for improved dynamic range

X Integrated channel filters

X 13.5mA at 2Mbps

X -82dBm sensitivity at 2Mbps

X -85dBm sensitivity at 1Mbps

X -94dBm sensitivity at 250kbps

RF Synthesizer
X Fully integrated synthesizer

X No external loop filer, VCO varactor diode or resonator

X Accepts low cost 60ppm 16MHz crystal

Enhanced ShockBurst
X 1 to 32 bytes dynamic payload length

X Automatic packet handling

X Auto packet transaction handling

X 6 data pipe MultiCeiver for 1:6 star networks

Power Management
X Integrated voltage regulator

X 1.9 to 3.6V supply range

X Idle modes with fast start-up times for advanced power management

X 26A Standby-I mode, 900nA power down mode

X Max 1.5ms start-up from power down mode

X Max 130us start-up from standby-I mode

Host Interface
X 4-pin hardware SPI

X Max 10Mbps

X 3 separate 32 bytes TX and RX FIFOs

X 5V tolerant inputs

Compact 20-pin 4x4mm QFN package

Revision 1.0 Page 8 of 78


nRF24L01+ Product Specification

2 Pin Information

2.1 Pin assignment

DVDD

IREF
VSS

VDD

VSS
20 19 18 17 16

CE 1 15 VDD

CSN 2 14 VSS

nRF24L01+
SCK 3 13 ANT2
QFN20 4X4
MOSI 4 12 ANT1

MISO 5 11 VDD_PA

6 7 8 9 10
IRQ

VDD

VSS

XC2

XC1

Figure 2. nRF24L01+ pin assignment (top view) for the QFN20 4x4 package

Revision 1.0 Page 10 of 78


nRF24L01+ Product Specification

2.2 Pin functions


Pin Name Pin function Description
1 CE Digital Input Chip Enable Activates RX or TX mode
2 CSN Digital Input SPI Chip Select
3 SCK Digital Input SPI Clock
4 MOSI Digital Input SPI Slave Data Input
5 MISO Digital Output SPI Slave Data Output, with tri-state option
6 IRQ Digital Output Maskable interrupt pin. Active low
7 VDD Power Power Supply (+1.9V - +3.6V DC)
8 VSS Power Ground (0V)
9 XC2 Analog Output Crystal Pin 2
10 XC1 Analog Input Crystal Pin 1
11 VDD_PA Power Output Power Supply Output (+1.8V) for the internal
nRF24L01+ Power Amplifier. Must be connected
to ANT1 and ANT2 as shown in Figure 32.
12 ANT1 RF Antenna interface 1
13 ANT2 RF Antenna interface 2
14 VSS Power Ground (0V)
15 VDD Power Power Supply (+1.9V - +3.6V DC)
16 IREF Analog Input Reference current. Connect a 22k resistor to
ground. See Figure 32.
17 VSS Power Ground (0V)
18 VDD Power Power Supply (+1.9V - +3.6V DC)
19 DVDD Power Output Internal digital supply output for de-coupling pur-
poses. See Figure 32.
20 VSS Power Ground (0V)

Table 1. nRF24L01+ pin function

Revision 1.0 Page 11 of 78