Sie sind auf Seite 1von 72

Malla Reddy College of Engineering and Technology Dept of ECE

ABSTRACT

Generally, journey in a bus is a safe and comfort factor, but due to increase in number
of buses and passenger its going be tough now a days and it will be more difficult for blind
people to travel in bus so with this project, we can make a system which can help blind people
to find the bus at the bus stop as they cannot able to see which bus is coming on the bus stop.

Generally, journey in a bus is a safe and comfort factor, but due to increase in number
of busses and passenger its going be tough now a days and it will be more difficult for blind
people to travel in bus so with this project, we can make a system which can help blind people
to find the bus at the bus stop as they

This project presents a bus detection system using RFID technology that aims to ease
the travelling and movement of blind people. The proposed system consists of two detection
subsystems, one on the buses and the other on the bus stations, database system and a
website. In the bus detection subsystem, the nearby stations will be easily detected and then
announced through a voice message inside the bus. Moreover, any existing blind person in
the surrounding area of the station will be detected by the bus subsystem to alert the bus
driver about the number of blind persons.

In the bus station subsystem, the coming buses will be detected and then announced
in the station in order to alert the blind people. A complete system prototype system. The
archived results show that the system performance is promising in terms of system
functionality, safety and cost. This bus detection device for the blind using RFID project
demonstrates the concept of bus detection using RFID. In which the blind people having RFID
reader with some microcontroller module which gives the buzzer sound whenever the
specific bus comes, the bus is equipped with RFID tag. Whenever bus comes at the bus stop
the blind person who is provided with RFID reader gets signal as it reads tag.

Bus Detection Device for Blind People 1


Malla Reddy College of Engineering and Technology Dept of ECE

CHAPTER 1 – INTRODUCTION

EMBEDDED SYSTEMS

1.1Embedded Systems:

An embedded system is a special-purpose computer system designed to perform one or a


few dedicated functions, sometimes with real-time computing constraints. It is usually
embedded as part of a complete device including hardware and mechanical parts. In contrast,
a general-purpose computer, such as a personal computer, can do many different tasks
depending on programming. Embedded systems have become very important today as they
control many of the common devices we use.

Since the embedded system is dedicated to specific tasks, design engineers can optimize it,
reducing the size and cost of the product, or increasing the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.

Physically, embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants. Complexity varies from low, with a single microcontroller
chip, to very high with multiple units, peripherals and networks mounted inside a large chassis
or enclosure.

In general, "embedded system" is not an exactly defined term, as many systems have some
element of programmability. For example, Handheld computers share some elements with
embedded systems — such as the operating systems and microprocessors which power them
— but are not truly embedded systems, because they allow different applications to be
loaded and peripherals to be connected.

An embedded system is some combination of computer hardware and software, either fixed
in capability or programmable, that is specifically designed for a particular kind of application
device. Industrial machines, automobiles, medical equipment, cameras, household
appliances, airplanes, vending machines, and toys (as well as the more obvious cellular phone
and PDA) are among the myriad possible hosts of an embedded system. Embedded systems

Bus Detection Device for Blind People 2


Malla Reddy College of Engineering and Technology Dept of ECE

that are programmable are provided with a programming interface, and embedded systems
programming is a specialized occupation.

Certain operating systems or language platforms are tailored for the embedded market, such
as Embedded Java and Windows XP Embedded. However, some low-end consumer products
use very inexpensive microprocessors and limited storage, with the application and operating
system both part of a single program. The program is written permanently into the system's
memory in this case, rather than being loaded into RAM (random access memory), as
programs on a personal computer are.

1.1.1 Need for Embedded Systems:

The uses of embedded systems are virtually limitless, because every day new products are
introduced to the market that utilizes embedded computers in novel ways. In recent years,
hardware such as microprocessors, microcontrollers, and FPGA chips have become much
cheaper. So, when implementing a new form of control, it' s wiser to just buy the generic
chip and write your own custom software for it. Producing a custom-made chip to handle a
particular task or set of tasks costs far more time and money. Many embedded computers
even come with extensive libraries, so that &out writing your own software & quote; becomes
a very trivial task indeed. From an implementation viewpoint, there is a major difference
between a computer and an embedded system. Embedded systems are often required to
provide Real-Time response. The main elements that make embedded systems unique are its
reliability and ease in debugging.

1.1.2Debugging:

Embedded debugging may be performed at different levels, depending on the facilities


available. From simplest to most sophisticate they can be roughly grouped into the following
areas:

Interactive resident debugging, using the simple shell provided by the embedded operating
system (e.g. Forth and Basic) External debugging using logging or serial port output to trace
operation using either a monitor in flash or using a debug server like the Remedy Debugger
which even works for heterogeneous multi core systems.

Bus Detection Device for Blind People 3


Malla Reddy College of Engineering and Technology Dept of ECE

An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via a
JTAG or nexus interface. This allows the operation of the microprocessor to be controlled
externally, but is typically restricted to specific debugging capabilities in the processor. A
complete emulator provides a simulation of all aspects of the hardware, allowing all of it to
be controlled and modified and allowing debugging on a normal PC.

Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code. Because an
embedded system is often composed of a wide variety of elements, the debugging strategy
may vary. For instance, debugging a software ( and microprocessor) centric embedded
system is different from debugging an embedded system where most of the processing is
performed by peripherals (DSP, FPGA, co-processor). An increasing number of embedded
systems today use more than one single processor core. A common problem with multi-core
development is the proper synchronization of software execution. In such a case, the
embedded system design may wish to check the data traffic on the busses between the
processor cores, which requires very low-level debugging, at signal/bus level, with a logic
analyser , for instance.

1.1.3Reliability:

Embedded systems often reside in machines that are expected to run continuously for years
without errors and in some cases recover by them if an error occurs. Therefore, the software
is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoded.
Specific reliability issues may include:

•The system will lose large amounts of money when shut down: Telephone switches, factory
controls, bridge and elevator controls, funds transfer and market making, automated sales
and service.

A variety of techniques are used, sometimes in combination, to recover from errors both
software bugs such as memory leaks, and also soft errors in the hardware:

Bus Detection Device for Blind People 4


Malla Reddy College of Engineering and Technology Dept of ECE

• Watchdog timer that resets the computer unless the software periodically notifies the
watchdog

• Subsystems with redundant spares that can be switched over to

• software &quote; limp modes& quote; that provide partial function

• Designing with a Trusted Computing Base (TCB) architecture [6] ensures a highly
secure & reliable system environment

• An Embedded Hypervisor is able to provide secure encapsulation for any subsystem


component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.

• Immunity Aware Programming.

1.1.4 Applications of embedded system:

We are living in the Embedded World. You are surrounded with many embedded products
and your daily life largely depends on the proper functioning of these gadgets. Television,
Radio, CD player of your living room, Washing Machine or Microwave Oven in your kitchen,
Card readers, Access Controllers, Palm devices of your workspace enable you to do many of
your tasks very effectively. Apart from all these, many controllers embedded in your car take
care of car operations between the bumpers and most of the times you tend to ignore all
these controllers. In recent days, you are showered with variety of information about these
embedded controllers in many places. All kinds of magazines and journals regularly dish out
details about latest technologies, new devices; fast applications which make you believe that
your basic survival is controlled by these embedded products. Now you can a agree to the
fact that these embedded products have successfully invaded into our world. You must be
wondering about these embedded controllers or systems. What is this Embedded System?
The computer you use to compose your mails, or create a document or analyze the database
is known as the standard desktop computer. These desktop computers are manufactured to
serve many purposes and applications. You need to install the relevant software to get the
required processing facility. So, these desktop computers can do many things. In contrast,

Bus Detection Device for Blind People 5


Malla Reddy College of Engineering and Technology Dept of ECE

embedded controllers’ carryout a specific work for which they are designed. Most of the time,
engineers design these embedded controllers with a specific goal in mind. So, these
controllers cannot be used in any other place.

Theoretically, an embedded controller is a combination of a piece of microprocessor-


based hardware and the suitable software to undertake a specific task. These days designers
have many choices in microprocessors/microcontrollers. Especially, in 8 bit and 32 bits, the
available variety really may overwhelm even an experienced designer. Selecting a right
microprocessor may turn out as a most difficult first step and it is getting complicated as new
devices continue to pop-up very often. In the 8bit segment, the most popular and used
architecture is Intel' s 8031. Market acceptance of this particular family has driven many
semiconductor manufacturers to develop something new based on this particular
architecture. Even after 25 years of existence, semiconductor manufacturers still come out
with some kind of device using these 8031 cores.

1.1.5 Military and Aerospace Software applications:

From in-orbit embedded systems to jumbo jets to vital battlefield networks, designers of
mission critical aerospace and defines systems requiring real-time performance, scalability,
and high availability facilities consistently turn to the Lynx OS® RTOS and the LynxOS-178 RTOS
for software certification to DO-178B.Rich in system resources and networking services, Lynx
OS provides an off-the-shelf software platform with hard real-time response backed by
powerful distributed computing (CORBA), high reliability, software certification, and long-
term support options.

The LynxOS-178 RTOS for software certification, based on the RTCA DO-178B
standard, assists developers in gaining certification for their mission- and safety-critical
systems. Real-time systems programmers get a boost with Lynx Works' DO-178B RTOS
training courses.

1.1.6 Communication applications:

&quote; Five-nine& quot; availability, Compact PCI hot swap support, and hard real-time
response— Lynx OS delivers on these key requirements and more for today' s carrier-
class systems. Scalable kernel configurations, distributed computing capabilities, integrated

Bus Detection Device for Blind People 6


Malla Reddy College of Engineering and Technology Dept of ECE

communications stacks, and fault-management facilities make Lynx OS the ideal choice for
companies looking for a single operating system for all embedded telecommunications
applications—from complex central controllers to simple line/trunk cards.

Lynx Works Jumpstart for Communications package enables OEMs to rapidly develop mission-
critical communications equipment, with pre-integrated, state-of-the-art, data networking
and porting software components—including source code for easy customization.
The Lynx Certifiable Stack (LCS) is a secure TCP/IP protocol stack designed especially for
applications where standards certification is required.

1.1.7 Electronics applications and consumer devices:

As the number of powerful embedded processors in consumer devices continues to rise, the
Blue Cat® Linux® operating system provides a highly reliable and royalty-free option for
systems designers. And as the wireless appliance revolution rolls on, web-enabled navigation
systems, radios, personal communication devices, phones and PDAs all benefit from the cost-
effective dependability, proven stability and full product life-cycle support opportunities
associated with Blue Cat embedded Linux. Blue Cat has teamed up with industry leaders to
make it easier to build Linux mobile phones with Java integration. for makers of low-cost
consumer electronic devices who wish to integrate the Lynx OS Seal-time operating system
into their products, we offer special MSRP-based pricing to reduce royalty fees to a negligible
portion of the device' s MSRP.

1.1.8 Industrial automation and process control software: -

Designers of industrial and process control systems know from experience that Lynx Works
operating systems provide the security and reliability that their industrial*applications
require. From ISO 9001 certification to fault-tolerance, POSIX conformance, secure
partitioning and high availability, we' vet got it all. Take advantage of our 20 years of
experience conformance, secure partitioning and high availability, we' vet got it all. Take
advantage of our 20 years of experience.

1.1.9 Microcontroller versus microprocessor:

What is the difference between a Microprocessor and Microcontroller? By microprocessor


is meant the general purpose Microprocessors such as Intel' s X86 family (8086, 80286,

Bus Detection Device for Blind People 7


Malla Reddy College of Engineering and Technology Dept of ECE

80386, 80486, and the Pentium) or Motorola' s 680X0 family (68000, 68010, 68020,
68030, 68040, etc.). These microprocessors contain no RAM, no ROM, and no I/O ports on
the chip itself. For this reason, they are commonly referred to as general-purpose
Microprocessors. A system designer using a general-purpose microprocessor such as the
Pentium or the 68040 must add RAM, ROM, I/O ports, and timers externally to make them
functional. Although the addition of external RAM, ROM, and I/O ports makes these systems
bulkier and much more expensive, they have the advantage of versatility such that the
designer candecide on the amount of RAM, ROM and I/O ports needed to fit the task at hand.
This is not the case with Microcontrollers. A Microcontroller has a CPU (a microprocessor) in
addition to a fixed amount of RAM, ROM, I/O ports, and a timer all on a single chip. In other
words, the processor, the RAM, ROM, I/O ports and the timer are all embedded together on
one chip; therefore, the designer cannot add any external memory, I/O ports, or timer to it.
The fixed amount of on- chip ROM, RAM, and number of I/O ports in Microcontrollers makes
them ideal for many applications in which cost and space are critical. In many applications,
for example a TV remote control, there is no need for the computing power of a 486 or even
an 8086 microprocessor. These applications most often require some I/O operations to read
signals and turn on and off certain bits.

The term microcontroller and microprocessor have always been confused with each other.
Both of them have been designed for real time application. They share many common
features and at the same time they have they have significant difference. Both the IC’s i.e.,
the microprocessor and microcontroller cannot be distinguished by looking at them. They are
available in different version starting from 6 pin to as high as 80 to 100 pins or even higher
depending on the features.

But this is not the case with microcontrollers. Microcontroller has a CPU,in addition with a
fixed amount of RAM,ROM and other peripherals all embedded on a single chip. Depending
on the input , some processing needs to be done and output is delivered. In, such cases the
relationship between input and output is not defined they need high amount of resources like
RAM,ROM, I/0 ports etc. Microprocessor cannot be used stand alone . Comparing
microcontroller and microprocessor in terms of cost is not justified. Undoubtedly a
microcontroller is far cheaper then a microprocessor. The clock speed of the microprocessor
is quite high as the compared to the microcontroller.

Bus Detection Device for Blind People 8


Malla Reddy College of Engineering and Technology Dept of ECE

1.2 Technology used: -

EM -18 RFID Reader

The EM-18 RFID Reader module operating at 125 kHz is an inexpensive solution for your
RFID based application. The Reader module comes with an on-chip antenna and can be
powered up with a 5V power supply. Power-up the module and connect the transmit pin of
the module to receive pin of your microcontroller. Show your card within the reading distance
and the card number is thrown at the output. Optionally the module can be configured for
also a Wigand output.

Typical Applications

• e- Payment

• e- Toll Road Pricing

• e- Ticketing for Events

• e- Ticketing for Public Transport

• Access Control

• PC Access

• Authentication

Bus Detection Device for Blind People 9


Malla Reddy College of Engineering and Technology Dept of ECE

• Printer / Production

Features

RF Transmit Frequency 125KHZ

Supported Standards EM4001 64-bit RFID tag


compatible

Communications Interface TTL Serial Interface, Wiegand


output

Communications Protocol Specific ASCII

Communications Parameter 9600 bps, 8, N, 1

Power Supply 4.6V – 5.5VDC

Current Consumption 50 mA

Reading distance Up to 100mm, depending on tag

Antenna Integrated

Size (LxWxH) 32 x 32 x 8mm

Bus Detection Device for Blind People 10


Malla Reddy College of Engineering and Technology Dept of ECE

Fig: Circuit diagram of bus detection for blind people

1.3 PIC: -

PIC is a Peripheral Interface Microcontroller which was developed in the year 1993 by the
General Instruments Microcontrollers. It Is controlled by software and programmed in such a
way that it performs different tasks and controls a generation line. PIC microcontrollers are
used in different new applications such as smart phones, audio accessories and advanced
medical devices. There are many PICs available in the market ranging from PIC16C84 to
PIC16C84. These types of PICs are affordable flash PICs

PIC16F1789

Bus Detection Device for Blind People 11


Malla Reddy College of Engineering and Technology Dept of ECE

The PIC microcontroller is based on RISC architecture. Its memory architecture follows the
Harvard pattern of separate memories for program and data, separate buses.

Fig: PIC microcontroller based on RISC architecture.

The hardware capabilities of PIC devices range from 6 -pin SMD , to 8-pin DIP chips up to
144- pin SMD chips , with discrete I/O pins ,ADC and DAC modules ,and communications. The
manufacturer supplies computers software for developing now as MPLAB X, assemblers and
C/C++ compilers, and programmer by debugger hardware Under the MPLAB and PICK it
series.

Chapter 2 –BLOCK DIAGRAM AND DESCRIPTION

Bus Detection Device for Blind People 12


Malla Reddy College of Engineering and Technology Dept of ECE

2.1 Description:-

Generally, journey in a bus is a safe and comfort factor, but due to increase in number of
busses and passenger its going be tougher now a days and it will be more difficult for blind
people to travel in bus so with this project, we can make a system which can help blind people
to find the bus at the bus stop as they cannot able to see which bus is coming on the bus stop.

By providing a device which can help them to know which bus is coming on bus stop. In
the project we have microcontroller, RFID reader and voice IC for voice announcement with

Speaker as basic blocks. Whenever the bus come to stop the RFID reader will be
reading the tag (which is given to every bus for particular route) and depending upon the tag
it will give voice intimation by using speaker the blind person can know the bus number.

The system is designed to provide information system for the visually impaired
assisting with voice command signals that utilizes RFID technology for task of identification as
shown in block diagram. In this system a RFID reader is installed at every bus stop which is
integrated with microcontroller and voice assistance equipment’s. The buses are equipped
with a unique RFID tag. When a bus approaches a bus stop the RFID reader receives the
information of the bus through a unique identification number of the bus and its route map
and trigger a signal to voice-based playback system. The voice-based play back system is
already fed the information and is transmitted out through speaker.

PIC stands for peripheral interface controller. PIC microcontroller was developed by
microchip technology in 1993. It was developed for supporting PDP computers to control its
peripheral devices and that’s why it was named peripheral interface controller.PIC
microcontroller are of low cost, very fast and easy for the programming and execution of
program . Their interfacing with other peripheral is also very easy.

Microchip company are divided into four large families. In this PIC microcontroller
architecture article, I will explain step by step about PIC microcontroller architecture and
compounds. The transfer of one bit of data at a time consecutively over a communication
channel is called serial communication . There are three protocols of serial communication.

USART: It stands for universal synchronous and asynchronous receiver and transmitter which
provides a serial communication in two devices. In this protocol data is transmitter and

Bus Detection Device for Blind People 13


Malla Reddy College of Engineering and Technology Dept of ECE

received bit by bit through a single wire according to the clock pulses . To send and receive
data serially the PIC microcontroller has two pins TXD and RXD. SPI stands for serial peripheral
interface. It is used to send data between PIC microcontroller and other peripherals like
sensors, shift register and SD cards. Three wire SPI communication is supported in PIC
microcontroller between two devices on a common clock source.

2.2 BLOCK DIAGRAM:

Fig: Block diagram of Microcontroller.

2.2.1 Microcontroller:

1. LPC2148 microcontroller: -

LPC2148 microcontroller is based on a 16-bit/32-bit ARM7TDMI-S with real-time emulation


and embedded trace support, that combine microcontrollers with embedded high – speed
flash memory ranging from 32 KB to 512 KB. A 128 – bit wide memory interface and unique
accelerator architecture enable 32- bit code execution at the maximum clock rate. For critical
code size applications, the alternative 16 – bit Thumb mode reduces code by more than 30%

Bus Detection Device for Blind People 14


Malla Reddy College of Engineering and Technology Dept of ECE

with minimal performance penalty. The meaning of LPC IS Low Power Low-Cost
microcontroller. This is 32-bit microcontroller manufactured by Philips semiconductors (NXP).
Due to their tiny size and low power consumption. LPC2148 is ideal for applications where
miniaturization is a key requirement, such as access control and point – of – sale.

Features of LPC2148 Microcontroller:

 8– bit/32 – bit ARM7TDMI – S microcontroller in a tiny LQFP64 package.


 8 KB to 40 KB of on – chip static RAM and 32KB to 5KBof on – chip flash memory; 128
– bit wide interface/accelerator enables high – speed of 60 MHZ operation.
 USB 2.0 Full – speed compliant device controller with 2 KB of endpoint RAM. In
addition, the LPC2148 provides 8 KB of on – chip RAM accessible to USB by DMA.
 One or two (LPC2142/42 Vs, LPC2144/46/48) 10 – bit ADCs provide a total of 6/14
analog inputs, with conversion times as low as 2.44 Ms per channel.
 Single 10 – bit DAC provides variable analog output (LPC2148 only).
 Two 32 – bit timers/external event counters (with four capture and four compare
channel each), PWM unit (six outputs) and watchdog.
 Low power Real – Time Clock (RTC) with independent power and 32 KHz clock input.
 Various crystal or RC oscillator configuration or an external clock.
 PIC devices are popular with both industrial developers and hobbyists due to their
low cost ,wide availability, large user base, extensive collection of application notes.
 A hardware stack for storing return address.
 ALU status flags are mapped into the data space.
 Data-space mapped CPU, port and peripheral registers.

2.2.2 LCD: -

Liquid Crystal Display (LCD) consists of rod – shaped tiny molecules sandwiched between a
flat piece of glass on an opaque substrate. These rod – shaped molecules in between the
plates align into two different physical positions based on different physical positions based
on the electric charge is applied they align to block the light entering through them, whereas
when no – charge is applied they become transparent.

Features of LCD:

Bus Detection Device for Blind People 15


Malla Reddy College of Engineering and Technology Dept of ECE

• Consumes less power and generates less heat.

• Saves lot of space compared picture tubes due to LCDs flatness.

• Due to less weight and flatness LCDs are highly portable.

• No flicker and less screen glare in LCDs to reduce eyestrain.

Fig :line of LCD display.

Bus Detection Device for Blind People 16


Malla Reddy College of Engineering and Technology Dept of ECE

2.2.3 RFID:

RFID Reader / Writer:

The reader write is used to communicate with tags that may pass within range. The RFID
reader writer will normally be located in a fixed position and will be used to interrogate an
RFID tag. Dependent upon the application and the format of the system and the RFID reader
/ writer, data may also be written to the RFID tag.

RFID tag:

RFID tags may also be called RFID transponders and are typically located on items that are
mobile. They are small and generally cheap so that they can be attached to low cost items
that need to have information associated with them. They are also generally considered as
being disposable. The RFID tag contains data that is relayed to the reader, and in some
systems, it may also be possible to update the data within the tag to indicate that the tag and
hence the item has undergone a specific stage in a process, etc.

RFID Application Software:

Like all system these days, RFID systems need application software to run the overall system.
With many systems there will be a number of different reader / writers and the data to and
from these needs to be coordinated and analyzed. Application software will be required for
these.

Although these RFID systems will vary according to its requirements, these are the main
elements which can be found. RFID technology has become widespread in its use. It offers
may advantages and RFID is a particularly versatile system, being able to be used in many
areas from shops

Bus Detection Device for Blind People 17


Malla Reddy College of Engineering and Technology Dept of ECE

Fig: RFID FREQUENCY READER.

Chapter 3 – Circuit working and its Description

3.1 Power supply to the controller :

3.1.1 Introduction:

Power supply is a supply of electrical power. A device or system that supplies electrical or
other types of energy to an output load or group of loads is called a power supply unit or PSU.
The term is most commonly applied to electrical energy supplies, less often to mechanical
ones, and rarely to others. A power supply may include a power distribution system as well
as primary or secondary sources of energy such as

Bus Detection Device for Blind People 18


Malla Reddy College of Engineering and Technology Dept of ECE

• Conversion of one form of electrical power to another desired form and voltage, typically
involving converting AC line voltage to a well-regulated lower-voltage DC for electronic
devices.

• Low voltage, low power DC power supply units are commonly integrated with the devices
they supply, such as computer sand household electronics.

• Chemical fuel cells and other forms of energy storage systems.

• Solar power.

• Generators or alternators.

3.1.2 Block Diagram:

Figure 3.1.2: Regulated Power Supply

The basic circuit diagram of a regulated power supply (DC O/P) with led connected as load is
shown in fig:

3.1.3 CIRCUIT DIAGRAM:

Bus Detection Device for Blind People 19


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 3.1.3: Circuit diagram of Regulated Power Supply with Led connection

The components mainly used in above figure are

• 230v AC mains

• Transformer

• Bridge rectifier(diodes)

• Voltage regulator (IC 7805)

• Resistor

• LED (light emitting diode)

3.1.4 Transformation:

The process of transforming energy from one device to another is called transformation. For
transforming energy, we use transformers.

Transformers:

A transformer is a device that transfers electrical energy from one circuit to another through
inductively coupled conductors without changing its frequency. A varying current in the first
or primary winding creates a varying magnetic flux in the transformer's core, and thus a
varying magnetic field through the secondary winding. This varying magnetic field induces a
varying electromotive force (EMF) or "voltage" in the secondary winding. This effect is called
mutual induction.

Bus Detection Device for Blind People 20


Malla Reddy College of Engineering and Technology Dept of ECE

If a load is connected to the secondary, an electric current will flow in the secondary winding
and electrical energy will be transferred from the primary circuit through the transformer to
the load. This field is made up from lines of force and has the same shape as a bar magnet.

If another coil is placed adjacent to the first coil then, as the field moves out or in, the moving
lines of force will "cut" the turns of the second coil. As it does this, a voltage is induced in the
second coil. With the 50 Hz AC mains supply, this will happen 50 times a second. This is called
MUTUAL INDUCTION and forms the basis of the transformer. The input coil is called the
PRIMARY WINDING; the output coil is the SECONDARY WINDING.

Fig: 3.1.4 Step-Down Transformer.

The voltage induced in the secondary is determined by the TURNS RATIO.

For example, if the secondary has half the primary turns; the secondary will have half the
primary voltage. Another example is if the primary has 5000 turns and the secondary has 500
turns, then the turn’s ratio is 10:1.

If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller = 24 volts.
Assuming a perfect transformer, the power provided by the primary must equal the power
taken by a load on the secondary. If a 24-watt lamp is connected across a 24-volt secondary,
then the primary must supply 24 watts.

Bus Detection Device for Blind People 21


Malla Reddy College of Engineering and Technology Dept of ECE

To aid magnetic coupling between primary and secondary, the coils are wound on a metal
CORE. Since the primary would induce power, called EDDY CURRENTS, into this core, the core
is LAMINATED. This means that it is made up from metal sheets insulated from each other.
Transformers to work at higher frequencies have an iron dust core or no core at all.

Note that the transformer only works on AC, which has a constantly changing current and
moving field. DC has a steady current and therefore a steady field and there would be no
induction.

Some transformers have an electrostatic screen between primary and secondary. This is to
prevent some types of interference being fed from the equipment down into the mains
supply, or in the other direction. Transformers are sometimes used for IMPEDANCE
MATCHING.

Step Up transformer: In case of step up transformer, primary windings are every less
compared to secondary winding. Because of having more turns secondary winding accepts
more energy, and it releases more voltage at the output side.

Step down transformer : In case of step-down transformer, Primary winding induces more
flux than the secondary winding, and secondary winding is having a smaller number of turns
because of that it accepts a smaller number of fluxes, and releases less amount of voltage.

3.1.5 Battery power supply:

A battery is a type of linear power supply that offers benefits that traditional line-
operated power supplies lack: mobility, portability and reliability. A battery consists of
multiple electrochemical cells connected to provide the voltage desired. Fig: 3.1.5 shows Hi-
Watt 9V battery

Bus Detection Device for Blind People 22


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 3.1.5: Hi-Watt 9V Battery

The most commonly used dry-cell battery is the carbon-zinc dry cell battery .Dry-cell
batteries are made by stacking a carbon plate, a layer of electrolyte paste, and a zinc plate
alternately until the desired total voltage is achieved. The most common dry-cell batteries
have one of the following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90. During the discharge of a
carbon-zinc battery, the zinc metal is converted to a zinc salt in the electrolyte, and
magnesium dioxide is reduced at the carbon electrode. These actions establish a voltage of
approximately 1.5 V.

The lead-acid storage battery may be used. This battery is rechargeable; it consists of lead
and lead/dioxide electrodes which are immersed in sulfuric acid. When fully charged, this type
of battery has a 2.06-2.14 V potential (A 12 volar battery uses 6 cells in series). During
discharge, the lead is converted to lead sulphate and the sulphuric acid is converted to water.
When the battery is charging, the lead sulphate is converted back to lead and lead dioxide
Nickel- cadmium battery has become more popular in recent years .This battery cell is
completely sealed and rechargeable. The electrolyte is not involved in the electrode reaction,
making the voltage constant over the span of the batteries long service life. During the
charging process, nickel oxide is oxidized to its higher oxidation state and cadmium oxide is
reduced. The nickel-cadmium batteries have many benefits. They can be stored both charged
and uncharged. They have a long service life, high current availabilities, constant voltage, and
the ability to be recharged. Fig: 3.9 shows pencil battery of 1.5V.

Bus Detection Device for Blind People 23


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 3.1.6: Pencil Battery of 1.5V

3.1.6 Rectification:

The process of converting an alternating current to a pulsating direct current is called as


rectification. For rectification purpose we use rectifiers.

Rectifiers:

A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. Rectifiers have many uses including as components of
power supplies and as detectors of radio signals. Rectifiers may be made of solid-state diodes,
vacuum tube diodes, mercury arc valves, and other components.

When only one diode is used to rectify AC (by blocking the negative or positive portion of
the waveform), the difference between the term diode and the term rectifier is merely one
of usage, i.e., the term rectifier describes a diode that is being used to convert AC to DC.
Almost all rectifiers comprise a number of diodes in a specific arrangement for more
efficiently converting AC to DC than is possible with only one diode. Before the development
of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide or selenium
rectifier stacks were used.

Bridge full wave rectifier:

The Bridge rectifier circuit is shown in fig: 3.10, which converts an ac voltage to dc voltage
using both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure.
The circuit has four diodes connected to form a bridge. The ac input voltage is applied to the
diagonally opposite ends of the bridge. The load resistance is connected between the other
two ends of the bridge.

Like wave circuit , the half a full wave rectifier circuit produces an output voltage or current
which is purely DC or has some specified DC component . Fullwave rectifiers has some
fundamentals advantages over their half wave rectifier counter parts.

Power diodes can be connected together to form a full wave rectifier that convert AC voltage
in to pulsating DC voltage for using power supplies . The previous power diodes tutorial were

Bus Detection Device for Blind People 24


Malla Reddy College of Engineering and Technology Dept of ECE

discussed ways of reducing the ripple or voltage variations on a direct DC voltage by


connecting something capacitors across the load resistance .

In a full wave rectifiers circuit two diodes are used, one for each half of the cycle. A multiple
winding transformer is used whose secondary winding is split equally in to two halves with a
common centre tapped connection. This configuration results in each diode conducting in
turn when its anode terminal is positive with respect to the transformer centre point C
producing an output during both half cycles , twice that for the half wave rectifier so it is 100%
efficient.

The full wave rectifier consists of two power diodes connected to a single load resistances
with each diode taking in term to supply current to the load. When the point A of the
transformer is positive with respect to point C, diode D1 conducts in the forward direction as
indicated by the arrows. When point B is positive with respect to pointC , the diode D2
conducts in the forward direction and the current flowing through the resistor R is in the same
direction for both half cycles .

As the output voltage across the resistor R is the phase sum of the two waveforms combined,
this type of full wave rectifiers circuit is known as bi-phase circuit . We can see this effect quite
clearly if we run the circuit in the partsim simulator circuit with the smoothing capacitor
removed.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas
diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with the
load resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct whereas, D1
and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load resistance
RL and hence the current flows through RL in the same direction as in the previous half cycle.
Thus, a bidirectional wave is converted into a unidirectional wave.

Bus Detection Device for Blind People 25


Malla Reddy College of Engineering and Technology Dept of ECE

Input Output

Figure 3.1.7: Bridge rectifier: a full-wave rectifier using 4 diodes

3.1.7 Filtration:

The process of converting a pulsating direct current to a pure direct current using filters is
called as filtration.

Filters: Electronic filters are electronic circuits, which perform signal-processing functions,
specifically to remove unwanted frequency components from the signal, to enhance wanted
ones.

Regulation: The process of converting a varying voltage to a constant regulated voltage is


called as regulation. For the process of regulation, we use voltage regulators.

3.1.8 Voltage Regulator:

A voltage regulator (also called a ‘regulator’) with only three terminals appears to be a
simple device, but it is in fact a very complex integrated circuit. It converts a varying input
voltage into a constant ‘regulated’ output voltage. Voltage Regulators are available in a
variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage regulators are
designed for positive input. For applications requiring negative input, the LM79XX series is
used. Using a pair of ‘voltage-divider’ resistors can increase the output voltage of a regulator
circuit.

Bus Detection Device for Blind People 26


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 3.1.8: Voltage Regulator

It is not possible to obtain a voltage lower than the stated rating. You cannot use a 12V
regulator to make a 5V power supply. Voltage regulators are very robust. These can withstand
over-current draw due to short circuits and also over-heating. In both cases, the regulator will
cut off before any damage occurs. The only way to destroy a regulator is to apply reverse
voltage to its input. Reverse polarity destroys the regulator almost instantly. Fig: 3.11 shows
voltage regulator.

3.2 VOICE Playback Module:

APR9600 is a low-cost high-performance sound record/replay IC incorporating flash analogue


storage technique. Recorded sound is retained even after power supply is removed from the
module. The replayed sound exhibits high quality with a low noise level. Sampling rate for a
60 second recording period is 4.2 kHz that gives a sound record/replay bandwidth of 20Hz to
2.1 kHz. However, by changing an oscillation resistor, a sampling rate as high as 8.0 kHz can
be achieved. This shortens the total length of sound recording to 32 seconds.

Total sound recording time can be varied from 32 seconds to 60 seconds by changing the
value of a single resistor. The IC can operate in one of two modes: serial mode and parallel
mode.

In mode, sound can be recorded in 2, 4 or 8 sections. The IC can be controlled simply using
push button keys. It is also possible to control the IC using external digital circuitry such as
micro-controllers and computers.

Bus Detection Device for Blind People 27


Malla Reddy College of Engineering and Technology Dept of ECE

The APR9600 has a 28 pin DIP package. Supply voltage is between 4.5V to 6.5V. During
recording and replaying, current consumption is 25 mA. In idle mode, the current drops to 1
Micro amp.

The APR9600 experimental board is an assembled PCB board consisting of an APR9600 IC,
an electret microphone, support components and necessary switches to allow users to
explore all functions of the APR9600 chip. The oscillation resistor is chosen so that the total
recording period is 60 seconds with a sampling rate of 4.2 kHz. The board measures 80mm by
55mm.

This voice recording module offers true single chip solid state storage capability and requires
no software or microcontroller support. It provides high quality recording and play back with
single 20 sec message .One button is pushed down to record the message through the on
board electret microphone. A LED turns on during this time. The other button just has to be
momentarily pressed to replay the message . A second momentary press during play back
will stop the play back.

1. APR9600

Pin-out of the APR9600 is given in Figure 1. A typical connection of the chip is given in
Figure 2 (This is the circuit diagram of the module). Pin functions of the

IC are given in Table 1.

During sound recording, sound is picked up by the microphone. A microphone pre-


amplifier amplifies the voltage signal from the microphone. An AGC circuit is included in
the pre-amplifier, the extent of which is controlled by an external capacitor and resistor.
If the voltage level of a sound signal is around 100 mV peak to-peak, the signal can be fed
directly into the IC through ANA IN pin (pin 20). The sound signal passes through a filter
and a sampling and holds circuit. The analogue voltage is then written into non-volatile
flash an algae RAMs

Bus Detection Device for Blind People 28


Malla Reddy College of Engineering and Technology Dept of ECE

Fig: Pin diagram of APR9600

It has a 28 pin DIP package. Supply voltage is between 4.5V to 6.5V. During recording and
replaying, current consumption is 25 mA. In idle mode, the current drops to 1 micro amp.

Table 1 Pin-functions of the APR9600

Pin Name Functions Pin Mane Functions

1 -M1 Select 1st section of sound or serial 15 SP- Speaker, negative end

mode recording and replaying

control (low active)

2 -M2 Select 2nd section or fast forward 16 VCCA Analogue circuit power supply

Bus Detection Device for Blind People 29


Malla Reddy College of Engineering and Technology Dept of ECE

control in serial mode (low active)

3 -M3 Select 3 rd. section of sound 17 MICIN Microphone input (electret type

microphone)

4 -M4 Select 4th section of sound 18 MICREF Microphone reference input

5 -M5 Select 5th section of sound 19 AGC AGC control

6 -M6 Select 6th section of sound 20 ANA-IN Audio input (accept a signal of

100 mV p-to-p)

7 OSCR Resistor to set clock frequency. See 21 ANA-OUT Audio output from the

Table 3 for details microphone amplifier

8 -M7 Select 7th section of sound or IC 22 STROBE During recording and

overflow indication replaying, it produces a strobe

signal

9 -M8 Select 8th section of sound or select 23 CE Reset sound track counter to

mode (see Table 2) zero/ Stop or Start / Stop


10 -BUSY Busy (low active) 24 MSEL1 Mode selection 1 (see Table 2)

11 BE =1, beep when a key is pressed 25 MSEL2 Mode selection 2 (see Table 2)

=0, do not beep

12 VSSD Digital circuit ground 26 EXTCLK External clock input

13 VSSA Analogue circuit ground 27 -RE =0 to record, =1 to replay

14 SP+ Speaker, positive end 28 VCCD Digital circuit power supply

During sound replaying, the IC’s control circuit reads analogue data from flash RAMs. The
signal then passes through a low-pass filter, a power amplifier and output to an 8 to 16 Ohm
speaker.

Bus Detection Device for Blind People 30


Malla Reddy College of Engineering and Technology Dept of ECE

There are different sound recording and replaying modes (see Table 2). These modes are
selected using MSEL1 (Pin 24), MSEL2 (Pin 25) and –M8 (Pin 9). –M1 to –M7 keys have
different functions in different modes.

Table 2 Modes and selection of modes

MSEL1 MSEL2 -M8 Function Keys Functions


-M1, -M2 to select 1st Parallel mode, 2 sections, 30 seconds for
0 1 0 or 1 and 2nd each

sound tracks. CE to stop

-M1 to –M4 to select a Parallel mode, 4 sections, 15 seconds for


1 0 0 or 1 sound each

track, CE to stop

-M1 to –M8 to select a Parallel mode, 8 sections, 7.5 seconds for


1 1 1 sound each

track, CE to stop

-M1 to –M8 to select a Pressing and hold down a key from –M1
1 1 1 sound to M8 to

track, CE to stop play the selected sound track repeatedly

Serial mode, allow up to 256 sound tracks


0 0 1 -M1 and CE to be
recorded and played. Sound tracks are
played from
1st to N in order after –M1 is toggled.
Press CE to

play from the 1 set sound track.

Serial mode, Press –M1 to replay one


0 0 0 -M1, -M2 and CE sound track.
Toggle –M2 once to move to the next
sound track.
Press CE to play sound from the 1 set
sound track

Notes:

0 RE=0 to record sound. RE=1 to replay sound 

Bus Detection Device for Blind People 31


Malla Reddy College of Engineering and Technology Dept of ECE

0 Press -M1 to -M8 once to replay a sound track. Press the key again to stop replaying the
 track 
0 Press and hold –M1 to -M8 continuously, the corresponding track will be replayed
 
repeatedly 
0 During recording, -M1 to M8 should be pressed while the sound is being recorded.
Releasing the key terminates recording. 

2. APR9600 module
The circuit diagram of the module is shown in Figure 2. The module consists of an APR9600
chip, an electret microphone, support components, a mode selection switch (-RE, MSEL1,
MSEL2 and – M8) and 9 keys (-M1 to –M8 and CE). The oscillation resistor is chosen so that
the total recording period is 60 seconds with a sampling rate of 4.2 kHz. Users can change the
value of the ROSC to obtain other sampling frequencies. It should be noted that if the
sampling rate is increased, the length of recording time is decreased. Table 3 gives the details.

An 8-16 Ohm speaker is to be used with the module. Users can select different modes using
the mode selection switch. The module is measured 80mm 55mm.

Connection points (0-8, C and B) can connect to other switches or external digital circuits. In
this case, on-board keys M1 to M8 and CE are by-passed.

3. Using the APR9600 module

3.1Parallel mode recording and replaying

Record sound tracks

This is an example of recording 8 sound tracks. The mode switch should have the following
pattern: MSEL1=1(switched to left-hand side of the mode selection switch), MSEL2=1 (left-
hand side). –M8=1 (left-hand side). RE=0 (right-hand side). The maximum length of the 8
tracks is 7.5 seconds. Press –M1 continuously and you will see BUZY LED illuminates. You can
now speak to the microphone. Recording will terminate if –M1 is released or if the recording
time exceeds 7.5 seconds. Similarly, press –M2 to -M8 to record other sound tracks.

Now makewitches at the same losoundPress otherM1 to CE to stop playing the sound trackis
playing, press the same-M8 is pressed continuously, the particular sound track will be played
continuously. Press RE=1 (switckey while a sound is being played causes a new sound track to

Bus Detection Device for Blind People 32


Malla Reddy College of Engineering and Technology Dept of ECE

be playIf a key from atiod to Left. Togglek .-y again or presh–nd sideM1 t –of thM8 (press key
and retrack to re CE key mode selection switch) whilewill terminate the current sound track.
once. Whilkeepother the –

3.2 Serial mode recording and replaying

Record sound tracks sequentially

This is an example of recording sequential sound tracks. The mode switch should have the
following pattern: MSEL1=0(switched to right-hand side of the mode selection switch),
MSEL2=0 (right-hand side). –M8=1 (left-hand side). RE=0 (right-hand side). Press CE first to
reset the sound track counter to zero. Press and hold –M1 down and you will see BUZY LED
illuminates. You can now speak to the microphone. Recording will terminate if –M1 is released
or if the recording time exceeds 60 seconds (in this case you will run out the memory for your
next sound track). Press –M1 again and again to record 2nd, 3rd, 4th and other consecutive
sound tracks. Each sound track may have different lengths, but the accumulated length of all
sound tracks will not exceed 60 seconds.

Replay sound tracks sequentially

Now make RE=1 (switched to Left-hand side of the mode selection switch) while keep other
switches at the same location. Toggle –M1 (press key and release) causes the 1s t sound track
to be played once. Toggle –M1 again and again will play the 2nd, 3rd, 4th and other
consecutive sound tracks. Press CE to reset the sound track counter to zero.

Record sound tracks with forward control

This is an example of recording sound tracks with forward control. The mode switch should
have the following pattern: MSEL1=0(switched to right-hand side of the mode selection
switch), MSEL2=0 (right-hand side). –M8=0 (right-hand side). RE=0 (right-hand side). Press CE
first to reset the sound track counter to zero. This mode is rather similar to the above
sequential sound recording. The only difference is that after –M1 is pressed and released, the
sound track counter does not increment itself to the next sound track location. To move to

Bus Detection Device for Blind People 33


Malla Reddy College of Engineering and Technology Dept of ECE

the next sound track, –M2 should be toggled. So, if –M1 is not toggled again and again without
toggling –M2, sound will be recorded at the same sound track location.

Replay sound tracks with forward control

Now make RE=1 (switched to Left-hand side of the mode selection switch) while keep other
switches at the same location. Toggle –M1 (press key and release) causes the 1s t sound track
to be played once. Toggle –M1 again and again will still play the 1s t sound track. Once –M2
is toggled,the sound track counter is incremented and the next sound can be played. Press CE
to reset the sound track count.

APR9600 is a low -cost high performance sound record/display IC incorporating flash


analogue storage technique. Recorded sound is retained even after power supply is removed
from the module . The replayed sound exhibits high quality with a low noise level. Sampling
rate for a 60 sec recording period is 4.2khz that gives a sound record /replay bandwidth of
20hz to 2.1khz. However , by changing an oscillation resistor, a sampling rate as high as 8.0hz
can be achieved .This shortens the total length of sound recording to 32sec.

The total sound recording time can be varied from 32sec to 60sec by changing the value of a
single resistor. The IC can operate in one of two modes :serial mode and parallel mode In
serial access mode , sound can be recorded in 256 sections. In parallel access mode, sound
can be recorded in 2,4 or 8 sections. The IC can be controlled simply using push button keys .
It is also possible to control the IC using external digital circuitry such as microcontrollers and
computers .

The APR9600 has a 28 pin DIP package . Supply voltage is between 4.5 volts to 6.5 volts.
During recording and replaying , current consumption is 25mA.In idle mode the current drops
to one micro amp .

The APR9600 experimental board is an assembled PCB board consisting of an APR9600 IC ,


an electret microphone , support component and necessary switches to allow users to explore
all functions of the APR9600 chip. The oscillation resistor is chosen so that the total recording
period is 60 sec with a sampling rate of 4.2khz . The board measures 80mm by 55mm

3.2.1. Sampling rates

Bus Detection Device for Blind People 34


Malla Reddy College of Engineering and Technology Dept of ECE

The sampling rate is determined by the value of the OSC resistor (R8 in the circuit diagram).
It can be adjusted by users to suit their specific requirements. The relationships amongst the
resistance, sampling rate, bandwidth and recording period are shown in Table

Table 3 OSC resistances

OSCR resistance Sampling rate Bandwidth Recording time

[kOhm] [kHz] [kHz] [Second]

44 4.2 2.1 60
38 6.4 3.2 40
24 8.0 4.0 32

3.2.2. Application tips

Tips for better sound replay quality:

1.Use a good quality 8 Ohm speaker with a cavity such as speakers for computer sound
systems. Do not use a bare speaker which gives you degraded sound.

2.For better sound replay quality, speak with a distance to the on-board microphone and
speak clearly. Also keep the background noise as low as possible.For even better sound replay
quality, use microphone input or Audio Line In input. If Audio Line In is used, the amplitude
of input signal should be < 100 mV p-p.

CHAPTER 4 – Software Development

4.1 Introduction to the Arduino Board

The Adriano is a family of microcontroller boards to simplify electronic design, prototyping


and experimenting for artists, hackers, hobbyists, but also many professionals. People use it
as brains for their robots, to build new digital music instruments, or to build a system that lets
your house plants tweet you when they’re dry. Arduinos (we use the standard Arduino Uno)
are built around an AT mega microcontroller — essentially a complete computer with CPU,
RAM, Flash memory, and input/output pins, all on a single chip.

Bus Detection Device for Blind People 35


Malla Reddy College of Engineering and Technology Dept of ECE

Unlike, say, a Raspberry Pi, it’s designed to attach all kinds of sensors, LEDs, small motors and
speakers, servos, etc. directly to these pins, which can read in or output digital or analog
voltages between 0 and 5 volts. The Arduino connects to your computer via USB, where you
program it in a simple language (C/C++, similar to Java) from inside the free Arduino IDE by
uploading your compiled code to the board. Once programmed, the Arduino can run with the
USB link back to your computer, or stand-alone without it — no keyboard or screen needed,
just power.

Fig 4.1 Structure of Arduino Board

Looking at the board from the top down, this is an outline of what you will see (parts of the
board you might interact with in the course of normal use are highlighted)

Bus Detection Device for Blind People 36


Malla Reddy College of Engineering and Technology Dept of ECE

Fig 4.2 Adriano Board Starting clockwise from the top centre:

➢ Analog Reference pin (orange)

➢ Digital Ground (light green)

➢ Digital Pins 2-13 (green)

➢ Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital
i/o (Digital Read and Digital Write) if you are also using serial communication (e.g. Serial.
Begin).

➢ Reset Button - S1 (dark blue)

➢ In-circuit Serial Programmer (blue-green)

➢ Analogy In Pins 0-5 (light blue)

➢ Power and Ground Pins (power: orange, grounds: light orange)

➢ External Power Supply In (9-12VDC) - X1 (pink)

➢ Toggles External Power and USB Power (place jumper on two pins closest to desired
supply) - SV1 (purple)

Bus Detection Device for Blind People 37


Malla Reddy College of Engineering and Technology Dept of ECE

➢ USB (used for uploading sketches to the board and for serial communication between the
board and the computer; can be used to power the board) (yellow)

4.2.1 Digital Pins

In addition to the specific functions listed below, the digital pins on an Arduino board can
be used for general purpose input and output via the pin Mode(),Digital Read(), and Digital
Write()commands. Each pin has an internal pull-up resistor which can be turned on and off
using digital Write () (w/ a value of HIGH or LOW, respectively) when the pin is configured as
an input. The maximum current per pin is 40mA.

➢ Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. On the
Arduino Diecimila, these pins are connected to the corresponding pins of the FTDI USB-to-TTL
Serial chip. On the Arduino BT, they are connected to the corresponding pins of the
WT11Bluetooth module. On the Arduino Mini and Lilypad Arduino, they are intended for use
with an external TTL serial module (e.g. the Mini-USB Adapter).

➢ External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attach Interrupt ()function for
details.

➢ PWM: 3, 5, 6, 9, 10, and 11 Provide 8-bit PWM output with the analog Write()function. On
boards with an ATmega8, PWM output is available only on pins 9, 10, and 11.

➢ BT Reset: 7. (Arduino BT-only) Connected to the reset line of the Bluetooth module.

➢ SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which,
although provided by the underlying hardware, is not currently included in the Arduino
language.

➢ LED: 13. On the Diecimila and Lilypad, there is a built-in LED connected to digital pin 13.
When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.

4.2.2 Analog Pins

In addition to the specific functions listed below, the analog input pins support 10-bit analog-
to-digital conversion (ADC) using the analog Read()function. Most of the analog inputs can

Bus Detection Device for Blind People 38


Malla Reddy College of Engineering and Technology Dept of ECE

also be used as digital pins: analog input 0 as digital pin 14 through analog input 5 as digital
pin 19. Analog inputs 6 and 7 (present on the Mini and BT) cannot be used as digital pins.

➢ I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire
library(documentation on the Wiring website).

2.4.3 Power Pins

➢ VIN (sometimes labelled "9V"): The input voltage to the Arduino board when it's using an
external power source (as opposed to 5 volts from the USB connection or other regulated
power source). You can supply voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin. Also note that the Lily Pad has no VIN pin and accepts only a
regulated input.

➢ 5V: The regulated power supply used to power the microcontroller and other components
on the board. This can come either from VIN via an on-board regulator, or be supplied by USB
or another regulated 5V supply. 3V3 (Decimal-only): A 3.3-volt supply generated by the on-
board FTDI chip.

➢ GND: Ground pins.

4.2.3 Other Pins

➢ AREF: Reference voltage for the analog inputs. Used with analogy Reference ().

➢ Reset: (Decimal-only) Bring this line LOW to reset the microcontroller. Typically used to
add a reset button to shields which block the one on the board.

4.2.4 Atmega328

Pin diagram

Bus Detection Device for Blind People 39


Malla Reddy College of Engineering and Technology Dept of ECE

Fig: 4.2.4 Pin Configuration of Atmega328

Pin Description Port A (PA7-PA0):

Bus Detection Device for Blind People 40


Malla Reddy College of Engineering and Technology Dept of ECE

Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-
directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up
resistors (selected for each bit).

The Port A output buffers have symmetrical drive characteristics with both high sink and
source capability.

When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source
current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a
reset condition becomes active, even if the clock is not running.

Port B (PB7-PB0):

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port B output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port B pins that are externally pulled low will source current if
the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition
becomes active, even if the clock is not running. Port B also serves the functions of various
special features of the ATmega32.

Port C (PC7-PC0):

Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port C output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally pulled low will source current if
the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition
becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up
resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs. The
TD0 pin is tri-stated unless TAP states that shift out data are entered. Port C also serves the
functions of the JTAG interface.

Port D (PD7-PD0):

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit).
The Port D output buffers have symmetrical drive characteristics with both high sink and
source capability. As inputs, Port D pins that are externally pulled low will source current if

Bus Detection Device for Blind People 41


Malla Reddy College of Engineering and Technology Dept of ECE

the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition
becomes active, even if the clock is not running. Port D also serves the functions of various
special features of the ATmega32.

Reset (Reset Input):

A low level on this pin for longer than the minimum pulse length will generate a reset, even if
the clock is not running. Shorter pulses are not guaranteed to generate a reset.

XTAL1:

Input to the inverting Oscillator amplifier and input to the internal clock operating circuit.

XTAL2:

Output from the inverting Oscillator amplifier.

AVCC:

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

AREF:

AREF is the analog reference pin for the A/D Converter.

4.2.5 Features:

➢ 1.8-5.5V operating range

➢ Up to 20MHz

➢ Part: ATMEGA328P-AU

➢ 32kB Flash program memory

➢ 1kB EEPROM

➢ 2kB Internal SRAM

➢ 2 8-bit Timer/Counters

Bus Detection Device for Blind People 42


Malla Reddy College of Engineering and Technology Dept of ECE

➢ 16-bit Timer/Counter

➢ RTC with separate oscillator

➢ 6 PWM Channels

➢ 8 Channel 10-bit ADC

➢ Serial USART

➢ Master/Slave SPI interface

➢ 2-wire (I2C) interface

➢ Watchdog timer

➢ Analog comparator

➢ 23 IO lines

➢ Data retention: 20 years at 85C/ 100 years at 25C

➢Digital I/O Pins are 14 (out of which 6 provide PWM output) ➢Analog Input Pins are 6.

➢DC Current per I/O is 40 mA

➢ DC Current for 3.3V Pin is 50mA

4.2.6 AVR CPU Core

The AVR core combines a rich instruction set with 32 general purpose working registers. All
the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two
independent registers to be accessed in one single instruction executed in one clock cycle.
The resulting architecture is more code efficient while achieving throughputs up to ten times
faster than conventional CISC microcontrollers.

BLOCK DIAGRAM:

Bus Detection Device for Blind People 43


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 4.2.6 Block Diagram AVR CPU Core

4.2.7 Overview

This section discusses the AVR core architecture in general. The main function of the CPU core
is to ensure correct program execution. The CPU must therefore be able to access memories,
perform calculations, control peripherals, and handle interrupts.

Bus Detection Device for Blind People 44


Malla Reddy College of Engineering and Technology Dept of ECE

Fig 4. 2.7 AVR core architecture

In order to maximize performance and parallelism, the AVR uses a Harvard architecture –
with separate memories and buses for program and data. Instructions in the program
memory are executed with a single level pipelining. While one instruction is being executed,
the next instruction is pre-fetched from the program memory. This concept enables
instructions to be executed in every clock cycle. The program memory is In-System
Reprogrammable Flash memory. The fast-access Register File contains 32 x 8-bit general
purpose working registers with a single clock cycle access time. This allows single-cycle
Arithmetic Logic Unit (ALU) operation. In a typical ALU operation, two operands are output
from the Register File, the operation is executed, and the result is stored back in the Register
File– in one clock cycle.

Six of the 32 registers can be used as three 16-bit indirect address register pointers for Data
Space addressing – enabling efficient address calculations. One of these address pointers can

Bus Detection Device for Blind People 45


Malla Reddy College of Engineering and Technology Dept of ECE

also be used as an address pointer for look up tables in Flash program memory. These added
function registers are the 16-bit X, Y-, and Z-register, described later in this section. The ALU
supports arithmetic and logic operations between registers or between a constant and a
register. Single register operations can also be executed in the ALU. After an arithmetic
operation, the Status Register is updated to reflect information about the result of the
operation. Program flow is provided by conditional and unconditional jump and call
instructions, able to directly address the whole address space. Most AVR instructions have a
single 16-bit word format. Every program memory address contains a 16- or 32-bit instruction.
Program Flash memory space is divided in two sections, the Boot Program section and the
Application Program section. Both sections have dedicated Lock bits for write and read/write
protection. The SPM instruction that writes into the Application Flash memory section must
reside in the Boot Program section. During interrupts and subroutine calls, the return address
Program Counter (PC) is stored on the Stack. The Stack is effectively allocated in the general
data SRAM, and consequently the Stack size is only limited by the total SRAM size and the
usage of the SRAM. All user programs must initialize the SP in the Reset routine (before
subroutines or interrupts are executed). The Stack Pointer (SP) is read/write accessible in the
I/O space. The data SRAM can easily be accessed through the five different addressing modes
supported in the AVR architecture.

The memory spaces in the AVRarchitecture are all linear and regular memory maps. A
flexible interrupt module has its control registers in the I/O space with an additional Global
Interrupt Enable bit in the Status Register. All interrupts have a separate Interrupt Vector in
the Interrupt Vector table. The interrupts have priority in accordance with their Interrupt
Vector position. The lower the Interrupt Vector address, the higher the priority.

4.2.8 ALU – Arithmetic Logic Unit

The high-performance AVR ALU operates in direct connection with all the 32 general purpose
working registers. Within a single clock cycle, arithmetic operations between general purpose
registers or between a register and an immediate are executed. The ALU operations are
divided into three main categories – arithmetic, logical, and bit functions. Some
implementations of the architecture also provide a powerful multiplier supporting both

Bus Detection Device for Blind People 46


Malla Reddy College of Engineering and Technology Dept of ECE

signed/unsigned multiplication and fractional format. See the “Instruction Set” section for a
detailed description.

4.2.9 Status Register

The Status Register contains information about the result of the most recently executed
arithmetic instruction. This information can be used for altering program flow in order to
perform conditional operations. Note that the Status Register is updated after all ALU
operations, as specified in the Instruction Set Reference. This will in many cases remove the
need for using the dedicated compare instructions, resulting in faster and more compact
code. The Status Register is not automatically stored when entering an interrupt routine and
restored when returning from an interrupt. This must be handled by software.

The AVR Status Register – SREG is defined as:

Figure 2.7 AVR status register

Bit 7 – I: Global Interrupt Enable

The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual
interrupt enable control The Global Interrupt Enable bit must be set for the interrupts to be
enabled. The individual interrupt enable control is then performed in separate control
registers. If the Global Interrupt Enable Register is cleared, none of the interrupts are enabled
independent of the individual interrupt enable settings. The I-bit is cleared by hardware after
an interrupt has occurred, and is set by the RETI instruction to enable subsequent interrupts.
The I-bit can also be set and cleared by the application with the SEI and CLI instructions, as
described in the instruction set reference.

Bit 6 – T: Bit Copy Storage

Bus Detection Device for Blind People 47


Malla Reddy College of Engineering and Technology Dept of ECE

The Bit Copy instructions BLD (Bit Load) and BST (Bit Store) use the T-bit as source or
destination for the operated bit. A bit from a register in the Register File can be copied into T
by the BST instruction, and a bit in T can be copied into a bit in a register in the Register File
by the BLD instruction.

Bit 5 – H: Half Carry Flag

The Half Carry Flag H indicates a Half Carry in some arithmetic operations The Half Carry Flag
H indicates a Half Carry in some arithmetic operations. Half Carry Is useful in BCD arithmetic.
See the

“Instruction Set Description” for detailed information.

Bit 4 – S: Sign Bit, S = N Å V

The S-bit is always an exclusive or between the Negative Flag N and the Two’s Complement
Overflow Flag V. See the “Instruction Set Description” for detailed information.

Bit 3 – V: Two’s Complement Overflow Flag

The Two’s Complement Overflow Flag V supports two’s complement arithmetic.

Bit 2 – N: Negative Flag

The Negative Flag N indicates a negative result in an arithmetic or logic operation.

Bit 1 – Z: Zero Flag

The Zero Flag Z indicates a zero result in an arithmetic or logic operation.

Bit 0 – C: Carry Flag

The Carry Flag C indicates a carry in an arithmetic or logic operation.

4.3 General Purpose Register File

Bus Detection Device for Blind People 48


Malla Reddy College of Engineering and Technology Dept of ECE

The Register File is optimized for the AVR Enhanced RISC instruction set. In order to achieve
the required performance and flexibility, the following input/output schemes are supported
by the Register File:

• One 8-bit output operand and one 8-bit result input

• Two 8-bit output operands and one 8-bit result input

• Two 8-bit output operands and one 16-bit result input

One 16-bit output operand and one 16-bit result input

Most of the instructions operating on the Register File have direct access to all registers, and
most of them are single cycle instructions. As shown in Figure 6-2, each register is also
assigned a data memory address, mapping them directly into the first32 locations of the user
data space. Although not being physically implemented as SRAM locations, this memory
organization provides great flexibility in excess of the registers, as the X-, Y-, and Z-pointer
registers can be set to index any register.

Bus Detection Device for Blind People 49


Malla Reddy College of Engineering and Technology Dept of ECE

Fig 4.3.1 Structure of the 32 general purpose working registers in the CPU

X-, Y-, and Z-register

The registers R26:R31 have some added functions to their general-purpose usage. These
registers are 16-bit address pointers for indirect addressing of the data space. The three
indirect address registers X, Y, and Z are defined as described in

Figure 2.9 X-, Y-, and Z-Registers

Bus Detection Device for Blind People 50


Malla Reddy College of Engineering and Technology Dept of ECE

In the different addressing modes these address registers have functions as fixed
displacement, automatic increment, and automatic decrement.

4.3.2 Stack Pointer

The Stack is mainly used for storing temporary data, for storing local variables and for storing
return addresses after interrupts and subroutine calls. Note that the Stack is implemented as
growing from higher to lower memory locations. The Stack Pointer Register always points to
the top of the Stack. The Stack Pointer points to the data SRAM Stack area where the
Subroutine and Interrupt Stacks are located. A Stack PUSH command will decrease the Stack
Pointer.

The Stack in the data SRAM must be defined by the program before any subroutine calls are
executed or interrupts are enabled. Initial Stack Pointer value equals the last address of the
internal SRAM and the Stack Pointer must be set to point above start of the SRAM

Table 4.3.2 Stack Pointer instructions

The AVR ATmega128A Stack Pointer is implemented as two 8-bit registers in the I/O space.
The number of bits actually used is implementation dependent. Note that the data space in
some implementations of the AVR architecture is so small that only SPL is needed. In this case,
the SPH Register will not be presents and SPL - Stack Pointer High and Low Register.

Bus Detection Device for Blind People 51


Malla Reddy College of Engineering and Technology Dept of ECE

Figure 4.3.2 SPH and SPL - Stack Pointer High and Low Register

4.3.3 Interrupt Response Time

The interrupt execution response for all the enabled AVR interrupts is four clock cycles
minimum. After four clock cycles the program vector address for the actual interrupt handling
routine is executed. During this four-clock cycle period, the Program Counter is pushed onto
the Stack. The vector is normally a jump to the interrupt routine, and this jump takes three
clock cycles. If an interrupt occurs during execution of a multicycle instruction, this instruction
is completed before the interrupt is served. If an interrupt occurs when the MCU is in sleep
mode, the interrupt execution response time is increased by four clock cycles. This increase
comes in addition to the start-up time from the selected sleep mode.

4.3.4 AVR Memories

This section describes the different memories in the ATmega328. The AVR architecture has
two main memory spaces, the Data Memory and the Program Memory space. In addition,
theATmega328 features an EEPROM Memory for data storage. All three memory spaces are
linear and regular.

In-System Reprogrammable Flash Program Memory:

The ATmega328 contains 4/8/16/32Kbytes On-chip In-System Reprogrammable Flash


memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is
organized as 2/4/8/16K x 16. For software security, the Flash Program memory space is
divided into two sections, Boot Loader Section and

Bus Detection Device for Blind People 52


Malla Reddy College of Engineering and Technology Dept of ECE

Application Program Section. The Flash memory has an endurance of at least 10,000
write/erase cycles. The ATmega328 Program Counter (PC) is 11/12/13/14 bits wide, thus
addressing the 2/4/8/16K program memory locations.

SRAM Data Memory:

ATmega328 is a complex microcontroller with more peripheral units than can be supported
within the 64 locations reserved in the Opcode for the IN and OUT instructions. For the
Extended I/O space from 0x60 - 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD
instructions can be used.

The lower 768/1280/1280/2303 data memory locations address both the Register File, the
I/O memory,

Extended I/O memory, and the internal data SRAM. The first 32 locations address the Register
File, the next 64 location the standard I/O memory, then 160 locations of Extended I/O
memory, and the next 512/1024/1024/2048 locations address the internal data SRAM. The
five different addressing modes for the data memory cover: Direct, Indirect with
Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In the
Register File, Registers R26 to R31 Feature the indirect addressing pointer registers. The direct
addressing reaches the entire data space. The Indirect with Displacement mode reaches 63
address locations from the base address given by the Y- or Z register.

When using register indirect addressing modes with automatic pre-decrement and post-
increment, the address registers X, Y, and Z are decremented or incremented. The 32 general
purpose working registers, 64 I/O Registers, 160 Extended I/O Registers, and the
512/1024/1024/2048 bytes of internal data SRAM in the ATmega328 are all accessible
through all these addressing modes.

Bus Detection Device for Blind People 53


Malla Reddy College of Engineering and Technology Dept of ECE

Fig:4.3.5 Data Memory Map

4.3.6 Interrupts

This section describes the specifics of the interrupt handling as performed in the Atmega328.
In Atmega328Each Interrupt Vector occupies two instruction words and the Reset Vector is
affected by the BOOTRST fuse, and the Interrupt Vector start address is affected by the IVSEL
bit in MCUCR.

Table 4.3.6 Reset and Interrupt Vectors in ATMEGA 328 and ATMEGA 328P

1 0x0000 RESET External Pin, Power-on Reset,


Brown-out Reset and Watchdog
System Reset
2 0x0002 INT0 External Interrupt Request 0
3 0x0004 INT1 External Interrupt Request 0
4 0x0006 PCINTO Pin Change Interrupt Request 0
5 0x0008 PCINT1 Pin Change Interrupt Request 1
6 0x000A PCINT2 Pin Change Interrupt Request 2
7 0x000C WDT Watchdog Time-out Interrupt
8 0x000E TIMER2 COMPA Timer/Counter2 Compare Match A
9 0x0010 TIMER2 COMPB Timer/Counter2 Compare Match B
10 0x0012 TIMER2 OVF Timer/Counter 2 Overflow
11 0x0014 TIMER1 CAPT Timer/Counter 2 Capture Event
12 0x0016 TIMER1 COMPA Timer/Counter1 Compare Match A
13 0x0018 TIMER1 COMPB Timer/Counter1 Compare Match B
14 0x001A TIMER 1 OVF Timer/Counter1 Overflow

Bus Detection Device for Blind People 54


Malla Reddy College of Engineering and Technology Dept of ECE

15 0x001C TIMER0 COMPA Timer/Counter0 Compare Match A


16 0x001E TIMER0 COMPB Timer/Counter0 Compare Match B
17 0x0020 TIME0 OVF Timer/Counter0 Overflow
18 0x0022 SPI, STC SPI Serial Transfer Complete
19 0x0024 USART, RX USART RX Complete
20 0x0026 USART, UDRE USART, Data Register Empty
21 0x0028 USART, TX USART, TX Complete
22 0x002A ADC ADC Conversion Complete
23 0x002C EE READY EEPROM Ready
24 0x002E ANALOG COMP Analog Comparator
25 0x0030 TWI 2-wire Serial Interface
26 0x0032 SPM READY Store Program Memory Ready

When the IVSEL bit in MCUCR is set, Interrupt Vectors will be moved to the start of the Boot
Flash Section. The address of each Interrupt Vector will then be the address in this table added
to the start address of the Boot Flash Section. Table below shows reset and Interrupt Vectors
placement for the various combinations of BOOTRST and IVSEL settings. If the program never
enables an interrupt source, the Interrupt Vectors are not used, and regular program code
can be placed at these locations. This is also the case if the Reset Vector is in the Application
section while the Interrupt Vectors are in the Boot section or vice versa.

Table 4.3.7 Reset and Interrupt Vectors Placement in ATmega328 and


ATmega328P

4.3.8 Arduino with ATmega328

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


digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16MHz
ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It

Bus Detection Device for Blind People 55


Malla Reddy College of Engineering and Technology Dept of ECE

contains everything needed to support the microcontroller; simply connect it to a computer


with a USB cable or power it with an AC-to-DC adapter or battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to versionR2) programmed as a
USB-to-serial converter.

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

Stronger RESET circuit.

➢ At mega 16U2 replace the 8U2.

"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The
Uno and version 1.0 will be the reference versions of Arduino, moving forward. The Uno is
the latest in a series of USB Arduino boards, and the reference model for the Arduino
platform; for a comparison with previous versions, see the index of Arduino boards.

4.3.9 Arduino Characteristics

Power

The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically. External (non-USB) power can come either from
an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a
2.1mm centre-positive plug into the board's power jack. Leads from a battery can be inserted
in the Gnd and Vin pin headers of the POWER connector. The board can operate on an
external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply
less than five volts and the board may be unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The power pins are as follows:

Bus Detection Device for Blind People 56


Malla Reddy College of Engineering and Technology Dept of ECE

➢VIN: The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.

➢ 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the
VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator,
and can damage your board. We don't advise it.

➢ 3V3. A 3.3-volt supply generated by the on-board regulator. Maximum current draw is 50
mA.

➢ GND. Ground pins.

➢ IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs for working
with the 5V or 3.3V.

Memory:

The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB of SRAM
and 1 KB of EEPROM (which can be read and written with the EEPROM library).

Serial Communication:

The Arduino Uno has a number of facilities for communicating with a computer, another
Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial
communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the
board channels this serial communication over USB and appears as a virtual com port to
software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no
external driver is needed. However, on Windows, a .inf file is required.

The Arduino software includes a serial monitor which allows simple textual data to be sent to
and from the Arduino board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-toserial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).

Bus Detection Device for Blind People 57


Malla Reddy College of Engineering and Technology Dept of ECE

A Software Serial libraryallows for serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a
Wire library to simplify use of the I2C bus. For SPI communication, use the SPI library.

4.4 Conclusion

In this chapter Arduino, ATmega328, and also about the Embedded system and its application
was discussed.

4.4.1CODE: -

#include<LiquidCrystal.h>

LiquidCrystal.h LCD (A0, A1, A2, A3, A4, A5);

String card = "";

String card1 = "0800A97CC61B";

String card2 = "0800A97A805B";

String card3 = "0800A947E600"; String card4 = "0800A93F920C";

Boolean st_cmp = false; unsigned char Count=0;

#define buzz 7

#define ir1 8

#define ir2 9

int count=0, n=0, flag=1; void setup ()

pin Mode (ir1, INPUT); pin Mode (ir2, INPUT); pin Mode (buz, OUTPUT);

Serial. Begin (9600);

LCD. Begin (16,2);

Serial.println("WELCOME"); LCD. Clear (); lcd. set Cursor (4,0); LCD. Print ("WELCOME "); lcd.
set Cursor (0,1);

Bus Detection Device for Blind People 58


Malla Reddy College of Engineering and Technology Dept of ECE

LCD. Print (" ................. ");

delay (1000); LCD. Clear (); lcd. set Cursor (0,0);

LCD. Print ("SPEED CHECKING"); lcd. set Cursor (0,1); LCD. Print ("OF VEHICLE RFID"); delay
(1500); LCD. Clear (); card. reserve (12); lcd. set Cursor (0,0);

LCD. Print ("SPEED:");

void beep ()

digital Write(buz,1); delay (1000); digital Write(buz,0); delay (200);

void loop () {

if (digital Read(ir1) ==1) { // Serial.println("IR 1 ACTIVE"); lcd. set Cursor (6,0); LCD. Print ("V
ENTER"); delay (500); while (1) { if (digital Read(ir2) ==1)

break;

lcd. set Cursor (6,0); LCD. Print("CALCULATING"); count++;

Serial. Print("C:");

Serial. Print("\t"); Serial.println(count); delay (500);

///////////////////////////////

///////////////////////////////

/*if (digital Read(ir2) ==1) {

Bus Detection Device for Blind People 59


Malla Reddy College of Engineering and Technology Dept of ECE

// Serial.println("IR 2 ACTIVE");

// lcd. set Cursor (6,0); LCD. Print ("V OVR SPEED");

// beep (); count=0; digital Write(buz,0);

}//*/

if (count<30 && digital Read(ir2) ==1)

Serial.println("VEHICLE OVER SPEEDINGG"); lcd. set Cursor (6,0); LCD. Print ("V OVER
SPEED"); beep (); count=0;

else if(count>30 && digital Read(ir2) ==1)

Serial.println("NORMAL SPEED"); lcd. set Cursor (6,0); LCD. Print ("V NRM SPEED");

if (st_cmp)

if (card == card1)

{Serial.println("");

Serial.println("CARD 1"); Serial.println("ACCESS GRANTED"); lcd. set Cursor (0,1);

LCD. Print ("VID:TS 13 H 1234"); card = ""; st_cmp = false;

else if (card == card2)

Serial.println("");

Bus Detection Device for Blind People 60


Malla Reddy College of Engineering and Technology Dept of ECE

Serial.println("CARD 2"); Serial.println("ACCESS GRANTED"); lcd. set Cursor (0,1); LCD.


Print ("VID:TS 9 H 4568"); card = ""; st_cmp = false;

else if (card == card3)

Serial.println("");

Serial.println("INVALID, ACCESS DENIED"); lcd. set Cursor (0,1); LCD. Print ("VID:TS 11 z
568"); card = ""; scamp = false;

void serial Event ()

{ int I = 0; while (I < 12)

while (Serial. Available ())

char inchar = Serial. Read (); card += inchar;

I++;

Serial. Print(inchar);

// Serial. Print("\r\n");

st_cmp = true;

Bus Detection Device for Blind People 61


Malla Reddy College of Engineering and Technology Dept of ECE

Chapter 5-Results

5.1Screenshots with detailed explanation: -

IMPLEMENTATION AND TESTING: -

To check the functionality of the proposed system, a prototype was built and tested. The
RFID reader used in this testing was CF-RU5106 with active tags of type EPC C1G2. The first
step in our testing was to establish communication from pc with the reader. Then the reader
software is used to determine the appropriate settings such as the baud rate, frequency,

Bus Detection Device for Blind People 62


Malla Reddy College of Engineering and Technology Dept of ECE

band, connection type, and the tag mode. These settings were later used in the developed
prototype. The overall developed prototype is shown in above figure. In the following sub-
sections, we present our prototype implementation and testing results for various parts of
the system.

A.Station Subsystem

The station subsystem is used for bus detection and it consists of RFID reader, speaker, and
a PC as a processing subsystem. Here the PC is used for two purposes: as a processing
subsystem interfaced with the other components of the subsystem.

The RFID reader, which is connected to the USB port, is used to detect the approaching buses.
Then the PC retrieves the tag information from the database. At the end of the process, the
speaker announces if there is any bus approaching that station. A PHP script was written for
detecting RFID tags and then takes the decision for the output depending each time on the
tag ID information which is stored in the database.

B.Bus Subsystem

The bus subsystem consists of RFID reader, speaker and LCD all connected to the processing
subsystem which is the Raspberry Pi. The Raspberry Pi board was initially properly prepared
and configured for use as processing subsystem for the bus subsystem the above figure shows
the interface between selected components and the processing subsystem. The LCD is
connected to GPIO pins of the Raspberry Pi. In addition, the two USB ports are used to connect
the RFID reader to provide network connectivity to access the database. A PHP script were
written to detect both the station and blind people tags and then reacts according to the tag
type as explained in this

Announcement Subsystem

Announcement subsystem exists in both station and bus designs. For the announcement
purpose we use recorder and playback module. The required information of the buses will be
stored in the form of voice message using recorded and the information will be available to
the blind people from voice playback module.

Bus Detection Device for Blind People 63


Malla Reddy College of Engineering and Technology Dept of ECE

The system has two subsystems which are: the bus subsystem and the station subsystem. Bus
subsystem announces the coming stations in the bus route for all passengers. Moreover, the
bus will be provided with the number of bind people who required the bus and their
destinations. The station subsystem will give announcement of the approaching buses.

CHAPTER 6-Conclusion and Future Scope

6.1 Advantages: -

• Easy transportation of the blind people

• Reduces the difficulty in identifying the buses for the blind people

• Easy and low-cost method

• A feasible system to assist the blind people to have a safe and normal travel by public
transport system.

6.2 Disadvantages: -

Bus Detection Device for Blind People 64


Malla Reddy College of Engineering and Technology Dept of ECE

a) System limitations

Any research study of this nature, covering a wide spectrum can only be representative,
leaving scope for further investigation. It is our responsibility to share with our readers, the
major constraints under which the present investigations have been conducted. As presented
in our previous research, the system functioned very well during lab and field testing on
university buses. There were no issues regarding system failure both electronically or
mechanically. But deploying the system on public buses of Delhi, revealed some of the
manufacturing defects pertaining to robustness. Due to high noise levels at a few bus stops
convinced us of the need for better amplification audio which has now been incorporated.
The user module has a projecting antenna which was deemed inconvenient to some users. b)
Study limitations

The following limitations pertaining to the field trials have been observed which need to be
catered to . I) During peak hours, a heavy rush was observed which made it difficult for users
to de-board from the front gate of the bus. Frequent collisions were observed near the front
door.

ii) Due to time pressures of private bus operators, bus drivers were frequently observed not
stopping the bus at the designated bus bay. This leads to other vehicles overtaking the bus
from the wrong side which hampers user movement as well as safety.

6.3 Applications: -

• Bus detection for blind people is used for easy identification of buses for blind people.

• Bus detection for blind people is also useful for illiterate people.

6.4 Future Scope: -

This prototype to assist the Visionless people while boarding the bus has wide applications
other than just helping the blind people inform their presence to the bus driver. In further
stages of development this project can be used to enhance the safety and comfort of a larger
section of society. Following are some of the anticipated future scopes:

1. This system can be installed over the taxies and not just public buses, all over the city so
that people can very easily communicate with them.

Bus Detection Device for Blind People 65


Malla Reddy College of Engineering and Technology Dept of ECE

2. This system, if manufactured commercially, is very economic and thus can be made
available at the stores so that women, children, senior citizens or any section of society can
use it.

3. With few changes in the hardware and programming, this prototype can be turned into a
security device. Women may have this all the time with them while they are out of their
homes. Each policeman will also be handed over one device. So, whenever any woman feels
any kind of danger.

References

1.J. Al Kalbani, R. B. Suwailam, A. Al Yafai, D. Al Abri and M. Awadalla, Bus Detection System
for BlindPeople using RFID, Proceedings of the 8th IEEE GCC Conference and Exhibition,
Muscat, Oman (2015).

2. IEEE Standard C95.1 (2005), IEEE Standard for Safety Levels with Respect to Human
Exposure to Radio Frequency Electromagnetic Fields 3 kHz to 300 GHz,
Availablefrom:http://standards.ieee.org/findstds/standard/C95.1-2005.html, Accessed 25
(2015).

3. On the Bus Public Transport, Available at: http://www.onthebus-project.com, Accessed 25


November (2015).

4. New York Transportation Statistics, Available from: http://transportation-


modescity.findthedata.org/q/1447/1033/How-many-people-use-public-transportation-
tocommute- in New-York, Accessed 25 November (2015).

5. T. Quoc, M. Kim, H. Lee and K. Eom, Wireless Sensor Network apply for the Blind U-bus
System, Int. J. u- and e- Service, Sci. Technol., 3(3) (2010).

6. M. Z. H. Noor, A. Shah, I. Ismail and M. F. Saaid, Bus Detection Device for the Blind Using
RFID Application, 5th International Colloquium on Signal Processing & Its Applications, 247-
249 (2009).

7. T. Jerry, H. Goh and K. Tan, Accessible Bus System: A Bluetooth Application, Assistive
Technology for Visually Impaired and Blind People, Chapter in Assistive Technology for

Bus Detection Device for Blind People 66


Malla Reddy College of Engineering and Technology Dept of ECE

Visually Impaired and Blind People, Springer, London (2008) 363-384. 858 B. Sridhar et al.:
RFID Based Assistance for….

8. M. A. Hersh and M. A. Johnson, Assistive Technology for Visually Impaired and Blind People,
Springer (2008).

9. J. Sanchez and E. Maureira, Subway Mobility Assistance Tools for Blind Users, LNCS, 4397,
386-404 (2007).

10. K. Miesenberger et al., Eds., Computers Helping People with Special Needs, LNCS, Vol.
4061 Springer Berlin/Heidelberg, 10th International Conference, ICCHP 2006, Linz, Austria
(2006).

Appendix A: Source Code

#include<LiquidCrystal.h>

LiquidCrystallcd (A0,A1,A2,A3,A4,A5);

String card = "";

String card1 = "0800A97CC61B";

String card2 = "0800A97A805B";

String card3 = "0800A947E600";

String card4 = "0800A93F920C";

booleanst_cmp = false; unsigned char Count=0; #define buz 7

#define ir1 8

#define ir2 9

int count=0,n=0,flag=1; void setup()

pin Mode (ir1, INPUT); pin Mode (ir2, INPUT); pin Mode (buz, OUTPUT); Serial. Begin
(9600); lcd.begin (16,2);

Serial.println("WELCOME");

Bus Detection Device for Blind People 67


Malla Reddy College of Engineering and Technology Dept of ECE

lcd.clear (); lcd.setCursor (4,0); lcd.print("WELCOME "); lcd.setCursor (0,1);

lcd.print (" ................. ");

delay (1000); lcd.clear(); lcd.setCursor (0,0); lcd.print ("SPEED CHECKING"); lcd.setCursor


(0,1); lcd.print ("OF VEHICLE RFID"); delay (1500); lcd.clear(); card.reserve(12); lcd.setCursor
(0,0); lcd.print ("SPEED:");

void beep()

digitalWrite(buz,1); delay(1000); digitalWrite(buz,0); delay(200);

void loop() {

if(digitalRead(ir1)==1){ // Serial.println("IR 1 ACTIVE"); lcd.setCursor(6,0); lcd.print("V


ENTER"); delay(500); while(1){ if (digitalRead(ir2)==1)

break;

lcd.setCursor(6,0); lcd.print("CALCULATING"); count++;

Serial.print("C:");

Serial.print("\t");

Serial.println(count); delay(500);

///////////////////////////////

///////////////////////////////

Bus Detection Device for Blind People 68


Malla Reddy College of Engineering and Technology Dept of ECE

/*if(digitalRead(ir2)==1){

// Serial.println("IR 2 ACTIVE");

// lcd.setCursor(6,0); lcd.print("V OVR SPEED");

// beep(); count=0; digitalWrite(buz,0);

}//*/

if(count<30 &&digitalRead(ir2)==1)

Serial.println("VEHICLE OVER SPEEDINGG"); lcd.setCursor(6,0); lcd.print("V OVER SPEED");


beep(); count=0;

else if(count>30 &&digitalRead(ir2)==1)

Serial.println("NORMAL SPEED"); lcd.setCursor(6,0); lcd.print("V NRM SPEED");

if (st_cmp)

if (card == card1)

Serial.println("");

Serial.println("CARD 1"); Serial.println("ACCESS GRANTED"); lcd.setCursor (0,1);


lcd.print ("VID:TS 13 H 1234"); card = ""; st_cmp = false;

Bus Detection Device for Blind People 69


Malla Reddy College of Engineering and Technology Dept of ECE

else if (card == card2)

Serial.println("");

Serial.println("CARD 2"); Serial.println("ACCESS GRANTED"); lcd.setCursor (0,1);


lcd.print ("VID:TS 9 H 4568"); card = ""; st_cmp = false;

else if (card == card3)

Serial.println("");

Serial.println("INVALID, ACCESS DENIED"); lcd.setCursor (0,1);

lcd.print ("VID:TS 11 z 568"); card = ""; st_cmp = false;

void serialEvent()

{ int i = 0; while (i< 12 )

while (Serial.available())

char inchar = Serial.read(); card += inchar;

i++;

Serial.print(inchar);

// Serial.print("\r\n");

Bus Detection Device for Blind People 70


Malla Reddy College of Engineering and Technology Dept of ECE

st_cmp = true;

Appendix B: Block Diagram

Fig:6.5 block diagram of appendix B

Appendix C: Project working Snap Shots

Bus Detection Device for Blind People 71


Malla Reddy College of Engineering and Technology Dept of ECE

Bus Detection Device for Blind People 72

Das könnte Ihnen auch gefallen