Sei sulla pagina 1di 88

ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY

CHAPTER 1
Introduction
1.1 Introduction
The project aims at designing a LED based scrolling message display controlled from an Android
mobile phone. The proposed system makes use of Bluetooth technology to communicate from Android phone
to LED display board.
Android is a software stack for mobile devices that includes an operating system middleware
and key applications. Android boasts a healthy array of connectivity options including !i"#i
Bluetooth and wireless data over a cellular connection $for e%ample &'() ED&E $Enhanced Data
rates for &)* Evolution+ and ,&+. Android provides access to a wide range of useful libraries and
tools that can be used to build rich applications. -n addition Android includes a full set of tools that
have been built from the ground up alongside the platform providing developers with high
productivity and deep insight into their applications.
The main controlling device of the whole system is a *icrocontroller. Bluetooth modem and
bu..er are interfaced to *icrocontroller. The message sent through predefined application from user
Android mobile phone is received by the Bluetooth modem. Bluetooth modem feds this information
to microcontroller which process it and displays it on the LED display. Also the *icrocontroller
horns a bu..er for every new message. To perform this intelligent task *icrocontroller is loaded with
an intelligent program written using embedded /01 language.
1.2 Project Overview
An embedded system is a combination of software and hardware to perform a dedicated task.
)ome of the main devices used in embedded products are *icroprocessors and *icrocontrollers.
*icroprocessors are commonly referred to as general purpose processors as they simply
accept the inputs process it and give the output. -n contrast a microcontroller not only accepts the
data as inputs but also manipulates it interfaces the data with various devices controls the data and
thus finally gives the result.
The 2Android controlled scrolling LED message display3 using '-045#6,
microcontroller is an e%clusive project which is used to control the devices in an industry using '0
hyper terminal.
SPHOORTHY ENGINEERING COLLEGE (ECE) 1
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
1.3 Thesis
The thesis e%plains the implementation of 2Android controlled scrolling LE !ess"ge
dis#l"$% using '-045#6, microcontroller. The organi.ation of the thesis is e%plained here with7
Ch"#ter 1 'resents introduction to the overall thesis and the overview of the project. -n the project
overview a brief introduction of interfacing mobile to *icro 0ontroller Bluetooth led display board
and its applications are discussed.
Ch"#ter 2 'resents the topic embedded systems. -t e%plains the about what is embedded systems
need for embedded systems e%planation of it along with its applications.
Ch"#ter 3 'resents the hardware description. -t deals with the block diagram of the project and
e%plains the purpose of each block. -n the same chapter the e%planation of *icro 0ontroller
Bluetooth power supplies bu..er mobile led notice board are considered.
Ch"#ter & 'resents the software description. -t e%plains the implementation of the project using
'-0 0 0ompiler software.
Ch"#ter ' 'resents the project description along with Bluetooth Led 8otice board and bu..er
interfacing to microcontroller.
Ch"#ter ( 'resents the advantages disadvantages and applications of the project.
Ch"#ter ) 'resents the results conclusion and future scope of the project.
SPHOORTHY ENGINEERING COLLEGE (ECE) 2
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
CHAPTER 2
E*+EE ,-,TE*,
2.1 Introduction
An embedded system is a computer system designed to perform one or a few dedicated
functions often with real"time computing constraints. -t is embedded as part of a complete device
often including hardware and mechanical parts. By contrast a general"purpose computer such as a
personal computer $'0+ is designed to be fle%ible and to meet a wide range of end"user needs.
Embedded systems control many devices in common use today.
Embedded systems are controlled by one or more main processing cores that are typically
either microcontrollers or digital signal processors $D)'+. The key characteristic however is being
dedicated to handle a particular task which may re9uire very powerful processors. #or e%ample air
traffic control systems may usefully be viewed as embedded even though they involve mainframe
computers and dedicated regional and national networks between airports and radar sites. $Each radar
probably includes one or more embedded systems of its own.+
)ince the embedded system is dedicated to specific tasks design engineers can optimi.e it to
reduce the si.e and cost of the product and increase the reliability and performance. )ome embedded
systems are mass"produced benefiting from economies of scale.
'hysically embedded systems range from portable devices such as digital watches and *',
players to large stationary installations like traffic lights factory controllers or the systems
controlling nuclear power plants. 0omple%ity varies from low with a single microcontroller chip to
very high with multiple units peripherals and networks mounted inside a large chassis or enclosure.
-n general :embedded system: is not a strictly definable term as most systems have some
element of e%tensibility or programmability. #or e%ample handheld computers share some elements
with embedded systems such as the operating systems and microprocessors which power them but
they allow different applications to be loaded and peripherals to be connected. *oreover even
systems which don;t e%pose programmability as a primary feature generally need to support software
updates. <n a continuum from :general purpose: to :embedded: large application systems will have
SPHOORTHY ENGINEERING COLLEGE (ECE) 3
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
subcomponents at most points even if the system as a whole is :designed to perform one or a few
dedicated functions: and is thus appropriate to call :embedded:. A modern e%ample of embedded
system is shown in fig7 =.4.
.ig 2.1/A !odern e0"!#le o1 e!2edded s$ste!
Labeled parts include microprocessor $>+ (A* $5+ flash memory $6+.Embedded systems
programming is not like normal '0 programming. -n many ways programming for an embedded
system is like programming '0 4? years ago. The hardware for the system is usually chosen to make
the device as cheap as possible. )pending an e%tra dollar a unit in order to make things easier to
program can cost millions. @iring a programmer for an e%tra month is cheap in comparison. This
means the programmer must make do with slow processors and low memory while at the same time
battling a need for efficiency not seen in most '0 applications. Below is a list of issues specific to the
embedded field.
2.1.1 Histor$
-n the earliest years of computers in the 4A,BC>Bs computers were sometimes dedicated to a
single task but were far too large and e%pensive for most kinds of tasks performed by embedded
computers of today. <ver time however the concept of programmable controllers evolved from
traditional electromechanical se9uencers via solid state devices to the use of computer technology.
SPHOORTHY ENGINEERING COLLEGE (ECE) 4
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
<ne of the first recogni.ably modern embedded systems was the Apollo &uidance 0omputer
developed by 0harles )tark Draper at the *-T -nstrumentation Laboratory. At the project;s inception
the Apollo guidance computer was considered the riskiest item in the Apollo project as it employed
the then newly developed monolithic integrated circuits to reduce the si.e and weight. An early mass"
produced embedded system was the Automatics D"46 guidance computer for the *inuteman missile
released in 4A54. -t was built from transistor logic and had a hard disk for main memory. !hen the
*inuteman -- went into production in 4A55 the D"46 was replaced with a new computer that was the
first high"volume use of integrated circuits.
2.1.2 Tools
Embedded development makes up a small fraction of total programming. There;s also a large
number of embedded architectures unlike the '0 world where 4 instruction set rules and the Dni%
world where there;s only , or > major ones. This means that the tools are more e%pensive. -t also
means that they;re lowering featured and less developed. <n a major embedded project at some point
you will almost always find a compiler bug of some sort.
Debugging tools are another issue. )ince you can;t always run general programs on your
embedded processor you can;t always run a debugger on it. This makes fi%ing your program difficult.
)pecial hardware such as ETA& ports can overcome this issue in part. @owever if you stop on a
breakpoint when your system is controlling real world hardware $such as a motor+ permanent
e9uipment damage can occur. As a result people doing embedded programming 9uickly become
masters at using serial -< channels and error message style debugging.
2.1.3 Resources
To save costs embedded systems fre9uently have the cheapest processors that can do the job.
This means your programs need to be written as efficiently as possible. !hen dealing with large data
sets issues like memory cache misses that never matter in '0 programming can hurt you. Luckily
this won;t happen too often" use reasonably efficient algorithms to start and optimi.e only when
necessary. <f course normal profilers won;t work well due to the same reason debuggers don;t work
well.
*emory is also an issue. #or the same cost savings reasons embedded systems usually have
the least memory they can get away with. That means their algorithms must be memory efficient
$unlike in '0 programs you will fre9uently sacrifice processor time for memory rather than the
SPHOORTHY ENGINEERING COLLEGE (ECE) 5
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
reverse+. -t also means you can;t afford to leak memory. Embedded applications generally use
deterministic memory techni9ues and avoid the default :new: and :mallow: functions so that leaks
can be found and eliminated more easily. <ther resources programmers e%pect may not even e%ist.
#or e%ample most embedded processors do not have hardware #'Ds $#loating"'oint 'rocessing
Dnit+. These resources either need to be emulated in software or avoided altogether.
2.1.& Re"l Ti!e Issues
Embedded systems fre9uently control hardware and must be able to respond to them in real
time. #ailure to do so could cause inaccuracy in measurements or even damage hardware such as
motors. This is made even more difficult by the lack of resources available. Almost all embedded
systems need to be able to prioriti.e some tasks over others and to be able to put offFskip low priority
tasks such as D- in favor of high priority tasks like hardware control.
2.2 3eed .or E!2edded ,$ste!s
The uses of embedded systems are virtually limitless because every day new products are
introduced to the market that utili.es embedded computers in novel ways. -n recent years hardware
such as microprocessors microcontrollers and #'&A chips have become much cheaper. )o when
implementing a new form of control it;s wiser to just buy the generic chip and write your own custom
software for it. 'roducing a custom"made chip to handle a particular task or set of tasks costs far more
time and money. *any embedded computers even come with e%tensive libraries so that :writing your
own software: becomes a very trivial task indeed. #rom an implementation viewpoint there is a major
difference between a computer and an embedded system. Embedded systems are often re9uired to
provide (eal"Time response. The main elements that make embedded systems uni9ue are its
reliability and ease in debugging.
2.2.1 e2ugging
Embedded debugging may be performed at different levels depending on the facilities
available. #rom simplest to most sophisticate they can be roughly grouped into the following areas7
-nteractive resident debugging using the simple shell provided by the embedded operating
system $e.g. #orth and Basic+
E%ternal debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the (emedy Debugger which even works for
heterogeneous multi core systems.
SPHOORTHY ENGINEERING COLLEGE (ECE) 6
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
An in"circuit debugger $-0D+ a hardware device that connects to the microprocessor via a
ETA& or 8e%us interface. This allows the operation of the microprocessor to be controlled
e%ternally but is typically restricted to specific debugging capabilities in the processor.
An in"circuit emulator replaces the microprocessor with a simulated e9uivalent providing full
control over all aspects of the microprocessor.
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 '0.
Dnless restricted to e%ternal 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. #or 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 $D)' #'&A 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
synchroni.ation of software e%ecution. -n such a case the embedded system design may wish to
check the data traffic on the busses between the processor cores which re9uires very low"level
debugging at signalFbus level with a logic analy.er for instance.
2.2.2 Reli"2ilit$
Embedded systems often reside in machines that are e%pected to run continuously for years
without errors and in some cases recover by themselves 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 avoided.
)pecific reliability issues may include7
The system cannot safely be shut down for repair or it is too inaccessible to repair. E%amples
include space systems undersea cables navigational beacons bore"hole systems and
automobiles.
The system must be kept running for safety reasons. :Limp modes: are less tolerable. <ften
backups are selected by an operator. E%amples include aircraft navigation reactor control
systems safety"critical chemical factory controls train signals engines on single"engine
aircraft.
SPHOORTHY ENGINEERING COLLEGE (ECE) 7
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
The system will lose large amounts of money when shut down7 Telephone switches factory
controls bridge and elevator controls funds transfer and market making automated sales and
service.
A variety of techni9ues are used sometimes in combination to recover from errorsGboth
software bugs such as memory leaks and also soft errors in the hardware7
!atchdog timer that resets the computer unless the software periodically notifies the watchdog
)ubsystems with redundant spares that can be switched over to
software :limp modes: that provide partial function
Designing with a Trusted 0omputing Base $T0B+ architectureH5I ensures a highly secure J
reliable system environment
An Embedded @ypervisor 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.
-mmunity Aware 'rogramming
2.3 E0#l"n"tion o1 E!2edded s$ste!s
2.3.1 ,o1tw"re Architecture
There are several different types of software architecture in common use.
)imple 0ontrol Loop7
-n this design the software simply has a loop. The loop calls subroutines each of
which manages a part of the hardware or software.
-nterrupt 0ontrolled )ystem7
)ome embedded systems are predominantly interrupt controlled. This means that tasks
performed by the system are triggered by different kinds of events. An interrupt could be generated
for e%ample by a timer in a predefined fre9uency or by a serial port controller receiving a byte. These
SPHOORTHY ENGINEERING COLLEGE (ECE) 8
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
kinds of systems are used if event handlers need low latency and the event handlers are short and
simple.
Dsually these kinds of systems run a simple task in a main loop also but this task is not very
sensitive to une%pected delays. )ometimes the interrupt handler will add longer tasks to a 9ueue
structure. Later after the interrupt handler has finished these tasks are e%ecuted by the main loop.
This method brings the system close to a multitasking kernel with discrete processes.
0ooperative *ultitasking7
A non"preemptive multitasking system is very similar to the simple control loop scheme
e%cept that the loop is hidden in an A'-. The programmer defines a series of tasks and each task gets
its own environment to 2run3 in. !hen a task is idle it calls an idle routine usually called 2pause3
2wait3 2yield3 2nap3 $stands for no operation+ etc. The advantages and disadvantages are very
similar to the control loop e%cept that adding new software is easier by simply writing a new task or
adding to the 9ueue"interpreter.
'rimitive *ultitasking7
-n this type of system a low"level piece of code switches between tasks or threads based on a
timer $connected to an interrupt+. This is the level at which the system is generally considered to have
an :operating system: kernel. Depending on how much functionality is re9uired it introduces more or
less of the comple%ities of managing multiple tasks running conceptually in parallel.
Because of these comple%ities it is common for organi.ations to buy a real"time operating
system allowing the application programmers to concentrate on device functionality rather than
operating system services at least for large systemsK smaller systems often cannot afford the overhead
associated with a generic real time system due to limitations regarding memory si.e performance
andFor battery life.
*icrokernel1s And E%okernels7
A microkernel is a logical step up from a real"time <). The usual arrangement is that the
operating system kernel allocates memory and switches the 0'D to different threads of e%ecution.
Dser mode processes implement major functions such as file systems network interfaces etc.
SPHOORTHY ENGINEERING COLLEGE (ECE) 9
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
-n general microkernel1s succeed when the task switching and interties communication is fast
and fail when they are slow. E%okernels communicate efficiently by normal subroutine calls. The
hardware and all the software in the system are available to and e%tensible by application
programmers. Based on performance functionality re9uirement the embedded systems are divided
into three categories7
2.3.2 ,t"nd Alone E!2edded ,$ste!
These systems takes the input in the form of electrical signals from transducers or commands
from human beings such as pressing of a button etc.. process them and produces desired output. This
entire process of taking input processing it and giving output is done in standalone mode. )uch
embedded systems comes under stand alone embedded systems
Egg7 microwave oven air conditioner etc..
2.3.3 Re"l4ti!e e!2edded s$ste!s
Embedded systems which are used to perform a specific task or operation in a specific time
period those systems are called as real"time embedded systems. There are two types of real"time
embedded systems.
@ard (eal"time embedded systems7
These embedded systems follow an absolute dead line time period i.e.. if the tasking is not
done in a particular time period then there is a cause of damage to the entire e9uipment.
Egg7 consider a system in which we have to open a valve within ,B milliseconds. -f this valve is not
opened in ,B ms this may cause damage to the entire e9uipment. )o in such cases we use embedded
systems for doing automatic operations.
)oft (eal Time embedded systems7
These embedded systems follow a relative dead line time period i.e.. if the task is not done in a
particular time that will not cause damage to the e9uipment.
SPHOORTHY ENGINEERING COLLEGE (ECE) 10
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Eg7 0onsider a TL remote control system if the remote control takes a few milliseconds delay it will not cause
damage either to the TL or to the remote control. These systems which will not cause damage when they are
not operated at considerable time period those systems comes under soft real"time embedded systems.
2.3.& 3etwor5 co!!unic"tion e!2edded s$ste!s
A wide range network interfacing communication is provided by using embedded systems.
Eg7
0onsider a web camera that is connected to the computer with internet can be used to
spread communication like sending pictures images videos etc.. to another computer
with internet connection throughout anywhere in the world.
0onsider a web camera that is connected at the door lock.
!henever a person comes near the door it captures the image of a person and sends to the
desktop of your computer which is connected to internet. This gives an alerting message with image
on to the desktop of your computer and then you can open the door lock just by clicking the mouse.
#ig7 =.= show the network communications in embedded systems.
.ig 2.2/ 3etwor5 co!!unic"tion e!2edded s$ste!s
2.3.' i11erent t$#es o1 #rocessing units
SPHOORTHY ENGINEERING COLLEGE (ECE) 11
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
The central processing unit $c.p.u+ can be any one of the following microprocessor
microcontroller digital signal processing.
Among these *icrocontroller is of low cost processor and one of the main advantage of
microcontrollers is the components such as memory serial communication interfaces analog
to digital converters etc.. all these are built on a single chip. The numbers of e%ternal
components that are connected to it are very less according to the application.
*icroprocessors are more powerful than microcontrollers. They are used in major applications
with a number of tasking re9uirements. But the microprocessor re9uires many e%ternal
components like memory serial communication hard disk input output ports etc.. so the
power consumption is also very high when compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly involved with
processing of signals
2.& A##lic"tions o1 e!2edded s$ste!s
2.&.1 Consu!er "##lic"tions
At home we use a number of embedded systems which include microwave oven remote
control vcd players dvd players camera etcM.
2.&.2 O11ice "uto!"tion
!e use systems like fa% machine modem printer etcM
2.&.3. Industri"l "uto!"tion
Today a lot of industries are using embedded systems for process control. -n industries
we design the embedded systems to perform a specific operation like monitoring temperature
pressure humidity voltage current etc.. and basing on these monitored levels we do control other
devices we can send information to a centrali.ed monitoring station.-n critical industries where
human presence is avoided there we can use robots which are programmed to do a specific operation.
2.&.' Co!#uter networ5ing
SPHOORTHY ENGINEERING COLLEGE (ECE) 12
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Embedded systems are used as bridges routers etc..
2.&.( Tele co!!unic"tions/
0ell phones web cameras etc.
CHAPTER 3
H"rdw"re descri#tion
3.1 Introduction
-n this chapter the block diagram of the project and design aspect of independent modules are
considered. Block diagram is shown in fig7 ,.47
.I6 3.1 Android controlled scrolling LE !ess"ge dis#l"$
The !"in 2loc5s o1 this #roject "re/
4. *icro controller $45#6,+
SPHOORTHY ENGINEERING COLLEGE (ECE) 13
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
=. (eset button
,. 0rystal oscillator
>. (egulated power supply $(')+
?. LED 8otice board
5. LED
6. Bu..er
N. Android phone
3.2 *icro controller/
.ig/ 3.2 *icrocontrollers
3.2.1 Introduction to *icrocontrollers/
0ircumstances 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 prere9uisite for
production of microprocessors and the first computers were made by adding e%ternal peripherals such
as memory input"output lines timers and other. #urther 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.
SPHOORTHY ENGINEERING COLLEGE (ECE) 14
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
*icroprocessors and microcontrollers are widely used in embedded systems products.
*icrocontroller is a programmable device. A microcontroller has a 0'D in addition to a fi%ed amount
of (A* (<* -F< ports and a timer embedded all on a single chip. The fi%ed amount of on"chip
(<* (A* and number of -F< ports in microcontrollers makes them ideal for many applications in
which cost and space are critical.
The microcontroller used in this project is '-045#6=. The '-0 families of microcontrollers are
developed by *icrochip Technology -nc. 0urrently they are some of the most popular
microcontrollers selling over 4=B million devices each year. There are basically four families of '-0
microcontrollers7
'-04=0OOO 4=F4>"bit program word
'-0 450?O 4="bit program word
'-0450OOO and '-045#OOO 4>"bit program word
'-0460OOO and '-04N0OOO 45"bit program word
The features pin description of the microcontroller used are discussed in the following sections.
3.2.2 escri#tion/
Introduction to PIC *icrocontrollers7
'-0 stands for 'eripheral -nterface 0ontroller given by *icrochip Technology to identify its
single"chip microcontrollers. These devices have been very successful in N"bit microcontrollers. The
main reason is that *icrochip Technology has continuously upgraded the device architecture and
added needed peripherals to the microcontroller to suit customers; re9uirements. The development
tools such as assembler and simulator are freely available on the internet at www.microchip.com
Low " end '-0 Architectures/
*icrochip '-0 microcontrollers are available in various types. !hen '-0 microcontroller *0D
was first available from &eneral -nstruments in early 4ANB;s the microcontroller consisted of a simple
processor e%ecuting 4="bit wide instructions with basic -F< functions. These devices are known as
low"end architectures. They have limited program memory and are meant for applications re9uiring
SPHOORTHY ENGINEERING COLLEGE (ECE) 15
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
simple interface functions and small program J data memories. )ome of the low"end device numbers
are
4=0?OO
450?O
450?B?
*id r"nge PIC Architectures/ *id range '-0 architectures are built by upgrading low"end
architectures with more number of peripherals more number of registers and more dataFprogram
memory. )ome of the mid"range devices are
4505O
4506O
45#N6O
'rogram memory type is indicated by an alphabet.
0 P E'(<* # P #lash (0 P *ask (<*
'opularity of the '-0 microcontrollers is due to the following factors.
4. )peed7 @arvard Architecture (-)0 architecture 4 instruction cycle P > clock cycles.
=. -nstruction set simplicity7 The instruction set consists of just ,? instructions $as opposed to
444 instructions for NB?4+.
,. 'ower"on"reset and brown"out reset. Brown"out"reset means when the power supply goes
below a specified voltage $say >L+ it causes '-0 to resetK hence malfunction is avoided. A
watch dog timer $user programmable+ resets the processor if the softwareFprogram ever
malfunctions and deviates from its normal operation.
>. '-0 microcontroller has four optional clock sources.
Low power crystal
*id range crystal
@igh range crystal
SPHOORTHY ENGINEERING COLLEGE (ECE) 16
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
(0 oscillator $low cost+.
?. 'rogrammable timers and on"chip AD0.
5. Dp to 4= independent interrupt sources.
6. 'owerful output pin control $=? mA $ma%.+ current sourcing capability per pin.+
N. E'(<*F<T'F(<*F#lash memory option.
A. -F< port e%pansion capability.
Basically all '-0 microcontrollers offer the following features7
(-)0 instruction set with around ,? instructions QA Digital -F< ports
<n"chip timer with N"bit prescaler.
'ower"on reset
!atchdog timer
'ower saving )LEE' mode
Direct indirect and relative addressing modes
E%ternal clock interface
(A* data memory
E'(<* $or <T'+ program memory
Peri#her"l 1e"tures/
@igh sinkFsource current =?mA
TimerB7 N"bit timerFcounter with N"bit prescaler can be incremented during sleep via e%ternal
crystalFclock
Timer=7N"bit timerFcounter with N"bit period register prescaler and post scalar.
0apture 0ompare '!* $00'+ module
0apture is 45"bit ma% resolution is 4=.?ns
SPHOORTHY ENGINEERING COLLEGE (ECE) 17
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
0ompare is 45"bit ma% resolution is =BB ns
'!* ma% resolution is 4B"bit
N"bit ? channel analog"to"digital converter
)ynchronous serial port $))'+ with )'- $*asterF)lave+ and $)lave+
)ome devices offer the following additional features7
Analogue input channels
Analogue comparators
Additional timer circuits
EE'(<* data memory
#lash EE'(<* program memory
E%ternal and timer interrupts
-n"circuit programming
-nternal oscillator
D)A(T serial interface
3.2.3 Introduction to PIC1(.)3 !icrocontroller
The '-045#6, 0*<) #LA)@"based N"bit microcontroller is upward compatible with the
'-04506,B
F6>BF65F66

'-045#N6,FN6>FN65FN66
devices. -t features =BB ns instruction e%ecution self
programming an -0D = 0omparators N channels of N"bit Analog"to"Digital $AFD+ converter =
captureFcompareF'!* functions a synchronous serial port that can be configured as either ,"wire
)'- or ="wire -=0 bus a D)A(T and a 'arallel )lave 'ort.
High4Per1or!"nce RI,C CP7
R <nly ,? single word instructions to learn
R All single cycle instructions e%cept for program branches which are two"cycle
R <perating speed7 D0 " =B *@. clock input
SPHOORTHY ENGINEERING COLLEGE (ECE) 18
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
D0 " =BB ns instruction cycle
R Dp to NS % 4> words of #LA)@ 'rogram *emory Dp to ,5N % N bytes of Data *emory $(A*+
R 'in out compatible to the '-04506,BF6>BF65F66
R 'in out compatible to the '-045#N6,FN6>FN65FN66
R -nterrupt capability $up to 4= sources+
R Eight level deep hardware stack
R Direct -ndirect and (elative Addressing modes
R 'rocessor read access to program memory
,#eci"l *icrocontroller .e"tures
R 'ower"up Timer $'!(T+ and oscillator )tart"up Timer $<)T+
R !atchdog Timer $!DT+ with its own on"chip (0 oscillator for reliable operation
R 'rogrammable code protection
R 'ower saving )LEE' mode
R )electable oscillator options
R -n"0ircuit )erial 'rogramming $-0)'+ via two 'ins
Peri#her"l .e"tures
R TimerB7 N"bit timerFcounter with N"bit prescaler
R Timer47 45"bit timerFcounter with prescaler can be incremented during )LEE' via e%ternal
crystalFclock
R Timer=7 N"bit timerFcounter with N"bit period register prescaler and postscaler
SPHOORTHY ENGINEERING COLLEGE (ECE) 19
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
R Two 0apture 0ompare '!* modules
" 0apture is 45"bit ma% resolution is 4=.? ns
" 0ompare is 45"bit ma% resolution is =BB ns
" '!* ma% resolution is 4B"bit
R N"bit up to N"channel Analog"to"Digital converter
R )ynchronous )erial 'ort $))'+ with )'-T $*aster mode+ and -=0T $)lave+
R Dniversal )ynchronous Asynchronous (eceiver Transmitter $D)A(TF)0-+
R 'arallel )lave 'ort $')'+ N"bits wide with e%ternal (D !( and 0) controls
R Brown"out detection circuitry for Brown"out (eset $B<(+
An"log Co!#"r"tor !odule
= analog comparators
'rogrammable on"chip voltage reference module
'rogrammable input multiple%ing from device inputs and internal L(E#
0omparator outputs are e%ternally accessible
C*O, Technolog$/
R Low power high speed 0*<) #LA)@ technology
R #ully static design
R !ide operating voltage range7 =.BL to ?.?L
R @igh )inkF)ource 0urrent7 =? mA
R -ndustrial temperature range
R Low power consumption7
" U = mA typical V ?L > *@.
SPHOORTHY ENGINEERING COLLEGE (ECE) 20
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
" =B WA typical V ,L ,= k@.
" U 4 WA typical standby current
#ollowing are the major blocks of '-0 *icrocontroller.
Progr"! !e!or$ 8.LA,H+ is used for storing a written program. )ince memory made in #LA)@
technology can be programmed and cleared more than once it makes this microcontroller suitable for
device development.
EEPRO* " data memory that needs to be saved when there is no supply. -t is usually used for storing
important data that must not be lost if power supply suddenly stops. #or instance one such data is an
assigned temperature in temperature regulators. -f 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.
RA*"Data memory used by a program during its e%ecution. -n (A* are stored all inter"results or
temporary data during run"time. PORT, are physical connections between the microcontroller and
the outside world. '-045#6, has ==-F<.
.REE4R73 TI*ER is an N"bit register inside a microcontroller that works independently of the
program. <n every fourth clock of the oscillator it increments its value until it reaches the ma%imum
$=??+ and then it starts counting over again from .ero. As we know the e%act timing between each
two increments of the timer contents timer can be used for measuring time which is very useful with
some devices.
CE3TRAL PROCE,,I36 73IT has a role of connective element between other blocks in the
microcontroller. -t coordinates the work of other blocks and e%ecutes the user program.
SPHOORTHY ENGINEERING COLLEGE (ECE) 21
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
CI,C9 RI,C
-t has already been said that '-045#6, has (-)0 architecture. This term is often found in
computer literature and it needs to be e%plained here in more detail. @arvard architecture is a newer
concept than von"8eumann. -t rose out of the need to speed up the work of a microcontroller. -n
@arvard architecture data bus and address bus are separate. Thus a greater flow of data is possible
through the central processing unit and of course a greater speed of work. )eparating a program from
data memory makes it further possible for instructions not to have to be N"bit words. '-045#6, uses
4> bits for instructions which allows for all instructions to be one word instructions. -t is also typical
for @arvard architecture to have fewer instructions than von"8eumann;s and to have instructions
usually e%ecuted in one cycle. *icrocontrollers with @arvard architecture are also called :(-)0
microcontrollers:. (-)0 stands for (educed -nstruction )et 0omputer. *icrocontrollers with von"
8eumann;s architecture are called ;0-)0 microcontrollers; title 0-)0 stands for 0omple% -nstruction
)et 0omputer.
)ince '-045#6, is a (-)0 microcontroller that means that it has a reduced set of instructions
more precisely ,? instructions. $E%. -ntel;s and *otorola;s microcontrollers have over hundred
instructions+ All of these instructions are e%ecuted in one cycle e%cept for jump and branch
instructions. According to what its maker says '-045#6, usually reaches results of =74 in code
compression and >74 in speed in relation to other N"bit microcontrollers in its class.
A##lic"tions
'-045#6, perfectly fits many uses from automotive industries and controlling home
appliances to industrial instruments remote sensors electrical door locks and safety devices. -t is also
ideal for smart cards as well as for battery supplied devices because of its low consumption.
EE'(<* memory makes it easier to apply microcontrollers to devices where permanent
storage of various parameters is needed $codes for transmitters motor speed receiver fre9uencies
etc.+. Low cost low consumption easy handling and fle%ibility make '-045#6, applicable even in
areas where microcontrollers had not previously been considered $e%ample7 timer functions interface
replacement in larger systems coprocessor applications etc.+.
SPHOORTHY ENGINEERING COLLEGE (ECE) 22
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
-n )ystem 'rogrammability of this chip $along with using only two pins in data transfer+
makes possible the fle%ibility 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.
Cloc5 : instruction c$cle
0lock is microcontroller;s main starter and is obtained from an e%ternal component called an
:oscillator:. -f we want to compare a microcontroller with a time clock our :clock: would then be a
ticking sound we hear from the time clock. -n 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.0lock from the oscillator enters a microcontroller via <)04 pin where internal
circuit of a microcontroller divides the clock into four even clocks X4 X= X, and X> which do not
overlap. These four clocks make up one instruction cycle $also called machine cycle+ during which
one instruction is e%ecuted.
Pi#elining
-nstruction cycle
consists of cycles X4 X=
X, and X>. 0ycles of
calling and e%ecuting
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 e%ecution.
@owever due to pipelining each instruction is effectively e%ecuted in one cycle. -f instruction causes
a change on program counter and '0 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 e%ecuting an
instruction. This is so because instruction must be processed again but this time from the right
address. 0ycle of calling begins with X4 clock by writing into instruction register $-(+. Decoding and
e%ecuting begins with X= X, and X> clocks.
SPHOORTHY ENGINEERING COLLEGE (ECE) 23
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Pin descri#tion
'-045#6, has a total of =N pins. -t is most fre9uently found in a D-'=N type of case but can
also be found in )*D case which is smaller from a D-'. D-' is an abbreviation for Dual -n 'ackage.
)*D is an abbreviation for )urface *ount Devices suggesting that holes for pins to go through when
mounting aren;t necessary in soldering this type of a component.
SPHOORTHY ENGINEERING COLLEGE (ECE) 24
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
'ins on '-045#6, microcontroller have the following meaning7
There are =N pins on '-045#6,. *ost of them can be used as an -< pin. <thers are already for
specific functions. These are the pin functions.
4. *0L( C to reset the '-0
=. (AB C port A pin B
,. (A4 C port A pin 4
>. (A= C port A pin =
?. (A, C port A pin ,
5. (A> C port A pin >
6. (A? C port A pin ?
N. L)) C ground
A. <)04 C connect to oscillator
4B. <)0= C connect to oscillator
44. (0B C port 0 pin B LDD C power supply
4=. (04 C port 0 pin 4
SPHOORTHY ENGINEERING COLLEGE (ECE) 25
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
4,. (0= C port 0 pin =
4>. (0, C port 0 pin ,
4?. (0> " port 0 pin >
45. (0? " port 0 pin ?
46. (05 " port 0 pin 5
4N. (06 " port 0 pin 6
4A. L)) " ground
=B. LDD C power supply
=4. (BB " port B pin B
==. (B4 " port B pin 4
=,. (B= " port B pin =
=>. (B, " port B pin ,
=?. (B> " port B pin >
=5. (B? " port B pin ?
=6. (B5 " port B pin 5
=N. (B6 " port B pin 6
By utili.ing all of this pin so many application can be done such as7
4. L0D C connect to 'ort B pin.
=. LED C connect to any pin declared as output.
,. (elay and *otor " connect to any pin declared as output.
>. E%ternal EE'(<* C connect to -=0 interface pin C (0, and (0> $)0L and )DA+
?. LD( 'otentiometer and sensor C connect to analogue input pin such as (AB.
5. &)* modem dial up modem C connect to (05 and (06 C the serial communication interface using
()=,= protocol.
Ports
Term :port: refers to a group of pins on a microcontroller which can be accessed
simultaneously or on which we can set the desired combination of .eros and ones or read from them
an e%isting status. 'hysically port is a register inside a microcontroller which is connected by wires to
the pins of a microcontroller. 'orts represent physical connection of 0entral 'rocessing Dnit with an
SPHOORTHY ENGINEERING COLLEGE (ECE) 26
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
outside world. *icrocontroller uses them in order to monitor or control other components or devices.
Due to functionality some pins have twofold roles like 'A>FT<0S- for instance which is in the same
time the fourth bit of port A and an e%ternal input for free"run counter.
All port pins can be designated as input or output according to the needs of a device that;s
being developed. -n order to define a pin as input or output pin the right combination of .eros and
ones must be written in T(-) register. -f the appropriate bit of T(-) register contains logical :4: then
that pin is an input pin and if the opposite is true it;s an output pin. Every port has its proper T(-)
register. Thus port A has T(-)A and port B has T(-)B. 'in direction can be changed during the
course of work which is particularly fitting for one"line communication where data flow constantly
changes direction. '<(TA and '<(TB state registers are located in bank B while T(-)A and T(-)B
pin direction registers are located in bank 4.PORT+ "nd TRI,+ '<(TB have adjoined N pins. The
appropriate register for data direction is T(-)B. )etting a bit in T(-)B register defines the
corresponding port pin as input and resetting a bit in T(-)B register defines the corresponding port
pin as output.
Each '<(TB pin has a weak internal pull"up resistor $resistor which defines a line to logic
one+ which can be activated by resetting the seventh bit (B'D in <'T-<8 register. These ;pull"up;
resistors are automatically being turned off when port pin is configured as an output. !hen a
microcontroller is started pull"ups are disabled.#our pins '<(TB (B67(B> can cause an interrupt
which occurs when their status changes from logical one into logical .ero and opposite. <nly pins
configured as input can cause this interrupt to occur $if any (B67(B> pin is configured as an output
an interrupt won;t be generated at the change of status.+ This interrupt option along with internal pull"
SPHOORTHY ENGINEERING COLLEGE (ECE) 27
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
up resistors makes it easier to solve common problems we find in practice like for instance that of
matri% keyboard. -f rows on the keyboard are connected to these pins each push on a key will then
cause an interrupt. A microcontroller will determine which key is at hand while processing an
interrupt -t is not recommended to refer to port B at the same time that interrupt is being processed
PORTA "nd TRI,A '<(TA have ? adjoining pins. The corresponding register for data direction is
T(-)A at address N?h. Like with port B setting a bit in T(-)A register defines also the corresponding
port pin as input and clearing a bit in T(-)A register defines the corresponding port pin as output.
-t is important to note that '<(TA pin (A> can be input only. <n that pin is also situated an
e%ternal input for timer T*(B. !hether (A> will be a standard input or an input for a counter
depends on TB0) bit $T*(B 0lock )ource )elect bit+. This pin enables the timer T*(B to increment
either from internal oscillator or via e%ternal impulses on (A>FTB0S- pin.
*e!or$ org"ni;"tion
'-045#6, has two separate memory blocks one for data and the other for program. EE'(<*
memory with &'( and )#( registers in (A* memory make up the data block while #LA)@
memory makes up the program block.
SPHOORTHY ENGINEERING COLLEGE (ECE) 28
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Progr"! !e!or$ 'rogram memory has been carried out in #LA)@ technology which makes it
possible to program a microcontroller many times before it;s installed into a device and even after its
installment if eventual changes in program or process parameters should occur. The si.e of program
memory is 4B=> locations with 4> bits width where locations .ero and four are reserved for reset and
interrupt vector.
"t" !e!or$ Data memory consists of EE'(<* and (A* memories. EE'(<* memory consists
of =?5 eight bit locations whose contents are not lost during loosing of power supply. EE'(<* is
not directly addressable but is accessed indirectly through EEAD( and EEDATA registers. As
EE'(<* memory usually serves for storing important parameters $for e%ample of a given
temperature in temperature regulators+ there is a strict procedure for writing in EE'(<* which
must be followed in order to avoid accidental writing. (A* memory for data occupies space on a
memory map from location B%B0 to B%># which comes to 5N locations. Locations of (A* memory
are also called &'( registers which is an abbreviation for &eneral 'urpose (egisters. &'( registers
can be accessed regardless of which bank is selected at the moment.
3.3 Regul"ted #ower su##l$
3.3.1 Introduction
'ower 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 ')D. 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
0onversion of one form of electrical power to another desired form and voltage typically
involving converting A0 line voltage to a well"regulated lower"voltage D0 for electronic devices.
Low voltage low power D0 power supply units are commonly integrated with the devices they
supply such as computers and household electronics.
Batteries.
SPHOORTHY ENGINEERING COLLEGE (ECE) 29
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
0hemical fuel cells and other forms of energy storage systems.
)olar power.
&enerators or alternators.
3.3.2 +loc5 i"gr"!/

.ig 3.3.2 Regul"ted Power ,u##l$
The basic circuit diagram of a regulated power supply $D0 <F'+ with led connected as load is
shown in fig7 ,.,.,.
.ig 3.3.3 Circuit di"gr"! o1 Regul"ted Power ,u##l$ with Led connection
The components mainly used in above figure are
=,BL A0 *A-8)
T(A8)#<(*E(
B(-D&E (E0T-#-E($D-<DE)+
0A'A0-T<(
L<LTA&E (E&DLAT<($-0 6NB?+
(E)-)T<(
SPHOORTHY ENGINEERING COLLEGE (ECE) 30
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
LED$L-&@T E*-TT-8& D-<DE+
The detailed e%planation of each and every component mentioned above is as follows7
Tr"ns1or!"tion/ The process of transforming energy from one device to another is called
transformation. #or transforming energy we use transformers.
Tr"ns1or!ers/ A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled conductors without changing its fre9uency. A varying current in the first
or primary winding creates a varying magnetic flu% in the transformer;s core and thus a
varying magnetic field through the secondary winding. This varying magnetic field induces a
varying electromotive force $E*#+ or :voltage: in the secondary winding. This effect is called mutual
induction.
-f 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. -f 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. !ith the ?B @. A0
mains supply this will happen ?B times a second. This is called *DTDAL -8DD0T-<8 and forms
the basis of the transformer.
The input coil is called the '(-*A(Y !-8D-8&K the output coil is the )E0<8DA(Y
!-8D-8&. #ig7 ,.,.> shows step"down transformer.
.ig 3.3.&/ ,te#4own Tr"ns1or!er
The voltage induced in the secondary is determined by the TD(8) (AT-<.
SPHOORTHY ENGINEERING COLLEGE (ECE) 31
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
#or e%ample if the secondary has half the primary turnsK the secondary will have half the
primary voltage.
Another e%ample is if the primary has ?BBB turns and the secondary has ?BB turns then the
turn1s ratio is 4B74.
-f the primary voltage is =>B volts then the secondary voltage will be % 4B smaller P => volts.
Assuming a perfect transformer the power provided by the primary must e9ual the power taken by a
load on the secondary. -f a =>"watt lamp is connected across a => volt secondary then the primary
must supply => watts.
To aid magnetic coupling between primary and secondary the coils are wound on a metal
0<(E. )ince the primary would induce power called EDDY 0D((E8T) into this core the core is
LA*-8ATED. This means that it is made up from metal sheets insulated from each other.
Transformers to work at higher fre9uencies have an iron dust core or no core at all.
8ote that the transformer only works on A0 which has a constantly changing current and
moving field. D0 has a steady current and therefore a steady field and there would be no induction.
)ome transformers have an electrostatic screen between primary and secondary. This is to
prevent some types of interference being fed from the e9uipment down into the mains supply or in
the other direction. Transformers are sometimes used for -*'EDA80E *AT0@-8&.
!e can use the transformers as step up or step down.
,te# 7# tr"ns1or!er
-n 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.
,te# down tr"ns1or!er
SPHOORTHY ENGINEERING COLLEGE (ECE) 32
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
-n case of step down transformer 'rimary winding induces more flu% than the secondary
winding and secondary winding is having less number of turns because of that it accepts less number
of flu% and releases less amount of voltage.
+"tter$ #ower su##l$
A battery is a type of linear power supply that offers benefits that traditional line"operated
power supplies lack7 mobility portability and reliability. A battery consists of multiple
electrochemical cells connected to provide the voltage desired. #ig7 ,.,.? shows @i"!att AL battery
The lead"acid storage battery may be used. This battery is rechargeableK it consists of lead and
leadFdio%ide electrodes which are immersed in sulfuric acid. !hen fully charged this type of battery
has a =.B5"=.4> L potential $A 4= volt car battery uses 5 cells in series+. During discharge the lead is
converted to lead sulfate and the sulfuric acid is converted to water. !hen the battery is charging the
lead sulfate is converted back to lead and lead dio%ide A 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 o%ide is o%idi.ed to its higher o%idation state and
cadmium o%ide 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. #ig7 ,.,.5 shows pencil battery of 4.?L.
Recti1ic"tion/ The process of converting an alternating current to a pulsating direct current is called
as rectification. #or rectification purpose we use rectifiers.
Recti1iers/ A rectifier is an electrical device that converts alternating current $A0+ to direct current
$D0+ a process known as rectification. (ectifiers have many uses including as components of power
supplies and as detectors of radio signals. (ectifiers may be made of solid"state diodes vacuum tube
diodes mercury arc valves and other components.
A device that it can perform the opposite function $converting D0 to A0+ is known as an
inverter. !hen only one diode is used to rectify A0 $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 A0 to D0. Almost all rectifiers
SPHOORTHY ENGINEERING COLLEGE (ECE) 33
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
comprise a number of diodes in a specific arrangement for more efficiently converting A0 to D0 than
is possible with only one diode. Before the development of silicon semiconductor rectifiers vacuum
tube diodes and copper $-+ o%ide or selenium rectifier stacks were used.
+ridge 1ull w"ve recti1ier/
The Bridge rectifier circuit is shown in fig7 ,.,.6 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.
#or the positive half cycle of the input ac voltage diodes D4 and D, conduct whereas diodes
D= and D> remain in the <## state. The conducting diodes will be in series with the load resistance
(
L
and hence the load current flows through (
L.

#or the negative half cycle of the input ac voltage diodes D= and D> conduct whereas D4 and
D, remain <##. The conducting diodes D= and D> will be in series with the load resistance (
L
and
hence the current flows through (
L
in the same direction as in the previous half cycle. Thus a bi"
directional wave is converted into a unidirectional wave.
-nput <utput
.ig 3.3.)/ +ridge recti1ier/ " 1ull4w"ve recti1ier using & diodes
+1<)/ 8ow "a "days Bridge rectifier is available in -0 with a number of DB4B6. -n our project we
are using an -0 in place of bridge rectifier. The picture of DB 4B6 is shown in fig7 ,.,.N.
SPHOORTHY ENGINEERING COLLEGE (ECE) 34
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.e"tures/
&ood for automation insertion
)urge overload rating " ,B amperes peak
-deal for printed circuit board
(eliable low cost construction utili.ing molded
&lass passivated device
'olarity symbols molded on body
*ounting position7 Any
!eight7 4.B gram
.ig 3.3.=/ +1<)
.iltr"tion/ The process of converting a pulsating direct current to a pure direct current using filters is
called as filtration.
.ilters/ Electronic filters are electronic circuits which perform signal"processing functions
specifically to remove unwanted fre9uency components from the signal to enhance wanted ones.
Introduction to C"#"citors/
The 0apacitor or sometimes referred to as a 0ondenser is a passive device and one which
stores energy in the form of an electrostatic field which produces a potential $static voltage+ across its
SPHOORTHY ENGINEERING COLLEGE (ECE) 35
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
plates. -n its basic form a capacitor consists of two parallel conductive plates that are not connected
but are electrically separated either by air or by an insulating material called the Dielectric. !hen a
voltage is applied to these plates a current flows charging up the plates with electrons giving one
plate a positive charge and the other plate an e9ual and opposite negative charge this flow of electrons
to the plates is known as the 0harging 0urrent and continues to flow until the voltage across the plates
$and hence the capacitor+ is e9ual to the applied voltage Lcc. At this point the capacitor is said to be
fully charged and this is illustrated below. The construction of capacitor and an electrolytic capacitor
are shown in figures ,.,.A and ,.,.4B respectively.
.ig 3.3.>/Construction O1 " C"#"citor .ig 3.1</Electrol$tic C"#"ticor
Dnits of 0apacitance7
*icrofarad $W#+ 4W# P 4F4BBBBBB P B.BBBBB4 P 4B
"5
#
8anofarad $n#+ 4n# P 4F4BBBBBBBBB P B.BBBBBBBB4 P 4B
"A
#
'ico farad $p#+ 4p# P 4F4BBBBBBBBBBBB P B.BBBBBBBBBBB4 P 4B
"4=
#
O#er"tion o1 C"#"citor/
Think of water flowing through a pipe. -f we imagine a capacitor as being a storage tank with
an inlet and an outlet pipe it is possible to show appro%imately how an electronic capacitor works.
SPHOORTHY ENGINEERING COLLEGE (ECE) 36
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
#irst let;s consider the case of a :coupling capacitor: where the capacitor is used to connect a signal
from one part of a circuit to another but without allowing any direct current to flow.
?olt"ge Regul"tor
A voltage regulator $also called a /regulator1+ with only three terminals appears to be a simple
device but it is in fact a very comple% integrated circuit. -t converts a varying input voltage into a
constant /regulated1 output voltage. Loltage (egulators are available in a variety of outputs like ?L
5L AL 4=L and 4?L. The L*6NOO series of voltage regulators are designed for positive input. #or
applications re9uiring negative input the L*6AOO series is used. Dsing a pair of /voltage"divider1
resistors can increase the output voltage of a regulator circuit.
-t is not possible to obtain a voltage lower than the stated rating. You cannot use a 4=L
regulator to make a ?L power supply. Loltage regulators are very robust. These can withstand over"
current draw due to short circuits and also over"heating. -n 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.
(everse polarity destroys the regulator almost instantly. #ig7 ,.,.44 shows voltage regulator.
Resistors/
A resistor is a two"terminal electronic component that produces a voltage across its terminals
that is proportional to the electric current passing through it in accordance with <hm;s law7
V P IR
(esistors are elements of electrical networks and electronic circuits and are ubi9uitous in most
electronic e9uipment. 'ractical resistors can be made of various compounds and films as well as
resistance wire $wire made of a high"resistivity alloy such as nickelFchrome+.
The primary characteristics of a resistor are the resistance the tolerance ma%imum working
voltage and the power rating. <ther characteristics include temperature coefficient noise and
inductance. Less well"known is critical resistance the value below which power dissipation limits the
ma%imum permitted current flow and above which the limit is applied voltage. 0ritical resistance is
determined by the design materials and dimensions of the resistor. (esistors can be made to control
SPHOORTHY ENGINEERING COLLEGE (ECE) 37
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
the flow of current to work as Loltage dividers to dissipate power and it can shape electrical waves
when used in combination of other components. Basic unit is ohms.
Power dissi#"tion/
The power dissipated by a resistor $or the e9uivalent resistance of a resistor network+ is
calculated using the following7
3.&. LE/
A light"emitting diode $LED+ is a semiconductor light source. LED1s are used as indicator
lamps in many devices and are increasingly used for lighting. -ntroduced as a practical electronic
component in 4A5= early LED1s emitted low"intensity red light but modern versions are available
across the visible ultraviolet and infrared wavelengths with very high brightness. The internal
structure and parts of a led are shown below.

.ig 3.&.1/ Inside " LE .ig 3.&.2/ P"rts O1 " LE
@or5ing/
The structure of the LED light is completely different than that of the light bulb. Ama.ingly
the LED has a simple and strong structure. The light"emitting semiconductor material is what
determines the LED;s color. The LED is based on the semiconductor diode.
SPHOORTHY ENGINEERING COLLEGE (ECE) 38
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
!hen a diode is forward biased $switched on+ electrons are able to recombine with holes
within the device releasing energy in the form of photons. This effect is called electroluminescence
and the color of the light $corresponding to the energy of the photon+ is determined by the energy gap
of the semiconductor. An LED is usually small in area $less than 4 mm
=
+ and integrated optical
components are used to shape its radiation pattern and assist in reflection. LED1s present many
advantages over incandescent light sources including lower energy consumption longer lifetime
improved robustness smaller si.e faster switching and greater durability and reliability. @owever
they are relatively e%pensive and re9uire more precise current and heat management than traditional
light sources. 0urrent LED products for general lighting are more e%pensive to buy than fluorescent
lamp sources of comparable output. They also enjoy use in applications as diverse as replacements for
traditional light sources in automotive lighting $particularly indicators+ and in traffic signals. The
compact si.e of LED1s has allowed new te%t and video displays and sensors to be developed while
their high switching rates are useful in advanced communications technology. The electrical symbol
and polarities of led are shown in fig7 ,.>.,.
.ig 3.&.3/ Electric"l ,$!2ol A Pol"rities o1 LE
LED lights have a variety of advantages over other light sources7
@igh"levels of brightness and intensity
@igh"efficiency
Low"voltage and current re9uirements
Low radiated heat
SPHOORTHY ENGINEERING COLLEGE (ECE) 39
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
@igh reliability $resistant to shock and vibration+
8o DL (ays
Long source life
0an be easily controlled and programmed
Applications of LED fall into three major categories7
Lisual signal application where the light goes more or less directly from the LED to the
human eye to convey a message or meaning.
-llumination where LED light is reflected from object to give visual response of these objects.
&enerate light for measuring and interacting with processes that do not involve the human
visual system.
3.'/ LE 3otice +o"rd
3.'.1 One LE9 no resistor
- thought that - would start as simply as - possibly could " just one LED with no resistor. #irst -
had to decide what power source to use and which LED to light up. This may seem obvious but this
was my first time through so - might as well be as clear as possibleM
LEDs re9uire sufficient voltage to light them. )ometimes if you give them too little voltage
they wont light at all other times they will just shine dimly with low voltage. Too much voltage is bad
and can burn out the LED instantaneously. )o ideally you would like the voltage of the LED to match
the voltage of your power supply or even be slightly less. To do this you can do a couple of things7
change your power supply voltage change the LED your using or you can use a resistor that allows
you use a higher voltage power supply with a lower voltage LED.
SPHOORTHY ENGINEERING COLLEGE (ECE) 40
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
3.'.1 One LE9 no resistor
#or now - just wanted to get one lit up so - chose my the power supply that had the lowest
voltage " the single AA battery which outputs 4.?L. - chose to light the red 4.6L LED since the
battery outputs 4.?L and - knew - wouldn;t kill the LED with too much power. - wrapped my positive
wire from the battery to the positive electrode of the LED and wrapped the negative wire from the
battery to my negative electrode and presto " let there be LED lightZ This first e%periment was pretty
easy to do " just some wire twisting and enough knowledge to know that the 4.?L power supply
would light the 4.6L LED without need a resistor.
3.'.2 One LE with " resistor
-t was just a coincidence that - bought an LED that was 4.6L and that it ended up working
being able to be powered by my 4.?L power supply without the use of a resistor. #or this second setup
- decided to use the same LED but up my power supply to the three AA batteries wired together
which output >.?L " enough power to burn out my 4.6L LED so - would have to use a resistor.
SPHOORTHY ENGINEERING COLLEGE (ECE) 41
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
3.'.2 One LE with " resistor
To figure out which resistor to use - used the formula7
( P $L4 " L=+ F -
where7
L4 P power supply voltage
L= P LED voltage
. - P LED current $usually =BmA which is .B=A+.
8ow there are lots of calculators online that will do this for you " and many other
instructorless reference this as a good one however the math really isn;t too hard and so -
wanted to go through the calculation myself and understand whets going on.
Again my LED is 4.6L it takes =BmA $which is .B= A+ of current and my supply is
>.?L. )o the math is...
( P $>.?L " 4.6L+ F .B= A
( P 4>B ohms
<nce - knew that - needed a resistor of 4>B ohms to get the correct amount of
voltage to the LED - looked into my assortment package of resistors to see if - could find the
right one.
Snowing the value of a resistor re9uires reading the code from the color bands on the resistor
itself. The package didn;t come with a 4>B ohm resistor but it did come with a 4?B ohm one. -t1s
always better to use the ne%t closest value resistor greater than what you calculated. Dsing a lower
value could burn out your LED. To figure out the color code you basically break down the first two
digits of the resistor value use the third digit to multiply the first two by and then assign the fourth
digit as an indicator of tolerance. That sounds a lot more difficult than it really is.

Dsing the color to number secret decoder website found here a 4?Bohm resistor should have the
following color code. Brown because the first digit in the value resistor - needed is 4
&reen because the fifth digit is ? Brown because in order to get to 4?B you have to add one B to 4? to
get to 4?B. &old " the resistors - got all have ?[ tolerance and ?[ is represented by gold
- looked through all the resistors found the one that was brown green brown gold and wired
it in line on the positive electrode of the LED. $!henever using a resistor on an LED it should get
placed before the LED on the positive electrode+. Low and behold the LED lit up once again. The
SPHOORTHY ENGINEERING COLLEGE (ECE) 42
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
4?B ohm resistor stopped enough of the >.?L power supply from reaching the 4.6L LED that it lit up
safely and kept it from burning out. This is just the process that - went through to figure out what
resistor to use with my particular LED with my particular power supply. You can easily use the
formula above to figure out what value resistor to use with whatever LED and power source you
happen to be using.

3.'.3 *ulti#le LEs in series
!hen it comes to wiring more than one LED to a power supply there are two options. The first
option is to wire them in series and the second is to wire them in parallel. To see an in depth
e%planation about the difference between series and parallel check out this page. -;m going to cover
wiring LEDs in series first. LEDs wired in series are connected end to end $the negative electrode of
the first LED connects to the positive electrode of the second LED and the negative electrode of the
second LED connects to the positive electrode of the third LED and so on and so on...+. The main
advantage of wiring things in series is that it distributes the total voltage of the power source between
all of the LEDs. !hat that means is that if - had a 4=L car battery - could power > ,L LEDs
$attaching a resistor to each of them+. @ypothetically this could also work to power 4= 4L LEDsK 5
=L LEDsK or even 4 4=L LED if such a thing e%isted.
SPHOORTHY ENGINEERING COLLEGE (ECE) 43
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
(P$AL"?.=L+.B=A
(P4AB<hms
8ow the variety package of resistors didn;t come with a 4AB or =BB <hm resistor but it did
come with other resistors which - could use to make a =BB <hm resistor. Eust like LEDs resistors can
be wired together in either series or parallel. !hen same value resistors are wired together in series
you add their resistance. !hen same value resistors are wired together in parallel you divide the value
of the resistor by the number of resistors wired together.
)o in the most simplified sense two 4BB <hm resistors wired together in series will e9ual 4
=BB <hm resistor $4BB \ 4BB P =BB+. Two 4BB <hm resistors wired together in parallel will e9ual one
?B <hm resistor $4BB F = P ?B+.
Dnfortunately - learned this key point after - wired my resistors together for the e%periment. -
had originally wanted to wire two 4BB <hm resistors together to e9ual the =BB <hms of resistance -
needed to protect my LEDs. -nstead of wiring them in series as it should have been - wired my
resistors in parallel $did - mention - am beginner with resistors]+ )o my resistors were only providing
?B <hms of resistance " which apparently worked out <S on my LEDs in the short duration of the
e%periment. @aving too much power getting to the LEDs would probably burn them out in the long
term. $Thanks beanwaur and shark?BB for pointing this out.+
- took my resistors and placed them in front of the positive lead of the first LED that was wired
in series and hooked them up to the battery and once again there was LED lightZ !ith three different
combinations of LEDs and battery power supplies and no puffs of plastic smoke yet things were
looking good " aside from my little confusion between wiring resistors in series and in parallel.
3.( +u;;er
A bu..er or beeper is an audio signaling device which may be magnetic or pie.oelectric.
1. *"gnetic Tr"nsducer
*agnetic transducers contain a magnetic circuit consisting of an iron core with a wound coil
and a yoke plate a permanent magnet and a vibrating diaphragm with a movable iron piece. The
diaphragm is slightly pulled towards the top of the core by the magnet;s magnetic field. !hen a
positive A0 signal is applied the current flowing through the e%citation coil produces a fluctuating
magnetic field which causes the diaphragm to vibrate up and down thus vibrating air. (esonance
SPHOORTHY ENGINEERING COLLEGE (ECE) 44
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
amplifies vibration through resonator consisting of sound hole$s+ and cavity and produces a loud
sound.
2. *"gnetic +u;;er 8,ounderB
Bu..ers like the T*B"series are magnetic audible signal devices with built"in oscillating
circuits. The construction combines an oscillation circuit unit with a detection coil a drive coil and a
magnetic transducer. Transistors resistors diodes and other small devices act as circuit devices for
driving sound generators. !ith the application of voltage current flows to the drive coil on primary
side and to the detection coil on the secondary side. The amplification circuit including the transistor
and the feedback circuit causes vibration. The oscillation current e%cites the coil and the unit
generates an A0 magnetic field corresponding to an oscillation fre9uency. This A0 magnetic field
magneti.es the yoke comprising the magnetic circuit. The oscillation from the intermittent
magneti.ation prompts the vibration diaphragm to vibrate up and down generating bu..er sounds
through the resonator.
3.(.1 +u;;er
SPHOORTHY ENGINEERING COLLEGE (ECE) 45
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
3.(.2 +u;;er structure
,#eci1ic"tions
R"ted ?olt"ge7 A magnetic bu..er is driven by 4F= s9uare waves$Lo"p+.
O#er"ting ?olt"ge7 #or normal operating. But it is not guaranteed to make the minimum )ound
'ressure Level $)'L+ under the rated voltage.
Consu!#tion Current7 The current is stably consumed under the regular operation. @owever it
normally takes three times of current at the moment of starting to work.
irect Current Resist"nce7 The direct current resistance is measured by ammeter directly.
,ound Out#ut7 The sound output is measured by decibel meter. Applying rated voltage and 4F=
s9uare waves and the distance of 4B cm.
R"ted .reCuenc$7 A bu..er can make sound on any fre9uencies but we suggest that the highest and
the most stable )'L comes from the rated fre9uency.
O#er"ting Te!#. 7 Seep working well between ",B and \6B.
@ow to choose7
riving !ethods7 AO series with built drive circuit will be the best choice when we cannot provide
fre9uency signal to a bu..er it only needs direct current.
i!ension7 Dimension affects fre9uency small si.e result in high fre9uency.
?olt"ge7 Depend on L o"p $4F= s9uare waves+
.i0ed !ethods7 #rom the highest cost to the lowest" D-' wiresF connector )*D.
,oldering !ethods7 A) series is soldered by hand the fre9uency is lower because of the holes on the
bottom. <n the other hand we suggest A0 series for the reflow soldering the reliability is better.
How to choose " 2u;;er
There are many different kinds of bu..er to choose first we need to know a few parameters such as
voltage current drive method dimension mounting type and the most important thing is how much
SPHOORTHY ENGINEERING COLLEGE (ECE) 46
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
)'L and fre9uency we want.
O#er"ting volt"ge/ 8ormally the operating voltage for a magnetic bu..er is from 4.?L to =>L for a
pie.o bu..er is from ,L to ==BL. @owever in order to get enough )'L we suggest giving at least AL
to drive a pie.o bu..er.
Consu!#tion current/ According to the different voltage the consumption current of a magnetic
bu..er is from do.ens to hundreds of mill amperesK oppositely the pie.o type saves much more
electricity only needs a few mill amperes and consumes three times current when the bu..er start to
work
riving !ethod/ Both magnetic and pie.o bu..er have self drive type to choose. Because of the
internal set drive circuit the self drive bu..er can emit sound as long as connecting with the direct
current. Due to the different work principle the magnetic bu..er need to be driven by 4F= s9uare
waves and the pie.o bu..er need s9uare waves to get better sound output.
i!ension/ The dimension of the bu..er affects its )'L and the fre9uency the dimension of the
magnetic bu..er is from 6 mm to =? mmK the pie.o bu..er is from 4= mm to ?B mm or even bigger.
Connecting w"$/ Dip type !ire type )*D type and screwed type for big pie.o bu..er are usually
seen.
,ound Pressure Level 8,PLB/ Bu..er is usually tested the )'L at the distance of 4B cm if distance
double the )'L will decay about 5 dBK oppositely the )'L will increase 5 dB when the distance is
shortened by one time. The )'L of the magnetic bu..er can reach to around N? dBF 4B cmK the pie.o
bu..er can be designed to emit very loud sound for e%ample the common siren are mostly made of
pie.o bu..er.
3. Pie;oelectric 2u;;ers/
'ie.oelectric bu..er comes under electronic type of bu..er which is horned by proper
electronic oscillatory circuit.
SPHOORTHY ENGINEERING COLLEGE (ECE) 47
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Basically the sound source of a pie.oelectric sound component is a pie.oelectric diaphragm.
A pie.oelectric diaphragm consists of a pie.oelectric ceramic plate which has electrodes on both sides
and a metal plate $brass or stainless steel etc.+.
A pie.oelectric ceramic plate is attached to a metal plate with adhesives. #ig. = shows the
oscillating system of a pie.oelectric diaphragm. Applying D.0. voltage between electrodes of a
pie.oelectric diaphragm causes mechanical distortion due to the pie.oelectric effect. #or a misshaped
pie.oelectric element the distortion of the pie.oelectric element e%pands in a radial direction. And the
pie.oelectric diaphragm bends toward the direction shown in #ig.= $a+. The metal plate bonded to the
pie.oelectric element does not e%pand. 0onversely when the pie.oelectric element shrinks the
pie.oelectric diaphragm bends in the direction shown in #ig.= $b+. Thus when A0 voltage is applied
across electrodes the bending shown in #ig.= $a+ and #ig.= $b+ is repeated as shown in #ig.= $c+
producing sound waves in the air.
SPHOORTHY ENGINEERING COLLEGE (ECE) 48
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY

-n general man;s audible fre9uency range is about =B @. to =B k@.. #re9uency ranges of =
k@. to > k@. are most easily heard. #or this reason most pie.oelectric sound components are used in
this fre9uency range and the resonant fre9uency $fB+ is generally selected in the same range too. As
shown in #ig. , the resonant fre9uency depends on methods used to support the pie.oelectric
diaphragm. -f pie.oelectric diaphragms are of the same shape their values will become smaller in the
order of $a+ $b+ and $c+. -n general the pie.oelectric diaphragm is installed in a cavity to produce high
sound pressure. The resonant fre9uency $fcav+ of the cavity in #ig. > is obtained from #ormula $4+
$@elmholt.;s #ormula+. )ince the pie.oelectric diaphragm and cavity have proper resonant
fre9uencies $fB+ and $fcav+ respectively sound pressure in specific fre9uencies can be increased and a
specific bandwidth can be provided by controlling both positions.
SPHOORTHY ENGINEERING COLLEGE (ECE) 49
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
^
,#eci1ic"tions/
R"ted ?olt"ge/ A pie.o bu..er is driven by s9uare waves $L p"p+.
O#er"ting ?olt"ge/ #or normal operating. But it is not guaranteed to make the minimum )'L under
the rated voltage.
Consu!#tion Current/ The current is stably consumed under the regular operation. @owever it
SPHOORTHY ENGINEERING COLLEGE (ECE) 50
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
normally takes three times of current at the moment of starting to work.
C"#"cit"nce/ A pie.o bu..er can make higher )'L with higher capacitance but it consumes more
electricity.
)ound <utput7 The sound output is measured by decibel meter. Applying rated voltage and s9uare
waves and the distance of 4B cm.
R"ted .reCuenc$/ A bu..er can make sound on any fre9uencies but we suggest that the highest and
the most stable )'L comes from the rated fre9uency.
O#er"ting Te!#./ Seep working well between ",B and \6B.
@ow to choose7
riving !ethods/ A_"%%%%)"% series with built drive circuit will be the best choice when we cannot
provide fre9uency signal to a bu..er it only needs direct current. Besides there are different tone
nature for you to choose such as continuous fast pulse and slow pulse.
i!ension/ Dimension affects fre9uency small si.e result in high fre9uency.
?olt"ge7 Driven by s9uare waves $L p"p+ the higher voltage results in the higher )'L.
Pin Pitch/ The numerous spec. for the pie.o bu..ers lead to the difficulty in finding a spec. in
facsimile therefore we suggest that you can firstly choose a spec. with the same pitch and similar
fre9uency.
Introduction o1 *icro ,#e"5er
@ow to choose7
The 1"ctors which "11ect the ,PL/ the
s9uare measure of diaphragm the amplitude
of vibration magnetic field intensity power
impedance resonant chamber the pattern
and the thickness of diaphragm and the
holes.
Power vs. ,PL/ )uppose all the conditions
are the same increasing the power dose not
mean the )'L will increase as well. !e
need to revise the diaphragm and the sound
coil to load the higher power but it leads to lower )'L instead.
i!ension vs. ,PL/ A larger speaker can vibrate more air therefore it provides higher )'L. -n
addition the thicker speaker can give wider amplitude of vibration which also leads to higher )'L.
SPHOORTHY ENGINEERING COLLEGE (ECE) 51
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Acoustics/ !hat we re9uest most is how much )'L a micro speaker can output.
*"tching/ -t will be better to provide the power slight higher than the rated power for the enlarged
circuit.
Xuestion for mechanism7
The volu!e o1 the reson"nt ch"!2er/ The general problem of the consuming products is that the
resonant chambers are not big enough. !e can only try to find space to enlarge the volume of the
resonant chamber.
,ound Hole/ *ust be more than 4FN of the diaphragm1s area at least.
Airtight/ The front and back sound fields of the speaker should be separated to avoid neutrali.ation.
,hoc5 "2sor2er/ !hen a speaker works the vibration will also happen at the same time. -n order to
reduce interference it will do good to have some material between speaker and case to absorb the
shock.
*ounting/ The speakers are usually fi%ed on the case. #irmly fi%ed is important especially for the
iron housing or the large si.e to avoid separating in the drop test.
How to choose the s#e"5er
i!ension/ To the micro speaker si.e has decisive influence on its volume. ?mm difference of
diameter might result in double or half area of diaphragm therefore the )'L is 9uite different.
Besides the thicker speaker has more space to vibrate the air and usually has bigger magnet so it will
be more powerful to push the air and emit louder sound.
Power/ *ainly refer to how much power can a speaker bear there is no direct relation to the )'L.
The speaker with larger power needs to use thicker diaphragm and sound coil to bear larger power
which will lead to lower efficiency $)'L+. Therefore according to the mechanical design try to select
a larger speaker which matches the outputting power from the amplified circuit then the best )'L
would be emitted.
I!#ed"nce/ @igher impedance can save more electricity however the )'L and the loaded power
will go down. The reason is that we have to use thinner wire or to coil more the front makes the
power lower and the after leads to heaviness and low efficiency. The material of diaphragm7 *ost
speakers $diameter less than ?Bmm+ use mylar diaphragms which are easily finished cheaper and
waterproof. @owever mylar diaphragm is not good at heatproof and the sound is stiff. The patterns of
diaphragm7 The speaker with concentric circles diaphragm is good for the speech sounds. &enerally
the )'L is good at the fre9uency before ?"5 S@. but will dramatically decrease after 5 S@.. <n the
other hand the speaker with radiate diaphragm has average fre9uency response. )upposing other
SPHOORTHY ENGINEERING COLLEGE (ECE) 52
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
conditions are all the same the )'L of radiate diaphragm will lower than the concentric circles one at
the fre9uency before 5 S@..
3.) +luetooth
+luetooth is "n o#en st"nd"rd s#eci1ic"tion 1or " r"dio 1reCuenc$ 8R.B42"sed9 short4
r"nge connectivit$ technolog$ that promises to change the face of computing and wireless
co!!unic"tion. -t is designed to be an ine%pensive wireless networking system for all classes of
portable devices such as laptops 'DAs $personal digital assistants+ and mobile phones. -t also will
enable wireless connections for desktop computers making connections between monitors printers
keyboards and the 0'D cable"free.
The idea of a cable"free or wireless technology was initially conceived by Ericsson in
1>>& when the company began a study to investigate the feasibility of a low"power low"cost radio
interface between mobile phones and their accessories. The company1s goal was to eliminate the need
for cables. The original idea was to create a small ine%pensive radio chip that could be used in mobile
computers printers mobile phones and so on to transmit data between these devices. The radio chip
of course would replace cables. The projected cost of the chip was around `? and it was to re9uire
low power so that it could be used in devices that rely on battery life.
As the idea grew a s#eci"l interest grou# 8,I6B was formed to create a standard for this
technology.
The original ,I6 formed in 1>>= consisted of 1ive companies7
Ericsson
-B*
-ntel
8okia
Toshiba
#our other major companies $*icrosoft ,0om Lucent and *otorola+ later joined this founding
group to form the +luetooth Pro!oter 6rou#. *any more companies have since become part of the
Bluetooth revolution e%panding on the original vision and helping drive the development of this new
technology.
The name Bluetooth comes from Danish history. @arald Blatand who was called +luetooth
was the son of Sing &orm the <ld who ruled Eutland the main peninsula of Denmark. By the time
@arald became king he was a skilled Liking warrior. )o when his sister asked for help to secure
SPHOORTHY ENGINEERING COLLEGE (ECE) 53
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
control in 8orway after her husband died @arald 9uickly sei.ed the opportunity to unite the countries
and e%pand his kingdom. By A5B A.D. according to the story @arald was at the height of his powers
and ruled both Denmark and 8orway. @e was later credited with bringing 0hristianity to his Liking
realm. Although it1s popularly believed that Sing @arald had a blue tooth and various stories e%plain
how this came about it1s more likely that the Bluetooth name is the English derivative of the original
Liking word Blatand. The +luetooth n"!e w"s chosen 1or the wireless technolog$ 2ec"use its
develo#ers "nd #ro!oters ho#e it will unite the !o2ile world9 just "s Ding H"r"ld united his
world.
+luetooth Co!#onents/
A complete Bluetooth system will re9uire these elements7
An (# portion for receiving and transmitting data
A module with a baseband microprocessor
*emory
An interface to the host device $such as a mobile phone+
+luetooth ter!inolog$/
The Bluetooth specification while innovative does not define a totally new technology. -n
fact Bluetooth draws heavily on e%isting radio communications and networking technologies which
enables it to be operationally compatible with the e%isting devices that also use these technologies.
*any of the various terms and concepts used in Bluetooth are borrowed from other areas and
included in the specification of Bluetooth1s elements such as baseband (# communications and
many of the upper" and lower"layer protocols. !hat makes Bluetooth uni9ue is how it applies its
proprietary components and the e%isting technologies to define its central core operations and its
application profiles. (egardless of their source the terms that are integral to Bluetooth are worth
e%amining a little more closely.
+luetooth st"c5/
As already noted the baseband or radio module is the hardware that enables wireless
communication between devices. The building block of this technology is the Bluetooth stack which
includes the hardware and software portions of the system. #igure shows a graphic representation of
the stack. Essentially the stack contains a physical"level protocol $baseband+ and a link level protocol
SPHOORTHY ENGINEERING COLLEGE (ECE) 54
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
$Link *anager 'rotocol or L*'+ with an adaptation layer $Logical Link 0ontrol and Adaptation
Layer 'rotocol or L=0A'+ enabling upper"layer protocols to interact with the lower layer.
The Bluetooth stack has the following components7
(# portion for reception and transmission
Baseband portion with microcontroller
Link control unit
Link manager to support lower"layer protocols
-nterface to the host device
@ost processor to support upper"layer protocols
L=0A' to support upper"layer protocols
The radio fre9uency $(#+ portion provides the digital signal processing component of the
system and the baseband processes these signals. The link controller handles all the baseband
functions and supports the link manager. -t sends and receives data identifies the sending device
performs authentication and determines the type of frame to use for sending transmissions. The link
controller also directs how devices listen for transmissions from other devices and can move devices
into power"saving modes.
The link manager located on top of the link controller controls setup authentication link
configuration and other low"level protocols. Together the baseband and the link manager establish
connections for the network.
SPHOORTHY ENGINEERING COLLEGE (ECE) 55
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
The host controller interface $@0-+ communicates the lower"layer protocols to the host device
$mobile computer or mobile phone for e%ample+. The host contains a processor the L=0A' which
supports the upper"layer protocols and communicates between upper and lower layers. The upper"
layer protocols consist of service"specific applications that must be integrated into the host
application.
Another element in the Bluetooth stack that relates to radio communications is the (#0<**
protocol which allows for the emulation of serial ports over the L=0A'.
The )ervice Discovery 'rotocol $)D'+ provides the means for Bluetooth applications to discover the
services and the characteristics of the available services that are uni9ue to Bluetooth.
The Bluetooth device manager provides for device in9uiry and connection management services.
Lin5s "nd ch"nnels
Links and channels are used to transmit data between Bluetooth units. #irst the links are
established. Bluetooth technology supports two link types7 synchronous connection"oriented $)0<+
and asynchronous connectionless $A0L+ links. The )0< links are used primarily for voice
communications. The A0L links are used for packet data. Bluetooth devices can use either link type
and can change link types during transmissions although an A0L link must be established before an
)0< link can be used. After the link has been established Bluetooth uses five logical channels to
transfer different types of information between devices7
Link control $L0+ manages the flow of packets over the link interface.
Link manager $L*+ transports link management information between participating
stations.
Dser asynchronous $DA+ carries user data.
Dser isochronous $D-+ carries user data.
Dser synchronous $D)+ carries synchronous $)0<+ data.
Protocols
Bluetooth protocols are sets of conventions that govern the transmittal of data in upper and lower
layers of the system. The lower"layer protocols pertain to establishing connections and the upper
layers correspond to specific types of applications.
SPHOORTHY ENGINEERING COLLEGE (ECE) 56
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
LI3D CO3TROL PROTOCOL
The link control protocol is responsible for delivery of the basic data elements. All packet
information is transmitted in a specific time"slot format $a single time slot in the Bluetooth system
lasts 5=? Ws+ and specific links are designed to transport a range of data types.
The Bluetooth link control protocol can be used to manage the associations and delivery of
information between the various units within a Bluetooth network. This format is used for both
synchronous $voice+ and asynchronous $data+ modes of operation with specific formats specified for
voice transport.
LI3D *A3A6ER PROTOCOL/
The link manager protocol $L*'+ is a command"response system for transmitting data. -t
transports packets through the Bluetooth baseband link protocol which is a time"slot"oriented
mechanism. L*' packets are limited in si.e to ensure that they fit into a single time slot. The format
of the protocol data unit $'DD+ is simple. Two fields are used7
The <p"0ode identifies the type and se9uence of the packet.
The content field contains application"specific information.
The L*' also specifies a collection of mandatory and optional 'DDs. Transmission and
reception of mandatory 'DDs must be supported. <ptional 'DDs don1t need to be implemented but
can be used as necessary.
The protocol se9uences are similar to client"server architectures with the e%change of
information following a similar re9uest"response pattern. -n general a single response 'DD is sent
upon receipt of the original re9uest. Because Bluetooth is an (# broadcast technology a set of re9uest
messages can be broadcast to all participants on a network. -n this case one re9uest can elicit several
responses.
Logical link and adaptation protocol $L=0A'+ enables transmission of data between upper and
lower layers of the stack. -t also enables support for many third"party upper"layer protocols such as
T0'F-'. -n addition L=0A' provides group management by mapping upper"layer protocol groups to
Bluetooth networks. -t also is a factor in ensuring interoperability among Bluetooth units by providing
application"specific protocols.
<ther protocols interfacing to the L=0A' include service discovery protocol $)D'+ radio
fre9uency communication $(#0<**+ telephony control protocol specification $T0)+ and -rDA
<bject E%change 'rotocol $-r<BEO+7
SPHOORTHY ENGINEERING COLLEGE (ECE) 57
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
,P provides service discovery specific to Bluetooth. That is one device can determine
the services available in another connected device by implementing the )D'.
R.CO** is a transport protocol that provides serial data transfer. -n other words it
enables legacy software applications to operate on a Bluetooth device.
TC, is for voice and data call control. -t provides group management capabilities and
allows for signaling unrelated to an ongoing call.
O+EE is a session protocol and for Bluetooth devices only connection"oriented <BEO is
supported. Three application profiles have been developed using <BEO7 synchroni.ation
$for phonebooks calendars messaging and so on+ file transfer between connected
devices and object push for business card support.
+luetooth 3etwor5ing
The Bluetooth technology provides both a point"to"point connection and a point"to"multipoint
connection. -n point"to"multipoint connections the channel is shared among several Bluetooth units.
-n point"to"point connections only two units share the connection.
Bluetooth protocols assume that a small number of units will participate in communications at
any given time. These small groups are called piconets and they consist of one master unit and up to
seven active slave units. The master is the unit that initiates transmissions and the slaves are the
responding units. This type of Bluetooth network can have only one master unit.
-f several piconets overlap a physical area and members of the various piconets communicate with
each other this new larger network is known as a scatternet. Any unit in one piconet can
communicate in a second piconet as long as it serves as master for only one piconet at a time.
+luetooth Conce#ts
Bluetooth is an emerging standard for wireless connectivity. -t specifies a system G not just a
radio G that encompasses the hardware software framework and interoperability re9uirements. And
the radio system is optimi.ed for mobility. -n other words Bluetooth primarily specifies a cable"
replacement technology that targets mobile users in the global marketplace.
SPHOORTHY ENGINEERING COLLEGE (ECE) 58
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
+luetooth connections/
The major difference between Bluetooth wireless connectivity and the cellular radio architecture
is that Bluetooth enables ad hoc networking. (ather than depending on a broadband system which
relies on terminals and base stations for maintaining connections to the network via radio links
Bluetooth implements peer"to"peer connectivity G no base stations or terminals are involved.
Dsing peer"to"peer connectivity Bluetooth technology simplifies personal area wireless connections
enabling all digital devices to communicate spontaneously. Early applications are e%pected to include
cable replacement for laptops 'DAs mobile phones and digital cameras.
Because Bluetooth supports voice transmissions headsets also are in line to become wireless. The
Bluetooth technology offers the following advantages7
LoiceFdata access points will allow for e%ample mobile phoneF-nternet connections.
0able is replaced by a Bluetooth chip that transmits information at a special radio
fre9uency to a receiver Bluetooth chip.
Ad hoc networking enables personal devices to automatically e%change information
and synchroni.e with each other. #or e%ample appointments made on a 'DA calendar
automatically appear on a desktop calendar as well.shows the three concepts that
distinguish Bluetooth technology from other wireless connections.
SPHOORTHY ENGINEERING COLLEGE (ECE) 59
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Reli"2le "nd secure tr"ns!issions
Bluetooth technology also provides fast secure voice and data transmissions. The range for
connectivity is up to 4B meters and line of sight is not re9uired. The Bluetooth radio unit
#unctions even in noisy radio environments ensuring audible voice transmissions in
severe conditions.
'rotects data by using error"correction methods.
'rovides a high transmission rate.
Encrypts and authenticates for privacy.
As with any wireless interface Bluetooth must address issues involving reliable delivery of
information. 8oise and interference from other -)* $-ndustrial )cientific and *edical+ band
transmissions for e%ample are factors that come into play. To help deliver accurate information
Bluetooth provides two error"correction mechanisms7 forward error correction $#E0+ and automatic
repeat re9uest $A(X+. Typically #E0 is applied to voice traffic for which the timeliness of the
delivery takes precedence over the accuracy G late voice traffic being unacceptable. A(X
mechanisms are used for data applications.
Because Bluetooth operates in the unlicensed -)* fre9uency band it competes with signals
from other devices such as garage door openers and microwave ovens. -n order for Bluetooth devices
to operate reliably each Bluetooth network is synchroni.ed to a specific fre9uency pattern. The
SPHOORTHY ENGINEERING COLLEGE (ECE) 60
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Bluetooth unit moves through 45BB different fre9uencies per second and the pattern is uni9ue to each
network.
Bluetooth also implements various security measures including authentication and encryption.
Authentication is used to verify the identity of the device sending information and encryption is used
to ensure the integrity of the data.
Low4#ower "rchitecture
Because Bluetooth is intended for mobile devices it implements low"power architecture in
which units move into lower"power modes when not actively participating on the network. Bluetooth
units also consume less power during operation. #or e%ample the Bluetooth radio consumes less than
, percent of the power that a mobile phone consumes.
6lo2"l co!#"ti2ilit$
Bluetooth architecture is compliant with global emissions rules operating on a globally
available fre9uency band $=.> &@. -)* band+ and the unlicensed portion of the radio fre9uency
spectrum. This ensures that Bluetooth devices will interact in the same way in any part of the world.
Bluetooth architecture also complies with airline regulations and is safe for use on airlines.
Developers of the technology work with the #AA EAA #00 airplane manufacturers and airlines to
ensure compliance.
Intero#er"2ilit$9 st"nd"rds9 "nd s#eci1ic"tions
Another key concept in the Bluetooth environment is the idea of interoperability among
Bluetooth units regardless of manufacturer. Because Bluetooth is an open specification for short range
wireless communication all Bluetooth products must conform to a standard. This ensures that
wireless connections will be globally available and Bluetooth units made anywhere in the world will
be able to connect with and communicate information and services to other Bluetooth devices.
To this end the Bluetooth )-& has developed detailed specifications for the hardware and software
elements of Bluetooth units. The specifications consist of 0ore and 'rofiles documentation. The 0ore
document discusses elements such as the radio baseband link manager and interoperability with
different communication protocols. The 'rofiles document delineates the protocols and procedures to
be used for specific classes of applications. The specifications are intended to prevent discrepancies in
end products due to different interpretations of the Bluetooth standard.
The )-& also has implemented a 9ualification process. This process defines criteria for Bluetooth
product 9ualification ensuring the Bluetooth standards are met in any product that sports the
Bluetooth name.
SPHOORTHY ENGINEERING COLLEGE (ECE) 61
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
CHAPTER &
,o1tw"re descri#tion
This project is implemented using following software1s7
E%press '0B C for designing circuit
'-0 0 compiler " for compilation part
'roteus 6 $Embedded 0+ C for simulation part
&.1 E0#ress PC+
Breadboards are great for prototyping e9uipment as it allows great fle%ibility to modify a
design when neededK however the final product of a project ideally should have a neat '0B few
cables and survive a shake test. 8ot only is a proper '0B neater but it is also more durable as there
are no cables which can yank loose.
E%press '0B is a software tool to design '0Bs specifically for manufacture by the company
E%press '0B $no other '0B maker accepts E%press '0B files+. -t is very easy to use but it does have
several limitations.
-t can be likened to more of a toy then a professional 0AD program.
-t has a poor part library $which we can work around+
-t cannot import or e%port files in different formats
-t cannot be used to make prepare boards for D-Y production
E%press '0B has been used to design many '0Bs $some layered and with surface"mount
parts. 'rint out '0B patterns and use the toner transfer method with an Etch (esistant 'en to make
boards. @owever E%press '0B does not have a nice print layout. @ere is the procedure to design in
E%press '0B and clean up the patterns so they print nicely.
SPHOORTHY ENGINEERING COLLEGE (ECE) 62
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
&.1.1 Pre#"ring E0#ress PC+ 1or .irst 7se/ E%press '0B comes with a less then e%citing list of
parts. )o before any project is started head over to Audio logic and grab the additional parts by
morsel pal and tangent and e%tract them into your E%press '0B directory. At this point start the
program and get ready to setup the workspace to suit your style.
0lick Liew "a <ptions. -n this menu setup the units for 2mm3 or 2in3 depending on how
you think and click 2see through the top copper layer3 at the bottom. The standard color scheme of
red and green is generally used but it is not as pleasing as red and blue.
&.1.2 The Inter1"ce
!hen a project is first started you will be greeted with a yellow outline. This yellow outline
is the dimension of the '0B. Typically after positioning of parts and traces move them to their final
position and then crop the '0B to the correct si.e. @owever in designing a board with a certain si.e
constraint crop the '0B to the correct si.e before starting.
#ig7 >.4 show the toolbar in which the each button has the following functions7
.ig &.1/ Tool 2"r necess"r$ 1or the inter1"ce
The select tool7 -t is fairly obvious what this does. -t allows you to move and manipulate
parts. !hen this tool is selected the top toolbar will show buttons to move traces to the top F
bottom copper layer and rotate buttons.
The .oom to selection tool7 does just that.
The place pad7 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. !hen
this tool is selected the top toolbar will give you a large selection of round holes s9uare holes
and surface mount pads.
SPHOORTHY ENGINEERING COLLEGE (ECE) 63
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
The place component7 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
ne%t to the component list. The components can always be rotated afterwards with the select
tool if the orientation is wrong.
The place trace7 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 -nsert 0orner in trace7 button does e%actly what it says. !hen 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.
&.1.3 esign Consider"tions/
Before starting a project there are several ways to design a '0B and one must be chosen to
suit the project1s needs.
)ingle sided or double sided]
!hen making a '0B you have the option of making a single sided board or a double sided
board. )ingle sided boards are cheaper to produce and easier to etch but much harder to design for
large projects. -f 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. !hile there1s technically nothing wrong with
this it should be avoided if the signal travelling over the traces is sensitive $e.g. audio signals+.
A double sided board is more e%pensive to produce professionally more difficult to etch on a
D-Y board but makes the layout of components a lot smaller and easier. -t should be noted that if a
trace is running on the top layer check with the components to make sure you can get to its pins
with a soldering iron.
SPHOORTHY ENGINEERING COLLEGE (ECE) 64
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
Large capacitors relays and similar parts which don1t have a%ial leads can 8<T have traces
on top unless boards are plated professionally.
!hen using a double sided board you must consider which traces should be on what side of
the board. &enerally 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.
)ome projects like power supplies or amps can benefit from having a solid plane to use for
ground. -n power supplies this can reduce noise and in amps it minimi.es the distance between
parts and their ground connections and keeps the ground signal as simple as possible. @owever
care must be taken with stubborn chips such as the T'A54=B amplifier from T-. The T'A54=B
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.
&.2 PIC Co!#iler
'-0 compiler is software used where the machine language code is written and compiled.
After compilation the machine source code is converted into he% code which is to be dumped into the
microcontroller for further processing. '-0 compiler also supports 0 language code.
-t1s important that you know 0 language for microcontroller which is commonly known as
Embedded 0. As we are going to use '-0 0ompiler hence we also call it '-0 0. The '0B '0* and
'0@ are separate compilers. '0B is for 4="bit opcodes '0* is for 4>"bitopcodes and '0@ is for 45"
bit opcode '-0 microcontrollers. Due to many similarities all three compilers are covered in this
reference manual. #eatures and limitations that apply to only specific microcontrollers are indicated
within. This allows developers to 9uickly design applications software in a more readable high"level
language. !hen compared to a more traditional 0 compiler '0B '0* and '0@ have some
limitations. As an e%ample of the limitations function recursion is not allowed.
This is due to the fact that the '-0 has no stack to push variables onto and also because of the
way the compilers optimi.e the code. The compilers can efficiently implement normal 0 constructs
inputFoutput operations and bit twiddling operations. All normal 0 data types are supported along
with pointers to constant arrays fi%ed point decimal and arrays of bits.
'-0 0 is not much different from a normal 0 program. -f you know assembly writing a 0
program is not a crisis. -n '-0 we will have a main function in which all your application specific
SPHOORTHY ENGINEERING COLLEGE (ECE) 65
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
work will be defined. -n case of embedded 0 you do not have any operating system running in there.
)o you have to make sure that your program or main file should never e%it. This can be done with the
help of simple while $4+ or for $KK+ loop as they are going to run infinitely. !e have to add header file for
controller you are using otherwise you will not be able to access registers related to peripherals.
binclude U45#6,.ha FF header file for '-0 45#6,::
&.3 Proteus
'roteus is software which accepts only he% files. <nce the machine code is converted into he%
code that he% code has to be dumped into the microcontroller and this is done by the 'roteus. 'roteus
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 he% file
from the pic compiler and dumps this he% file into the microcontroller which is to be programmed. As
the 'roteus programmer re9uires 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 e%ecuted to check any
errors and hence after the successful compilation of the program the program is dumped in to the
microcontroller using a dumper.
&.& Procedur"l ste#s 1or co!#il"tion9 si!ul"tion "nd du!#ing/
&.&.1 Co!#il"tion "nd si!ul"tion ste#s
#or '-0 microcontroller '-0 0 compiler is used for compilation. The compilation steps are as
follows7 <pen '-0 0 compiler.
You will be prompted to choose a name for the new project so create a separate folder where
all the files of your project will be stored choose a name and click save.
SPHOORTHY ENGINEERING COLLEGE (ECE) 66
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.ig &.1/ Picture o1 o#ening " new 1ile using PIC C co!#iler
0lick 'roject9 8ew and something the bo% named ;Te%t4; is where your code should be
written later.
8ow you have to click ;#ile )ave as; and choose a file name for your source code ending with
the letter ;.c;. You can name as ;project.c; for e%ample and click save. Then you have to add
SPHOORTHY ENGINEERING COLLEGE (ECE) 67
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
this file to your project work.
.ig &.2/ Picture o1 co!#iling " new 1ile using PIC C co!#iler
SPHOORTHY ENGINEERING COLLEGE (ECE) 68
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.ig &.3/ Picture o1 co!#iling " #roject.c 1ile using PIC C co!#iler
You can then start to write the source code in the window titled ;project.c; then before testing
your source codeK you have to compile your source code and correct eventual synta% errors.
SPHOORTHY ENGINEERING COLLEGE (ECE) 69
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.ig &.&/ Picture o1 chec5ing errors "nd w"rnings using PIC C co!#iler
By clicking on compile option .he% file is generated automatically.
This is how we compile a program for checking errors and hence the compiled program is
saved in the file where we initiated the program.
SPHOORTHY ENGINEERING COLLEGE (ECE) 70
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.ig &.'/ Picture o1 .he0 1ile e0isting using PIC C co!#iler
After compilation ne%t step is simulation. @ere first circuit is designed in E%press '0B
using 'roteus 6 software and then simulation takes place followed by dumping. The simulation steps
are as follows7
<pen 'roteus 6 and click on -)4)5.
8ow it displays '0B where circuit is designed using microcontroller. To design circuit
components are re9uired. )o click on component option.
SPHOORTHY ENGINEERING COLLEGE (ECE) 71
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
4B. 8ow click on letter 1p1 then under that select '-045#6, other components related to the project
and click <S. The '-0 45#6, will be called your 2'Target device, which is the final destination of
your source code.
&.&.2 u!#ing ste#s
The steps involved in dumping the program edited in proteus 6 to microcontroller are
shown below7
4. -nitially before connecting the program dumper to the microcontroller kit the window is
appeared as shown below.
.ig &.(/ Picture o1 #rogr"! du!#er window
SPHOORTHY ENGINEERING COLLEGE (ECE) 72
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
=. )elect Tools option and click on 0heck 0ommunication for establishing a connection as shown
in below window
.ig &.) Picture o1 chec5ing co!!unic"tions 2e1ore du!#ing #rogr"! into !icrocontroller
SPHOORTHY ENGINEERING COLLEGE (ECE) 73
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
,. After connecting the dumper properly to the microcontroller kit the window is appeared as
shown below.
&.
.ig &.=/ Picture "1ter connecting the du!#er to !icrocontroller
SPHOORTHY ENGINEERING COLLEGE (ECE) 74
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
>. Again by selecting the Tools option and clicking on 0heck 0ommunication the microcontroller
gets recogni.ed by the dumper and hence the window is as shown below.
.ig &.>/ Picture o1 du!#er recognition to !icrocontroller
SPHOORTHY ENGINEERING COLLEGE (ECE) 75
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
?. -mport the program which is /.he%1 file from the saved location by selecting #ile option and
clicking on /-mport @e%1 as shown in below window.
.ig &.1</ Picture o1 #rogr"! i!#orting into the !icrocontroller
SPHOORTHY ENGINEERING COLLEGE (ECE) 76
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
5. After clicking on /-mport @e%1 option we need to browse the location of our program and click the
/prog.he%1 and click on /open1 for dumping the program into the microcontroller.
.ig &.11/ Picture o1 #rogr"! 2rowsing which is to 2e du!#ed
6. After the successful dumping of program the window is as shown below.
SPHOORTHY ENGINEERING COLLEGE (ECE) 77
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
.ig &.12/ Picture "1ter #rogr"! du!#ed into the !icrocontroller
CHAPTER '
Project descri#tion
SPHOORTHY ENGINEERING COLLEGE (ECE) 78
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
-n this chapter schematic diagram and interfacing of '-045#6= microcontroller with each
module is considered.
'.1 Inter1"cing cr$st"l oscill"tor "nd reset 2utton with !icro controller
.ig '.1/ Inter1"cing cr$st"l oscill"tor "nd reset 2utton with !icro controller/
The above schematic diagram of e%plains the interfacing section of each component with micro
controller and '0 @yperTerminal. 0rystal oscillator connected to A
th
and 4B
th
pins of micro controller
and regulated power supply is also connected to micro controller and LED1s also connected to micro
controller through res
SPHOORTHY ENGINEERING COLLEGE (ECE) 79
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
The detailed e%planation of each module interfacing with microcontroller is as follows7
'.2 LE inter1"cing with PIC1(.)3
.ig '.2 LE inter1"cing with PIC !icrocontroller
'.3 +luetooth inter1"cing with PIC !icrocontroller
SPHOORTHY ENGINEERING COLLEGE (ECE) 80
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
1ig'.3/ +luetooth inter1"cing with PIC !icrocontroller
'.& Inter1"cing +u;;er with !icro controller
SPHOORTHY ENGINEERING COLLEGE (ECE) 81
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
'.& Android controlled scrolling LE !ess"ge
SPHOORTHY ENGINEERING COLLEGE (ECE) 82
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY

SPHOORTHY ENGINEERING COLLEGE (ECE) 83
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
CHAPTER (
Adv"nt"ges "nd dis"dv"nt"ges
Adv"nt"ges/
4. 0ontrolling of LED 8otice board operations is through a Android mobile.
=. !ireless communication using Bluetooth technology.
,. 8o need of training.
>. Efficient design.
?. Life time is more compared to e%isting devices.
5. Low power consumption.
is"dv"nt"ges/
4. Dealing with Bluetooth is sensitive.
=. Distance of 0ommunication between Bluetooth and mobile jest ,meters.
A##lic"tions/
4. This system can be practically implemented in real time to operate wireless LED display
=. This system can be used in schools display systems in railway stations airports etc.
SPHOORTHY ENGINEERING COLLEGE (ECE) 84
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
CHAPTER )
CO3CL7,IO3
).1 Result/
The project 2Android controlled scrolling LE !ess"ge dis#l"$3 is designed such
that it is used to control the LED 8otice board using wireless Bluetooth technology. -nstead of using
wire communication one can use this device from certain distance and can perform all the functions
that our voice commands sends to LED 8oticeboard wirelessly using Bluetooth module.
).2 Conclusion
-ntegrating features of all the hardware components used have been developed in it. 'resence
of every module has been reasoned out and placed carefully thus contributing to the best working of
the unit. )econdly using highly advanced -01s with the help of growing technology the project has
been successfully implemented. Thus the project has been successfully designed and tested.
).3 .uture ,co#e
<ur project 2Android controlled scrolling LE !ess"ge dis#l"$3 is mainly
intended to operate a LED 8otice board using a Bluetooth eliminating the use of generally used input
peripherals like !ires'01s. This project has a Bu..er and LED 8otice board to the micro controller
wirelessly using Bluetooth technology. -n future we can provide secrete code for Bluetooth to operate
from selected mobile phone. this is have high security in school LED 8otice board.
SPHOORTHY ENGINEERING COLLEGE (ECE) 85
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
RE.ERE3CE,
The sites which were used while doing this project7
4. www.wikipedia.com
=. www.allaboutcircuits.com
,. www.microchip.com
>. www.howstuffworks.com
+oo5s re1erred/
4. (aj kamal C*icrocontrollers Architecture 'rogramming -nterfacing and )ystem Design.
=. *a.idi and *a.idi CEmbedded )ystems.
,. '0B Design Tutorial CDavid.L.Eones.
>. '-0 *icrocontroller *anual C *icrochip.
?. Embedded 0 C*ichael.E.'ont.

SPHOORTHY ENGINEERING COLLEGE (ECE) 86
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY
APPE3IE
Progr"! Code
The program code which is dumped in the microcontroller of our project is shown below.
binclude U45#6,.ha
binclude Ustring.ha
buse delay $clockP=BBBBBBB+ FF=B *@. 0rystal fre9uency
buse rs=,= $baud P A5BB %mitP'-8QB4rcvP'-8QBBstreamPLEDQD-)'LAY+ FF)erial communication with LED
display
buse rs=,= $baud P A5BB %mitP'-8QABrcvP'-8QA4streamPBT+ FFBluetooth DA(T
void beep$int duration+
c
outputQhigh$'-8Q0>+K FFBu..er <8

delayQms$duration+K FFdelay in milli seconds

outputQlow$'-8Q0>+K FFBuu.er <##
d

void main$+
c
char noticeQdataHABIK FFfor storing data coming from Bluetooth *odule

outputQhigh$'-8Q0>+K FFBu..er <8

delayQms$4BBB+K FFdelay 4 second $4BBB milli seconds+
SPHOORTHY ENGINEERING COLLEGE (ECE) 87
ANDROID CONTROLLED SCROLLING LED MESSAGE DISPLAY

outputQlow$'-8Q0>+K FFBu..er <##

outputQhigh$'-8Q0,+K FFLED <8

delayQms$4BBB+K

outputQlow$'-8Q0,+K FFLED <##

delayQms$4BBB+K

outputQhigh$'-8Q0,+K

delayQms$4BBB+K

outputQlow$'-8Q0,+K


while$4+
c
fgets$noticeQdataBT+K FF&et string from Bluetooth *odule

outputQhigh$'-8Q0>+K FFLED flashes after receiving data from Bluetooth

delayQms$4BB+K FF4BB milli seconds

outputQlow$'-8Q0>+K FFLED off

sendQdataQtoQLEDQDisplay$+K FF)end data to LED display
d
d
SPHOORTHY ENGINEERING COLLEGE (ECE) 88

Potrebbero piacerti anche