Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 57

ABSTRACT

CHAPTER – I

INTRODUCTION

This project is done to comprehend the innovation utilized in the driverless


metro train framework which is used by some other nations like Germany Japan

1
and France. It likewise diminishes the vitality utilization by 30% of the metro train
as it additionally utilizes the sunlight based boards on the best to run the extras of
the train . It additionally gives precise planning control of the train on station
entries and takeoffs.

The activity of the driverless metro train is constrained by a focal processor


unit like Arduino controller, 8051 processor or PIC controllers. The train is
modified to keep running on a predefined way which has fixed separation of
stations and the speed of the train is likewise predefined and it is constrained by the
motor driver IC. The stoppage of the train on the stations is additionally predefined.

CHAPTER – II

PROPOSED SYSTEM

2
CHAPTER – III

HARDWARE DESCRIPTION

3.1 ARDUINO

Arduino interface boards provide the engineers,artists,designers,hobbyists and


anyone who tinker with technology with a low-cost,easy-to-use technology to
create their creative,interactive objects,useful projects etc.,A whole new breed of
projects can now be built that can be controlled from a computer.

WHAT IS ARDUINO?

3
Figure 1.1 ARDUINO UNO

Arduino is a open source electronics prototyping platform based on


flexible,easy-to-use hardware and software.It’s intended for
artists,designers,hobbyists,and anyone interested in creating interactive objects or
environments.It’s an open-source physical computing platform based on a
microcontroller board,and a development environment for writing software for the
board.

In simple words,Arduino is a small microcontroller board with a USB plug to


connect to your computer and a number of connection sockets that can be wired up
to external electronics,such as motors,relays,light sensors,laser
diodes,loudspeakers,microphones,etc.,They can either be powered through the USB
connection from the computer or from a 9V battery. They can be controlled from
the computer or programmed by the computer and then disconnected and allowed to
work independently.

Anyone can buy this device through online auction site or search engine.Since
the Arduino is an open-source hardware designs and ccreate their own clones of the
Arduino and sell them, so the market for the boards is competitive. An official
Arduino costs about $30,and a clone often less than $20.

The name “Arduino” is reserved by the original makers. However, clone Arduino
designs often have the letters “duino” on the end of their name, for example,

4
Freeduino or DFRduino. The software for programming your Arduino is easy to
use and also freely available for Windows, Mac, and LINUX computers at no cost.

Microcontroller

Microcontroller can be described as a computer embedded on a rather small


circuit board. To describe the function of a microcontroller more precisely, it is a
single chip that can perform various calculations and tasks, and send/receive signals
from other devices via the available pins. Precisely what tasks and Communication
with the world it does, is what is governed by what instructions we give to the
Microcontroller. It is this job of telling the chip what to do, is what we refer to as
programming on it.

However, the uC by itself cannot accomplish much; it needs several


external inputs: power, for one; a steady clock signal, for another. Also, the job of
programming it has to be accomplished by an external circuit. So typically, a uC is
used along with a circuit which provides these things to it; this combination is
called a microcontroller board. The Arduino Uno that you have recieved, is one
such microcontroller board. The actual microcontroller at its heart is the chip called
Atmega328. The advantages that Arduino offers over other microcontroller boards
are largely in terms of reliability of the circuit hardware as well as the ease of
programming and using it.

Open-source hardware

Open-source hardware shares much of the principles and approach of free


and open-source software.The founders of Arduino wanted people to study their
hardware,to understand how it works,make changes to it,and share those changes
with the world.To facilitate this,they release all of the original design files(Eagle
CAD)for the Arduino hardware.These files are licensed under a Creative Common
Attribution Share-Alike license,which allows for both personal and commercial

5
derivative works,as long as they(people) credit Arduino and release their designs
under the same license.

The Arduino software is also oen-source.The source code for the Java
environment is released under the GPL and the C/C++ microcontroller libraries are
under the LGPL

HISTORY OF ARDUINO

While teaching a physical computing class at the Interaction Design Institute


Ivrea in 2005, Massimo Banzi’s students were unwilling to spend the 76 euros for
the BASIC Stamp microcontrollers commonly used in such applications. Banzi and
his colleagues looked for alternatives, finally settling on the wiring platform
developed by one of Banzi’s students. In his own words:

“…we started to figure out how could we make the whole platform even simpler,
even cheaper, and even easier to use. And then we started to essentially
reimplement the whole thing as an open source project.”

Once they had a prototype, a student wrote the software that would allow wiring
programs to run on the new platform. Upon seeing the project, visiting professor
Casey Reas suggested that there might be wider applications than just design
schools for the new product. The prototype was redesigned for mass production and
a test run of 200 boards was made. Orders began coming in from other design
schools and the students looking for Arduinos, and the Arduino project was born
and  Massimo Banzi and David Cuartielles became its founders.”ARDUINO” is
an Italian word, meaning “STRONG FRIEND”. The English version of the name is
“Hardwin”. As of May 2011, more than 300,000 Arduino units are “in the wild”.

Design Goals

 Work with a Mac (as most design students use one)

6
 USB connectivity (MacBooks don’t have serial ports
 Look nice
 Cheap (about 20 euros, the cost of going out for pizza in Europe)
 More powerful than a BASIC stamp
 Something you could build/fix yourself
Simple and easy to use by someone without formal electronics training

Business Models

Since the entire project is open source, anyone can build and sell Arduino-
compatible devices. So in this sense, the Arduino project relies heavily on its
branding for it’s financial success . Other projects manufacture compatible and
cheaper boards, however people are loyal to the Arduino branded boards because
they associate quality and a certain image to the

final product .

By the Numbers

Year Units Sold

2005 200

2006 10 000

2010 120 000

2011 300 000

Competitors

Before Arduino, the largest players in the design/hobbyist market segment


were the PIC microcontroller family (made by Microchip) and the BASIC Stamp
(made by Parallax). Since the introduction of the Arduino, other large companies
have tried to enter the hobbyist market, including Texas Instruments , and even
Microsoft . However, the open-sourced tools

7
of the Arduino and the size of its community are large barriers for new platforms
to overcome.

Figure 2 GOOGLE trends comparing ARDUINO with its biggest competitors

Community

As the project is aimed at students and hobbyists who may not have any formal
electronics background, there are many excellent guides online covering everything
from making a light blink to creating a laser harp. The official forum has almost 60
000 registered users, and along with helping users with their projects, is extremely
active in developing new libraries to extend the functionality of the Arduino . The
open-source share and share alike sentiment is very strong, and the vast majority of
users freely publish the code to their projects.

PHYSICAL COMPUTING

Physic al Computing is
an approach to learn how
humans communicate
through computers that
starts by considering how
humans express themselves physically.

8
PLATFORM

HARDWARE

ARDUINO Board Layout

Figure 3 ARDUINO board layout

ARDUINO pin diagram

Figure 4 ARDUINO pin diagram


ATmega8(Microcontroller)

9
 16 MHz
 8 Kbyte Flash RAM(1K taken by the boot loader)
 1 Kbyte RAM(eg.for auto/local variables and stack)
 14 digital Input/Output Ports

Figure 5 ATmega8

Single chip USB to async. Serial data transfer


interface

 USB 2.0 compatible


 Transmit and receive LED frive signals
 256 Byte receive,128 Byte transmit buffer
 Data transfer rate from 300bits/sec to 2 Mb/sec

Fig2.1 Android Software Architecture

The OFF-the shelf adapter

 must be a DC adapter (i.e. it has to put out


DC, not AC)
 should be between 9V and 12V DC 

10
 must be rated for a minimum of 250mA current output, although you will
likely want something more like 500mA or 1A output, as it gives you the
current necessary to power a servo or twenty LEDs if you want to.
 must have a 2.1mm power plug on the Arduino end, and
 the plug must be "centre positive", that is, the middle pin of the plug has to
be the + connection.
Current rating: Since you'll probably be connecting other things to the Arduino
(LEDs, LCDs, servos) you should get an adapter that can supply at least 500mA, or
even 1000 mA (1 ampère). That way you can be sure you have enough juice to
make each component of the circuit function reliably.

The Arduino's on-board regulator can actually handle up to 20V or more, so you
can actually use an adapter that puts out 20V
DC. The reasons you don't want to do that are
twofold: you'll lose most of that voltage in
heat, which is terribly inefficient. Secondly, the
nice 9V pin on the Arduino board will actually
be putting out 20V or so, which could lead to
potential disaster when you connect something
expensive to what you thought was the 9V pin.
Our advice is to stick with the 9V or 12V DC
adapter.

ARDUINO flavors!!

There have been many revisions of the USB Arduino.some of them are

1. Arduino UNO:
This is the latest revision of the basic Arduino USB board. It connects to the
computer with a standard USB cable and contains everything else you need to
program and use the board. It can be extended with a variety of shields: custom
daughter-boards with specific features. It is similar to the Duemilanove, but has a

11
different USB-to-serial chip the ATMega8U2,
and newly designed labeling to make inputs
and outputs easier to identify.

2. Arduino Mega 2560:


A larger, more powerful Arduino board.
Has extra digital pins, PWM pins, analog
inputs, serial ports, etc. The version of the
Mega released with the Uno, this version
features the Atmega2560, which has twice the memory, and uses
the ATMega 8U2 for USB-to-serial
communication. 

3. Arduino Duemilanove:
The Duemilanove automatically
selects the appropriate power
supply (USB or external power), eliminating the need for the power
selection jumper found on previous boards. It also adds an easiest to cut
trace for disabling the auto-reset, along with a solder jumper for re-
enabling it.
Note: around March 1st, 2009, the Duemilanove started to ship with
the ATmega328p instead of
theATmega168.

4. Arduino Fio:
An Arduino intended for use as a
wireless node. Has a header for
an XBee radio, a connector for
a LiPobattery, and a battery
chargingcircuit.

12
5. LilyPad Arduino:

A stripped-down, circular Arduino board


designed for stitching into clothing and
other fabric/flexible applications. Needs
an additional adapter to communicate
with a computer.

6. Arduino Diecimila:

The main change in the Arduino Diecimila is that it can be reset from the
computer, without the need to physically press the reset button on the board. The
Diecimila uses a low dropout voltage regulator which lowers the board's power
consumption when powered by an external supply (AC/DC adapter or battery).
A resettable polyfuse protects your
computer's USB ports from shorts and
surges. It also provides pin headers for the
reset line and for 3.3V. There is a built-in
LED on pin 13. Some blue Diecimila
boards say "Prototype - Limited Edition"
but are in fact fully-tested production
boards (the actual prototypes are red).

13
7. Lilypad Arduino 03

This revision has a 6-pin programming


header that's compatible with FTDI USB
cables and the Sparkfun FTDI Basic
Breakout. It adds support for automatic reset,
allowing sketches to be uploaded without
pressing the reset button on the board. The
header is surface mounted, meaning that the
board has no pokey bits sticking out the back.

8. Arduino NG Rev.C

Revision C of the Arduino NG does not


have a built-in LED on pin 13 - instead
you'll see two small unused solder pads
near the labels "GND" and "13". There
is, however, about 1000 ohms of
resistance on pin 13, so you can connect
an LED without external resistor. 

9. Arduino Extreme

14
The Arduino Extreme uses many more surface mount components than previous
USB Arduino boards and comes with female pin headers. It also has RX and
TX LEDs that indicate when data is being sent to or from the board.

10.

Arduino Mini 04

On this version of the Arduino Mini, two of the pins changed. The third pin
became reset (instead of ground) and fourth pin became ground (instead of
being unconnected). These boards are labelled "Mini 04".

Still there are ,Arduino Serial,Arduino Serial v2.0,Arduino Nano 3.0,Arduino


Nano 2.x,Serverino(S3V3),Arduino Stamp 02,Mini USB adapter 03,Mini USB
Adapter,Arduino Bluetooth.

Figure 6 Different Flavours Of ARDUINO with their Configuration

15
Basic Terminologies in ARDUINO:

1.Analog to digital converter(ADC)

The process of Analog to digital conversion is shown in


figure.

The Arduino has 10 bits of Resolution when reading analog


signals.

2 power 10=1024 increments

Influence also by how fast you sample

16
2.Pulse width modulation (PWM)

The Arduino has 8bit of resolution,when outputting a signal using PWM.The


range of output voltage is from 0 to 5 Volts

2power 8=255 Increments

Average of on/off(digital signals to make an average voltage),Duty cycle in 100%


of 5Volts.

LANGUAGE REFERENCES:

The Microcontroller on the board is programmed using the Arduino


programming language(based on wiring) and the arduino development
environment(based on processing).

Arduino Programming Language(APL)(based on wiring)

The Arduino programming language is an implementation of Wiring, a similar


physical computing platform, which is based on the Processing multimedia
programming environment.

Wiring

Wiring is an open-source programming framework for microcontrollers.


Wiring allows writing cross-platform software to control devices attached to a wide
range of microcontroller boards to create all kinds of creative coding, interactive
objects, spaces or physical experiences. The framework is thoughtfully created with
designers and artists in mind to encourage a community where beginners through
experts from around the world share ideas, knowledge and their collective
experience. There are thousands of students, artists, designers, researchers, and
hobbyists who use Wiring for learning, prototyping, and finished professional work
production.

Arduino development environment(based on processing)

17
Processing

Processing is an open source programming language and environment for


people who want to create images, animations, and interactions. Initially developed
to serve as a software sketchbook and to teach fundamentals of computer
programming within a visual context, Processing also has evolved into a tool for
generating finished professional work. Today, there are tens of thousands of
students, artists, designers, researchers, and hobbyists who use Processing for
learning, prototyping, and production.

Software

The software used by the arduino is Arduino IDE.

he Arduino IDE is a cross-platform application written in Java, and is derived from


the IDE for the Processing programming language and the Wiringproject. It is
designed to introduce programming to artists and other newcomers unfamiliar with
software development. It includes a code editor with features such as syntax
highlighting, brace matching, and automatic indentation, and is also capable of
compiling and uploading programs to the board with a single click. There is
typically no need to edit makefiles or run programs on acommand-line interface.
Although building on command-line is possible if required with some third-party
tools such as Ino.

The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of
the same name), which makes many common input/output operations much easier.
Arduino programs are written in C/C++, although users only need define two
functions to make a runnable program:

 setup() – a function run once at the start of a program that can initialize
settings
 loop() – a function called repeatedly until the board powers off

18
3.2 ATMEGA 328P

Fig 3.2 ATmega328p

The ATmega328p is a single chip micro-controller created by Atmel and belongs to


the megaAVR series. In ATmega328p ‘p’ stands for “Pico Power”. The Atmel 8-bit
AVR RISC-based microcontroller combines 32 KB ISP flash memory with read-
while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general purpose I/O
lines, 32 general purpose working registers, three flexible timer/counters with
compare modes, internal and external interrupts, serial programmable USART, a
byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D
converter, programmable watchdog timer with internal oscillator, and five software
selectable power saving modes. The device operates between 1.8-5.5 volts. The
device achieves throughputs approaching 1 MIPS.

19
Table 3.1 Key features of ATmega328p

3.3CRYSTAL OSCILLATOR

It is often required to produce a signal whose frequency or pulse rate is very stable
and exactly known. This is important in any application where anything to do with
time or exact measurement is crucial. It is relatively simple to make an oscillator
that produces some sort of a signal, but another matter to produce one of relatively
precise frequency and stability. An ordinary quartz watch must have an oscillator
accurate to better than a few parts per million. One part per million will result in an
error of slightly less than one half second a day, which would be about 3 minutes a
year. This might not sound like much, but an error of 10 parts per million would
20
result in an error of about a half an hour per year. A clock such as this would need
resetting about once a month, and more often if you are the punctual type

21
Fig 3.4Crystal oscillator

A crystal oscillator is an electronic circuit that uses the mechanical resonance of a


vibrating crystal of piezoelectric material to create an electrical signal with a very
precise frequency. This frequency is commonly used to keep track of time (as in
quartz wristwatches), to provide a stable clock signal for digital integrated circuits,
and to stabilize frequencies for radio transmitters.

Quartz crystal oscillators were developed for high-stability frequency references


during the 1920s and 1930s. Prior to crystals, radio stations controlled their
frequency with tuned circuits, which could easily drift off frequency by 3–4 kHz.

Since broadcast stations were assigned frequencies only 10 kHz apart, interference
between adjacent stations due to frequency drift was a common problem. In 1925
Westinghouse installed a crystal oscillator in its flagship station KDKA, and by
1926 quartz crystals were used to control the frequency of many broadcasting
stations and were popular with amateur radio operators.

22
 In 1928, Warren Marrison of Bell Telephone Laboratories developed the
first quartz-crystal clock. With accuracies of up to 1 second in 30 years (30 ms/y,
or  quartz clocks replaced precision pendulum clocks as the world's most accurate
timekeepers until atomic clocks were developed in the 1950s. Using the early
work at Bell Labs, AT&T eventually established their Frequency

3.4 POWER SUPPLY:

Power supply block consists of following units:

 Step down transformer.


 Bridge rectifier circuit.
 Input filter.
 Voltage regulators.
 Output filter.
 Indicator unit
Let’s get into detail of rating of the devices :

Voltage regulator :

As we require a 5V we need LM7805 Voltage Regulator IC.

7805 IC Rating :

 Input voltage range 7V- 35V


 Current rating Ic = 1A
 Output voltage range   VMax=5.2V ,VMin=4.8V 

23
Transformer :

Selecting a suitable transformer is of great importance. The current rating and the
secondary voltage of the transformer is a crucial factor.

 The current rating of the transformer depends upon the current required for
the load to be driven.
 The input voltage to the 7805 IC should be at least 2V greater than the
required 2V output, therefore it requires an input voltage at least close to 7V.
 So I chose a 6-0-6 transformer with current rating 500mA (Since 6*√2 =
8.4V).

NOTE : Any transformer which supplies secondary peak voltage up to 35V can be
used but as the voltage increases size of the transformer and power dissipation
across regulator increases.

Rectifying circuit :

The best is using a full wave rectifier

24
 Its advantage is DC saturation is less as in both cycle diodes conduct.
 Higher Transformer Utilization Factor (TUF).
 1N4007 diodes are used as its is capable of withstanding a higher reverse
voltage of 1000v whereas 1N4001 is 50V

Capacitors :

Knowledge of Ripple factor is essential while designing the values of capacitors

It is given by

 Y=1/(4√3fRC)  (as the capacitor filter is used)

1. f= frequency of AC ( 50 Hz)

2. R=resistance calculated

R= V/Ic   

V= secondary voltage of transformer


25
      V=6√2=8. 4
      R=8.45/500mA=16.9Ω standard 18Ω chosen

3. C= filtering capacitance

We have to determine this capacitance for filtering

Y=Vac-rms/Vdc

Vac-rms = Vr/2√3

Vdc= VMax-(Vr/2)

Vr= VMax- VMin

   Vr = 5.2-4.8 =0. 4V


    Vac-rms = .3464V
    Vdc = 5V
     Y=0 .06928

Hence the capacitor value is found out by substituting the ripple factor
in Y=1/(4√3fRC)

Thus, C= 2314 µF and  standard 2200µF is chosen

Datasheet of 7805 prescribes to use a 0.01μF capacitor at the output side to


avoid transient changes in the voltages due to changes in load and a 0.33μF at the
input side of regulator to avoid ripples if the filtering is far away from regulator.

26
3.5 Liquid Crystal Display

Introduction:

Advances in the features, miniaturization, and cost of LCD (Liquid Crystal


Display) controller chips have made LCDs usable not only in commercial products
but also in hobbyist projects. By themselves, Liquid Crystal Displays can be
difficult to drive because they require multiplexing, AC drive waveforms, and
special voltages. LCD modules make this driving simpler by attaching hardware to
the raw glass LCD to assist in some or all of these rudimentary driving tasks. LCD
modules can be split into two groups: those that have built-in controller and driver
chips, and those that have only driver chips. LCD displays that do not have
controllers are typically used with powerful hardware, such as a laptop computer,
where a video controller is available to generate the complex drive signals
necessary to run the display. Most color and large (greater than 320x240)
monochrome displays are of this type. Other common sizes are 16x1, 20x1, 20x2,
20x4, 40x1, and 40x2 (characters x lines). Fortunately, all HD44780-based
displays (of any size) use the same standard 14-wire interface.

27
Therefore, code and hardware made for one size/type display can be
painlessly adapted to work for any HD44780 compatible. Information about these
displays can be easily obtained on the web by including “HD44780” in our search
keywords. Because of their widespread use, these displays can be purchased
surplus with typical prices of $3 for small displays to $20 for large ones.

3.4.2. Interfacing our LCD module:

The microcontroller/microprocessor interface to HD44780 LCD modules


(hereafter generically Referred to as character LCD modules) is almost always 14
pins. We May find that some displays have additional pins for backlighting or
other purposes, but the first 14 pins still serve as the interface.

The first three pins provide power to the LCD module. Pin 1 is GND and
should be grounded to the power supply. Pin 2 is VCC and should be connected to
+5V power. Pin 3 is the LCD Display Bias. By adjusting the voltage or duty cycle
of pin 3, the contrast of the display can be adjusted. Most character LCDs can
achieve good display contrast with a voltage between 5V and 0V on pin 3. Note
that greater contrast comes with lower voltage and we should never apply a VLCD
higher than VCC. Some displays, which are specially made to work over a large
temperature range, may require a negative voltage to achieve readable contrast.

3.4.3. Basic 16x 2 Characters LCD - Black on Green 5V:

Description:

This is a basic 16 character by 2-line display. Black text on Green


background. Utilizes the extremely common HD44780 parallel interface chipset.

28
Interface code is freely available. We will need ~11 general I/O pins to interface to
this LCD screen. Includes LED backlight.

Fig3.4.1 16/2 character LCD display

Pin Description: The most commonly used LCDs found in the market today are 1
Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of
80 characters, whereas LCDs supporting more than 80 characters make use of 2
HD44780 controllers.

29
Fig 3.4.2 Pin Description of LCD

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16
Pins (two pins are extra in both for back-light LED connections). Pin description is
shown in the table below.

30
Figure 3.4.3: Character LCD type HD44780 Pin diagram

Pin description of character LCD:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 3.4.1: Character LCD pins with 1 Controller

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2

31
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Enable signal for row 0 and 1
Pin no. 9 EN1
(1stcontroller)
0 = Write to LCD module
Pin no. 10 R/W
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Enable signal for row 2 and 3
Pin no. 15 EN2
(2ndcontroller)
Pin no. 16 NC Not Connected

Table 3.4.2: Character LCD pins with 2 Controller

3.4.4. LCD Background:

Frequently, an 8051 program must interact with the outside world using
input and output devices that communicate directly with a human being. One of the
most common devices attached to an 8051 is an LCD display. Some of the most
common LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16
characters per line by 2 lines and 20 characters per line by 2 lines, respectively.

3.4.5. Interfacing Example - 16 Characters x 2 Lines LCD:

Description: This is the first interfacing example for the Parallel Port. We will
start with something simple. This example doesn't use the Bi-directional feature
found on newer ports, thus it should work with most, if no all Parallel Ports. It
however doesn't show the use of the Status Port as an input. A 16 Character x 2

32
Line LCD Modules to the Parallel Port. These LCD Modules are very common
these days, and are quite simple to work with, as all the logic required running
them is on board.

3.4.6Schematic:

Fig 3.4.4 Schematic Diagram of 2 line 16 character LCD display

3.4.7 Circuit Description:

Above is the quite simple schematic. The LCD panel's Enable and Register
Select is connected to the Control Port. The Control Port is an open collector /
open drain output. While most Parallel Ports have internal pull-up resistors, there is
a few which don't. Therefore by incorporating the two 10K external pull up
resistors, the circuit is more portable for a wider range of computers, some of
which may have no internal pull up resistors. We make no effort to place the Data
bus into reverse direction. Therefore we hard wire the R/W line of the LCD panel,
into write mode. This will cause no bus conflicts on the data lines. As a result we
cannot read back the LCD's internal Busy Flag which tells us if the LCD has

33
accepted and finished processing the last instruction. This problem is overcome by
inserting known delays into our program.

The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I've left the power supply out. We can use a
bench power supply set to 5v or use an onboard +5 regulator. Remember a few de-
coupling capacitors, especially if we have trouble with the circuit working
properly.

Ultrasonic Sensor

Introduction
The main purpose of this project is to measure the distance to
unreachable objects, obstacles or places using a portable device.

Figure 2.1: The hand-held ultrasonic range meter device.

34
2.2 Motivation
The motivation of using this device is when construction engineers at any sites
need to measure distances to unreachable places in a quick and easy way using this
device with high efficiency and accuracy.

2.3 Characteristics
This device detects the distance to an object and shows the result in centimeters.
This device is activated by a trigger mechanism, pressing the trigger for one time
will give us the distance to an object if there was no error like poor aiming. The
distance to an object is displayed using a digital display with a high intensity in
order to be seen in any lighting conditions.

It is a simple and portable device similar to a gun as shown in Figure 2.2 that uses
a laser pointer to aim at a specific area to get the reflection at the receiver side.

Figure 2.2: Description of each part of the device.

35
3.3 Target range
The target range is the distance range between the person who is using the hand-
held ultrasonic range meter device and the targeted object. The target range
consists of two boundaries, one is the minimum distance limit and the other is the
maximum distance limit. If the operator of the hand-held ultrasonic range meter
device exceeds these two boundaries, the hand-held ultrasonic range meter device
may not detect the distance or may display a false detection.

Frequency, wavelength and attenuation:

The frequency of the ultrasonic sensing system is determined by the resonant


frequency of the ultrasonic transducer. The selection of this transducer is made
considering number of factors such as transducer size, measurement resolution,

36
measurement range, background noise and attenuation. The wavelength of the
ultrasonic wave can be found out with the following formula,

λ = C/f (6.1)

Where λ is the wavelength, C is the velocity of sound equal to 340 m/s at 20º C
and f is the frequency equal to 40 KHz.

C, velocity of sound varies with variation in temperature, pressure, medium type,


humidity, air turbulence, conventional currents. So before calculating the
wavelength, the speed of sound is required to be calculated.

IR SENSOR

IR detectors are little microchips with a photocell that are tuned to listen to infrared
light. They are almost always used for remote control detection - every TV and
DVD player has one of these in the front to listen for the IR signal from the clicker.
Inside the remote control is a matching IR LED, which emits IR pulses to tell the
TV to turn on, off or change channels. IR light is not visible to the human eye,
which means it takes a little more work to test a setup.There are a few difference
between these and say a CdS Photocells : IR detectors are specially filtered for
Infrared light, they are not good at detecting visible light. On the other hand,
photocells are good at detecting yellow/green visible light, not good at IR light

37
IR detectors have a demodulator inside that looks for modulated IR at 38 KHz. Just
shining an IR LED wont be detected, it has to be PWM blinking at 38KHz.
Photocells do not have any sort of demodulator and can detect any frequency
(including DC) within the response speed of the photocell (which is about
1KHz)IR detectors are digital out - either they detect 38KHz IR signal and output
low (0V) or they do not detect any and output high (5V). Photocells act like
resistors, the resistance changes depending on how much .

 Arrival distance
o With our IR LED 520E940C (above): 
direct view 35m, with inclination 45 deg 8m
 Description

38
o A miniaturized receiver for infrared remote control and IR data
transmission.
o PIN diode and preamplifier are assembled on lead frame.
o The epoxy package is designed as IR filter.
o The demodulated output signal can directly be decoded by a
microprocessor.
o The main benefit is the operation with high data rates and long
distances.
 Features
o Photo detector and preamplifier in one package
o Internal band filter for PCM frequency
o Internal shielding against electrical field disturbance
o TTL and CMOS compatibility
o Output active low
o Small size package
 Special Features
o Supply voltage 5.5 V
o Short settling time after power on
o High envelope duty cycle can be received
o Enhanced immunity against disturbance from energy saving lamps
o B.P.F Center Frequency 38khz
o Peak Emission Wavelength 940nm
 Application
o AV instruments such as Audio, TV, VCR, CD, DVD, MD etc.
o Home appliances such as Air conditioner, Fan etc.

39
o The other equipments with wireless remote control.
o CATV set top boxes.
o Multi-media Equipment.
o Sensors and light barrier systems for long distances
 IR Receiver Codes
o Best works with: Rc6 Code, Rcmm Code, Sony 15bit Code
o Also suitable for: Grundig Code, Nec Code, Rc5 Code, R-2000 Code,
Rca Code, Sharp Code, Sony 12bit Code, Zenith Code
o Not recommended for: Rcs-80 Code, High Data Rate Code

L293D MOTOR DRIVE

L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers
act as current amplifiers since they take a low-current control signal and provide a
higher-current signal. This higher current signal is used to drive the motors.

L293D contains two inbuilt H-bridge driver circuits. In its common mode of
operation, two DC motors can be driven simultaneously, both in forward and
reverse direction. The motor operations of two motors can be controlled by input
logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding
motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions,
respectively.

Enable pins 1 and 9 (corresponding to the two motors) must be high for
motors to start operating. When an enable input is high, the associated driver gets
enabled. As a result, the outputs become active and work in phase with their inputs.

40
Similarly, when the enable input is low, that driver is disabled, and their outputs
are off and in the high-impedance state.

Working of L293D

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

In simple you need to provide Logic 0 or 1 across the input pins for rotating the
motor.

L293D Logic Table.

41
Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the
motor in clockwise direction the input pins has to be provided with Logic 1 and
Logic 0.

• Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction

• Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction

• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]

• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]

In a very similar way the motor can also operate across input pin 15,10 for motor
on the right hand side.

Voltage Specification

VCC is the voltage that it needs for its own internal operation 5v; L293D will not
use this voltage for driving the motor. For driving the motors it has a separate
provision to provide motor supply VSS (V supply). L293d will use this to drive
the motor. It means if you want to operate a motor at 9V then you need to provide
a Supply of 9V across VSS Motor supply.

The maximum voltage for VSS motor supply is 36V. It can supply a max current
of 600mA per channel.Since it can drive motors Up to 36v hence you can drive
pretty big motors with this l293d.

VCC pin 16 is the voltage for its own internal Operation. The maximum voltage
ranges from 5v and upto 36v.

42
GEAR MOTOR

The gear motor is used to move robot "Gear motor" refers to a


combination of a motor plus a reduction gear train. These are often
conveniently packaged together in one unit. The gear reduction (gear train)
reduces the speed of the motor, with a corresponding increase in torque. Gear
ratios range from just a few (e.g.3) to huge (e.g.500). A small ratio can be
accomplished with a single gear pair, while a large ratio requires a series of gear
reduction steps and thus more gears. There are a lot of different kinds of gear
reduction.

43
OPERATION

Geared DC motors can be defined as an extension of DC motor which


already had its Insight details demystified here. A geared DC Motor has a gear
assembly attached to the motor. The speed of motor is counted in terms of
rotations of the shaft per minute and is termed as RPM .The gear assembly
helps in increasing the torque and reducing the speed. Using the correct
combination of gears in a gear motor, its speed can be reduced to any desirable
figure. This concept where gears reduce the speed of the vehicle but increase its
torque is known as gear reduction.  This Insight will explore all the minor and
major details that make the gear head and hence the working of geared DC
motor.

FEATURES

 Protection against overload and locked rotor

 Protection against RFI/EMI caused by PWM control

 Precautions for instantaneous reversing and dynamic braking

 Speed detection and control

44
CHAPTER - IV

PREPARATION OF PRINTIG CIRCUITED BOARD

PCB DESGNING AND FABRICATION

PROCEDURE FOR MAKING THE PCB

PREPARING OF LAYOUT

45
With the diagram and all the hand, draw a complete layout plan of the circuit
on a sheet of a tracing paper. As a model, for laying the circuit, a thermo cole base
may be used to hold components. Avoid over crowding of components while
making full space utilization. Keep the ground line on the side of the PCB and the
supply line on other side as far as possible. When all the components have been
mounted on the tracing paper sheet fixed on a piece of thermo cole base, take out a
sketch pen for making in such a way that all the connecting wires are equal in
width, termination rounded off. Re-draw draw it on a fresh paper if required.

PAINTING OF PCB

The tracing so prepared has to be imposed over the copper printed circuit
board keeping in view that the component would be mounted from the non-clad
side of the board. Take a PCB lamination sheet and cur a piece of required size of
the board by using hacksaw file edges, put the copper clad sheet on the table
keeping side on the runway the dirt grease and oxide with a sand paper with its
marked side tracing the carbon paper and at her side on top. Since the tracing paper
is transformed you can now reproduce a carbon point over a surface but using ball
pen on a hard pencil over the drawing on the transparent side. When the carbon
print has been obtained over the copper clad board drill ropes in the board using a
hand drill. The holes may be draw with 1/32 bit for component lead sand the
carbon should be raised or wiped by mistake.

DEVELOPMENT OF THE PRINTED CIRCUIT DIAGRAM

After painting the board, it will be made by the cool air for sometime. Now
take a plastic tray and get some Fe Cl3 chemical powder. The ferric chloride salt is
then added with 500ml of water. The color of the solution is pink. Color of the salt
46
is in yellow, now we add three to five drops of dilute HCL or H2SO4. This is
necessary to quicken the process.

ETCHING OF PCB

Now we take the painted copper clad board and dip it in the solution kept in
the tray. After 15 to 25 minutes we see the board, with only printed pattern portion
remaining in other place the copper coating is removed due to the chemical action.
Then the board is taken out and washes in water. After wash the board by using
thinner solution. Now a printed circuit has been formed on the board.

Take fresh water and mix a few teaspoons of FeCL3 add a few drops of
dilute HCL to it, as it speeds the etching process. Shake well immerse the PC Bin
the solution for about 20 minutes occasionally altering the solution by giving the
seesaw reaction to the disk storing reduces the etching time. Observe the changing
color on the copper surface. Take out the PCB only when the unpainted portion of
the copper surface is completely dissolved in the

3solution wash the PCB with the water. After the PCB is thoroughly washed
remove the paint by soft pieces of the cloth dipped in thinner or turpentine.

DRILLING OF HOLES

Then take a drilling machine with 1/32 drill bit to make holes for the
incretion of the components use 1/18 drill bit for inset wires and other thick
components.

Now the PCB is ready to use.

ADVANTAGES

47
 Reliability in operation and low cost.
 Space required becomes less.

DIS ADVANTAGES

 It can’t withstand larger weight such as transformer.

MATERIAL REQUIRED

 Copper clad sheet (It is made of hylam or board over


which the sheet copper is pressed.)
 “Paint or Nail polish” or even “PCB Ink”.
 Painting brush, tray.
 Ferric chloride solution and also few drop of dilute HCL or
H2so4.
 Thinner or kerosene or petrol.
 Cotton cloth.
 Trace paper.

CHAPTER 5

5.1 SOFTWARE USED

5.1 Introduction to Arduino IDE

The Arduino integrated development environment (IDE) is a cross-


platform application written in Java and consists of a standard programming
language compiler and a boot loader that executes on the microcontroller. A
program or code written for Arduino is called a sketch and are written in C or C++.

48
Arduino is a prototype platform (open-source) based on an easy-to-use
hardware and software. It consists of a circuit board, which can be programed
(referred to as a microcontroller) and a ready-made software called Arduino IDE
(Integrated Development Environment), which is used to write and upload the
computer code to the physical board.

Arduino provides a standard form factor that breaks the functions of


the micro-controller into a more accessible package. The key features are:

 Arduino boards are able to read analog or digital input signals from
different sensors and turn it into an output such as activating a motor,
turning LED on/off, connect to the cloud and many other actions
 You can control your board functions by sending a set of instructions
to the microcontroller on the board via Arduino IDE (referred to as
uploading software)
 Unlike most previous programmable circuit boards, Arduino does not
need an extra piece of hardware (called a programmer) in order to
load a new code onto the board. You can simply use a USB cable
 Additionally, the Arduino IDE uses a simplified version of C++,
making it easier to learn to program
 Finally, Arduino provides a standard form factor that breaks the
functions of the microcontroller into a more accessible package

5.2 Arduino Installation

Step 1: First you must have your Arduino board (you can choose your
favorite board) and a USB cable. In case you use Arduino UNO, Arduino
Duemilanove, Nano, Arduino Mega 2560, or Diecimila, you will need a
49
standard USB cable (A plug to B plug), the kind you would connect to a
USB printer
Step 2: Download Arduino IDE Software
You can get different versions of Arduino IDE from the Download page on
the Arduino Official website. You must select your software, which is
compatible with your operating system (Windows, IOS, or Linux). After
your file download is complete, unzip the file
Step 3: Power up your board. The Arduino UNO, Mega, Duemilanove and
Arduino Nano automatically draw power from either, the USB connection
to the computer or an external power supply. If you are using an Arduino
Diecimila, you have to make sure that the board is configured to draw
power from the USB connection. The power source is selected with a
jumper, a small piece of plastic that fits onto two of the three pins between
the USB and power jacks. Check that it is on the two pins closest to the
USB port. Connect the Arduino board to your computer using the USB
cable. The green power LED (labeled PWR) should glow
Step 4: Launch Arduino IDE. After your Arduino IDE software is downloaded,
you need to unzip the folder. Inside the folder, you can find the
application icon with an infinity label (application.exe). Double-click the
icon to start the IDE
Step 5: Open your first project
Once the software starts, you have two options:
 Create a new project
 Open an existing project example
Step 6: Select your Arduino board. To avoid any error while uploading your
program to the board, you must select the correct Arduino board name,

50
which 1matches with the board connected to your computer. Go to Tools
-> Board and select your board

5.3 Functions

The code you write for your Arduino are known as sketches. They are
written in C++. Every sketch needs two void type functions, setup() and loop(). A
void type function doesn’t return any value. The setup() method is ran once at the
just after the Arduino is powered up and the loop() method is ran continuously
afterwards. The setup() is where you want to do any initialization steps, and in
loop() you want to run the code you want to run over and over again. So, your
basic sketch or program should look like this:

void setup()

void loop()

5.4 Arduino Function Libraries

5.4.1 Arduino I/O Function

51
The pins on the Arduino board can be configured as either inputs or
outputs. We will explain the functioning of the pins in those modes. It is important
to note that a majority of Arduino analog pins, may be configured, and used, in
exactly the same manner as digital pins.

Pins Configured as INPUT

Arduino pins are by default configured as inputs, so they do not need to be


explicitly declared as inputs with pin Mode () when you are using them as inputs.
Pins configured this way are said to be in a high-impedance state. Input pins make
extremely small demands on the circuit that they are sampling, equivalent to a
series resistor of 100 mega ohm in front of the pin.

This means that it takes very little current to switch the input pin from one
state to another. This makes the pins useful for such tasks as implementing a
capacitive touch sensor or reading an LED as a photodiode.

Pins Configured as OUTPUT

Pins configured as OUTPUT with pin Mode() are said to be in a low-


impedance state. This means that they can provide a substantial amount of current
to other circuits. ATmega pins can source (provide positive current) or sink
(provide negative current) up to 40 mA (milliamps) of current to other

52
devices/circuits. This is enough current to brightly light up an LED (do not forget
the series resistor), or run many sensors but not enough current to run relays,
solenoids, or motors.

Attempting to run high current devices from the output pins, can damage
or destroy the output transistors in the pin, or damage the entire ATmega chip.
Often, this results in a "dead" pin in the microcontroller but the remaining chips
still function adequately. For this reason, it is a good idea to connect the OUTPUT
pins to other devices through 470Ω or 1k resistors, unless maximum current drawn
from the pins is required for a particular application.

pinMode() functions

The pin Mode() function is used to configure a specific pin to behave


either as an input or an output. It is possible to enable the internal pull-up resistors
with the mode INPUT_PULLUP. Additionally, the INPUT mode explicitly
disables the internal pull-ups.

pinMode() Function Syntax

void setup ()
{

53
pinMode (pin , mode);
}

 pin − the number of the pin whose mode you wish to set
 mode − INPUT, OUTPUT, or INPUT_PULLUP

5.5 Compiling

Sketches are compiled by avr-gcc and avr-g++ according to the variables


in the boards.txt file of the selected board's platform.

System-wide temporary directory (e.g. /tmp on Linux). The .c and .cpp


files of the target are compiled and output with .o extensions to this directory, as is
the main sketch file and any other .c or .cpp files in the sketch and any .c or .cpp
files in any libraries which are #included in the sketch.
Before compiling each .c or .cpp file, an attempt is made to reuse the
previously compiled .o file, which speeds up the build process. A special .d
(dependency) file provides a list of all other files included by the source. The
compile step is skipped if the .o and .d files exist and have timestamps newer than
the source and all the dependent files. If the source or any dependent file has been
modified, or any error occurs verifying the files, the compiler is run normally,
writing a new .o & .d file. After a new board is selected from the Tools menu, all .c
and .cpp files are rebuilt on the next compile.

These .o files are then linked together into a static library and the main
sketch file is linked against this library. Only the parts of the library needed for

54
your sketch are included in the final .hex file, reducing the size of most sketches.
The .hex file is the final output of the compilation which is then uploaded to the
board.

If verbose output during compilation is checked in the Preferences dialog,


the complete command line of each external command executed as part of the
build process will be printed in the editor console.

CHAPTER – VI

CONCLUSION

We have exhibited this task by assembling a model of driverless metro


train. We have utilized DC gear engines and associated it to the wheels. A basic
CD drive is utilized for programmed doorway task. A DC engine is utilized for
entryway task. It is to be noticed that a buzzer will work at each entryway activity.
By running this model we got results as getting messages like the name of the
station, the number of travelers and entryway position on LCD display. Our
driverless metro train venture gives the special highlights like it completely
furnishes programmed driverless activity with less voyaging time, less utilization
of power, smoke discovery and so on.

55
CHAPTER – VI

REFERENCE

[1]. Pooja Balaso, Shinde Pooja Sanjay, Bhosale Smita Vijayanand, Pansare Prof.
Sukeshkumar Borate, RFID based metro train system, International Engineering
Research Journal (IERJ), Volume 2 Issue 8 Page 3008-3010, ISSN 2395-1621,
April 2017.

[2]. Automatic Fire Initiated Braking and Alert System for Trains, Sumit Pandey1,
Abhishek Mishra1, Pankaj Gaur1, Amrindra Pal1, Sandeep Sharma1
#1Department of Applied Electronics and Instrumentation, 2015 Second
International Conference on Advances in Computing and Communication
Engineering.

[3]. The New Approach for Passenger Counting in Public Transport System,
Antons Patlins, Nadezhda Kunicina Faculty of Power and Electrical Engineering,

56
Institute of Industrial Electronics and Electrical Engineering, Riga Technical
University,1 Kalku Street, the 8th IEEE International Conference on Intelligent
Data Acquisition and Advanced Computing Systems: Technology and
Applications 24-26 September 2015, Warsaw, Poland.

[4]. The Design of an Optical Wireless Sensor Network Based Train Vibration
Monitoring System, Walid Abdallah and Noureddine Boudriga Communication
Networks and Security Research Lab., University of Carthage, Tunisia, ICTON
2017

57

You might also like