Documents - Tips Ultrasonic Navigation For Blind With Audio Interface Documentation
Documents - Tips Ultrasonic Navigation For Blind With Audio Interface Documentation
INDEX
CHAPTER 1
Department of EIE, VITS 1
ULTRASONIC NAVIGATION FOR BLIND WITH AUDIO INTERFACE
Since sometimes blind people collide against high and moving obstacles, we need obstacle-sensing
function in front of the blind people. This paper proposes a method of point-to-point distance
measurement using ultrasonic for cap in order to detect moving and high obstacles.
In this method, we apply ultrasonic wave technique to measure distance to obstacles, since it does
not disturb other people. By setting two ultrasonic sensors on the cap, one for transmission and the other
for reception, the moving and high obstacles are detected before colliding. Moreover, embedded systems
are employed in the system in order to reduce system size and cost, as well as saving energy.
In experiments (with wood, concrete, plastic, etc. as obstacles), the results reveal distance
measurement accuracy 95 % approximately. In this project we are using an IR transmitter and Receiver
circuit based path clearing assist stick. Path clearing assist stick is used to detect any obstacles. If any
obstacle is found, the IR light will be reflected back and sensed by IR receiver and sends a signal to the
buzzer driver circuit, which produces buzzer sound near hand.
The project works very well even in night and day timings, irrespective of the lighting intensity. The
project is reliable and effective. This project uses regulated 5V, 750mA power supply. Unregulated 12V
DC is used for relay. 7805 three terminal voltage regulator is used for voltage regulation. Bridge type
full wave rectifier is used to rectify the ac output of secondary of 230/12V step down transformer. This
project can be powered by a simple 9V battery also for portability.
1.2 OBJECTIVE
The objective of this project is to help Blind people in their daily commute. As Blind people are
given less importance in the society, we took the initiate to help them in their day to day life with this
project.
1. Programming in embedded C
2. Keil Micro vision
3. Flash Magic
Chapter 3 Block diagram of the project is explained and mode of operation and also their function in
detail.
Chapter 4 Discuss about Circuit Diagram, Operation and also the code.
CHAPTER 2
MICROCONTROLLER
2.1 INTRODUCTION
This is in direct contrast to the personal computer in the family room. It too is comprised of
computer hardware and software and mechanical components (disk drives, for example). However, a
personal computer is not designed to perform a specific function rather; it is able to do many different
things. Many people use the term general-purpose computer to make this distinction clear. As shipped, a
general-purpose computer is a blank slate; the manufacturer does not know what the customer will do
wish it. One customer may use it for a network file server another may use it exclusively for playing
games, and a third may use it to write the next great American novel.
Frequently, an embedded system is a component within some larger system. For example,
modern cars and trucks contain many embedded systems. One embedded system controls the anti-lock
brakes, other monitors and controls the vehicle's emissions, and a third displays information on the
dashboard. In some cases, these embedded systems are connected by some sort of a communication
network, but that is certainly not a requirement.
At the possible risk of confusing you, it is important to point out that a general-purpose computer
is itself made up of numerous embedded systems. For example, my computer consists of a keyboard,
mouse, video card, modem, hard drive, floppy drive, and sound card-each of which is an embedded
system. Each of these devices contains a processor and software and is designed to perform a specific
function. For example, the modem is designed to send and receive digital data over analog telephone
line. That's it and all of the other devices can be summarized in a single sentence as well.
If an embedded system is designed well, the existence of the processor and software could be
completely unnoticed by the user of the device. Such is the case for a microwave oven, VCR, or alarm
clock. In some cases, it would even be possible to build an equivalent device that does not contain the
processor and software. This could be done by replacing the combination with a custom integrated
circuit that performs the same functions in hardware. However, a lot of flexibility is lost when a design
is hard-cooled in this way. It is much easier, and cheaper, to change a few lines of software than to
redesign a piece of custom hardware.
The issue of what if a deadline is missed is a crucial one. For example, if the real-time system is
part of an airplane's flight control system, it is possible for the lives of the passengers and crew to be
endangered by a single missed deadline. However, if instead the system is involved in satellite
communication, the damage could be limited to a single corrupt data packet. The more severe the
consequences, the more likely it will be said that the deadline is "hard" and thus, the system is a hard
real-time system. Real-time systems at the other end of this discussion are said to have "soft" deadlines.
All of the topics and examples presented in this book are applicable to the designers of real-time
system who is more delight in his work. He must guarantee reliable operation of the software and
hardware under all the possible conditions and to the degree that human lives depend upon three
system's proper execution, engineering calculations and descriptive paperwork.
Nearly 99 per cent of the processors manufactured end up in embedded systems. The embedded
system market is one of the highest growth areas as these systems are used in very market segment-
consumer electronics, office automation, industrial automation, biomedical engineering, wireless
communication, data communication, telecommunications, transportation, military and so on.
At home we use a number of embedded systems which include digital camera, digital diary,
DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner, VCO player,
video game consoles, video recorders etc. Today’s high-tech car has about 20 embedded systems for
transmission control, engine spark control, air-conditioning, navigation etc. Even wristwatches are now
becoming embedded systems. The palmtops are powerful embedded systems using which we can carry
out many general-purpose tasks such as playing games and word processing.
The office automation products using embedded systems are copying machine, fax machine, key
telephone, modem, printer, scanner etc.
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and transmission.
The embedded systems for industrial use are designed to carry out specific tasks such as monitoring the
temperature, pressure, humidity, voltage, current etc., and then take appropriate action based on the
monitored levels to control other devices or to send information to a centralized monitoring station. In
hazardous industrial environment, where human presence has to be avoided, robots are used, which are
programmed to do specific jobs. The robots are now becoming very powerful and carry out many
interesting and complicated tasks such as hardware assembly.
Almost every medical equipment in the hospital is an embedded system. These equipment’s
include diagnostic aids such as ECG, EEG, blood pressure measuring devices, X-ray scanners;
equipment used in blood analysis, radiation, colonoscopy, endoscopy etc. Developments in medical
electronics have paved way for more accurate diagnosis of diseases.
Computer networking products such as bridges, routers, Integrated Services Digital Networks
(ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay switches are embedded systems
which implement the necessary data communication protocols. For example, a router interconnects two
networks. The two networks may be running different protocol stacks. The router’s function is to obtain
the data packets from incoming pores, analyse the packets and send them towards the destination after
doing necessary protocol conversion. Most networking equipment’s, other than the end systems (desktop
computers) we use to access the networks, are embedded systems
2.3.6 Tele-communications
Advances in mobile communications are paving way for many interesting applications using
embedded systems. The mobile phone is one of the marvels of the last decade of the 20’h century. It is a
very powerful embedded system that provides voice communication while we are on the move. The
Personal Digital Assistants and the palmtops can now be used to access multimedia services over the
Internet. Mobile communication infrastructure such as base station controllers, mobile switching centres
are also powerful embedded systems.
2.3.8 Security
Security of persons and information has always been a major issue. We need to protect our
homes and offices; and also the information we transmit and store. Developing embedded systems for
security applications is one of the most lucrative businesses nowadays. Security devices at homes,
offices, airports etc. for authentication and verification are embedded systems. Encryption devices are
nearly 99 per cent of the processors that are manufactured end up in~ embedded systems. Embedded
systems find applications in. every industrial segment- consumer electronics, transportation, avionics,
biomedical engineering, manufacturing, process control and industrial automation, data communication,
telecommunication, defence, security etc. Used to encrypt the data/voice being transmitted on
communication links such as telephone lines. Biometric systems using fingerprint and face recognition
are now being extensively used for user authentication in banking applications as well as for access
control in high security buildings.
2.3.9 Finance
Financial dealing through cash and cheques are now slowly paving way for transactions using
smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money) machines. Smart
card, of the size of a credit card, has a small micro-controller and memory; and it interacts with the
smart card reader! ATM machine and acts as an electronic wallet. Smart card technology has the
capability of ushering in a cashless society. Well, the list goes on. It is no exaggeration to say that eyes
wherever you go, you can see, or at least feel, the work of an embedded system.
2.4 Microcontroller
2.4.1 Definition
Like all good things, this powerful component is basically very simple. It is made by mixing
tested and high- quality "ingredients" (components) as per following receipt:
1. The simplest computer processor is used as the "brain" of the future system.
2. Depending on the taste of the manufacturer, a bit of memory, a few A/D converters, timers,
input/output lines etc. are added
4. A simple software able to control it all and which everyone can easily learn about has been
developed.
On the basis of these rules, numerous types of microcontrollers were designed and they quickly
became man's invisible companion. Their incredible simplicity and flexibility conquered us a long time
ago and if you try to invent something about them, you should know that you are probably late, someone
before you has either done it or at least has tried to do it.
The following things have had a crucial influence on development and success of the
microcontrollers:
1. Powerful and carefully chosen electronics embedded in the microcontrollers can independently
or via input/output devices (switches, push buttons, sensors, LCD displays, relays etc.), control
various processes and devices such as industrial automation, electric current, temperature, engine
performance etc.
2. Very low prices enable them to be embedded in such devices in which, until recent time it was
not worthwhile to embed anything. Thanks to that, the world is overwhelmed today with cheap
automatic devices and various “smart” appliances.
3. Prior knowledge is hardly needed for programming. It is sufficient to have a PC (software in use
is not demanding at all and is easy to learn) and a simple device (called the programmer) used for
“loading” ready-to-use programs into the microcontroller.
So, if you are infected with a virus called electronics, there is nothing left for you to do but to learn how
to use and control its power.
2.4.2 Operation
Even though there is a large number of different types of microcontrollers and even more
programs created for their use only, all of them have many things in common. Thus, if you learn to
handle one of them you will be able to handle them all. A typical scenario on the basis of which it all
functions is as follows:
1. Power supply is turned off and everything is still…the program is loaded into the
microcontroller, nothing indicates what is about to come…
2. Power supply is turned on and everything starts to happen at high speed! The control logic unit
keeps everything under control. It disables all other circuits except quartz crystal to operate.
While the preparations are in progress, the first milliseconds go by.
3. Power supply voltage reaches its maximum and oscillator frequency becomes stable. SFRs are
being filled with bits reflecting the state of all circuits within the microcontroller. All pins are
configured as inputs. The overall electronics starts operation in rhythm with pulse sequence.
From now on the time is measured in micro and nanoseconds.
4. Program Counter is set to zero. Instruction from that address is sent to instruction decoder which
recognizes it, after which it is executed with immediate effect.
5. The value of the Program Counter is incremented by 1 and the whole process is
repeated...several million times per second.
As you can see, all the operations within the microcontroller are performed at high speed and
quite simply, but the microcontroller itself would not be so useful if there are not special circuits which
make it complete. In continuation, we are going to call your attention to them.
Read Only Memory (ROM) is a type of memory used to permanently save the program being
executed. The size of the program that can be written depends on the size of this memory. ROM can be
built in the microcontroller or added as an external chip, which depends on the type of the
microcontroller. Both options have some disadvantages. If ROM is added as an external chip, the
microcontroller is cheaper and the program can be considerably longer. At the same time, a number of
available pins is reduced as the microcontroller uses its own input/output ports for connection to the
chip. The internal ROM is usually smaller and more expensive, but leaves more pins available for
connecting to peripheral environment. The size of ROM ranges from 512B to 64KB.
Random Access Memory (RAM) is a type of memory used for temporary storing data and
intermediate results created and used during the operation of the microcontrollers. The content of this
memory is cleared once the power supply is off. For example, if the program performs an addition, it is
necessary to have a register standing for what in everyday life is called the “sum”. For that purpose, one
of the registers in RAM is called the "sum" and used for storing results of addition. The size of RAM
goes up to a few KBs.
The EEPROM is a special type of memory not contained in all microcontrollers. Its contents may
be changed during program execution (similar to RAM), but remains permanently saved even after the
loss of power (similar to ROM). It is often used to store values, created and used during operation (such
as calibration values, codes, values to count up to etc.), which must be saved after turning the power
supply off. A disadvantage of this memory is that the process of programming is relatively slow. It is
measured in milliseconds
Special function registers are part of RAM memory. Their purpose is predefined by the
manufacturer and cannot be changed therefore. Since their bits are physically connected to particular
circuits within the microcontroller, such as A/D converter, serial communication module etc., any
change of their state directly affects the operation of the microcontroller or some of the circuits. For
example, writing zero or one to the SFR controlling an input/output port causes the appropriate port pin
to be configured as input or output. In other words, each bit of this register controls the function of one
single pin.
Program Counter is an engine running the program and points to the memory address containing
the next instruction to execute. After each instruction execution, the value of the counter is incremented
by 1. For this reason, the program executes only one instruction at a time just as it is written. However…
the value of the program counter can be changed at any moment, which causes a “jump” to a new
memory location. This is how subroutines and branch instructions are executed. After jumping, the
counter resumes even and monotonous automatic counting +1, +1, +1…
Block diagram consists of a micro-controller (PIC), Power Supply, LCD Display (16X2
Display), APR33A3 (Voice module), Ultrasonic Sensor, Speaker. The Block Diagram is shown below to
get a better understanding of the project
CHAPTER 3
HARDWARE DESCRIPTION
Circumstances that we find ourselves in today in the field of microcontrollers had their
beginnings in the development of technology of integrated circuits. This development has made it
possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for
production of microprocessors, and the first computers were made by adding external peripherals such
as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted
in creation of integrated circuits. These integrated circuits contained both processor and peripherals.
That is how the first chip containing a microcomputer, or what would later be known as a
microcontroller came about.
The microcontroller used in this project is PIC16F73. The PIC families of microcontrollers are
developed by Microchip Technology Inc. Currently they are some of the most popular microcontrollers,
selling over 120 million devices each year. There are basically four families of PIC microcontrollers:
The features, pin description of the microcontroller used are discussed in the following sections.
3.2 MICROCONTROLLER
1. A smaller computer
3.3.1 Microprocessor
• Designer can decide on the amount of ROM, RAM and I/O ports.
• expansive
• versatility
• general-purpose
3.3.2 Microcontroller
• CPU, RAM, ROM, I/O and timer are all on a single chip
• single-purpose
3.3.3 Choosing a MC
• Speed
• Power Consumption
• Amount of RAM,ROM
• I/O Pins
In a microcontroller, two types of memory are found. They are, program memory and data memory
respectively. Program memory is also known as 'control store' and 'firm ware'. It is non-volatile i.e, the
memory content is not lost when the power goes off. Non-volatile memory is also called Read Only
Memory (ROM). There are various types of ROM.
3.4.1 Mask ROM: Some microcontrollers with ROM are programmed while they are still in
the factory. This ROM is called Mask ROM. Since the microcontrollers with Mask ROM
are used for specific application, there is no need to reprogram them. Some times, this
type of manufacturing reduces the cost for bulk production.
In the un programmed state, the 'float' does not have any charge and the MOSFET is in the OFF
state. To program the cell, the 'control' above the 'float' is raised to a high enough potential such that
a charge leaks to the float through SiO 2 insulating layer. Hence a channel is formed between 'Source'
and 'Drain' in the silicon substrate and the MOSFET becomes 'ON'. The charge in the 'float' remains
for a long time (typically over 30 years). The charge can be removed by exposing the float to UV
radiation. For UV erasable version, the packaging is done in a ceramic enclosure with a glass
window.
3.4.3 OTP EPROM: One time programmable (OTP) EPROM based microcontrollers do not have
any glass window for UV erasing. These can be programmed only once. This type of packaging
results in microcontroller that have the cost 10% of the microcontrollers with UV erase facility (i.e.,
1/10th cost).
3.4.4 EEPROM: (Electrically Erasable Programmable ROM): This is similar to EPROM but the
float charge can be removed electrically.
3.4.5 FLASH (EEPROM Memory): FLASH memory was introduced by INTEL in late 1980's.
This memory is similar to EEPROM but the cells in a FLASH memory are bussed so that they
can be erased in a few clock cycles. Hence the reprogramming is faster.
3.6.1 Random access memory (RAM): data will disappear after power down.
– Dynamic RAM (DRAM): each bit is a small capacitor, and is needed to be recharged
regularly, slower but cheap. To be used as primary memory in a computer.
Bits
Registers
Variable RAM
Microcontroller can have ability to perform manipulation of individual bits in certain registers (bit
manipulation). This is a unique feature of a microcontroller, not available in a microprocessor.
Eight bits make a byte. Memory bytes are known as file registers.
Registers are some special RAM locations that can be accessed by the processor very easily.
This consists of two CMOS inverters connected back to front, so as to form a latch. Processor stacks
store/save the data in a simple way during program execution. Processor stack is a part of RAM area
where the data is saved in a Last in First out (LIFO) fashion just like a stack of paper on a table. Data is
stored by executing a 'push' instruction and data is read out using a 'pop' instruction
At times, a microcontroller can have external memory also (if there is no internal memory or extra
memory interface is required). Early microcontrollers were manufactured using bipolar or NMOS
technologies. Most modern microcontrollers are manufactured with CMOS technology, which leads
to reduction in size and power loss. Current drawn by the IC is also reduced considerably from
10mA to a few micro Amperes in sleep mode (for a microcontroller running typically at a clock
speed of 20MHz).
Many years ago, in the late 1940's, the US Government asked Harvard and Princeton universities
to come up with a computer architecture to be used in computing distances of Naval artillery shell
for defense applications. Princeton suggested computer architecture with a single memory interface.
It is also known as Von Neumann architecture after the name of the chief scientist of the project in
Princeton University John Von Neumann (1903 - 1957 Born in Budapest, Hungary).
Harvard suggested a computer with two different memory interfaces, one for the data / variables and
the other for program / instructions. Although Princeton architecture was accepted for simplicity and
ease of implementation, Harvard architecture became popular later, due to the parallelism of
instruction execution
Program memory and data memory are interfaced to CPU through common buses
An instruction "Read a data byte from memory and store it in the accumulator" is executed as follows: -
Hence each instruction is effectively executed in one instruction cycle, except for the ones that
modify the content of the program counter. For example, the "jump" (or call) instructions takes 2
cycles. Thus, due to parallelism, Harvard architecture executes more instructions in a given time
compared to Princeton Architecture
PIC stands for Peripheral Interface Controller given by Microchip Technology to identify its
single-chip microcontrollers. These devices have been very successful in 8-bit microcontrollers. The
main reason is that Microchip Technology has continuously upgraded the device architecture and
added needed peripherals to the microcontroller to suit customers' requirements. The development
tools such as assembler and simulator are freely available on the internet at www.microchip.com.
Microchip PIC microcontrollers are available in various types. When PIC microcontroller MCU was
first available from General Instruments in early 1980's, the microcontroller consisted of a simple
processor executing 12-bit wide instructions with basic I/O functions. These devices are known as
low-end architectures. They have limited program memory and are meant for applications requiring
simple interface functions and small program & data memories. Some of the low-end device
numbers are
12C5XX
16C5X
16C505
Mid range PIC architectures are built by upgrading low-end architectures with more number of
peripherals, more number of registers and more data/program memory. Some of the mid-range
devices are
16C6X
16C7X
16F87X
C = EPROM
F = Flash
RC = Mask ROM
Popularity of the PIC microcontrollers is due to the following factors.
2. Instruction set simplicity: The instruction set consists of just 35 instructions (as opposed to 111
instructions for 8051).
3. Power-on-reset and brown-out reset. Brown-out-reset means when the power supply goes below
a specified voltage (say 4V), it causes PIC to reset; hence malfunction is avoided.
A watch dog timer (user programmable) resets the processor if the software/program ever
malfunctions and deviates from its normal operation.
7. Powerful output pin control (25 mA (max.) current sourcing capability per pin.)
The CPU uses Harvard architecture with separate Program and Variable (data) memory interface.
This facilitates instruction fetch and the operation on data/accessing of variables simultaneously.
Most of the PIC microcontrollers can operate up to 20MHz. One instructions cycle (machine cycle)
consists of four clock cycles
Relation between instruction cycles and clock cycles for PIC microcontrollers
Instructions that do not require modification of program counter content get executed in one
instruction cycle.
Microcontroller differs from a microprocessor in many ways. First and the most important is its
functionality. In order for a microprocessor to be used, other components such as memory, or
components for receiving and sending data must be added to it. In short that means that microprocessor
is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one.
No other external components are needed for its application because all necessary peripherals are
already built into it. Thus, we save the time and space needed to construct devices.
Memory unit
The easiest way to explain it is to describe it as one big closet with lots of drawers. If we suppose that
we marked the drawers in such a way that they can not be confused, any of their contents will then be
easily accessible. It is enough to know the designation of the drawer and so its contents will be known.
Memory components are exactly like that. For a certain input we get the contents of a certain addressed
memory location and that's all. Two new concepts are brought to us: addressing and memory location.
Memory consists of all memory locations, and addressing is nothing but selecting one of them. This
means that we need to select the desired memory location on one hand, and on the other hand we need to
wait for the contents of that location. Besides reading from a memory location, memory must also
provide for writing onto it. This is done by supplying an additional line called control line. We will
designate this line as R/W (read/write). Control line is used in the following way: if r/w=1, reading is
done, and if opposite is true then writing is done on the memory location.
Memory is the first element, and we need a few operation of our microcontroller.
Let add 3 more memory locations to a specific block that will have a built in capability to multiply,
divide, subtract, and move its contents from one memory location onto another. The part we just added
in is called "central processing unit" (CPU). Its memory locations are called registers.
Registers are therefore memory locations whose role is to help with performing various mathematical
operations or any other operations with data wherever data can be found. Look at the current situation.
We have two independent entities (memory and CPU) which are interconnected, and thus any exchange
of data is hindered, as well as its functionality. If, for example, we wish to add the contents of two
memory locations and return the result again back to memory, we would need a connection between
memory and CPU. Simply stated, we must have some "way" through data goes from one block to
another.
Bus
That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires
there are two types of buses: address and data bus. The first one consists of as many lines as the amount
of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection
line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside
the microcontroller.
As far as functionality, the situation has improved, but a new problem has also appeared: we have a unit
that's capable of working by itself, but which does not have any contact with the outside world, or with
us! In order to remove this deficiency, let's add a block which contains several memory locations whose
one end is connected to the data bus, and the other has connection with the output lines on the
microcontroller which can be seen as pins on the electronic component.
Input-output unit
Those locations we've just added are called "ports". There are several types of ports : input, output or
bidirectional ports. When working with ports, first of all it is necessary to choose which port we need to
work with, and then to send data to, or take it from the port.
When working with it the port acts like a memory location. Something is simply being written into or
read from it, and it could be noticed on the pins of the microcontroller.
Serial communication
Beside stated above we've added to the already existing unit the possibility of communication with an
outside world. However, this way of communicating has its drawbacks. One of the basic drawbacks is
the number of lines which need to be used in order to transfer data. What if it is being transferred to a
distance of several kilometers? The number of lines times’ number of kilometers doesn't promise the
economy of the project. It leaves us having to reduce the number of lines in such a way that we don't
lessen its functionality. Suppose we are working with three lines only, and that one line is used for
sending data, other for receiving, and the third one is used as a reference line for both the input and the
output side. In order for this to work, we need to set the rules of exchange of data. These rules are called
protocol. Protocol is therefore defined in advance so there wouldn't be any misunderstanding between
the sides that are communicating with each other. For example, if one man is speaking in French, and
the other in English, it is highly unlikely that they will quickly and effectively understand each other.
Let's suppose we have the following protocol. The logical unit "1" is set up on the transmitting line until
transfer begins. Once the transfer starts, we lower the transmission line to logical "0" for a period of time
(which we will designate as T), so the receiving side will know that it is receiving data, and so it will
activate its mechanism for reception. Let's go back now to the transmission side and start putting logic
zeros and ones onto the transmitter line in the order from a bit of the lowest value to a bit of the highest
value. Let each bit stay on line for a time period which is equal to T, and in the end, or after the 8th bit,
let us bring the logical unit "1" back on the line which will mark the end of the transmission of one
data. The protocol we've just described is called in professional literature NRZ (Non-Return to Zero).
As we have separate lines for receiving and sending, it is possible to receive and send data (info.) at the
same time. So called full-duplex mode block which enables this way of communication is called a serial
communication block. Unlike the parallel transmission, data moves here bit by bit, or in a series of bits
what defines the term serial communication comes from. After the reception of data we need to read it
from the receiving location and store it in memory as opposed to sending where the process is reversed.
Data goes from memory through the bus to the sending location, and then to the receiving unit
according to the protocol.
Timer unit
Since we have the serial communication explained, we can receive, send and process data.
However, in order to utilize it in industry we need a few additionally blocks. One of those is the timer
block which is significant to us because it can give us information about time, duration, protocol etc.
The basic unit of the timer is a free-run counter which is in fact a register whose numeric value
increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the
basis of their difference we can determine how much time has elapsed. This is a very important part of
the microcontroller whose understanding requires most of our time
Watchdog
One more thing is requiring our attention is a flawless functioning of the microcontroller
during its run-time. Suppose that as a result of some interference (which often does occur in industry)
our microcontroller stops executing the program, or worse, it starts working incorrectly.
Of course, when this happens with a computer, we simply reset it and it will keep working. However,
there is no reset button we can push on the microcontroller and thus solve our problem. To overcome
this obstacle, we need to introduce one more block called watchdog. This block is in fact another free-
run counter where our program needs to write a zero in every time it executes correctly.
In case that program gets "stuck", zero will not be written in, and counter alone will reset the
microcontroller upon achieving its maximum value this will result in executing the program again, and
correctly this time around. That is an important element of every program to be reliable without man's
supervision.
As the peripheral signals usually are substantially different from the ones that microcontroller can
understand (zero and one), they have to be converted into a pattern which can be comprehended by a
microcontroller. This task is performed by a block for analog to digital conversion or by an ADC. This
block is responsible for converting an information about some analog value to a binary number and for
follow it through to a CPU block so that CPU block can further process it.
Finally, the microcontroller is now completed, and all we need to do now is to assemble it into an
electronic component where it will access inner blocks through the outside pins. The picture below
shows what a microcontroller looks like inside.
Thin lines which lead from the center towards the sides of the microcontroller represent wires
connecting inner blocks with the pins on the housing of the microcontroller so called bonding lines.
Chart on the following page represents the center section of a microcontroller.
3.10 Microcontroller outline with its basic elements and internal connections
For a real application, a microcontroller alone is not enough. Beside a microcontroller, we need a
program that would be executed, and a few more elements which make up a interface logic towards the
elements of regulation (which will be discussed in later chapters).
The program adds the contents of two memory locations, and views their sum on port A. The
first line of the program stands for moving the contents of memory location "A" into one of the registers
of central processing unit. As we need the other data as well, we will also move it into the other register
of the central processing unit. The next instruction instructs the central processing unit to add the
contents of those two registers and send a result to port A, so that sum of that addition would be visible
to the outside world. For a more complex problem, program that works on its solution will be bigger.
Programming can be done in several languages such as Assembler, C and Basic which are most
commonly used languages. Assembler belongs to lower level languages that are programmed slowly, but
take up the least amount of space in memory and gives the best results where the speed of program
execution is concerned. As it is the most commonly used language in programming microcontrollers it
will be discussed in a later chapter. Programs in C language are easier to be written, easier to be
understood, but are slower in executing from assembler programs. Basic is the easiest one to learn, and
its instructions are nearest a man's way of reasoning, but like C programming language it is also slower
than assembler. In any case, before you make up your mind about one of these languages you need to
consider carefully the demands for execution speed, for the size of memory and for the amount of time
available for its assembly.
After the program is written, we would install the microcontroller into a device and run it. In
order to do this we need to add a few more external components necessary for its work. First we must
give life to a microcontroller by connecting it to a power supply (power needed for operation of all
electronic instruments) and oscillator whose role is similar to the role that heart plays in a human body.
Based on its clocks microcontroller executes instructions of a program. As it receives supply
microcontroller will perform a small check up on itself, look up the beginning of the program and start
executing it. How the device will work depends on many parameters, the most important of which is the
skillfulness of the developer of hardware, and on programmer's expertise in getting the maximum out of
the device with his program.
3.11 Introduction
Its general structure is shown on the following map representing basic blocks.
Program memory (FLASH)-
It is used for storing a written program. Since memory made in FLASH technology can be programmed
and cleared more than once, it makes this microcontroller suitable for device development.
3.11.1 EEPROM - data memory that needs to be saved when there is no supply.
It is usually used for storing important data that must not be lost if power supply suddenly stops. For
instance, one such data is an assigned temperature in temperature regulators. If during a loss of power
supply this data was lost, we would have to make the adjustment once again upon return of supply. Thus
our device looses on self-reliance
3.11.2 RAM- Data memory used by a program during its execution. In RAM are stored all inter-results
or temporary data during run-time.
PORTA and PORTB are physical connections between the microcontroller and the outside world.
3.11.3 FREE-RUN TIMER is an 8-bit register inside a microcontroller that works independently of the
program. On every fourth clock of the oscillator it increments its value until it reaches the maximum
(255), and then it starts counting over again from zero. As we know the exact timing between each two
increments of the timer contents, timer can be used for measuring time which is very useful with some
devices.
3.11.4 CENTRAL PROCESSING UNIT has a role of connective element between other blocks in the
microcontroller. It coordinates the work of other blocks and executes the user program.
3.11.5 Applications
PIC16F perfectly fits many uses, from automotive industries and controlling home appliances to
industrial instruments, remote sensors, electrical door locks and safety devices. It is also ideal for smart
cards as well as for battery supplied devices because of its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage of
various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.). Low cost,
low consumption, easy handling and flexibility make PIC16F applicable even in areas where
microcontrollers had not previously been considered (example: timer functions, interface replacement in
larger systems, coprocessor applications, etc.).
In System Programmability of this chip (along with using only two pins in data transfer) makes possible
the flexibility of a product, after assembling and testing have been completed. This capability can be
used to create assembly-line production, to store calibration data available only after final testing, or it
can be used to improve programs on finished products.
Clock is microcontroller's main starter, and is obtained from an external component called an
"oscillator". If we want to compare a microcontroller with a time clock, our "clock" would then be a
ticking sound we hear from the time clock. In that case, oscillator could be compared to a spring that is
wound so time clock can run. Also, force used to wind the time clock can be compared to an electrical
supply.
Clock from the oscillator enters a microcontroller via OSC1 pin where internal circuit of a
microcontroller divides the clock into four even clocks Q1, Q2, Q3, and Q4 which do not overlap. These
four clocks make up one instruction cycle (also called machine cycle) during which one instruction is
executed.
Execution of instruction starts by calling an instruction that is next in string. Instruction is called from
program memory on every Q1 and is written in instruction register on Q4. Decoding and execution of
instruction are done between the next Q1 and Q4 cycles. On the following diagram we can see the
relationship between instruction cycle and clock of the oscillator (OSC1) as well as that of internal
clocks Q1-Q4. Program counter (PC) holds information about the address of the next instruction.
3.11.7 Pipelining
Instruction cycle consists of cycles Q1, Q2, Q3 and Q4. Cycles of calling and executing instructions are
connected in such a way that in order to make a call, one instruction cycle is needed, and one more is
needed for decoding and execution. However, due to pipelining, each instruction is effectively executed
in one cycle. If instruction causes a change on program counter, and PC doesn't point to the following
but to some other address (which can be the case with jumps or with calling subprograms), two cycles
are needed for executing an instruction. This is so because instruction must be processed again, but this
time from the right address. Cycle of calling begins with Q1 clock, by writing into instruction register
(IR). Decoding and executing begins with Q2, Q3 and Q4 clocks.
TCY0 reads in instruction MOVLW 55h (it doesn't matter to us what instruction was executed, because
there is no rectangle pictured on the bottom).
TCY3 executes a call of a subprogram CALL SUB_1, and reads in instruction BSF PORTA, BIT3. As
this instruction is not the one we need, or is not the first instruction of a subprogram SUB_1 whose
execution is next in order, instruction must be read in again. This is a good example of an instruction
needing more than one cycle.
TCY4 instruction cycle is totally used up for reading in the first instruction from a subprogram at
address SUB_1.
TCY5 executes the first instruction from a subprogram SUB_1 and reads in the next one.
Pin description
Oscillator circuit is used for providing a microcontroller with a clock. Clock is needed so that
microcontroller could execute a program or program instructions.
Since configurations with crystal oscillator and resistor-capacitor (RC) are the ones that are used most
frequently, these are the only ones we will mention here. Microcontroller type with a crystal oscillator
has in its designation XT, and a microcontroller with resistor-capacitor pair has a designation RC.
This is important because you need to mention the type of oscillator when buying a microcontroller.
XT Oscillator
In applications where great time precision is not necessary, RC oscillator offers additional
savings during purchase. Resonant frequency of RC oscillator depends on supply voltage rate, resistance
R, capacity C and working temperature. It should be mentioned here that resonant frequency is also
influenced by normal variations in process parameters, by tolerance of external R and C components,
etc.
Above diagram shows how RC oscillator is connected with PIC16F84. With value of resistor R being
below 2.2k, oscillator can become unstable, or it can even stop the oscillation. With very high value of R
(ex.1M) oscillator becomes very sensitive to noise and humidity. It is recommended that value of
resistor R should be between 3 and 100k. Even though oscillator will work without an external capacitor
(C=0pF), capacitor above 20pF should still be used for noise and stability. No matter which oscillator is
being used, in order to get a clock that microcontroller works upon, a clock of the oscillator must be
divided by 4. Oscillator clock divided by 4 can also be obtained on OSC2/CLKOUT pin, and can be
used for testing or synchronizing other logical circuits.
Following a supply, oscillator starts oscillating. Oscillation at first has an unstable period and amplitude,
but after some period of time it becomes stabilized.
To prevent such inaccurate clock from influencing microcontroller's performance, we need to keep the
microcontroller in reset state during stabilization of oscillator's clock. Diagram above shows a typical
shape of a signal which microcontroller gets from the quartz oscillator.
Reset
Reset is used for putting the microcontroller into a 'known' condition. That practically means that
microcontroller can behave rather inaccurately under certain undesirable conditions. In order to continue
its proper functioning it has to be reset, meaning all registers would be placed in a starting position.
Reset is not only used when microcontroller doesn't behave the way we want it to, but can also be used
when trying out a device as an interrupt in program execution, or to get a microcontroller ready when
loading a program.
The second one is a product of purposeful bringing in of a logical zero to MCLR pin during normal
operation of the microcontroller. This second one is often used in program development.
During a reset, RAM memory locations are not being reset. They are unknown during a power up and
are not changed at any reset. Unlike these, SFR registers are reset to a starting position initial state.
One of the most important effects of a reset is setting a program counter (PC) to zero (0000h) , which
enables the program to start executing from the first written instruction.
Reset at supply voltage drop below the permissible (Brown-out Reset). Impulse for resetting during
voltage voltage-up is generated by microcontroller itself when it detects an increase in supply Vdd (in a
range from 1.2V to 1.8V). That impulse lasts 72ms which is enough time for an oscillator to get
stabilized. These 72ms are provided by an internal PWRT timer which has its own RC oscillator.
Microcontroller is in a reset mode as long as PWRT is active. However, as device is working, problem
arises when supply doesn't drop to zero but falls below the limit that guarantees microcontroller's proper
functioning. This is a likely case in practice, especially in industrial environment where disturbances and
instability of supply are an everyday occurrence. To solve this problem we need to make sure that
microcontroller is in a reset state each time supply falls below the approved limit.
If, according to electrical specification, internal reset circuit of a microcontroller can not satisfy the
needs, special electronic components can be used which are capable of generating the desired reset
signal. Beside this function, they can also function in watching over supply voltage. If voltage drops
below specified level, a logical zero would appear on MCLR pin which holds the microcontroller in
reset state until voltage is not within limits that guarantee accurate performance.
Memory organization
PIC16F84 has two separate memory blocks, one for data and the other for program. EEPROM memory
with GPR and SFR registers in RAM memory make up the data block, while FLASH memory makes up
the program block.
SFR registers
Registers which take up first 12 locations in banks 0 and 1 are registers of specialized function assigned
with certain blocks of the microcontroller. These are called Special Function Registers.
3.13 Description:
PIC stands for Peripheral Interface Controller given by Microchip Technology to identify its
single-chip microcontrollers. These devices have been very successful in 8-bit microcontrollers. The
main reason is that Microchip Technology has continuously upgraded the device architecture and added
needed peripherals to the microcontroller to suit customers' requirements. The development tools such as
assembler and simulator are freely available on the internet at www.microchip.com
Microchip PIC microcontrollers are available in various types. When PIC microcontroller MCU was
first available from General Instruments in early 1980's, the microcontroller consisted of a simple
processor executing 12-bit wide instructions with basic I/O functions. These devices are known as low-
end architectures. They have limited program memory and are meant for applications requiring simple
interface functions and small program & data memories. Some of the low-end device numbers are
12C5XX
16C5X
16C505
Mid range PIC architectures are built by upgrading low-end architectures with more number of
peripherals, more number of registers and more data/program memory. Some of the mid-range
devices are
16C6X
16C7X
16F87X
3. Power-on-reset and brown-out reset. Brown-out-reset means when the power supply goes below
a specified voltage (say 4V), it causes PIC to reset; hence malfunction is avoided. A watch dog
timer (user programmable) resets the processor if the software/program ever malfunctions and
deviates from its normal operation.
7. Powerful output pin control (25 mA (max.) current sourcing capability per pin.)
CPU Architecture:
The CPU uses Harvard architecture with separate Program and Variable (data) memory interface.
This facilitates instruction fetch and the operation on data/accessing of variables simultaneously.
Architecture of PIC microcontroller
Figure 3.19 shows the basic block diagram of a fixed regulated power supply. Let us go through
each block.
3.3.3 TRANSFORMER
They are linked together through inductively coupled electrical conductors also called as CORE.
A changing current in the primary causes a change in the Magnetic Field in the core & this in turn
induces an alternating voltage in the secondary coil. If load is applied to the secondary then an
alternating current will flow through the load. If we consider an ideal condition then all the energy from
the primary circuit will be transferred to the secondary circuit through the magnetic field.
So
The secondary voltage of the transformer depends on the number of turns in the Primary as well
as in the secondary.
3.2.2 Rectifier
A rectifier is a device that converts an AC signal into DC signal. For rectification purpose we use
a diode, a diode is a device that allows current to pass only in one direction i.e. when the anode of the
diode is positive with respect to the cathode also called as forward biased condition & blocks current in
the reversed biased condition.
Bridge Rectifier
As the name suggests it converts the full wave i.e. both the positive & the negative half cycle
into DC thus it is much more efficient than Half Wave Rectifier & that too without using a center tapped
transformer thus much more cost effective than Full Wave Rectifier.
Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4. During the
positive half cycle diodes D1 & D4 conduct whereas in the negative half cycle diodes D2 & D3 conduct
thus the diodes keep switching the transformer connections so we get positive half cycles in the output.
We place the Filter Capacitor at the output of the rectifier the capacitor will charge to the peak
voltage during each half cycle then will discharge its stored energy slowly through the load while the
rectified voltage drops to zero, thus trying to keep the voltage as constant as possible.
Where,
Vr= accepted ripple voltage. (Should not be more than 10% of the voltage)
F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25Hz
Also called as Resistive Voltage regulator because they dissipate the excessive voltage resistively as
heat.
They regulate the output voltage by switching the Current ON/OFF very rapidly. Since their
output is either ON or OFF it dissipates very low power thus achieving higher efficiency as compared to
linear voltage regulators. But they are more complex & generate high noise due to their switching
action. For low level of output power switching regulators tend to be costly but for higher output
wattage they are much cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the 78XX series where the
XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.
After filtering the rectifier output the signal is given to a voltage regulator. The maximum input
voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the regulator so
the input voltage should be at least 2-3 Volts higher than the output voltage. If the input voltage gets
below the Vmin of the regulator due to the ripple voltage or due to any other reason the voltage regulator
will not be able to produce the correct regulated voltage.
3.2.5 IC 7805
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input
voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp although
lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also has a built-in
current limiter as a safety feature. 7805 is manufactured by many companies, including National
Semiconductors and Fairchild Semiconductors.
The 7805 will automatically reduce output current if it gets too hot. The last two digits represent
the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators is designed to
work in complement with the 79xx series of negative voltage regulators in systems that provide both
positive and negative regulated voltages, since the 78xx series can't regulate negative voltages in such a
system.
The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as it's
small component count and medium-power regulated 5V make it useful for powering TTL devices.
SPECIFICATIONS IC 7805
Vout 5V
Output Imax 1A
ULTRASONIC NAVIGATION FOR BLIND WITH AUDIO INTERFACE
Sensor, showing the pins. There are 2 sets of 5 pins, 1 set you can use, the other is for programming the
PIC chip so don't touch them!
3.4.2 Specification:
Note: This module is not suitable to connect with electric power, if you need to connect this module
with electronic power, then let the GND terminal of this module to be connected first, otherwise, it will
affect the normal work of the module
3.4.3 Interface:
3.4.4 Usage
Note: the module should be inserted in the circuit before been power, which
avoid producing high level of miss operation; if not, then power again.
1. Adopt 10 trigger through supplying at least l0us sequence of high level signal,
2. The module automatically send eight 40khz square wave and automatically
detect whether receive the returning pulse signal,
Very, very simple circuit, I've used the breadboard to share the GND
connection and to add the LED which I could probably have done without the
breadboard. You'll see the most complex thing is the code later on.
3.5 Buzzer
shrinks, the piezoelectric diaphragm bends in the direction Thus, when AC voltage is
applied across electrodes, the bending is repeated, producing sound waves in the air.
If a battery is used as the power supply, it is worth remembering that piezo sounders
draw much less current than buzzers. Buzzers also just have one ‘tone’, whereas a
piezo sounder is able to create sounds of many different tones.
1) When the piezoelectric buzzer is set to produce intermittent sounds, sound may be
heard continuously even when the self drive circuit is turned ON / OFF at the "X"
point shown in Fig. 9. This is because of the failure of turning off the feedback
voltage.
2) Build a circuit of the piezoelectric sounder exactly as per the recommended circuit
shown in the catalog of the transistor and circuit constants are designed to ensure
stable oscillation of the piezoelectric sounder.
4) The self drive circuit is already contained in the piezoelectric buzzer. So there is no
need to prepare another circuit to drive the piezoelectric buzzer.
5) Rated voltage (3.0 to 20Vdc) must be maintained. Products which can operate with
voltage higher than 20Vdc are also available.
6) Do not place resistors in series with the power source, as this may cause abnormal
oscillation. If a resistor is essential to adjust sound pressure, place a capacitor (about
1μF) in parallel with the piezo buzzer.
7) Do not close the sound emitting hole on the front side of casing.
8) Carefully install the piezo buzzer so that no obstacle is placed within 15mm from
the sound release hole on the front side of the casing.
CHAPTER 4
4.1 OPERATION
The existing range finders measure the distance to the object using ultrasound
beam and represent it via variable tone sound signals.
This approach has limitations because the individual must remember the
lookup table between sound tone and the distance. In addition, these range finders are
incapable of detecting moving objects such as cars or people which reduce safety.
This contest entry describes the vision system which helps the blind orienting in the
surround space. As contrasted to existing systems, the proposed device combines the
usefulness, simplicity to use together with low cost. Device measures the distance to
the object and “visualizes” the measurement results as special slider position which
can be easily touched by blind people. Moreover, the device estimates the
neighboured objects speed using Doppler and generates the proportional to the objects
speed number of sound signals. As result, the blind individual with the proposed
system can travel efficiently and safely.
The system consist of the ultrasound transmitter TX and receiver RX, the
CPU-controlled carrier generator to form the ultrasound carrier signal, the transmitter
driver to amplify the carrier signal to the piezoelectric transmitter acceptable levels,
the signal mixer to select the Doppler frequency shift during speed measurements,
synchronous rectifier to rectify the incoming signal during distance measurements,
multiplexer, low-pass filter to suppress the high frequency mixer/rectifier products,
CPU for system control, an buzzer.
Ultrasonic sensors are used for obstacle detection and calculation of its
adaptive distance from the visually impaired person. Ultrasonic sensors are used in
pair as transceivers. One device which emits sound waves is called as transmitter and
other who receives echo is known as receiver. These sensors work on a principle
Department of ECE, MRITS 56
ULTRASONIC NAVIGATION FOR BLIND WITH AUDIO INTERFACE
similar to radar or sonar which detects the object with the help of echoes from sound
waves. An algorithm is implemented in C-language on PIC microcontroller. The time
interval between sending the signal and receiving the echo is calculated to determine
the distance to an object. As these sensors use sound waves rather than light for object
detection, so can be comfortably used in ambient outdoor application. Five ultrasonic
sensor pairs are used in this system.
Output Signals: An Echo signal: PWM signal. Time required for sound signal
to travel twice between source and obstacle. A Range: 5 meters.
Where,
D = Distance in cm
Before concluding the obstacle distance from the subject, repeated information
sampling and averaging is performed. As ambient light conditions do not affect
ultrasonic sensors, object detection and distance calculation can be performed
accurately.
This system can understand 500 meters distant object / obstacle in any
direction. This system announces calculated real time distance as it is in meters or
centimetres using speech messages. To make distance understanding more appealing
to the subject, speech messages can be stored in a universal language.
Many researchers [10, 11, 12] used vibration array, buzzer based audio
frequency clips or text to speech conversion for announcing any detected condition to
the subject. This system uses pre-recorded speech messages for conveying any
detected condition to the subject. It uses APR33A3 audio recording and playback
flash memory. It can store variable duration speech messages up to 60 sec. duration.
Number of messages can be increased by reducing the duration of each message. PIC
microcontroller processes real-time data collected by ultrasonic sensor array and takes
the correct decision. Based on processed data, correct decision is taken and relevant
message is invoked from the flash memory and conveyed to the subject through
earphone. Sample speech messages stored in flash memory are shown in table 1.
For speech assisted navigation, many researchers are using text to speech
conversion. In such cases researchers are converting text into English language only.
As this system uses APR33A3 flash memory to store the pre-recorded speech
messages, there is no barrier for usage of any language. Any appealing universal
language can be used for recording speech warning messages. This system offers a
simple mechanism for recording and storing such speech warning messages.
CHAPTER 5
Metal surface gives highest reflections and then concrete wall, wood and
human body. These four surfaces are considered for testing as subject can come across
any of them during navigation. All these tests are carried out in laboratory
environment and their readings are recorded. Details of test carried and their distance
range outcomes are given in table 5.1.
O B S TA C L E DETECTION RANGE IN CM
S U R FA C E
Test 1 Test 2 Test 3 Test 4
4.2 RESULT
During the experiment, user’s walking motion is recorded. Time taken by the users
(trained and novice) for successfully walking through the obstacles is measured and
travel speed for each test has been calculated. It is that average speed of a trained and
novice users are 0.76 and 0.38 m/s respectively. In comparison with the traveling
speed of the sighted people (1.4 m/s), this result is acceptable. The accuracy of the
device in finding out obstacles is also very good. This result shows that training of the
user is one of the important factors for gaining high traveling speed and also to
increase the user confidence to choose obstacle free path.
CHAPTER 5
5.1 CONCLUSION
In future we would see more compact and more user friendly devices which
can be operated with ease and comfort. We are presently using this application in
various projects like Automated parking systems, Velocity meter, Automatic door
systems and other applications.
CHAPTER 6
Department of ECE, MRITS 62
ULTRASONIC NAVIGATION FOR BLIND WITH AUDIO INTERFACE
SOFTWARE DESCRIPTION
This project is implemented using following software’s:
Express PCB – for designing circuit
PIC C compiler - for compilation part
PIC2kit dumper – for dump embedded code into microcontroller
Proteus 7 (Embedded C) – for simulation part
Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very
easy to use, but it does have several limitations.
Express PCB has been used to design many PCBs (some layered and with surface-
mount parts. Print out PCB patterns and use the toner transfer method with an Etch
Resistant Pen to make boards. However, Express PCB does not have a nice print
layout. Here is the procedure to design in Express PCB and clean up the patterns so
they print nicely.
Express PCB comes with a less then exciting list of parts. So before any project is
started head over to Audio logic and grab the additional parts by morsel, ppl, and
tangent, and extract them into your Express PCB directory. At this point start the
program and get ready to setup the workspace to suit your style.
Click View -> Options. In this menu, setup the units for “mm” or “in” depending on
how you think, and click “see through the top copper layer” at the bottom. The
standard color scheme of red and green is generally used but it is not as pleasing as
red and blue.
When a project is first started you will be greeted with a yellow outline. This yellow
outline is the dimension of the PCB. Typically after positioning of parts and traces,
move them to their final position and then crop the PCB to the correct size. However,
in designing a board with a certain size constraint, crop the PCB to the correct size
before starting.
Fig: 4.1 show the toolbar in which the each button has the following functions:
The select tool: It is fairly obvious what this does. It allows you to move and
manipulate parts. When this tool is selected the top toolbar will show buttons
to move traces to the top / bottom copper layer, and rotate buttons.
The zoom to selection tool: does just that.
The place pad: button allows you to place small soldier pads which are useful
for board connections or if a part is not in the part library but the part
dimensions are available. When this tool is selected the top toolbar will give
you a large selection of round holes, square holes and surface mount pads.
The place component: tool allows you to select a component from the top
toolbar and then by clicking in the workspace places that component in the
orientation chosen using the buttons next to the component list. The
components can always be rotated afterwards with the select tool if the
orientation is wrong.
The place trace: tool allows you to place a solid trace on the board of varying
thicknesses. The top toolbar allows you to select the top or bottom layer to
place the trace on.
The Insert Corner in trace: button does exactly what it says. When this tool is
selected, clicking on a trace will insert a corner which can be moved to route
around components and other traces.
The remove a trace button is not very important since the delete key will
achieve the same result.
Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.
When making a PCB you have the option of making a single sided board, or a
double sided board. Single sided boards are cheaper to produce and easier to etch,
but much harder to design for large projects. If a lot of parts are being used in a
small space it may be difficult to make a single sided board without jumper over
traces with a cable. While there’s technically nothing wrong with this, it should be
avoided if the signal travelling over the traces is sensitive (e.g. audio signals).
When using a double sided board you must consider which traces should be on what
side of the board. Generally, put power traces on the top of the board, jumping only
to the bottom if a part cannot be soldiered onto the top plane (like a relay), and vice-
versa.
Some projects like power supplies or amps can benefit from having a solid plane to
use for ground. In power supplies this can reduce noise, and in amps it minimizes
the distance between parts and their ground connections, and keeps the ground
signal as simple as possible. However, care must be taken with stubborn chips such
as the TPA6120 amplifier from TI. The TPA6120 datasheet specifies not to run a
ground plane under the pins or signal traces of this chip as the capacitance generated
could effect performance negatively.
PIC C is not much different from a normal C program. If you know assembly, writing
a C program is not a crisis. In PIC, we will have a main function, in which all your
application specific work will be defined. In case of embedded C, you do not have
any operating system running in there. So you have to make sure that your program or
main file should never exit. This can be done with the help of simple while (1) or for
(;;) loop as they are going to run infinitely.
We have to add header file for controller you are using, otherwise you will not be able
to access registers related to peripherals.
6.3 PICkit
Versions
PICkit 1
The PICkit 1 — introduced on March 31, 2003 for US$36— was a rudimentary
USB programmer for PIC microcontrollers, produced by Microchip
Technology, the manufacturers of the PIC series of microcontrollers. It was
integrated into a demonstrator board, featuring eight LEDs, a switch, and a
PICkit 2
The PICkit 2 — introduced in May 2005 — replaced the PICkit 1. The most notable
difference between the two is that the PICkit 2 has a separate programmer/debugger
unit which plugs into the board the chip to be programmed, whereas the PICkit 1 was
a single unit. This makes it possible to use the programmer with a circuit board via an
In Circuit Serial Programming (ICSP) header. This feature is not intended for socalled
"production" programming, however. The PICkit 2 uses an internal PIC18F2550 with
FullSpeed USB. The latest PICkit 2 firmware allows the user to program and debug
most of the 8 and 16 bit PICmicro and dsPIC members of the Microchip product line.
The PICkit 2 is open to the public, including its hardware schematic, firmware source
code (in C language) and application programs (in C# language). End users and third
parties can easily modify both the hardware and software for enhanced features. e.g.
GNU/Linux version of PICkit 2 application software, DOS style CMD support, etc.
The PICkit 2 has a programmertogo (PTG) feature, which can download the hex file
and programming instructions into onboard memory (128 KB I²C EEPROM or 256
KB I2C EEPROM),
This enhancement has been contributed by Au Group Electronics and the PICkit 2
firmware is also reported to be submitted to Microchip PICkit 2 team in the middle of
March 2009. This enhancement may be integrated into future firmware releases, too.
PICkit 3
Microchip has gone on to manufacture the PICkit 3, a variation of the PICkit 2 with
the same form factor and a new translucent case. It features a faster 16bit PIC24F
processor and a wider voltage regulation range. There are some complaints of it not
being as as the Pickit 2. Both PICkit 2 and PICkit 3 have internal, switchmode
Voltage.
Clones:
PICkit 2 has been an interesting PIC programmer from Microchip. It can program
most PICs and debug most of the PICs (as of May2009, only the PIC32 family is not
supported for MPLAB debugging). Ever since its first releases, all software source
code (firmware, PC application) and hardware schematics are open to the public. This
makes it relatively easy for an end user to modify the programmer for use with a
Department of ECE, MRITS 69
ULTRASONIC NAVIGATION FOR BLIND WITH AUDIO INTERFACE
nonWindows operating system such as Linux or Mac OS. In the meantime, it also
creates much DIY interest and clones.
This opensource structure brings many features to the PICkit 2 community, such as
ProgrammertoGo, the UART Tool and the Logic Tool, which have been contributed
by PICkit 2 users. Users have also added such features to the PICkit 2 as 4 MB
Programmertogo capability, USB buck/boost circuits, RJ12 type connectors, and
more. It even penetrated into the Atmel community as it is able to be configured into
an AVR ICSP tool.
There are many other USB PIC programmers other than the PICkit series. regulators.
This allows them, in the case of the PICkit 2, to generate voltages from 2.5 to 5 volts,
or in the case of the PICkit 3, 2.5 to 5.5 volts, from a 5 V USB supply, at around 100
mA. Both have options
6.4 Proteus:
Proteus is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is
done by the Proteus. Proteus is a programmer which itself contains a microcontroller
in it other than the one which is to be programmed. This microcontroller has a
program in it written in such a way that it accepts the hex file from the pic compiler
and dumps this hex file into the microcontroller which is to be programmed. As the
Proteus programmer requires power supply to be operated, this power supply is given
from the power supply circuit designed and connected to the microcontroller in
proteus. The program which is to be dumped in to the microcontroller is edited in
proteus and is compiled and executed to check any errors and hence after the
successful compilation of the program the program is dumped in to the
microcontroller using a dumper.
For PIC microcontroller, PIC C compiler is used for compilation. The compilation
steps are as follows:
Click Project, New, and something the box named 'Text1' is where your code
should be written later.
Now you have to click 'File, Save as' and choose a file name for your source
code ending with the letter '.c'. You can name as 'project.c' for example and
click save. Then you have to add this file to your project work.
Fig 6.5.4: Picture of checking errors and warnings using PIC C compiler
After compilation, next step is simulation. Here first circuit is designed in Express
PCB using Proteus 7 software and then simulation takes place followed by dumping.
The simulation steps are as follows:
Open Proteus 7 and click on IS1S6.
Now it displays PCB where circuit is designed using microcontroller. To
design circuit components are required. So click on component option.
10. Now click on letter ’p’, then under that select PIC16F73 ,other components related
to the project and click OK. The PIC 16F73 will be called your “'Target device”,
which is the final destination of your source code.
6.6 Dumping steps:
The steps involved in dumping the program edited in proteus 7 to microcontroller are
shown below:
1. Initially before connecting the program dumper to the microcontroller kit the
window is appeared as shown below.
3. After connecting the dumper properly to the microcontroller kit the window is
appeared as shown below.
4. Again by selecting the Tools option and clicking on Check Communication the
microcontroller gets recognized by the dumper and hence the window is as shown
below.
5. Import the program which is ‘.hex’ file from the saved location by selecting File
option and clicking on ‘Import Hex’ as shown in below window.
6. After clicking on ‘Import Hex’ option we need to browse the location of our
program and click the ‘prog.hex’ and click on ‘open’ for dumping the program into
the microcontroller.
REFFERENCES
[1] Margrain, TH. Helping blind and partially sighted people to read: the
effectiveness of low vision aids. British Journal of Ophthalmology. Pp.919-922,
2000.
[4] A. Heyes, “A polaroid ultrasonic travel aid for the blind,” Journal of Visual
Impairment and Blindness, vol. 76, pp. 199– 201, 1982.
[7] S. Shoval, J. Borenstein, and Y. Koren, “The NavBelt- A computerized travel aid
for the blind based on mobile robotics technology,” IEEE Transactions on Biomedical
Engineering, vol. 45, no 11, pp. 1376-1386,1998.
[8] P. Meijer, “An Experimental System for Auditory Image Representations,” IEEE
Transactions on Biomedical Engineering, vol.39, no 2, pp. 112-121, Feb 1991.
[12] Amit kumar, M. Manjunatha and J. Mukhopadhyay, “An Electronic Travel Aid
for Navigation of Visually Impaired Person,” Proceeding of the 3rd International
Conference on Communication Systems and Networks, pp.1-5, 2011.