Vous êtes sur la page 1sur 98

FREQUENCY LOCKED LOOP DC MOTOR SPEED

CONTROL AND MONITORING SYSTEM


A MAJOR PROJECT REPORT

Submitted by

CH.CHANDRA KANTH 16W91A0216

In partial fulfillment of the requirement for the degree

Of

BACHELOR OF TECHNOLOGY

in

ELECTRICAL AND ELECTRONICS ENGINEERING

Under the guidance of

Mrs.D.SWATHI M.Tech

Assistant professor

Malla Reddy Institute of Engineering and Technology

Maisammaguda, Dhulapally(post via Hakimpet), Sec-bad-500 014.


Affiliated to
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY
Hyderabad, Telangana.
Accredited by NBA & NAAC
May 2020.
Malla Reddy Institute of Engineering & Technology
(Sponsored by Malla Reddy Educational Society)
Affiliated to JNTU, Hyderabad, Accredited by NBA & NAAC
Maisammaguda, Dhulapally(post via Hakimpet), Sec-bad-500 014.
Phone: 040-65969674, Cell: 9348161223

BONAFIDE CERTIFICATE

Certified that the mini project entitled “FREQUENCY LOCKED LOOP DC MOTOR SPEED
CONTROL AND MONITORING SYSTEM”is the bonafide work done by

STUDENT NAME ROLL NUMBER

CH.CHANDRA KANTH 16W91A0216

Who carried out the Major-project work under our supervision and guidance

SIGNATURE SIGNATURE

Mrs.D.SWATHIM.Tech Dr.K.HANUMAJIPh.D

Assistant Professor Associate Professor

Internal guide Head of the Department

EEE Department EEE Department

M.R.I.E.T M.R.I.E.T

EXTERNAL EXAMINER
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to our Principal Dr M. ASHOK PhD, Malla
Reddy Institute of Engineering and Technology.

I would also like to thank all the other staff members for extending their help whenever
needed. I am thankful to our Director P. PRAVEEN REDDY Sir, for his valuable guidance and
support to complete this major project.

I mention my sincere gratitude to Associate Prof. Dr K. Hanumaji, HOD, Dept. of EEE


Malla Reddy Institute of Engineering and Technology, who helped me a lot in all the aspects.

I would like to express my sincere gratitude to my Project Co-Ordinator,


Mr. U. Lili Kumar, Asst. Prof., for helping me in carrying out the project work.

I express my deep sense of my sincere gratitude to Assistant.professor Mrs.D.SWATHI


who guided me in all the way to carry out this project.

STUDENT NAME ROLL NUMBER

CH.CHANDRA KANTH 16W91A0216


INDEX

CONTENTS PAGE NO
LIST OF FIGURES i

ABSTRACT iii

CHAPTER - 1 1-12
INTRODUCTION
1.1 Introduction to speed control 1
1.2 Introduction to embedded system 2
1.2.1 History 4
1.2.2 Tools 4
1.2.3 Resources 5
1.2.4 Real time issues 5
1.2.5 Need for embedded systems 5
1.2.6 Debugging 6
1.2.7 Reliability 7
1.2.8 Explanation of embedded systems 8
1.2.9 Stand Alone embedded systems 10
1.2.10 Real time embedded systems 11
1.2.11 Network Commutation embedded systems 11
1.2.12 Different types of Processing units 11
1.2.13 Characteristics of embedded systems 12

CHAPTER - 2 14-48
HARDWARE DESCRIPTION
2.1 Block diagram 14
2.2 Circuit diagram 15
2.3 Hardware used 16
2.4 Components Description 16
2.4.1 Transformer 16
2.4.2 Voltage Regulator 7805 19
2.4.3 Regulated Power Supply 20
2.4.4 Rectifiers 21
2.4.5 LED 22
2.4.6 IR Sensor 25
2.4.7 Liquid Crystal Display 29
2.4.8 Resistance & Variable Resistance 32
2.4.9 Capacitor 32
2.4.10 DC Motor 33
2.5 Components List 37
2.5.1 Diode 38
2.5.2 Resistors 38
2.5.3 Bluetooth module 40
2.5.4 Battery power supply 45
2.6 Pluse Width Modulation 46
2.6.1 PWM Controllers 48

CHAPTER - 3 49- 66
SOFTWARE DESCRIPTION
3.1 Arduino Uno 49
3.1.1 Introduction 49
3.1.2 Arduino working system 50
3.1.3 Trouble Shooting 51
3.2 Microcontroller 51
3.2.1 Introduction to microcontroller 51
3.2.2 Crystal Oscillator 52
3.2.3 Architecture 53
3.2.4 Device Architecture 57
3.2.5 Program execution 59
3.2.6 MCU Speed 59
3.2.7 Features 59
3.2.8 Pin Diagram 63
3.2.9 Applications 66

CHAPTER - 4 67- 84
SOFTWARE ASPECT
4.1 Express PCB 67
4.1.1 Interface 68
4.1.2 Design Considerations 69
4.2 Arduino Compiling 71
4.2.1 Arduino Code 77
4.3 Proteus 81
4.3.1 Software Development Cycle 81
4.3.2 Compiling in windows environment 82
4.3.3 Program Loader 83

CHAPTER - 5 84-85
5.1 Advantages 84
5.2 Disadvantages 84
5.3 Applications 84
5.4 Precautions 84

CHAPTER - 6
RESULTS & ANALYSIS 86

CHAPTER – 7
CONCLUSION & FUTURE SCOPE 88

BIBLIOGRAPHY 89
LIST OF FIGURES

FIG.NO NAME OF THE FIGURE PAGE NO


1.1 Block diagram of embedded system 3
2.1 Block diagram of system 14
2.2 Circuit diagram of a system 15
2.3 Basic Transformer 17
2.4 Voltage regulator LM7805 19
2.5 Block diagram of Voltage regulator Lm7805 19
2.6 Block diagram of regulated power supply 20
2.7 Circuit diagram of regulated supply with load 21
2.8 Full wave bridge rectifier 22
2.9 Parts of LED 23
2.10 Electrical symbols & polarities of LED 24
2.11 Representation of LED 25
2.12 LCD Pin diagram 29
2.13 Pin description of LED 31
2.14 Variable resistor 32
2.15 Capacitor 32
2.16 DC motor 33
2.17 Simple electric diagram of DC motor 34
2.18 Operation of DC motor 34
2.19 L293D IC 36
2.20 L293D Pin diagram 36
2.21 Internal Structure of L293D 36
2.22 Hi- watt 9V battery 45
3.1 Arduino Uno board 50
3.2 Microcontroller 51
3.3 Crystal oscillator circuit 53
3.4 AVR Architecture 55

i
3.5 Device Architecture 56
3.6 Pin diagram of ATMEGA328 63
4.1 DC motor control by Android 86
4.2 Clockwise direction 86
4.3 Anti Clockwise direction 87

ii
ABSTRACT

The project reveals the digital closed loop control system for speed control of DC
motor using frequency locked loop System. In present days the power semiconductor devices have
completely revolutionized the control of drives especially in the area of control usage of thyristor’s
, IGBT power MOSFET etc., was increased

The digital circuit can be interfaced to microcontroller. So that the speed can be controlled by
Microcontroller there by making speed control of DC motor even more easily. Frequency locked
loop System. to the digital circuit drives the component correspondingly speed will change .

The project basically consists of micro controller MCS 51 series 89c52 and motor driver,
thermal sensor, comparator, key pad,16X2 dot matrix LCD display and rotation feedback sensor
(optical encoder). The program is written in micro controller to take the input values from the user,
then rotates the motor by placing 50% duty cycle pulse on the motor. The motor is rotated at X
RPM speed, can be detected by using feedback sensor and micro controller. If the speed is above
the specified speed then the micro controller continuously reduces the duty cycle till the speed
comes to a predetermined level. If the detected speed is less than the pre determined speed then
the micro controller continuously increases the duty cycle till the determined level. The micro
controller keeps on tracking the determined speed by varying duty cycle in a closed loop control
system.

iii
CHAPTER-1

INTRODUCTION:
This involves a micro controller based control system with an input reference
frequency and a feedback frequency (speed equivalent) from DC motor optical encoder. Optical
encoder is to detect speed of a DC motor and converts speed into equivalent frequency. Initially
DC motor tries to maintain the speed equivalent to the reference frequency, then onward the DC
motor will maintain constant speed at variables loads too.

This project makes use of a micro controller, which is programmed, with the help
of embedded C instructions. The Switches are provided to send the information to the
microcontroller (on board computer) and the controller judges whether the instruction is to
decrease or increase the speed of the fan. The controller is interfaced with fan whose speed is
either increased/decreased using switches. To perform the task, the controller is loaded with
intelligent program written using Embedded C language.

1.1 INTRODUCTION TO SPEED CONTROL:


Speed control means intentional change of drive speed to a value required for
performing the specific work process. This concept of speed control or adjustment should not be
taken to include the natural change in speed which occurs due to change in the load on the shaft.

Any given piece of industrial equipment may have its speed change or Adjusted
mechanically by means of stepped pulleys, sets of change gears, variable speed friction clutch
mechanism and other mechanical devices. Historically it is proved to be the first step in
transition from non adjustable speed to adjustable speed drive. The electrical speed control has
many economical as well as engineering advantages over mechanical speed control

The nature of the speed control requirement for an industrial drive depends upon its
type. Some drives may require continues variation of speed for the whole of the range from zero
to full speed or over a portion of this range, while the others may require two or more fixed
speeds

DEPT OF EEE 1 MRIET


1.2 INTRODUCTION TO EMBEDDED SYSTEMS:
In our present work we have used a combination of hardware and software which
forms as embedded system.

An embedded system is a computer system designed to perform one or a few


dedicated functions often with real-time computing constraints. It 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 (PC), is designed to be flexible 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 (DSP). The key characteristic,
however, is being dedicated to handle a particular task, which may require very powerful
processors. For example, 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.)

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

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

What is embedded system?

An embedded system is one kind of a computer system mainly designed to perform


several tasks like to access, process, store and also control the data in various electronics-based
systems. Embedded systems are a combination of hardware and software where software
is usually known as firmware that is embedded into the hardware. One of its most important

DEPT OF EEE 2 MRIET


characteristics of these systems is, it gives the o/p within the time limits. Embedded systems
support to make the work more perfect and convenient. So, we frequently use embedded systems
in simple and complex devices too. The applications of embedded systems mainly involve in our
real life for several devices like microwave, calculators, TV remote control, home security and
neighborhood traffic control systems, etc.

Embedded system design cycle :

Fig 1.1Block diagram of embedded system

DEPT OF EEE 3 MRIET


1.2.1 HISTORY :

In the earliest years of computers in the 193040s, computers were sometimes


dedicated to a single task, but were far too large and expensive for most kinds of tasks performed
by embedded computers of today. Over time however, the concept of programmable controllers
evolved from traditional electromechanical sequencers, via solid state devices, to the use of
computer technology.

One of the first recognizably modern embedded systems was the Apollo Guidance
Computer, developed by Charles Stark Draper at the MIT Instrumentation 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 size
and weight. An early mass-produced embedded system was the Autonetics D-17 guidance
computer for the Minuteman missile, released in 1961. It was built from transistor logic and had
a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17
was replaced with a new computer that was the first high-volume use of integrated circuits.

1.2.2 TOOLS :

Embedded development makes up a small fraction of total programming.


There's also a large number of embedded architectures, unlike the PC world where 1 instruction
set rules, and the UNIX world where there's only 3 or 4 major ones. This means that the tools are
more expensive. It also means that they're lowering featured, and less developed. On a major
embedded project, at some point you will almost always find a compiler bug of some sort.

Debugging tools are another issue. Since you can't always run general programs
on your embedded processor, you can't always run a debugger on it. This makes fixing your
program difficult. Special hardware such as JTAG ports can overcome this issue in part.
However, if you stop on a breakpoint when your system is controlling real world hardware (such
as a motor), permanent equipment damage can occur. As a result, people doing embedded
programming quickly become masters at using serial IO channels and error message style
debugging.

DEPT OF EEE 4 MRIET


1.2.3 RESOURCES :

To save costs, embedded systems frequently have the cheapest processors that
can do the job. This means your programs need to be written as efficiently as possible. When
dealing with large data sets, issues like memory cache misses that never matter in PC
programming can hurt you. Luckily, this won't happen too often- use reasonably efficient
algorithms to start, and optimize only when necessary. Of course, normal profilers won't work
well, due to the same reason debuggers don't work well.

Memory is also an issue. For 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 PC programs, you will frequently sacrifice processor time for
memory, rather than the reverse). It also means you can't afford to leak memory. Embedded
applications generally use deterministic memory techniques and avoid the default "new" and "m
alloc" functions, so that leaks can be found and eliminated more easily. Other resources
programmers expect may not even exist. For example, most embedded processors do not have
hardware FPUs (Floating-Point Processing Unit). These resources either need to be emulated in
software, or avoided altogether.

1.2.4 REAL TIME ISSUES :

Embedded systems frequently control hardware, and must be able to respond to


them in real time. Failure 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 prioritize some tasks over others, and to be able
to put off/skip low priority tasks such as UI in favor of high priority tasks like hardware control.

1.2.5 NEED FOR EMBEDDED SYSTEMS :

The uses of embedded systems are virtually limitless, because every day new
products are introduced to the market that utilizes embedded computers in novel ways. In recent
years, hardware such as microprocessors, microcontrollers, and FPGA chips have become much
cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip and
write your own custom software for it. Producing a custom-made chip to handle a particular task

DEPT OF EEE 5 MRIET


or set of tasks costs far more time and money. Many embedded computers even come with
extensive libraries, so that "writing your own software" becomes a very trivial task indeed. From
an implementation viewpoint, there is a major difference between a computer and an embedded
system. Embedded systems are often required to provide Real-Time response. The main
elements that make embedded systems unique are its reliability and ease in debugging.

1.2.6 DEBUGGING :

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


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

 Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
 External debugging using logging or serial port output to trace operation using either a
monitor in flash or using a debug server like the Remedy Debugger which even works for
heterogeneous multi core systems.
 An in-circuit debugger (ICD), a hardware device that connects to the microprocessor via
a JTAG or Nexus interface. This allows the operation of the microprocessor to be
controlled externally, but is typically restricted to specific debugging capabilities in the
processor.
 An in-circuit emulator replaces the microprocessor with a simulated equivalent,
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 PC.
 Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.

Because an embedded system is often composed of a wide variety of elements, the


debugging strategy may vary. For instance, debugging software(and microprocessor) centric
embedded system is different from debugging an embedded system where most of the
processing is performed by peripherals (DSP, FPGA, co-processor). An increasing number of

DEPT OF EEE 6 MRIET


embedded systems today use more than one single processor core. A common problem with
multi-core development is the proper synchronization of software execution. In such a case,
the embedded system design may wish to check the data traffic on the busses between the
processor cores, which requires very low-level debugging, at signal/bus level, with a logic
analyzer, for instance.

1.2.7 RELIABILITY :

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

Specific reliability issues may include:

 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples 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.
Often backup s are selected by an operator. Examples include aircraft navigation, reactor
control systems, safety-critical chemical factory controls, train signals, engines on single-
engine aircraft.
 The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.
 A variety of techniques are used, sometimes in combination, to recover from errorsboth
software bugs such as memory leaks, and also soft errors in the hardware:
 Watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 Subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure
& reliable system environment

DEPT OF EEE 7 MRIET


 An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.
 Immunity Aware Programming

1.2.8 EXPLANATION OF EMBEDDED SYSTEMS :

SOFTWARE ARCHITECTURE :

There are several different types of software architecture in common use

 Simple Control Loop:

In this design, the software simply has a loop. The loop calls subroutines, each of which manages
a part of the hardware or software.

 Interrupt Controlled System:

Some 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 example by a timer in a predefined frequency, or by a serial port controller
receiving a byte. These kinds of systems are used if event handlers need low latency and the
event handlers are short and simple.

Usually these kinds of systems run a simple task in a main loop also, but this task
is not very sensitive to unexpected delays. Sometimes the interrupt handler will add longer tasks
to a queue structure. Later, after the interrupt handler has finished, these tasks are executed by
the main loop. This method brings the system close to a multitasking kernel with discrete
processes.

 Cooperative Multitasking:

A non-preemptive multitasking system is very similar to the simple control


loop scheme, except that the loop is hidden in an API. The programmer defines a series of tasks,
and each task gets its own environment to run in. When a task is idle, it calls an idle routine,

DEPT OF EEE 8 MRIET


usually called pause, wait, yield, nop (stands for no operation), etc.The advantages and
disadvantages are very similar to the control loop, except that adding new software is easier, by
simply writing a new task, or adding to the queue-interpreter.

 Premitive multitasking :

In 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 required, it introduces more or less of the complexities of managing multiple
tasks running conceptually in parallel.

As any code can potentially damage the data of another task (except in larger
systems using an MMU) programs must be carefully designed and tested, and access to shared
data must be controlled by some synchronization strategy, such as message queues, semaphores
or a non-blocking synchronization scheme.

Because of these complexities, it is common for organizations 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 systems; smaller systems often cannot
afford the overhead associated with a generic real time system, due to limitations regarding
memory size, performance, and/or battery life.

 Microkernels And Exokernels:

A microkernel is a logical step up from a real-time OS. The usual arrangement is


that the operating system kernel allocates memory and switches the CPU to different threads of
execution. User mode processes implement major functions such as file systems, network
interfaces, etc

In general, microkernels succeed when the task switching and intertask communication is fast,
and fail when they are slow. Exokernels communicate efficiently by normal subroutine calls. The
hardware and all the software in the system are available to, and extensible by application
programmers. Based on performance, functionality, requirement the embedded systems are
divided into three categories:

DEPT OF EEE 9 MRIET


1.2.9 STAND ALONE EMBEDDED SYSTEMS:

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. Such embedded systems comes under stand alone embedded systems

Eg: microwave oven, air conditioner etc..

1.2.10 REAL TIME EMBEDDED SYSTEMS :

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.

 Hard Real-time embedded systems:

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 equipment.

Eg: consider a system in which we have to open a valve within 30 milliseconds. If this valve is
not opened in 30 ms this may cause damage to the entire equipment. So in such cases we use
embedded systems for doing automatic operations.

 Soft Real Time embedded systems:

Eg: Consider a TV remote control system, if the remote control takes a few milliseconds delay it
will not cause damage either to the TV 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.

1.2.11 NETWORK COMMUNICATION EMBEDDED SYSTEMS :

A wide range network interfacing communication is provided by using embedded


systems.

Eg:

DEPT OF EEE 10 MRIET


 Consider 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.
 Consider a web camera that is connected at the door lock.

Whenever 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.

1.2.12 DIFFERENT TYPES OF PROCESSING UNITS :

The central processing unit (c.p.u) can be any one of the following microprocessor,
microcontroller, digital signal processing.

 Among these Microcontroller 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
external components that are connected to it are very less according to the application.
 Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor requires
many external 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

DEPT OF EEE 11 MRIET


1.2.13 CHARACTERISTICS OF EMBEDDED SYSTEM :

Embedded systems come in a variety of shapes and sizes, from the largest multiple-
rack data storage or networking power houses to tiny modules such as your personal MP3 player
or cellular handset. Following are some of the usual characteristics of an embedded system:

 Contains a processing engine, such as a general-purpose microprocessor


 Typically designed for a specific application or purpose
 Includes a simple (or no) user interface, such as an automotive engine ignition controller
 Often is resource-limited. For example, it might have a small memory foot-print and no
hard drive
 Might have power limitations, such as a requirement to operate from batteries
 Not typically used as a general-purpose computing platform
 Generally has application software built in, not user-selected
 Ships with all intended application hardware and software pre-integrated
 Often is intended for applications without human intervention.

Most commonly, embedded systems are resource-constrained compared to the typical


desktop PC. Embedded systems often have limited memory, small or no hard-drives, and
sometimes no external network connectivity. Frequently, the only user interface is a serial
port and some LEDs. These and other issues can present challenges to the embedded system
developer. With advancements in IOT, embedded systems are getting much more complex.

APPLICATIONS :

Some applications of embedded system are as follows:

 Military and aerospace.


 Communication systems.
 Industrial automation and process control software.
 Product designing.
 Real time processing of ever increasing amount of data.

DEPT OF EEE 12 MRIET


DEPT OF EEE 13 MRIET
CHAPTER – 2

HARDWARE DESCRIPTION :

Introduction :
In this chapter the block diagram of the project and design aspect of independent modules are
considered. Block diagram is shown in fig

BLOCK DIAGRAM :

Fig 2.1 BLOCK DIAGRAM OF SYSTEM

DEPT OF EEE 14 MRIET


2.2 CIRCUIT DIAGRAM :

Fig 2.2 CIRCUIT DIAGRAM OF A SYSTEM

DEPT OF EEE 15 MRIET


2.3 HARDWARE USED :

1. Transformer

2. Voltage regulator

3. Rectifier

4. Arduino UNO

5. Diode IN4007

6. Resistor

7. Capacitor

8. Push button

9. LCD

10. LED

11. IR sensor

12. Motor Drive

2.4 COMPONENTS DISCRIPTION :

2.4.1 Transformer :

An electrical transformer works on the principle of Mutual Induction,


which states that a uniform change in current in a coil will induce an E.M.F in the other coil
which is inductively coupled to the first coil.

In its basic form, a transformer consists of two coils with high mutual inductance
that are electrically separated but have common magnetic circuit. The following image shows the
basic construction of a Transformer.

DEPT OF EEE 16 MRIET


Fig 2.3Basic Transformer

How Transformer Works?

The first set of the coil, which is called as the Primary Coil or Primary Winding, is
connected to an alternating voltage source called Primary Voltage.

Vbb The other coil, which is called as Secondary Coil or Secondary Winding, is
connected to the load and the load draws the resulting alternating voltage (stepped up or step
down voltage).

The alternating voltage at the input excites the Primary Winding, an alternating current
circulates the winding. The alternating current will result in an alternating magnetic flux, which
passes through the iron magnetic core and completes its path.

DEPT OF EEE 17 MRIET


Since the secondary winding is also linked to the alternating magnetic flux, according
to Faraday’s Law, an E.M.F is induced in the secondary winding. The strength of the voltage at
the secondary winding is dependent on the number of windings through which the flux gets
passed through.

Thus, without making an electrical contact, the alternating voltage in the primary
winding is transferred to the secondary winding.

NOTE: Depending on the construction of the transformer, the voltage at the secondary of the
transformer may be equal, higher or lower than that at the primary of the transformer but the time
period of the voltage i.e. its frequency will not change.

Relation between Voltage and Turns

Let NP be the number of turns of the coil in the Primary Winding and NS be the
number of turns of the coil in the Secondary Winding.

If the alternating voltage at the primary side of the transformer is VP and the alternating voltage
at the secondary side of the transformer is VS, then the relation between the voltages at primary
and secondary and number of turns of the coil in primary and secondary is given as follows.

DEPT OF EEE 18 MRIET


2.4.2 VOLTAGE REGULATOR 7805 :

Fig 2.4 voltage regulator LM7805

Voltage sources in a circuit may have fluctuations resulting in not providing fixed
voltage outputs. A voltage regulator IC maintains the output voltage at a constant value. 7805 IC,
a member of 78xx series of fixed linear voltage regulators used to maintain such fluctuations, is a
popular voltage regulator integrated circuit (IC).The xx in 78xx indicates the output voltage it
provides. 7805 IC provides +5 volts regulated power supply with provisions to add a heat sink.

 INTERNAL BLOCK DIAGRAM OF VOLTAGE REGULATOR IC:

DEPT OF EEE 19 MRIET


Fig 2.5 Block diagram of voltage regulator LM7805

2.4.3 REGULATED POWER SUPPLY :

Introduction:

Power supply is a supply of electrical power. A device or system that supplies


electrical or other types of energy to an output load or group of loads is called a power supply
unit or PSU. The term is most commonly applied to electrical energy supplies, less often to
mechanical ones, and rarely to others.

A power supply may include a power distribution system as well as primary


or secondary sources of energy such as conversion of one form of electrical power to another
desired form and voltage, typically involving converting AC line voltage to a well-regulated
lower-voltage DC for electronic devices. Low voltage, low power DC power supply units are
commonly integrated with the devices they supply, such as computers and household electronics.

Fig 2.6 Block diagram of regulated power supply

DEPT OF EEE 20 MRIET


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

Fig 2.7 Circuit diagram of regulated supply with load

2.4.4 RECTIFIERS :

A rectifier is an electrical device that converts alternating current (AC) to


direct current (DC), a process known as rectification. Rectifiers have many uses including as
components of power supplies and as detectors of radio signals. Rectifiers may be made of solid-
state diodes, vacuum tube diodes, mercury arc valves, and other components.

A device that it can perform the opposite function (converting DC to AC) is


known as an inverter.

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

DEPT OF EEE 21 MRIET


FULL WAVE BRIDGE RECTIFIER :

The Bridge rectifier circuit is shown in Fig: 4.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.

Fig 2.8 Full wave bridge rectifier using 4 diodes

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

D2 and D4 conduct whereas, D1 and D3 remain OFF. The conducting diodes D2


and D4 will be in series with the load resistance RL and hence the current flows through RL in
the same direction as in the previous half cycle. Thus a bi-directional wave is converted into a
unidirectional wave.

2.4.5 LED:

A light-emitting diode (LED) is a semiconductor light source. LED is used as


indicator lamps in many devices, and are increasingly used for lighting. Introduced as a practical
electronic component in 1962, early LED is 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 in the Fig.

DEPT OF EEE 22 MRIET


Fig 2.9 parts of LED

LED Working:

The structure of the LED light is completely different than that of the light bulb.
Amazingly, 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.
When 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 than1 mm2), and integrated optical
components are used to shape its radiation pattern and assist in reflection. LED is present many
advantages over incandescent light sources including lower energy consumption, longer lifetime,
improved robustness, smaller size, faster switching, and greater durability and reliability.
However, they are relatively expensive and require more precise current and heat management
than traditional light sources. Current LED products for general lighting are more expensive 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 size of LED is has allowed new text 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.

DEPT OF EEE 23 MRIET


2.10 Electrical symbols & polarities of LED

 LED lights have a variety of advantages over other light sources:


 High-levels of brightness and intensity
 High-efficiency
 Low-voltage and current requirements
 Low radiated heat
 High reliability (resistant to shock and vibration)
 No UV Rays
 Long source life

 Applications of LED fall into three major categories:


 Visual signal application where the light goes more or less directly from the LED
to the human eye, to convey a message or meaning.
 Illumination where LED light is reflected from object to give visual response of
these objects.
 Generate light for measuring and interacting with processes that do not involve
the human visual system

DEPT OF EEE 24 MRIET


2.4.6 IR SENSOR :

IR TRANSMITTER AND RECEIVER :

Basics of IR transmitter and receiver transmitter and receiver are commonly used
in engineering projects for remote control of objects. In particularly, in Robotic system uses
transmitter and receiver. Here would like to describe the basics if IR transmitter and receiver.

Fig 2.11 Representation of LED

BASICS OF IR TRANSMITTER :

An electroluminescent IR LED is a product which requires care in use. IR


LED is fabricated from narrow band hetero structures with energy gap from 0.25 to 0.4 eV.
Infrared transmitter emits IR rays in planar wave front manner. Even though infrared rays spread
in all directions, it propagates along straight line in forward direction. IR rays have the
characteristics of producing secondary wavelets when it collides with any obstacles in its path.
This property of IR is used here. When IR rays gets emitted from LED, it moves in the direction
it is angled. When any obstacle interferes in the path, the IR rays get cut and it produces
secondary wavelets which propagates mostly in return direction or in a direction opposite to that
of the primary waves, which produces the net result like reflection of IR rays.

BASICS OF IR RECEIVER :

DEPT OF EEE 25 MRIET


Infrared photo receiver is a two terminal PN junction device, which operates
in a reverse bias. It has a small transparent window, which allows light to strike the PN junction.
A photodiode is a type of photo detector capable of converting light into either current or
voltage, depending upon the mode of operation. Most photodiodes will look similar to a light
emitting diode. They will have two leads, or wires, coming from the bottom. The shorter end of
the two is the cathode, while the longer end is the anode. A photodiode consists of PN junction
or PIN structure. When a photon of sufficient energy strikes the diode, it excites an electron
thereby creating a mobile electron and a positively charged electron hole. If the absorption
occurs in the junction's depletion region, or one diffusion length away from it, these carriers are
swept from the junction by the built-in field of the depletion region. Thus holes move toward the
anode, and electrons toward the cathode, and a photocurrent is produced.

Working of infrared communication:

Various types of infrared based applications are available in the market. The
circuit for infrared based applications is designed along with the transmitter and receiver sections
i.e. we can it use it for other application. But the infrared communication project which we have
done here can be used in any application just by replacing the application at the place of infrared
LED in the circuit diagram of infrared communication. By using this project we can design
infrared based applications easily.

The entire circuit consists of two sections named as:

1. Transmitter section

2. Receiver section

1. Transmitter section:

The transmitter section consists of a 555 timer IC functioning in a stable mode. It


is wired as shown in figure. The output from a stable mode is fed to an IR LED via resistor

DEPT OF EEE 26 MRIET


which limits its operating current. Infrared LED in the transmitter section emits IR radiation
which is focused by a plastic lens (optics) in to a narrow beam.

2. Receiver section:

The receiver section consists of a silicon phototransistor to convert the infrared


radiation to an electric current. It responds only to the rapidly pulsing signal created by the
transmitter, and filters out slowly changing infrared radiation from ambient light. The receiver
section comprises an infrared receiver module, and a led indicator. When the signals are
interrupted, the IR Led goes off after a few seconds depending upon the value of RC
combination.

We can increase the distance between the IR transmitter and receiver just by placing
the lens between them. After connecting the IR transmitter and receiver circuit, we can get the
output by applying 6V Power supply to the circuit. We can use this circuit with any application
very simply. For example a buzzer circuit is placed at the output of IR circuit, when the signals
are interrupted, the buzzer produces sound. Both the transmitter and receiver parts can be
mounted on a single bread board or PCB. The infrared receiver must be placed behind the IR Led
to avoid false indication due to infrared leakage. An object moving nearby actually reflects the
IR rays emitted by the IR Led.

INFRARED LED'S:-

Gallium arsenide is a direct-gap semiconductor with an energy gap of 1.4eV at room


temperature. A typical GaPs LED is made by solid-state impurity diffusion with zinc as the p-
type impurity diffused into an n-type substrate doped with tin, tellurium or silicon. The external
efficiency at room temperature is typically 5 percent.

A GaAs diode can also be fabricated by liquid-phase epitaxial with silicon as both
its n and p dopants. If a silicon atom replaces a Ga atom, it provides one additional electron, thus
the resulting GaAs in as n-type. If a silicon atom replaces arsenic atoms, an electron is missing
and the resulting GaAs is a p-type. In Si doped GaAs diode, the emission peak shifts down to
1.32eV. Since the emission is in infrared region, GaAs light sources are suitable for application

DEPT OF EEE 27 MRIET


such as the optical isolator. The high switching speed, with a recovery time between 2 and 10ns,
makes them ideal for data transmission.

The disadvantages of the GaAs emitter are emitted wavelength and the associated
attenuation and dispersion. A critical issue of using an LED for the fiber optics is the coupling of
light from the semiconductor to the fiber. Because of the larger refractive index of GaAs relative
to air, the internal efficiency of LED can be quite low.

PHOTO SEMICONDUCTOR :

A Germanium or silicon diode or transistor, which has a transparent encasing,


can serve as a photodiode or transistor because the light photons can initiate conduction in the p-
n- junction region. Early devices such as the OCP 71 were Ge-devices. Later, silicon types
became available with lower leakage current and better light sensitivity. In a phototransistor, the
base lead is not used; but, if a resistor is connected form base to emitter it reduced the light
sensitivity. Darlington connected photo transistors (two transistors together in one case) such as
the 2N5777 are very sensitive with a hFE of 2.5K, a dark current of 100 nA and a light current of
0.5-2.0 mA for light flux density H = 2mW/cm2. The device is rated 200 mW and voltage of 25
V maximum.

SCRs with a light window are also available, called as LASCR, which are very
sensitive and can turn mains power ON and OFF, with light.

The switching speed of phototransistors far exceeds those of LDRs, made of CdS.
The rise time for the 2N5777 is 75 s and fall time is 50 s. Maximum switching speed is 1 KHz.
Photo devices are useful in optical encoding, intrusion alarms, tape readers, level control,
character recognition etc.

Nowadays packing containing an LED and a photodiode, called ‘opto-coupler’ is


used for switching on power or control circuits. Because the light source (LED) and photodiode
are physically kept separated (with 2 mm) in the package, isolation up to 2500 V can be had.

DEPT OF EEE 28 MRIET


2.4.7 LIQUID CRYSTAL DISPLAY (LCD) :

A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated


optical device that uses the light-modulating properties of liquid crystals. Liquid crystals do not
emit light directly, instead using a backlight or reflector to produce images in color or
monochrome. LCDs are available to display arbitrary images (as in a general-purpose computer
display) or fixed images with low information content, which can be displayed or hidden, such as
preset words, digits, and seven-segment displays, as in a digital clock. They use the same basic
technology, except that arbitrary images are made up of a large number of small pixels, while
other displays have larger elements.

In this project Liquid crystal display are interfacing to microcontroller Pic16F877A.


A 16 × 2 LCD display is very basic module and is very commonly used in various devices and
circuits. These modules are preferred over seven segments and other multi segment LED’s.

Fig 2.12 LCD Pin diagram.

The reasons being: LCDs are economical; easily programmable; have no limitation of
displaying special & even custom characters (unlike in seven segments), animations and soon. A

DEPT OF EEE 29 MRIET


16 × 2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD
each character is displayed in 5 × 7 pixel matrix.

This LCD has two registers, namely, Command and Data. The command register
stores the command instructions given to the LCD.A command is an instruction given to LCD to
do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling
display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD.

Features of 16×2 LCD module :

 Operating Voltage is 4.7V to 5.3V


 Current consumption is 1mA without backlight
 Alphanumeric LCD display module, meaning can display alphabets and
numbers
 Consists of two rows and each row can print 16 characters.
 Each character is build by a 5×8 pixel box
 Can work on both 8-bit and 4-bit mode
 It can also display any custom generated characters
 Available in Green and Blue Backlight
 Some full form of lcd 16x2 commands
 DDRAM = Display Data RAM.
 CGRAM = Character Generator RAM.
 DDRAM address corresponds to cursor position.
 Address Counter is used for both DDRAM and CGRAM.
 * = Don't care.
 ** = Based on Fosc = 250 KHz.

DEPT OF EEE 30 MRIET


PIN DESCRIPTION OF LCD :

Fig 2.13 pin description of LED

DEPT OF EEE 31 MRIET


2.4.8 Resistance and variable resistance :

The resistors can be connected together with the other components to form filters
for a desired level. In this project Variable resistor is connected across the LCD to vary the
resistance for the brightness of the display & Resistance is used to design the cable line.

Fig 2.14 Variable resistor.

2.4.9 CAPACITOR:

Fig 2.15 Capacitor.

In this project there are two types of capacitors used. Cylindrical type of value 100 and 470
micro-farad to provide pure dc and two ceramic type capacitor of value 0.01 µF connected across
the bridge rectifier.

DEPT OF EEE 32 MRIET


2.4.10 DC MOTOR :

A dc motor uses electrical energy to produce mechanical energy, very typically


through the interaction of magnetic fields and current-carrying conductors. The reverse process,
producing electrical energy from mechanical energy, is accomplished by
an alternator, generator or dynamo. Many types of electric motors can be run as generators, and
vice versa. The input of a DC motor is current/voltage and its output is torque (speed).

Fig 2.16 DC motor.

The DC motor has two basic parts: the rotating part that is called
the armature and the stationary part that includes coils of wire called the field coils. The
stationary part is also called the stator. Figure shows a picture of a typical DC motor, Figure
shows a picture of a DC armature, and Fig shows a picture of a typical stator. From the picture
you can see the armature is made of coils of wire wrapped around the core, and the core has an
extended shaft that rotates on bearings. You should also notice that the ends of each coil of wire
on the armature are terminated at one end of the armature. The termination points are called
the commutator, and this is where the brushes make electrical contact to bring electrical current
from the stationary part to the rotating part of the machine.

Operation:

The DC motor you will find in modem industrial applications operates very
similarly to the simple DC motor described earlier in this chapter. Figure 12-9 shows an
electrical diagram of a simple DC motor. Notice that the DC voltage is applied directly to the

DEPT OF EEE 33 MRIET


field winding and the brushes. The armature and the field are both shown as a coil of wire. In
later diagrams, a field resistor will be added in series with the field to control the motor speed.

When voltage is applied to the motor, current begins to flow through the field coil from
the negative terminal to the positive terminal. This sets up a strong magnetic field in the field
winding. Current also begins to flow through the brushes into a commutator segment and then
through an armature coil. The current continues to flow through the coil back to the brush that is
attached to other end of the coil and returns to the DC power source. The current flowing in the

armature coil sets up a strong magnetic field in the armature.

Fig 2.17 Simple electric diagram of DC motor

Fig 2.18 Operation of a DC motor.

The magnetic field in the armature and field coil causes the armature to begin to rotate. This
occurs by the unlike magnetic poles attracting each other and the like magnetic poles repelling
each other. As the armature begins to rotate, the commutator segments will also begin to move
under the brushes. As an individual commutator segment moves under the brush connected to
positive voltage, it will become positive, and when it moves under a brush connected to negative
voltage it will become negative. In this way, the commutator segments continually change

DEPT OF EEE 34 MRIET


polarity from positive to negative. Since the commutator segments are connected to the ends of
the wires that make up the field winding in the armature, it causes the magnetic field in the
armature to change polarity continually from North Pole to South Pole. The commutator
segments and brushes are aligned in such a way that the switch in polarity of the armature
coincides with the location of the armature's magnetic field and the field winding's magnetic
field. The switching action is timed so that the armature will not lock up magnetically with the
field. Instead the magnetic fields tend to build on each other and provide additional torque to
keep the motor shaft rotating.

When the voltage is de-energized to the motor, the magnetic fields in the
armature and the field winding will quickly diminish and the armature shaft's speed will begin to
drop to zero. If voltage is applied to the motor again, the magnetic fields will strengthen and the
armature will begin to rotate again.

DC Motor Driver:

The L293 and L293D are quadruple high-current half-H drivers. The L293 is
designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The
L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5
V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and
bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply
applications.

All inputs are TTL compatible. Each output is a complete totem-pole drive circuit,
with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs,
with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN.When an enable
input is high, the associated drivers are enabled and their outputs are active and in phase with
their inputs.

When the enable input is low, those drivers are disabled and their outputs are off and in
the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or
bridge) reversible drive suitable for solenoid or motor applications. On the L293, external high-
speed output clamp diodes should be used for inductive transient suppression. A VCC1 terminal,

DEPT OF EEE 35 MRIET


separate from VCC2, is provided for the logic inputs to minimize device power dissipation. The
L293and L293D is characterized for operation from 0°C to 70°C.

Fig 2.19 L293D IC. Fig 2.20 L293D pin diagram

Fig 2.21 Internal structure of L293D

DEPT OF EEE 36 MRIET


Features of L293D:

 600mA Output current capability per channel


 1.2A Peak output current (non repetitive) per channel
 Enable facility
 Over temperature protection
 Logical 0input voltage up to 1.5 v
 High noise immunity
 Internal clamp diodes

2.5 COMPONENTS LIST :

DEPT OF EEE 37 MRIET


2.5.1 DIODE:

Diode.

The diode is a p-n junction device. Diode is the component used to control the flow of
the current in any one direction. The diode widely works in forward bias.

Diode when the current flows from the P to N direction. Then it is in forward bias. The
zenor diode is used in reverse bias function i.e. N to P direction. Visually the identification of the
diode`s terminal can be done by identifying he silver/black line. The silver/black line is the
negative terminal (cathode) and the other terminal is the positive terminal (cathode).

 APPLICATIONS :

•Diodes: Rectification, free-wheeling, etc.

•Zener diode: Voltage control, regulator etc.

•Tunnel diode: Control the current flow, snobbier circuit, etc.

2.5.2 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 Ohm's law:

V = IR

Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most
electronic equipment. Practical resistors can be made of various compounds and films, as well as
resistance wire (wire made of a high-resistivity alloy, such as nickel/chrome).

DEPT OF EEE 38 MRIET


The primary characteristics of a resistor are the resistance, the tolerance, maximum working
voltage and the power rating. Other characteristics include temperature coefficient, noise, and
inductance. Less well-known is critical resistance, the value below which power dissipation
limits the maximum permitted current flow, and above which the limit is applied voltage. Critical
resistance is determined by the design, materials and dimensions of the resistor.

Resistors can be made to control the flow of current, to work as Voltage dividers,
to dissipate power and it can shape electrical waves when used in combination of other
components. Basic unit is ohms.

Theory of operation:

Ohm's law:

The behavior of an ideal resistor is dictated by the relationship specified in


Ohm's law:

V = IR

Ohm's law states that the voltage (V) across a resistor is proportional to the
current (I) through it where the constant of proportionality is the resistance (R).

Power dissipation:

The power dissipated by a resistor (or the equivalent resistance of a resistor


network) is calculated using the following:

DEPT OF EEE 39 MRIET


Resistor Color Bands In Resist

2.5.3 BLUE TOOTH Module:

Bluetooth, the short-range radio link technology designed to "connect" an array


of devices including mobile phones, PCs, and PDAs, and the strategic decisions that Motorola
should make in incorporating this nascent technology into its product portfolio. The purpose of
this paper will be to provide a high-level overview of the technology to the head of Motorola's
Communications Enterprise, and prepare this corporate officer to be strategically and
functionally conversant in the technology with subordinates that have direct responsibility for
integrating Bluetooth into Motorola's product lines. The first sections of the paper detail the
background of the Bluetooth technology and its associated Special-Interest Group, or SIG, (a
conglomeration of firms that has sought to reduce market uncertainty, thereby expediting the
diffusion of Bluetooth devices). Bluetooths perceived strengths over other wireless connectivity
technologies are also discussed and some macro-level threats that may impede Bluetooth
diffusion are outlined. The remainder of the paper details potential Bluetooth markets (in terms
of consumer and corporate applications) and examines Motorola's current Bluetooth product

DEPT OF EEE 40 MRIET


offerings (a cell phone battery and computer PCMCIA card each enabled with a Bluetooth chip).
Finally, the paper provides guidance for Motorola's Bluetooth application development strategies
regarding the applications outlined in the SIG's specifications, namely emphasizing those
applications that leverage existing complementary assets, and those that are critical to Bluetooth
adoption regardless of prior expertise.

History

Bluetooth is a worldwide initiative spearheaded by some of the leading


powerhouses in the electronics industry, chiefly Ericsson, Intel, IBM, Nokia, and Toshiba.
Following initial development by Ericsson, these firms started the Bluetooth special-interest
group in 1998 with the intent of developing a worldwide technology for wireless communication
among diverse devices. Bluetooth enables wireless data and voice communication via a short-
range radio to provide a low-cost solution for wireless information exchange. Targeted electronic
devices include handsets, notebooks, PCs, and personal digital assistants for the first wave. For
instance, this technology could enable Palm Pilots to synchronize with each other, PCs, or with a
mobile phone. This effort to provide a wide range of wireless data and voice communication to
disparate devices may have a significant impact on the way people synchronize and share data, in
that the time and ease of communicating improves radically. To date, no other effort has been so
comprehensive, incorporating potentially dozens of devices with eclectic user groups (most
notably the home and business user). Given an increasing desire amongst consumer and
commercial users for mobility and connectivity, Bluetooth proponents expect that the demand
for Bluetooth technology will lead to its rapid adoption. Dataquest estimates that two-thirds of
all new mobile phone handsets will utilize Bluetooth by 2004. That amounts to more than 570
million phones, as compared to less than 1% this year, or 1.2 million phones (See Exhibit 1).
Most believe that the growth and ultimate success of Bluetooth, much like fax machines and
email, will be dependent on Metcalfes Law, which states that the value of a system increases
proportionately to the number of nodes in that system.

The Bluetooth SIG started out with a better strategy than many other technology
innovators. It marketed the Bluetooth concept and membership heavily, accentuating the
potential of the technology to hardware and software developers and manufacturers. Unlike some
earlier groups, this SIG encouraged broad membership, as it charges no fees to joinno royalties,

DEPT OF EEE 41 MRIET


guarantees, or promises. This open standard has enabled the original five-member group to reach
more than 2,108 members to date; there is massive momentum behind this initiative. More
striking, the SIG has focused on a global roadmap from the onset, supporting country-specific
local laws and restrictions, thus lowering hurdles at the point of initialization. The members of
the SIG clearly understand that Bluetooth will create a "Mix and Match" market, and have
worked to unite a broad range of manufacturers under one standard and minimize the uncertainty
for manufacturers and consumers. From G. Moore's "Chasm" perspective, the users are any firms
that can utilize the technology, and SIG has attained critical mass amongst these users. The
manufacturer is the critical component of the adoption cycle, rather than the consumer, because
the benefits of the Bluetooth technology are dependent on the availability of a complementary
variety of Bluetooth enabled devices. Accordingly, the support from a wide assortment of device
manufacturers is essential to ensure widespread customer adoption. Consequently, the SIG has
dramatically shortened the product adoption cycle and created market momentum that will
surmount the chasm between early and mainstream markets.

Bluetooth itself is a low-power, short-range radio that will operate on average from
10 meters to 100 meters. These radios are built on silicon using the most common chip
fabrication technology, a CMOS (complimentary metal oxide silicon) process, although some
will be built on silicon-germanium wafers. The module, which essentially is a commodity radio,
also includes a baseband hardware link controller, a link management interface, and software
applications to run the module. The Bluetooth SIG expects the modules will cost $25-$30 each
through the end of 2000. Thereafter, the price is expected to decrease as the volumes increase,
possibly to as low as $5-$10 per module.

Advantages:

Bluetooth has the potential to improve personal communications


(consumer and corporate) and productivity by creating personal networks between all of a user's
electronic devices. It operates in the unlicensed, internationally available 2.45GHz band and is a
much more robust technology than other wireless technologies used for similar applications,
most notably infrared-- which requires a line of sight link between communicating devices.
Bluetooths multidirectional capability makes the technology adaptable to a multitude of

DEPT OF EEE 42 MRIET


applications. Additionally, Bluetooth can enable up to eight devices at one time, forming a
piconet, communicating amongst themselves (See Exhibit 2).

Additionally, Bluetooth-enabled devices have greater computing power devoted


to communications compared to previous generations of devices, allowing for the power to
translate between internal languages of all sorts of devices thought to be previously
incompatible. As an example, a Bluetooth-enabled portable CD player would be able to play
with Bluetooth-enabled speakers in the absence of headphones. Accordingly, as that example
shows, Bluetooths most important hurdle is adoption, which is a function of the demonstrated
benefit being offered by a sufficient number of enabled devices.

Disadvantages:

First and foremost, for Bluetooth to become widely adopted, the incremental
costs for enabling Bluetooth technology need to decline significantly. As mentioned, Bluetooths
success is network constrained - if it is not widely adopted, its usefulness and capabilities are
limited, much like applications like ICQ. Unlike ICQ, the cost for manufacturers to incorporate
Bluetooth chipsets into devices and the subsequent costs to consumers are presently quite high--
at its current cost levels, wide-scale adoption is not likely. While prices are anticipated to drop
to the $5 per device level, industry analysts believe that the $1 price point is needed for the
technology to become truly ubiquitous (i.e. in a variety of CE products, not simply limited to cell
phones and PDAs).

In the software and hardware industries, certain companies have been known to
take open, clearly defined standards, and modify them slightly, and then claim that the modified
standard was proprietary. In this way, standards have fragmented and products that should be
compatible have not been. New applications have also failed to be correctly aligned with the
traditional and revised standards, leading to compatibility and design confusion concerns. A
positive for the Bluetooth platform is its capability to support the robust, versatile TCP/IP
platform.

Bluetooth is currently operating in an unlicensed spectrum- 2.45 GHz. This is


potentially a problem if other technologies using the spectrum will interfere with Bluetooth
devices. While 2.45GHz is not presently heavily congested, neither were phone lines in 1993

DEPT OF EEE 43 MRIET


with data transmission. The point is that growth can be explosive with technologies that grow
geometrically. Bluetooths 79-channel architecture helps to curb cross-interference problems, as
each time it transmits a packet of information, it hops to a new frequency. Any problem
transmissions are re-transmitted on new frequencies. Nonetheless, despite the unique technology,
the possibility for problems exists.

It should be noted that this paper will not attempt to address the threats that
extend somewhat beyond Motorola's operational parameters (in the sense that Motorola cannot
dictate the usage parameters of unlicensed spectrum, nor control the development activities of
independent business entities). The paper assumes that most companies will adhere to the SIG
specifications and that the Bluetooth architecture will withstand bandwidth congestion; it then
focuses on the potential markets and immediate development strategies that Motorola should
undertake to effectively incorporate Bluetooth into the company's product portfolio and speed
Bluetooth on its way to widespread adoption.

Applications:

According to Stephens, Inc., given Bluetooths status as an embryonic technology,


the market for Bluetooth-enabled devices has been characterized as very much in its infancy
stage. Nonetheless, there are numerous applications that Bluetooth enables in the marketplace.
The following delineates the potential markets for the Bluetooth under two broad categories,
Consumer and Corporate.

Serial Port Applications:

Current State: Motorola is not currently working on applications that would allow
a Bluetooth enabled keyboard, mouse, or other serial device to connect wirelessly with a
computer.

Relevance to Motorolas Current Business Model/Complementary Assets: These


products are low-tech and low margin. Motorola does not have the expertise nor the

DEPT OF EEE 44 MRIET


complementary assets required in manufacturing, marketing, or distributing these types of
products.

Competitive Environment: Motorola would face fierce competition from established companies
such as Microsoft and Logitech.

Strategic Recommendation: Motorola would have to re-tool manufacturing facilities that are
producing high margin products in order to produce the low margin serial devices. Motorola
would also have to absorb the costs associated with traveling up the learning curve before it
could attain a similar cost base to its competitors. Additionally, avoiding head-to-head
competition with Microsoft is almost always a good strategy. Therefore, Motorola should not
devote resources to developing serial port applications.

2.5.4 Battery power supply:

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

Watt 9V battery

Fig 2.22 Hi-Watt 9V Battery

DEPT OF EEE 45 MRIET


2.6 PULSE WIDTH MODULATION (PWM):

Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a


commonly used technique for controlling power to inertial electrical devices, made practical by
modern electronic power switches.

The average value of voltage (and current) fed to the load is controlled by turning
the switch between supply and load on and off at a fast pace. The longer the switch is on
compared to the off periods, the higher the power supplied to the load is.

The PWM switching frequency has to be much faster than what would affect the
load, which is to say the device that uses the power. Typically switching have to be done several
times a minute in an electric stove, 120 Hz in a lamp dimmer, from few kilohertz (kHz) to tens of
kHz for a motor drive and well into the tens or hundreds of kHz in audio amplifiers and
computer power supplies.

The term duty cycle describes the proportion of 'on' time to the regular interval or
'period' of time; a low duty cycle corresponds to low power, because the power is off for most of
the time. Duty cycle is expressed in percent, 100% being fully on.

The main advantage of PWM is that power loss in the switching devices is very
low. When a switch is off there is practically no current, and when it is on, there is almost no
voltage drop across the switch. Power loss, being the product of voltage and current, is thus in
both cases close to zero. PWM also works well with digital controls, which, because of their
on/off nature, can easily set the needed duty cycle. PWM has also been used in certain
communication systems where its duty cycle has been used to convey information over a
communications channel.

Communication and control

One of the advantages of PWM is that the signal remains digital all the way from
the processor to the controlled system; no digital-to-analog conversion is necessary. By keeping
the signal digital, noise effects are minimized. Noise can only affect a digital signal if it is strong
enough to change a logic-1 to a logic-0, or vice versa.

DEPT OF EEE 46 MRIET


Increased noise immunity is yet another benefit of choosing PWM over analog control, and is the
principal reason PWM is sometimes used for communication. Switching from an analog signal to
PWM can increase the length of a communications channel dramatically. At the receiving end, a
suitable RC (resistor-capacitor) or LC (inductor-capacitor) network can remove the modulating
high frequency square wave and return the signal to analog form.

PWM finds application in a variety of systems. As a concrete example,


consider a PWM-controlled brake. To put it simply, a brake is a device that clamps down hard on
something. In many brakes, the amount of clamping pressure (or stopping power) is controlled
with an analog input signal. The more voltage or current that's applied to the brake, the more
pressure the brake will exert.

The output of a PWM controller could be connected to a switch between the


supply and the brake. To produce more stopping power, the software need only increase the duty
cycle of the PWM output. If a specific amount of braking pressure is desired, measurements
would need to be taken to determine the mathematical relationship between duty cycle and
pressure. (And the resulting formulae or lookup tables would be tweaked for operating
temperature, surface wear, and so on.)

To set the pressure on the brake to, say, 100 psi, the software would do a reverse
lookup to determine the duty cycle that should produce that amount of force. It would then set
the PWM duty cycle to the new value and the brake would respond accordingly. If a sensor is
available in the system, the duty cycle can be tweaked, under closed-loop control, until the
desired pressure is precisely achieved.

PWM is economical, space saving, and noise immune. And it's now in your bag
of tricks. So use it.

DEPT OF EEE 47 MRIET


2.6.1 PWM controllers :

Many microcontrollers include on-chip PWM controllers. For example,


Microchip's PIC16C67 includes two, each of which has a selectable on-time and period. The
duty cycle is the ratio of the on-time to the period; the modulating frequency is the inverse of the
period. To start PWM operation, the data sheet suggests the software should:

 Set the period in the on-chip timer/counter that provides the modulating square wave
 Set the on-time in the PWM control register
 Set the direction of the PWM output, which is one of the general-purpose I/O pins
 Start the timer
 Enable the PWM controller

Although specific PWM controllers do vary in their programmatic details, the basic idea is
generally the same.

DEPT OF EEE 48 MRIET


CHAPTER – 3

SOFTWARE DESCRIPTION

ARDUINO UNO :3.1

INTRODUCTION

Overview:3.1.1

The Arduino microcontroller is an easy to use yet powerful single board


computer that has gained considerable traction in the hobby and professional market. The
Arduino is open-source, which means hardware is reasonably priced and development software
is free. This guide is for students in ME 2011, or students anywhere who are confronting the
Arduino for the first time. For advanced Arduino users, prowl the web; there are lots of
resources.

The Duemilanove board features an Atmel ATmega328 microcontroller


operating at 5 V with 2Kb of RAM, 32 Kb of flash memory for storing programs and 1 Kb of
EEPROM for storing parameters. The clock speed is 16 MHz, which translates to about
executing about 300,000 lines of C source code per second. The board has 14 digital I/O pins and
6 analog input pins. There is a USB connector for talking to the host computer and a DC power
jack for connecting an external 6-20 V power source, for example a 9 V battery, when running a
program while not connected to the host computer. Headers are provided for interfacing to the
I/O pins using 22 g

Solid wire or header connectors. For additional information on the hardware

The Arduino programming language is a simplified version of C/C++. If you


know C, programming the Arduino will be familiar. If you do not know C, no need to worry as
only a few commands are needed to perform useful functions.

An important feature of the Arduino is that you can create a control program
on the host PC, download it to the Arduino and it will run automatically. Remove the USB cable
connection to the PC, and the program will still run from the top each time you push the reset

DEPT OF EEE 49 MRIET


button. Remove the battery and put the Arduino board in a closet for six months. When you
reconnect the battery, the last program you stored will run. This means that you connect the
board to the host PC to develop and debug your program, but once that is done, you no longer
need the PC to run the program.

3.1.2 AURDUINO WORKING SYSTEM:

Fig 3.1 AURDUINO UNO BOARD.

 Arduino Duemilanove board.


 USB programming cable (A to B)

DEPT OF EEE 50 MRIET


 9V battery or external power supply (for stand-alone operation)
 Solder less breadboard for external circuits, and 22 g solid wire for connections
 Host PC running the Arduino development environment. Versions exist for Windows,
Mac and Linux.

3.1.3 TROUBLESHOOTING:

If there is a syntax error in the program caused by a mistake in typing, an error


message will appear in the bottom of the program window. Generally, staring at the error will
reveal the problem. If you continue to have problems, try these ideas

 Run the Arduino program again


 Check that the USB cable is secure at both ends.
 Reboot your PC because sometimes the serial port can lock up
 If a “Serial port…already in use” error appears when uploading.

3.2 MICROCONTROLLER:

Fig 3.2 Microcontroller.

3.2.1 INTRODUCTION TO MICROCONTROLLER:

Circumstances that we find ourselves in today in the field of microcontrollers had


their beginnings in the development of technology of integrated circuits. This development has
made it possible to store hundreds of thousands of transistors into one chip. That was a
prerequisite for production of microprocessors, and the first computers were made by adding

DEPT OF EEE 51 MRIET


external peripherals such as memory, input-output lines, timers and other. Further increasing of
the volume of the package resulted in creation of integrated circuits. These integrated circuits
contained both processor and peripherals. That is how the first chip containing a microcomputer,
or what would later be known as a microcontroller came about.

Microprocessors and microcontrollers are widely used in embedded systems products.


Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed
amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount
of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many
applications in which cost and space are critical.

The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was
developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-
chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM,
or EEPROM used by other microcontrollers at the time.

3.2.2 Crystal Oscillator:

XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier
which can be configured for use as an On-chip Oscillator, Either a quartz

Crystal or a ceramic resonator may be used. The CKOPT Fuse selects between two
different Oscillator amplifier modes. When CKOPT is programmed, the Oscillator output will
oscillate a full rail-to-rail swing on the output. This mode is suitable when operating in a very
noisy environment or when the output from XTAL2 drives a second clock buffer. This mode has
a wide frequency range. When CKOPT is unprogrammed, the Oscillator has a smaller output
swing. This reduces power consumption considerably.

DEPT OF EEE 52 MRIET


Fig 3.3 crystal oscillator circuit

This mode has a limited frequency range and it cannot be used to drive other clock buffers. For
resonators, the maximum frequency is 8 MHz with CKOPT unprogrammed and 16 MHz with
CKOPT programmed. C1 and C2 should always be equal for both crystals and resonators. The
optimal value of the capacitors depends on the crystal or resonator in use, the amount of stray
capacitance, and the electromagnetic noise of the environment. For ceramic resonators, the
capacitor values given by the manufacturer should be used. The Oscillator can operate in three
different modes, each optimized for a specific frequency range. The operating mode is selected
by the fuses CKSEL3..1

3.2.3 Architecture:

Memory: It has 8 Kb of Flash program memory (10,000 Write/Erase cycles durability), 512
Bytes of EEPROM (100,000 Write/Erase Cycles). 1Kbyte Internal SRAM

I/O Ports: 23 I/ line can be obtained from three ports; namely Port B, Port C and Port D.

Interrupts: Two External Interrupt source, located at port D. 19 different interrupt vectors
supporting 19 events generated by internal peripherals.

Timer/Counter: Three Internal Timers are available, two 8 bit, one 16 bit, offering various
operating modes and supporting internal or external clocking.

DEPT OF EEE 53 MRIET


SPI (Serial Peripheral interface): ATmega8 holds three communication devices integrated.
One of them is Serial Peripheral Interface. Four pins are assigned to Atmega8 to implement this
scheme of communication.

USART: One of the most powerful communication solutions is USART and ATmega8 supports
both synchronous and asynchronous data transfer schemes. It has three pins assigned for that. In
many projects, this module is extensively used for PC-Micro controller communication.

TWI (Two Wire Interface): Another communication device that is present in ATmega8 is Two
Wire Interface. It allows designers to set up a commutation between two devices using just two
wires along with a common ground connection, As the TWI output is made by means of open
collector outputs, thus external pull up resistors are required to make the circuit.

Analog Comparator: A comparator module is integrated in the IC that provides comparison


facility between two voltages connected to the two inputs of the Analog comparator via External
pins attached to the micro controller.

Analog to Digital Converter: Inbuilt analog to digital converter can convert an analog input
signal into digital data of 10bit resolution. For most of the low end application, this much
resolution is enough.

Fig 3.4 AVR Architecture

Microcontroller can be termed as a single on chip computer which includes number


of peripherals like RAM, EEPROM, Timers etc., required to perform some predefined task.

DEPT OF EEE 54 MRIET


The computer on one hand is designed to perform all the general purpose tasks on a
single machine like you can use a computer to run a software to perform calculations or you can
use a computer to store some multimedia file or to access internet through the browser, whereas
the microcontrollers are meant to perform only the specific tasks, for e.g., switching the AC off
automatically when room temperature drops to a certain defined limit and again turning it ON
when temperature rises above the defined limit.

There are number of popular families of microcontrollers which are used in


different applications as per their capability and feasibility to perform the desired task, most
common of these are 8051, AVR and PIC microcontrollers. In this article we will introduce you
with AVR family of microcontrollers.

AVR was developed in the year 1996 by Atmel Corporation. The architecture
of AVR was developed by Alf-Egil Bogen and Vegard Wollan. AVR derives its name from its
developers and stands for Alf-Egil Bogen Vegard Wollan RISC microcontroller, also known
as Advanced Virtual RISC. The AT90S8515 was the first microcontroller which was based
on AVR architecture however the first microcontroller to hit the commercial market was
AT90S1200 in the year 1997.

AVR microcontrollers are available in three categories:

1. TinyAVR Less memory, small size, suitable only for simpler applications

2. MegaAVR These are the most popular ones having good amount of memory (upto 256
KB), higher number of inbuilt peripherals and suitable for moderate to complex applications.

3. XmegaAVR Used commercially for complex applications, which require large program
memory and high speed.

ARCHITECTURE:

DEPT OF EEE 55 MRIET


Fig 3.5 Device Architecture

DEPT OF EEE 56 MRIET


Device architecture

Flash, EEPROM, and SRAM are all integrated onto a single chip, removing the need
for external memory in most applications. Some devices have a parallel external bus option to
allow adding additional data memory or memory-mapped devices. Almost all devices (except the
smallest TinyAVR chips) have serial interfaces, which can be used to connect larger serial
EEPROMs or flash chips.

Program memory

Program instructions are stored in non-volatile flash memory. Although the MCUs
are 8-bit, each instruction takes one or two 16-bit words.

The size of the program memory is usually indicated in the naming of the device itself
(e.g., the ATmega64x line has 64 kB of flash while the ATmega32x line has 32 kB).

There is no provision for off-chip program memory; all code executed by the AVR
core must reside in the on-chip flash. However, this limitation does not apply to the AT94
FPSLIC AVR/FPGA chips.

Internal data memory

The data address space consists of the register file, I/O registers, and SRAM.

Internal registers

The AVRs have 32 single-byte registers and are classified as 8-bit RISC
devices.In most variants of the AVR architecture, the working registers are mapped in as the first
32 memory addresses (000016001F16) followed by the 64 I/O registers (002016005F16).

Actual SRAM starts after these register sections (address 006016). (Note that the
I/O register space may be larger on some more extensive devices, in which case the memory
mapped I/O registers will occupy a portion of the SRAM address space.)

Even though there are separate addressing schemes and optimized opcodes for
register file and I/O register access, all can still be addressed and manipulated as if they were in
SRAM.

DEPT OF EEE 57 MRIET


In the XMEGA variant, the working register file is not mapped into the data address
space; as such, it is not possible to treat any of the XMEGA's working registers as though they
were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very
beginning of the address space. Additionally, the amount of data address space dedicated to I/O
registers has grown substantially to 4096 bytes (0000160FFF16). As with previous generations,
however, the fast I/O manipulation instructions can only reach the first 64 I/O register locations
(the first 32 locations for bitwise instructions). Following the I/O registers, the XMEGA series
sets aside a 4096 byte range of the data address space which can be used optionally for mapping
the internal EEPROM to the data address space (1000161FFF16). The actual SRAM is located
after these ranges, starting at 200016.

EEPROM

Almost all AVR microcontrollers have internal EEPROM for semi-permanent data
storage. Like flash memory, EEPROM can maintain its contents when electrical power is
removed.

In most variants of the AVR architecture, this internal EEPROM memory is not
mapped into the MCU's addressable memory space. It can only be accessed the same way an
external peripheral device is, using special pointer registers and read/write instructions which
makes EEPROM access much slower than other internal RAM.

However, some devices in the SecureAVR (AT90SC) family use a special EEPROM
mapping to the data or program memory depending on the configuration. The XMEGA family
also allows the EEPROM to be mapped into the data address space.

Since the number of writes to EEPROM is not unlimited Atmel specifies 100,000
write cycles in their datasheets a well designed EEPROM write routine should compare the
contents of an EEPROM address with desired contents and only perform an actual write if the
contents need to be changed.

Note that erase and write can be performed separately in many cases, byte-by-byte,
which may also help prolong life when bits only need to be set to all 1s (erase) or selectively
cleared to 0s (write).

DEPT OF EEE 58 MRIET


3.2.5 Program execution

Atmel's AVRs have a two stage, single level pipeline design. This means the next
machine instruction is fetched as the current one is executing. Most instructions take just one or
two clock cycles, making AVRs relatively fast among eight-bit microcontrollers.

The AVR processors were designed with the efficient execution of compiled C code in mind
and have several built-in pointers for the task.

3.2.6 MCU speed

The AVR line can normally support clock speeds from 0 to 20 MHz, with some
devices reaching 32 MHz. Lower powered operation usually requires a reduced clock speed. All
recent (Tiny, Mega, and Xmega, but not 90S) AVRs feature an on-chip oscillator, removing the
need for external clocks or resonator circuitry. Some AVRs also have a system clock prescaler
that can divide down the system clock by up to 1024. This prescaler can be reconfigured by
software during run-time, allowing the clock speed to be optimized.

Since all operations (excluding literals) on registers R0 - R31 are single cycle, the
AVR can achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS.
Loads and stores to/from memory take two cycles, branching takes two cycles. Branches in the
latest "3-byte PC" parts such as ATmega2560 are one cycle slower than on previous devices

3.2.7 Features:

 High-performance, Low-power Atmel®AVR® 8-bit Microcontroller


 Advanced RISC Architecture
 130 Powerful Instructions Most Single-clock Cycle Execution
 32 × 8 General Purpose Working Registers
 Fully Static Operation
 Up to 16MIPS Throughput at 16MHz
 On-chip 2-cycle Multiplier
 High Endurance Non-volatile Memory segments
 8Kbytes of In-System Self-programmable Flash program memory
 512Bytes EEPROM

DEPT OF EEE 59 MRIET


 1Kbyte Internal SRAM
 Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
 Data retention: 20 years at 85°C/100 years at 25°C(1)
 Optional Boot Code Section with Independent Lock Bits
 In-System Programming by On-chip Boot Program
 True Read-While-Write Operation
 Programming Lock for Software Security
 Peripheral Features
 Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
 One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
 Mode
 Real Time Counter with Separate Oscillator
 Three PWM Channels
 8-channel ADC in TQFP and QFN/MLF package
 Eight Channels 10-bit Accuracy
 6-channel ADC in PDIP package
 Six Channels 10-bit Accuracy
 Byte-oriented Two-wire Serial Interface
 Programmable Serial USART
 Master/Slave SPI Serial Interface
 Programmable Watchdog Timer with Separate On-chip Oscillator
 On-chip Analog Comparator
 Special Microcontroller Features
 Power-on Reset and Programmable Brown-out Detection
 Internal Calibrated RC Oscillator
 External and Internal Interrupt Sources
 Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
 Standby
 I/O and Packages

DEPT OF EEE 60 MRIET


 23 Programmable I/O Lines
 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF
 Operating Voltages
 2.7V - 5.5V (ATmega8L)
 4.5V - 5.5V (ATmega8)
 Speed Grades
 0 - 8MHz (ATmega8L)
 0 - 16MHz (ATmega8)
 Power Consumption at 4Mhz, 3V, 25oC
 Active: 3.6mA
 Idle Mode: 1.0mA
 Power-down Mode: 0.5µA

Brown-out Detector:

If the Brown-out Detector is not needed in the application, this module should be turned off. If
the Brown-out Detector is enabled by the BODEN Fuse, it will be enabled in all sleep modes,
and hence, always consume power. In the deeper sleep modes, this will contribute significantly
to the total current consumption. Refer to Brown-out Detection on page 38 for details on how to
configure the Brown-out Detector.

Internal Voltage Reference the Internal Voltage Reference will be enabled when needed by the
Brown-out Detector, the Analog Comparator or the ADC. If these modules are disabled as
described in the sections above, the internal voltage reference will be disabled and it will not be
consuming power. When turned on again, the user must allow the reference to start up before the
output is used. If the reference is kept on in sleep mode, the output can be used immediately.
Refer to Internal Voltage Reference on page 40 for details on the start-up time. Watchdog Timer
If the Watchdog Timer is not needed in the application, this module should be turned off.

If the Watchdog Timer is enabled, it will be enabled in all sleep modes, and hence, always
consume power. In the deeper sleep modes, this will contribute significantly to the total current

DEPT OF EEE 61 MRIET


consumption. Refer to Watchdog Timer on page 41 for details on how to configure the
Watchdog Timer. Port Pins When entering a sleep mode, all port pins should be configured to
use minimum power.

The most important thing is then to ensure that no pins drive resistive loads. In sleep modes
where the both the I/O clock (clkI/O) and the ADC clock (clkADC) are stopped, the input
buffers of the device will be disabled. This ensures that no power is consumed by the input logic
when not needed. In some cases, the input logic is needed for detecting wake-up conditions, and
it will then be enabled. Refer to the section Digital Input Enable and Sleep Modes on page 53 for
details on which pins are enabled. If the input buffer is enabled and the input signal is left
floating or have an analog signal level close to VCC/2, the input buffer will use excessive power.

Power-on Reset:

A Power-on Reset (POR) pulse is generated by an On-chip detection circuit. The detection level
is defined in Table 15. The POR is activated whenever VCC is below the detection level. The
POR circuit can be used to trigger the Start-up Reset, as well as to detect a failure in supply
voltage.

A Power-on Reset (POR) circuit ensures that the device is reset from Power-on. Reaching the
Power-on Reset threshold voltage invokes the delay counter, which determines how long the
device is kept in RESET after VCC rise. The RESET signal is activated again, without any
delay, when VCC decreases below the detection level.

External Reset:

An External Reset is generated by a low level on the RESET pin. Reset pulses longer than the
minimum pulse width (see Table 15) will generate a reset, even if the clock is not running.
Shorter pulses are not guaranteed to generate a reset. When the applied signal reaches the Reset
Threshold Voltage VRST on its positive edge, the delay counter starts the MCU after the time-
out period tTOUT has expired.

DEPT OF EEE 62 MRIET


3.2.8 Pin diagram:

Fig 3.6 Pin diagram of ATMEGA328.

VCC :

Digital supply voltage magnitude of the voltage range between 4.5 to 5.5 V for the ATmega8 and
2.7 to 5.5 V for ATmega8L

GND:

Ground Zero reference digital voltage supply.

DEPT OF EEE 63 MRIET


PORTB (PB7.. PB0) :

PORTB is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be
selected. This port output buffers have symmetrical characteristics when used as a source or
sink. When used as an input, the pull-pin low externally will emit a current if the pull-up resistor
is activated it. PORTB pins will be in the condition of the tri-state when RESET is active,
although the clock is not running.

PORTC (PC5.. PC0) :

PORTC is a port I / O two-way (bidirectional) 7-bit with internal pull-up resistor can be
selected. This port output buffers have symmetrical characteristics when used as a source or
sink. When used as an input, the pull-pin low externally will emit a current if the pull-up resistor
is activated it. PORTC pins will be in the condition of the tri-state when RESET is active,
although the clock is not running.

PC6/RESET :

If RSTDISBL Fuse programmed, PC6 then serves as a pin I / O but with different
characteristics. PC0 to PC5 If Fuse RSTDISBL not programmed, then serves as input Reset
PC6. LOW signal on this pin with a minimum width of 1.5 microseconds will bring the
microcontroller into reset condition, although the clock is not running.

PORTD (PD7.. PD0) :

PORTD is a port I / O two-way (bidirectional) 8-bit with internal pull-up resistor can be
selected. This port output buffers have symmetrical characteristics when used as a source or
sink. When used as an input, the pull-pin low externally will emit a current if the pull-up resistor
is activated it. PORTD pins will be in the condition of the tri-state when RESET is active,
although the clock is not running.

RESET:

Reset input pin. LOW signal on this pin with a minimum width of 1.5 microseconds will
bring the microcontroller into reset condition, although the clock is not running. Signal with a
width of less than 1.5 microseconds does not guarantee a Reset condition.

DEPT OF EEE 64 MRIET


AVCC:

AVCC is the supply voltage pin for the ADC, PC3 .. PC0, and ADC7..ADC6. This pin
should be connected to VCC, even if the ADC is not used. If the ADC is used, AVCC should be
connected to VCC through a low-pass filter to reduce noise.

Aref :

Analog Reference pin for the ADC.

ADC7 .. ADC6 :

ADC analog input there is only on ATmega8 with TQFP and QFP packages / MLF.

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 zeros and ones, or read from
them an existing status. Physically, port is a register inside a microcontroller which is connected
by wires to the pins of a microcontroller. Ports represent physical connection of Central
Processing Unit with an outside world. Microcontroller uses them

The Atmega8 has 23 I/O ports which are organized into 3 groups:

 Port B (PB0 to PB7)


 Port C (PC0 to PC6)
 Port D (PD0 to PD7)

We will use mainly 3 registers known as DDRX, PORTX & PINX. We have total
four PORTs on my ATmega16. They are PORTA, PORTB, PORTC and PORTD. They are
multifunctional pins. Each of the pins in each port (total 32) can be treated as input or output pin.

DEPT OF EEE 65 MRIET


3.2.9 Applications :

 AVR microcontroller perfectly fits many uses, from automotive industries and
controlling home appliances to industrial instruments, remote sensors, electrical door
locks and safety devices. It is also ideal for smart cards as well as for battery supplied
devices because of its low consumption.
 EEPROM memory makes it easier to apply microcontrollers to devices where permanent
storage of various parameters is needed (codes for transmitters, motor speed, receiver
frequencies, etc.). Low cost, low consumption, easy handling and flexibility make
ATmega8 applicable even in areas where microcontrollers had not previously been
considered (example: timer functions, interface replacement in larger systems,
coprocessor applications, etc.).
 In System Programmability of this chip (along with using only two pins in data transfer)
makes possible the flexibility of a product, after assembling and testing have been
completed. This capability can be used to create assembly-line production, to store
calibration data available only after final testing, or it can be used to improve programs
on finished products.

DEPT OF EEE 66 MRIET


CHAPTER – 4

SOFTWARE ASPECT

SOFTWARE :

This project is implemented using following softwares:

 Express PCB for designing circuit


 Arduino IDE compiler - for compilation part
 Proteus 7 (Embedded C) for simulation part

4.1 Express PCB:

Breadboards are great for prototyping equipment as it allows great flexibility to


modify a design when needed; however the final product of a project, ideally should have a neat
PCB, few cables, and survive a shake test. Not only is a proper PCB neater but it is also more
durable as there are no cables which can yank loose.

Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy to use,
but it does have several limitations.

It can be likened to more of a toy then a professional CAD program.

It has a poor part library (which we can work around)

It cannot import or export files in different formats

It cannot be used to make prepare boards for DIY production

Express PCB has been used to design many PCBs (some layered and with surface-
mount parts. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen
to make boards. However, Express PCB does not have a nice print layout. Here is the procedure
to design in Express PCB and clean up the patterns so they print nicely.

Preparing Express PCB for First Use:

DEPT OF EEE 67 MRIET


Express PCB comes with a less then exciting list of parts. So before any project is started
head over to Audio logical and grab the additional parts by morsel, ppl, and tangent, and extract
them into your Express PCB directory. At this point start the program and get ready to setup the
workspace to suit your style.

Click View -> Options. In this menu, setup the units for mm or in depending on
how you think, and click see through the top copper layer at the bottom. The standard color
scheme of red and green is generally used but it is not as pleasing as red and blue.

4.1.1 The Interface:

When a project is first started you will be greeted with a yellow outline. This
yellow outline is the dimension of the PCB. Typically after positioning of parts and traces, move
them to their final position and then crop the PCB to the correct size. However, in designing a
board with a certain size constraint, crop the PCB to the correct size before starting.

Fig: show the toolbar in which the each button has the following functions:

Tool bar necessary for the interface.

 The select tool: It is fairly obvious what this does. It allows you to move and
manipulate parts. When this tool is selected the top toolbar will show buttons to move
traces to the top / bottom copper layer, and rotate buttons.
 The zoom to selection tool: does just that.
 The place pad: button allows you to place small soldier pads which are useful for board
connections or if a part is not in the part library but the part dimensions are available.
When this tool is selected the top toolbar will give you a large selection of round holes,
square holes and surface mount pads.
 The place component: tool allows you to select a component from the top toolbar and
then by clicking in the workspace places that component in the orientation chosen using
the buttons next to the component list. The components can always be rotated afterwards
with the select tool if the orientation is wrong.

DEPT OF EEE 68 MRIET


 The place trace: tool allows you to place a solid trace on the board of varying thicknesses.
The top toolbar allows you to select the top or bottom layer to place the trace on.
 The Insert Corner in trace: button does exactly what it says. When this tool is selected,
clicking on a trace will insert a corner which can be moved to route around components
and other traces.
 The remove a trace button is not very important since the delete key will achieve the
same result.

4.1.2 Design Considerations:

Before starting a project there are several ways to design a PCB and one must be
chosen to suit the projects needs.

Single sided, or double sided?

When making a PCB you have the option of making a single sided board, or a
double sided board. Single sided boards are cheaper to produce and easier to etch, but much
harder to design for large projects. If a lot of parts are being used in a small space it may be
difficult to make a single sided board without jumpering over traces with a cable. While theres
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 expensive to produce professionally, more difficult


to etch on a DIY board, but makes the layout of components a lot smaller and easier. It 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. Large capacitors, relays, and similar parts which dont have
axial leads can NOT have traces on top unless boards are plated professionally.

Ground-plane or other special purposes for one side

When using a double sided board you must consider which traces should be on
what side of the board. Generally, put power traces on the top of the board, jumping only to the
bottom if a part cannot be soldiered onto the top plane (like a relay), and vice- versa.

Some projects like power supplies or amps can benefit from having a solid plane
to use for ground. In power supplies this can reduce noise, and in amps it minimizes the distance

DEPT OF EEE 69 MRIET


between parts and their ground connections, and keeps the ground signal as simple as possible.
However, care must be taken with stubborn chips such as the TPA6120 amplifier from TI. The
TPA6120 datasheet specifies not to run a ground plane under the pins or signal traces of this chip
as the capacitance generated could effect performance negatively.

4.2 ARDUINO COMPILING:

DEPT OF EEE 70 MRIET


 In next step download library

DEPT OF EEE 71 MRIET


 As Arduino doesn't recognize the directory name, please rename it

DEPT OF EEE 72 MRIET


 Launch Arduino by double click Arduino below

DEPT OF EEE 73 MRIET


 One example

DEPT OF EEE 74 MRIET


 Select the target board as Arduino Uno

DEPT OF EEE 75 MRIET


 Click sketch -> verify/compile

DEPT OF EEE 76 MRIET


4.2.1 ARDUINO CODE:
#include<SoftwareSerial.h>// serial communication library

SoftwareSerial ConfigurePorts (8, 9); // Port_8 ==> RX, Port_9 ==> TX

int ReceiveInfo; // for the received information

int MotorPort=11; // Port 13 for the dc motor

void setup()

ConfigurePorts.begin(9600); // Baud rate

Serial.begin(9600);

ConfigurePorts.println("0=off, 1=speed 1, 2=speed 2 ...");

pinMode(MotorPort, OUTPUT);

Serial.println(" waiting for data ");

void loop()

if(ConfigurePorts.available()>0)

ReceiveInfo=ConfigurePorts.read();

switch (ReceiveInfo)

case '0': // off

analogWrite(MotorPort,0);

DEPT OF EEE 77 MRIET


ConfigurePorts.println("off");

Serial.println(" motor off");

break;

//case '1': // speed 1

//

//analogWrite(MotorPort,40);

//

//ConfigurePorts.println("1");

//Serial.println(" motor speed 10%");

//break;

case '1': // speed 2

analogWrite(MotorPort,40);

ConfigurePorts.println("1");

Serial.println(" motor speed 20%");

break;

case '2': // speed 3

analogWrite(MotorPort,60);

ConfigurePorts.println("2");

Serial.println(" motor speed 30%");

break;

case '3': // speed 4

analogWrite(MotorPort,80);

DEPT OF EEE 78 MRIET


ConfigurePorts.println("3");

Serial.println(" motor speed 40%");

break;

case '4': // speed 5

analogWrite(MotorPort,110);

ConfigurePorts.println("4");

Serial.println(" motor speed 50%");

break;

case '5': // speed 6

analogWrite(MotorPort,140);

ConfigurePorts.println("5");

Serial.println(" motor speed 75%");

break;

//case '7': // speed 7

//

//analogWrite(MotorPort,200);

//

//ConfigurePorts.println("7");

//Serial.println(" motor speed 80%");

//

//break;

//

//case '8': // speed 8

DEPT OF EEE 79 MRIET


//

//analogWrite(MotorPort,240);

//

//ConfigurePorts.println("8");

//

//Serial.println(" motor speed 100%");

//break;

DEPT OF EEE 80 MRIET


4.3 Proteus:
Keil development tools for the 8051 microcontroller architecture supports every
level of software developer from the professional applications engineered to the student just
learning about embedded software development.

The Keil 8051 development tools are designed to solve the complex problems
facing embedded software developer. The keil software 8051 development tools are programs
used to compile C code, assemble source files, link and locate object modules and libraries,
create hex files, and debug the target program. Some of the commonly used keil software 8051
development tools are:-

 µvision4 for windows is an integrated development environment that combines project


management, source code editing and program debugging in one single Powerful
environment.
 The C51 ANSI optimizing C cross compiler creates re-locatable object modules from the
C source code.
 The A51 macro assembler creates re-locatable object modules from the 8051 assembly
source code.
 The L51 linker/locater combines re-locatable object modules created by the C51
compiler and the A51 assembler into object modules.
 The LIB51 library manager combines object modules into libraries that may be used by
the linker.
 The OHS51 object-HEX converter creates Intel HEX files from absolute object modules.

4.3.1 Software Development Cycle :

When the keil software tools are used, the project development cycle is roughly the same as it is
for any other software development project.

 Create a project, select the target chip from device database, and configure the tools
settings.
 Create source file in C or assembly.
 Build the application with the project manager.

DEPT OF EEE 81 MRIET


 Correct the errors in source file.
 Test the linked application.

C51 Compiler and A51 Assembler :

Source files are created by the µ vision4 IDE and are passed to the C51 compiler or
A51 Assembler. The compiler and assembler process source files and create re-locatable files.
The Keil C51 compiler is a full ANSI implementation of the C programming language that
supports all standard features of the C language. In addition, numerous features for direct support
of the 8751 architecture have been added.

4.3.2 COMPILING IN WINDOWS ENVIRONMENT:

PROTEUS Software:-

It is the Software which we have used to develop the program using Embedded C
Language. It has inbuilt compiler in it which is used to convert Embedded C program into Hex
file. The hex file is dumped into the microcontroller by which it will understand the code we

DEPT OF EEE 82 MRIET


have return in Embedded C language and operates according to the logics which we have
written.

4.3.3 PROGRAM LOADER

Proload:-

DEPT OF EEE 83 MRIET


CHAPTER – 5
5.1 ADVANTAGES :

 Automatic controlling of speed at various load.


 No need for manual monitoring.
 Fast response.
 Efficient and low cost design.
 Low power consumption.

 Conservation energy.

 Dynamic user input.

5.2 DISADVANTAGES :

 Interfacing of high voltage device to microcontroller is sensitive.

5.3 APPLICATIONS :

 This system can be practically implemented in real time to regulate the speed of AC DC
fan or the intensity of the lamps.
 Industrial application.

 In chemical labs.

5.4 PRECAUTIONS :

 SOLDERING PRECAUTIONS :
 The construction was carried out with care. The precautions taken during the soldering
were:
 The tip of soldering iron was kept clean with the help of a file from time to time.
 The solder wire was of smaller thickness.
 Extra solder was not used in order to avoid a cause of short circuit in the conductive path.

DEPT OF EEE 84 MRIET


 The overheating of components was avoided to prevent component damage as a result of
excessive heat on the components due to the heat from the soldering iron.
 The leads of the components were kept clean before soldering, with the use of sand
paper.

 COMPONENTS PRECAUTION:
 IR sensor used should be sensitive. Before using in the circuit it should be tested with a
multi-meter.
 I.C should not be heated much while soldering; too much heat can destroy the I.C. For
safety and ease of replacement, the use of I.C socket is suggested.
 While placing the I.C pin no 1 should be made sure at right hole.
 Opposite polarity of battery can destroy I.C so please check the polarity before switching
ON the circuit. One should use diode in series with switch for safety since diode allows
flowing current in one direction only.
 Each component was soldered neatly and clean.
 We should use insulated wires

DEPT OF EEE 85 MRIET


CHAPTER – 6

RESULTS & ANALYSIS


The project “FREQUENCY LOCKED LOOP DC MOTOR SPEED CONTROL SYSTEM” was
designed such that to control and maintain constant speed of DC motor event at variable load
automatically without any manual mechanism.

Fig 4.1 DC MOTOR CONTROL BY ANDROID

Fig 4.2 CLOCK WISE DIRECTION

DEPT OF EEE 86 MRIET


Fig 4.3 ANTICLOCKWISE DIRECTION

DEPT OF EEE 87 MRIET


CHAPTER – 7

CONCLUSION :
Integrating features of all the hardware components used have been developed in it. The
presence of every module has been reasoned out and placed carefully, thus contributing the best
working of the unit. Secondly, using highly advanced IC’s is the help of growing technology, the
project has been successfully implemented. Thus the project has been successfully designed and
tested.

FUTURE SCOPE :
Our project “FREQUENCY LOCKED LOOP DC MOTOR CONTROL” is mainly intended to
control and maintain constant speed of DC motor even at variable load.

The speed DC motor can be varied by varying the input reference frequency. These two
frequency are continuously compared and the difference of these frequencies gets converted into
equivalent voltage and fed to DC motor. If the reference frequency is greater than feedback
frequencies, than the voltage input to the motor is increased till both frequency are equal. If the
reference frequencies is less than the motor feedback frequency than the voltage input to the Dc
motor are reduced so as to match with reference frequency. In this way the speed of Dc motor
can be controlled based on input frequency.

DEPT OF EEE 88 MRIET


BIBLIOGRAPHY

WEBSITES :
 www.wikipedia.com
 www.circuitdigest.com
 www.efxkits.com
 www.elprocus.com
 http://www.nptel.com
 http://www.ieee.com
 www.wikipedia.com
 www.allaboutcircuits.com
 www.microchip.com
 www.howstuffworks.com

BOOKS :
 Programming and Customizing the PIC Microcontroller by MykePredko
 Power system by C.L Wadhwa
 Raj kamal Microcontrollers Architecture, Programming, Interfacing and System Design.
 Mazidi and Mazidi Embedded Systems.
 PCB Design Tutorial David.L.Jones.
 ARDUINO Microcontroller Manual Microchip.
 Pyroelectric Sensor Module- Murata.
 Embedded C Michael.J.Pont

DEPT OF EEE 89 MRIET

Vous aimerez peut-être aussi