SlideShare a Scribd company logo
1 of 66
Download to read offline
MEASUREMENT, PROTECTION AND GRAPHICAL
OBSERVATION OF DC MOTOR BY USING
ATMEGA-16 USING EMBEDDED SYSTEM
A Project Report
Submitted by:
NADIMINTI SAROJA KUMAR (1201210503)
DIGVIJAY KUMAR (1201210537)
MANIKA NAYAK (1201210527)
In partial fulfillment for the award of the Degree
Of
BACHELOR IN TECHNOLOGY
IN
ELECTRICAL AND ELECTRONICS
ENGINEERING
Under the esteemed guidance of
Mr. MANOJ KUMAR SWAIN
Asst. Prof., EEE
AT
2012-2016
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING
GANDHI INSTITUTE OF ENGINEERING AND
TECHNOLOGY GUNUPUR – 765022
2012-2016
ii
DECLARATION
We hereby declare that the project entitled “MEASUREMENT,
PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR
BY USING ATMEGA-16 USING EMBEDDED SYSTEM” submitted for
the B.Tech. Degree is our original work and the project has not formed on
the basis for the award of any degree, associate-ship, fellowship or any
other similar titles.
Signature of the Students:
1.
2.
3.
Place:
Date:
iii
Gandhi Institute of
Engineering & Technology
GUNUPUR – 765 022, Dist: Rayagada (Orissa), India
(Approved by AICTE, Govt. of Orissa and Affiliated to Biju Patnaik
University of Technology)
06857 – 250172(Office), 251156(Principal), 250232(Fax),
e-mail: gandhi_giet@yahoo.com visit us at www.giet.org
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
CERTIFICATE
ISO
9001:2
000
Certified
Institute
This is to certify that the project work entitled
“MEASUREMENT,PROTECTION AND GRAPHICAL OBSERVATION OF
DC MOTOR BY USING ATMEGA-16 USING EMBEDDED SYSTEM ”is
the bonafide work carried out by NADIMINTI SAROJA KUMAR (1201210503),
DIGVIJAY KUMAR(1201210537),MANIKA NAYAK(1201210527) students of
BACHELOR IN TECHNOLOGY, GANDHI INSTITUTE OF ENGINEERING
AND TECHNOLOGY during the academic year 2012-16 in partial fulfilment
of the requirements for the award of the Degree of BACHELOR IN
TECHNOLOGY in ELECTRICAL & ELECTRONICS ENGINEERING.
Mr. Manoj Kumar Swain Mr. Rati Ranjan Sabat
Asst. Prof. (EEE) and Guide HOD (EEE )
EXTERNAL EXAMINER
4
4
ACKNOWLEDGEMENT
It is our privilege to express our sincerest regards to the project guide, Mr. Manoj
Kumar Swain, Asst Prof.(EEE), for his valuable inputs, able guidance,
encouragement, whole-hearted cooperation and constructive criticism throughout the
duration of our project. It is deeply expressed our sincere thanks to Mr. Ch.
Venkateswara Rao, Prof. & Asst HOD(EEE), Mr. R.R Sabat Prof. & HOD (EEE),
Dr. M. Muralidhara Rao Principal & all the teachers for encouraging and allowing
us to present the project on the topic “MEASUREMENT,PROTECTION AND
GRAPHICAL OBSERVATION OF DC MOTOR BY USING ATMEGA-16 USING
EMBEDDED SYSTEM “at the department premises for the partial fulfilment of the
requirements leading to the award of B-Tech degree. It is taken this opportunity to
thank all the lecturers and non teaching staffs who have directly or indirectly helped
us in this project.
It is our respects and love to our parents and all other family members and friends for
their love and encouragement throughout our career. Last but not the least it is
expressed our thanks to friends for their cooperation and support.
NADIMINTI SAROJA KUMAR
DIGVIJAY KUMAR
MANIKA NAYAK
5
ABSTRACT
The objective of the project is to design a circuit which is applicable for multiple
purposes of a dc motor. DC motors are widely used not only in the industries but also in
daily life applications like drills, shapers, vacuum cleaner, spinning and weaving
machines etc. So it is required to observe the basic parameters like voltage, current,
speed and torque by measuring the values of those parameters. The experimental values
are measured using different techniques and displayed in a 16x4 alphanumeric LCD
(Liquid Crystal Display).The limit values are given for each parameters above which the
circuit does not work, it will directly stop the motor for the protection purpose. Two
graphs have been plotted in 124X64 graphical LCD by taking the respective parameter
values. The first graph is one of the characteristics curves of dc motor (N~I, T~I and
N~T). And the second graph is drawn for observation of any parameter according to the
users wish. In this project the first graph is plotted for N~I characteristics curve and the
second curve is plotted by taking voltage vs time for observation of voltage parameter.
The total circuitry is connected with a dc supply through a adapter which supplies 12V dc
to the motor and 5V to the ATMEGA-16 microcontroller through the 7805 voltage
regulator.
6
TABLE OF CONTENT
Chapter no. Subject Page no
1. 1.1 INTRODUCTION 08
1.2 OBJECTIVE OF THE PROJECT 08
1.3 ORGANISATION OF THE WORK 09
2. COMPONENTS DESCRIPTION
2.1 INTRODUCTION 10
2.2 COMPONENTS USED 10
2.3 COMPONENT DESCRIPTION 11
2.3.1 DC MOTOR 11
2.3.2 ATMEGA 16 MICROCONTROLLER 15
2.3.3 16x4 ALPHANUMERIC LCD 20
2.3.4 128x64 GRAPHICAL LCD 22
2.3.5 L293D MOTOR DRIVER 25
2.3.6 ACS712 CURRENT SENSOR 27
2.3.7 7805 VOLTAGE REGULATOR 32
2.3.8 CAPACITOR 34
2.3.9 RESISTOR 36
3. INTRODUCTION TO AVR SERIES
3.1 INTRODUCTION 43
3.2 OVERVIEW 43
3.3 FEATURES 44
3.4 PIN DESCRIPTION 46
3.5 BLOCK DIAGRAM
4. SOFTWARES USED
4.1 INTRODUCTION 54
4.2 AVR STUDIO 4 54
4.3 WINAVR 2010 56
4.4 SINAPROG 57
4.5 USBasp DRIVER 58
5. ANALYSIS OF THE PROJECT
5.1 INTRODUCTION 59
5.2 BLOCK DIAGRAM 59
5.3 CIRCUIT DIAGRAM 60
5.4 DESCRIPTION 60
6. RESULTS AND DISCUSSIONS
6.1 INTRODUCTION 63
6.2 DISCUSSION 63
7. CONCLUSION & FUTURE
APPLICATIONS
64
REFERENCE 65
PUBLICATIONS
7
LIST OF FIGURES
FIG.NO NAME OF THE FIG.
PAGE
NO.
2.1 CLASSIFICATION OF DC MOTOR 11
2.2 DC MOTOR 14
2.3 OVERALL DIAGRAM OF ATMEGA-16 16
2.4 PIN CONFIGURATION OF ATMEGA-16 17
2.5 16X4 LCD 20
2.6 LCD INTERFACING WITH ATMEGA-16 22
2.7 128X64 GRAPHICAL LCD 23
2.8 GLCD INTERFACING WITH ATMEGA 16 25
2.9 PIN DESRIPTION OF L293D 26
2.10 IR SENSOR CIRCUIT 29
2.11 IR SENSOR 29
2.12 BLOCK DIAGRAM OF INFRARED DETECTION 30
2.13 WAVELENGTH IN MM 31
2.14 CIRCUIT DIAGRAM OF 7805 VOLTAGE REGU 33
2.15 VOLTAGE REGULATOR 33
2.16 CERAMIC CAPACITOR 36
2.17 ELECTROLYTIC CAPACITOR 36
2.18 CARBON COMPOSITION RESISTORS 37
2.19 CARBON FILM RESISTORS 38
3.1 EMBEDDED SYSTEM 43
3.2 PIN CONFIGURATION OF ATMEGA-16 46
3.3 BLOCK DIAGRAM OF ATMEGA-16 47
4.1 AVR STUDIO 4 55
4.2 SINAPROG 57
5.1
BLOCK DIAGRAM OF MEASUREMENT,
PROTECTION AND G-OBSERVATION OF DC
MOTOR
59
5.2
CIRCUIT OF MEASUREMENT, PROTECTION AND
G-OBSERVATION OF DC MOTOR
60
5.3 16X4V LCD 61
5.4 128X64 GRAPHICAL LCD 62
6.1 G-DISPLAYING OF MEASURED VALUESS 63
8
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
The main objective of this project is to measure, protect, speed control and graphical
observation of different parameters of a DC motor with a minimum cost, portable, reliable,
easy operation and low power application. Large scale industries use different electric panels
for controlling and smooth operation of high voltage DC motors. But it is difficult to invest
that much of huge amount in small industrial labs, institutional labs, research centers,
robotics clubs etc. It is neither affordable to use for daily life appliances like drills, hair
driers, mixer, sewing machines, vacuum cleaners nor in small business purposed motor
applications like lathes, boring mills, spinning and weaving machines, elevators, etc. So
power electronics components and technology can be used both for improving the
performance of the motor and implementation in its practical fields with the protection of the
motor. It is also applicable to control the speed of the motor used in the machine by using
PWM technique. This project is done using ATMEGA-16 microcontroller.
1.2 OBJECTIVE OF THE PROJECT
The objective of the present paper is to design a circuit which is applicable for multiple
purposes of a dc motor. DC motors are widely used not only in the industries but also in
daily life applications like drills, shapers, vacuum cleaner, spinning and weaving
machines etc. So it is required to observe the basic parameters like voltage, current, speed
and torque by measuring the values of those parameters. The experimental values are
measured using different techniques and displayed in a 16x4 LCD. Two graphs have been
plotted in 124X64 graphical LCD by taking the respective parameter values.
The total project consists of three sections i.e
A. Displaying the measured parameters (V,I,N,T) of a DC motor
B. Giving limit values for protection purpose
C. Graphical observation of respective parameters (N~I, V~t)
9
1.3 ORGANISATION OF THE WORK
The different components and its functional pin configurations are explained in chapter-2
and the features of AVR FAMILY is discussed in chapter-3. Experimental Investigation
is explained in chapter-4 where the step by step experimental procedure is shown.
Experimental results is discussed in chapter-5. Discussion of results is explained in
chapter 5, chapter 6 deals with the conclusion and future applications.
10
CHAPTER 2
COMPONENTS DESCRIPTION
2.1 INTRODUCTION
The components used in this project are mostly related to embedded systems. They have
a multiple functionality in according to the need of the user. So these components can be
used for making different type of application.
2.2 COMPONENTS USED
Table no.2.1 COMPONENTS USED
Sl.no Name of components Specifications Quantity
1. DC motor with clamp and screw 12V, 1 amp, 200 rpm 1,1,4
2. ATMEGA-16 5V, 8- bit, 40 pin 1
3. Alphanumeric LCD 16x4 1
4. Graphical LCD 128x64 1
5. Motor driver (L293D) 4.5V-36V, 1.2 amp 1
6. Current sensor (ACS712) 2.1 kVRMS, 20 amp 1
7. Speed sensor (IR sensor) 2.2V-5.5V 1
8. Voltage regulator (7805) 1.5 amp, 3-pin 1
9. DC socket and power switch 12V, 1amp 1,1
10. Reset switch 1.6V-5.5V, 140ms 1
11. Wheel with screw
.
7c.m.x2c.m. 1
12. Capacitor (Electrolyte) 10uF, 100uF 1,1
13. Capacitor (Ceramic) 0.1F 3
14. Resistor 220, 0.6k, 1k, 1.5k,
10k
1 each
11
2.3 COMPONENTS DESCRIPTION
2.3.1 DC MOTOR
An electric motor is a machine which converts electric energy into mechanical energy. Its
action is based on the principle that when a current carrying conductor is placed in
magnetic field, it experiences a mechanical force whose direction is given by Flemings
left hand rule and magnitude is given by F= BIl Newton.
The primary classification ofDC motor can be tabulated as shown in Fig no. 2.1
Fig no. 2.1 CLASSIFICATION OF DC MOTOR
15. LED 5V, 20 mamp 1
16. Reset switch 5V 1
17. LCD Preset 0-5 V 1
18. Header pins Male 52
19. Zero PCB 10x10, 10x5, 7.5x5 1,2,2
20. Connecting wires 0.5 mm As per
required
12
A. ADVANTAGES OF DC MOTOR:
The different advantages for which DC motors are used widely are given below:
 Speed control over a wide range both above and below the rated speed: The
attractive feature of the dc motor is that it offers the wide range of speed control
both above and below the rated speeds. This can be achieved in dc shunt motors
by methods such as armature control method and field control method. This is one
of the main applications in which dc motors are widely used in fine speed
applications such as in rolling mills and in paper mills.
 High starting torque: dc series motors are termed as best suited drives
for electrical traction applications used for driving heavy loads in starting
conditions. DC series motors will have a staring torque as high as 500% compared
to normal operating torque. Therefore dc series motors are used in the
applications such as in electric trains and cranes.
 Accurate steep less speed with constant torque: Constant torque drives is one
such the drives will have motor shaft torque constant over a given speed range. In
such drives shaft power varies with speed.
 Quick starting, stopping, reversing and acceleration
 Free from harmonics, reactive power consumption and many factors which makes
dc motors more advantageous compared to ac induction motors.
B. APPLICATIONS OF DC MOTOR:-
The different applications of different types of DC motor are described below:
a. D.C Shunt Motors: It is a constant speed motor.Where the speed is required to
remain almost constant from noload to full load.Where the load has to be driven at a
number of speeds and any one of which is nearly constant.
13
Industrial use:
 Lathes
 Drills
 Boring mills
 Shapers
 Spinning and Weaving machines.
b.D.CSeriesmotor:
It is a variable speed motor. The speed is low at high torque. At light or no load ,the
motor speed attains dangerously high speed. The motor has a high starting
torque.(elevators, electric traction)
Industrial Uses:
 Electric traction
 Cranes
 Elevators
 Air compressor
 Vacuum cleaner
 Hair drier
 Sewing machine
c. D.C Compound motor:
Differential compound motors are rarely used because of its poor torque characteristics.
Industrial uses:
 Presses Shears
 Reciprocating machine.
200RPM Centre Shaft Economy Series DC Motor is high quality low cost DC geared
motor. It has steel gears and pinions to ensure longer life and better wear and tear
properties. The gears are fixed on hardened steel spindles polished to a mirror finish. The
14
output shaft rotates in a plastic bushing. The whole assembly is covered with a plastic
ring. Gearbox is sealed and lubricated with lithium grease and require no maintenance.
The motor is screwed to the gear box from inside. Although motor gives 200 RPM at
12V but motor runs smoothly from 4V to 12V and gives wide range of RPM, and torque.
Tables below gives fairly good idea of the motor’s performance in terms of RPM and no
load current as a function of voltage and stall torque, stall current as a function of voltage.
For compatible wheels refer to Wheels and Accessories product category.
You can also mount this motor on the chassis using Motor Mount for Centre Shaft
Economy Series DC Motor
For adding Position Encoder, refer to Encoder Kit for Centre Shaft Economy Series DC
Motor as shown in fig no. 2.2.
C. SPECIFICATION OF THE MOTOR USED
 DC supply: 4 to 12V
 RPM: 200 at 12V
 Total length: 46mm
 Motor diameter: 36mm
 Motor length: 25mm
 Brush type: Precious metal
 Gear head diameter: 37mm
 Gear head length: 21mm
 Output shaft: Centred
 Shaft diameter: 6mm
 Shaft length: 22mm Fig no. 2.2 DC MOTOR
 Gear assembly: Spur
 Motor weight: 90gms
15
D. PRATICAL ANALYSIS
Motor performance in terms of RPM and
no load current as a function of input
voltage
Motor performance in terms of stall
torque and stall current as a function of
input voltage
Voltage
(V)
RPM (No
Load)
Current
(A)
4 59 0.029
5 78 0.030
6 95 0.031
7 106 0.047
8 124 0.051
9 141 0.052
10 160 0.052
11 179 0.052
12 198 0.052
Voltage
(V)
Stall torque
(Kg/cm)
Stall
Current (A)
4 1.827 0.412
5 2.171 0.522
6 2.666 0.611
7 3.397 0.735
8 3.569 0.839
9 4.020 0.924
10 4.515 1.030
11 4.794 1.121
12 4.966 1.204
Note: Motors’s data can vary by ±10%
2.3.2 ATMEGA-16 MICROCONTROLLER:-
A microcontroller is a computer present in a single integrated circuit which is dedicated
to perform one task and execute one specific application.
It contains memory, programmable input/output peripherals as well a processor.
Microcontrollers are mostly designed for embedded applications and are heavily used in
automatically controlled electronic devices such as cellphones, cameras, microwave
ovens, washing machines, etc.
16
A.SPECIFICATION
Fig no. 2.3 OVERALL DIAGRAM OF ATMEGA-16
In our journey with the AVR we will be working on Atmega16 microcontroller, which is
a 40-pin IC and belongs to the mega AVR category of AVR family. The overall diagram
for atmega 16 is shown in Fig no. 2.3. Some of the features of Atmega16 are:
 16KB of Flash memory
 1KB of SRAM
 512 Bytes of EEPROM
 Available in 40-Pin DIP
 8-Channel 10-bit ADC
 Two 8-bit Timers/Counters
 One 16-bit Timer/Counter
 4 PWM Channels.
 In System Programmer (ISP)
 Serial USART
 SPI Interface
 Digital to Analog Comparator
17
B. PIN DIAGRAM
The pin diagram of ATMEGA-16 microcontroller is given in Fig no. 2.4.
Fig no. 2.4 PIN CONFIGURATION OF ATMEGA-16
18
C. PIN DESCRIPTION
PIN
NO
PINS DESCRIPTION
10 VCC Digital supply voltage.
11,31 GND Ground
33-40 Port A (PA7..PA0) Port A serves as the analog inputs to the A/D
Converter.
Port A also serves as an 8-bit bi-directional I/O port, if
the A/D Converter is not used.
Port pins can provide internal pull-up resistors (selected
for each bit).
The Port A output buffers have symmetrical drive
characteristics with both high
sink and source capability. When pins PA0 to PA7 are
used as inputs and are
externally pulled low, they will source current if the
internal pull-up resistors
are activated. The Port A pins are tri-stated when a
reset condition becomes active,
even if the clock is not running.
1-7 Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each
bit). The Port B output buffers have symmetrical drive
characteristics with both high
sink and source capability. As inputs, Port B pins that
are externally pulled low will
source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
19
22-29 Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each
bit). The Port C output buffers have symmetrical drive
characteristics with both high
sink and source capability. As inputs, Port C pins that
are externally pulled low will
source current if the pull-up resistors are activated. The
Port C pins are tri-stated when a reset condition
becomes active, even if the clock is not running. If the
JTAG interface is
enabled, the pull-up resistors on pins PC5(TDI),
PC3(TMS) and PC2(TCK) will be
activated even if a reset occurs.
Port C also serves the functions of the JTAG interface.
14-21 Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal
pull-up resistors (selected for each
bit). The Port D output buffers have symmetrical drive
characteristics with both high
sink and source capability. As inputs, Port D pins that
are externally pulled low will
source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
9 RESET Reset Input. A low level on this pin for longer than the
minimum pulse length will
generate a reset, even if the clock is not running.
Shorter pulses are not guaranteed to
20
2.3.3 16x4 ALPHANUMERIC LCD:-
A.DESCRIPTION
A 16 x 4 character LCD display with green backlit LCD. It is having 4 rows and each
row is having 16 columns. So it can display in 4 lines and in each line it can display upto
16 characters. It can display both the alphabetic and numbers. So it is called as
alphanumeric LCD. Standard Hitachi HD44780 compatible interface for easy connection
to microcontrollers as shown in fig no.2.5.
B. FEATURES
• Type: Character
• Display format: 16 x 4 characters
• Built-in controller: ST 7066 (or equivalent)
• Duty cycle: 1/16
• 5 x 8 dots includes cursor
• + 5 V power supply (also available for + 3 V)
• B/L to be driven by pin 1, pin 2, pin 15, pin 16 or A and K
• N.V. optional for + 3 V power supply
• Connected pin no: 20
Fig no. 2.5 16x4 LCD
21
C. TERMINAL LIST TABLE
Table no. 2.2 TERMINAL LIST OF 16X4 LCD
INTERFACE PIN
FUNCTION
PIN NO. SYMBOL FUNCTION
1 VSS Ground
2 VDD + 3 V or + 5 V
3 V0 Contrast adjustment
4 RS H/L register select signal
5 R/W H/L read/write signal
6 E H L enable signal
7 DB0 H/L data bus line
8 DB1 H/L data bus line
9 DB2 H/L data bus line
10 DB3 H/L data bus line
11 DB4 H/L data bus line
D. INTERFACING WITH ATMEGA-16
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. These modules are preferred over seven segments and other multi
segment LEDs. When you start working with LCD modules you will start feeling the real
power of MCU and your imaginations will be touching sky. The alphanumeric LCD that
we are going to interface is a 16X4 alphanumeric LCD. It means the LCD can display 16
characters in each row and it has four rows as shown in fig no.2.6. It is a HD44780
controller based LCD. There are two methods to interface any alphanumeric LCD with
AVR ATmega16 microcontroller: 8-bit and 4-bit interfacing method. In 8-bit interfacing
method, all the eight data pins of the alphanumeric LCD are used and in 4-bit interfacing
method, only the upper 4 data pins (D4, D5, D6 and D7) of the alphanumeric LCD are
used to send 8-bit data (or command) to the alphanumeric LCD from the microcontroller.
In 8-bit method, the 8-bit data (or command) is sent at a time using the 8 data lines of the
alphanumeric LCD but in 4-bit method, the 8-bit data (or command) cannot be sent at a
22
time to the alphanumeric LCD. So, the upper 4 bits of data (or command) are sent first
and the lower 4 bits are sent later.
FIG NO. 2.6 LCD INTERFACING WITH ATMEGA-16
2.3.4 128x64 GRAPHICAL LCD
A. DESCRIPTION
Various graphical LCDs are available in the market with different sizes.
Here JHD12864E Graphical LCD has been explained. This LCD has a display format
of 128x64 dots and has yellow-green colour backlight. Each LCD needs a controller to
execute its internal operations. This LCD uses twoKS0108 controllers.
The 128x64 LCD is divided into two equal halves with each half being controlled by a
separate KS0108 controller. Such LCDs (using KS0108 controller) involve paging
scheme, i.e., whole LCD is divided equally into pages. The paging scheme of
the graphical LCD can be easily understood from fig no.2.7.
23
B. FEATURES
• Type: Graphic
• Display format: 128 x 64 dots
• Built-in controller: Samsung KS
0107/KS 0108 (or equivalent)
• Duty cycle: 1/64
• + 5 V power supply
• N.V. built-in
• Compliant to RoHS directive
2002/95/EC
Fig no. 2.7 128X64 GRAPHICAl LCD
C. TERMINAL LIST TABLE
Table no. 2.3 TERMINAL LIST OF 128x64 GRAPHICAL LCD
PIN NUMBER SYMBOL FUNCTION
1 Vss GND
2 Vdd Power Supply (+ 5V)
3 Vo Contrast Adjustment
4 D/L Data/Instruction
5 R/W Data Read/Write
6 E H → L Enable Signal
7 DB0 Data Bus Line
8 DB1 Data Bus Line
9 DB2 Data Bus Line
10 DB3 Data Bus Line
11 DB4 Data Bus Line
12 DB5 Data Bus Line
13 DB6 Data Bus Line
24
14 DB7 Data Bus Line
15 CS1 Chip Select for IC1
16 CS2 Chip Select for IC2
17 RST Reset
18 Vee Negative Voltage Output
19 A Power Supply for LED (4.2V)
20 K Power Supply for LED (0V)
D. INTERFACING WITH ATMEGA-16
User friendly visual displays are used nowadays to keep track of working of any device.
Such a visual display can be anything ranging from old Analog meters to new and smart
Digital meters. In digital world, to keep track of devices, LCD is very commonly used.
LCDs are easy to program and prove to be a better display unit as compared to other
devices like seven segments and LED display units. The graphics LCDs are preferred
over the character LCDs for those applications where both character and graphical
representation are required. The use of a graphical LCD (GLCD) drastically changes the
look of any device. The 128x 64 Graphical LCD has 128 horizontal pixels and 64 vertical
pixels resolution and it is based on KS0108 controller. The 128×64 graphical LCD is
divided vertically into two sections, each with a resolution of 64×64 and separate
controllers are provided for each section for its functioning. Now, each section is again
divided horizontally into 8 pages, each with a resolution of 64×8.
In this project, we will learn How to interface a 128X64 Graphical LCD with AVR
ATmega16 microcontroller. Here, the microcontroller will write 8 bytes of binary data in
the 1st page of both left and right section of 128X64 Graphical LCD. In the Left section,
the microcontroller will write : 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
respectively and in the right section it will write : 0x80, 0x40, 0x20, 0x10, 0x08, 0x04,
0x02, 0x01 respectively. Now, see the output in the graphical LCD. It is shown in fig
no.2.8.
25
Fig no. 2.8 GRAPHICAL LCD INTERFACING WITH ATMEGA-16
2.3.5 L293D MOTOR DRIVER
A. DESRIPTION:-
L293D as shown in fig no.2.9 is a dual H-bridge motor driver integrated circuit (IC).
Motor drivers act as current amplifiers since they take a low-current control signal and
provide a higher-current signal. This higher current signal is used to drive the motors.
L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation,
two DC motors can be driven simultaneously, both in forward and reverse direction. The
motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 &
15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it
in clockwise and anticlockwise directions, respectively.
Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start
operating. When an enable input is high, the associated driver gets enabled. As a result,
26
the outputs become active and work in phase with their inputs. Similarly, when the enable
input is low, that driver is disabled, and their outputs are off and in the high-impedance
state. The terminal list table for L293D is given in table no. 2.3.
B. PIN DESCRIPTION
Fig no.2.9 PIN DESCRIPTION OF L293D
C. TERMINAL LIST TABLE
Table no.2.4 TERMINAL LIST TABLE FOR L293D
Pin
No
Function Name
1 Enable pin for Motor 1; active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground (0V) Ground
5 Ground (0V) Ground
27
6 Output 2 for Motor 1 Output 2
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Output 3
12 Ground (0V) Ground
13 Ground (0V) Ground
14 Output 2 for Motor 1 Output 4
15 Input2 for Motor 1 Input 4
16 Supply voltage; 5V (up to 36V) Vcc 1
2.3.6 ACS712 CURRENT SENSOR
A. DESCRIPTION
The Allegro™ ACS712 provides economical and precise solutions for AC or DC current
sensing in industrial, commercial, and communications systems. The device package
allows for easy implementation by the customer. Typical applications include motor
control, load detection and management, switch mode power supplies, and over current
fault protection. The device is not intended for automotive applications. The device
consists of a precise, low-offset, linear Hall circuit with a copper conduction path located
near the surface of the die. Applied current lowing through this copper conduction path
generates a magnetic field which the Hall IC converts into a proportional voltage. Device
accuracy is optimized through the close proximity of the magnetic signal to the Hall
transducer. A precise, proportional voltage is provided by the low-offset, chopper-
stabilized BiCMOS Hall IC, which is programmed for accuracy after packaging.
28
B. FEATURES
 Low-noise analog signal path
 Device bandwidth is set via the new FILTER pin
 5 μs output rise time in response to step input current
 80 kHz bandwidth
 Total output error 1.5% at TA = 25°C
 Small footprint, low-profile SOIC8 package
 1.2 mΩ internal conductor resistance
 2.1 kVRMS minimum isolation voltage from pins 1-4 to pins 5-8
 5.0 V, single supply operation
 66 to 185 mV/A output sensitivity
 Output voltage proportional to AC or DC currents
 Factory-trimmed for accuracy
 Extremely stable output offset voltage
 Nearly zero magnetic hysteresis
C. TERMINAL LIST TABLE
Table no.2.5 TERMINAL LIST TABLE FOR ACS712
Number Name Description
1 and 2 IP+ Terminals for current being sampled; fused
internally
3 and 4 IP– Terminals for current being sampled; fused
internally
5 GND Signal ground terminal
6 FILTER Terminal for external capacitor that sets bandwidth
7 VIOUT Analog output signal
8 VCC Device power supply terminal
29
D. IR SENSOR FOR SPEED MEASUREMENT:-
 IR sensor works on the principle of emitting IR rays and receiving the reflected
ray by a receiver (Photo Diode).
 IR source (LED) is used in forward bias.
 IR Receiver (Photodiode) is used in reverse bias.
E. IR SENSOR CIRCUIT (Fig no.2.10)
Fig no.2.10 IR SENSOR CIRCUIT
Fig no.2.11 IR SENSOR
A ir sensor is shown in fig no.2.11. When the IR receiver does not receive a signal, the
potential at the inverting input goes higher than that non-inverting input of the
comparator IC (LM339). Thus the output of the comparator goes low, but the LED does
not glow. When the IR receiver module receives signal to the potential at the inverting
30
input goes low. Thus the output of the comparator (LM 339) goes high and the LED
starts glowing. Resistor R1 (100 ), R2 (10k ) and R3 (330) are used to ensure that
minimum 10 mA current passes through the IR LED Devices like Photodiode and normal
LEDs respectively. Resistor VR2 (preset=5k ) is used to adjust the output terminals.
Resistor VR1 (preset=10k) is used to set the sensitivity of the circuit Diagram. Read more
about IR sensors.
F.ELEMENTS OF INFRARED DETECTION SYSTEM
A typical system for detecting infrared radiation is given in fig no.2.11
Fig no.2.12 BLOCK DIAGRAM OF INFRARED DETECTION
a. Infrared Source
All objects above 0 K radiate infrared energy and hence are infrared sources. Infrared
sources also include blackbody radiators, tungsten lamps, silicon carbide, and various
others. For active IR sensors, infrared Lasers and LEDs of specific IR wavelengths are
used as IR sources.
b. Transmission Medium
Three main types of transmission medium used for Infrared transmission are vacuum, the
atmosphere, and optical fibers.
The transmission of IR – radiation is affected by presence of CO2, water vapour and
other elements in the atmosphere. Due to absorption by molecules of water carbon
dioxide, ozone, etc. the atmosphere highly attenuates most IR wavelengths leaving some
31
important IR windows in the electromagnetic spectrum; these are primarily utilized
by thermal imaging/ remote sensing applications.
 Medium wave IR (MWIR:3-5 µm)
 Long wave IR (LWIR:8-14 µm)
Fig no.2.13 WAVELENGTH IN MM.
c. Optical Components.
Often optical components are required to converge or focus infrared radiations, to limit
spectral response, etc. To converge/focus radiations, optical lenses made of quartz, CaF2,
Ge and Si, polyethylene Fresnel lenses, and mirrors made of Al, Au or a similar material
are used. For limiting spectral responses, bandpass filters are used. Choppers are used to
pass/ interrupt the IR beams.
d. Infrared detectors.
Various types of detectors are used in IR sensors. Important specifications of detectors
are
Photosensitivity or Responsivity
Responsivity is the Output Voltage/Current per watt of incident energy. Higher the
better.
Noise Equivalent Power (NEP)
32
Detectivity(D*: D-star)
D* is the photosensitivity per unit area of a detector. It is a measure of S/N ratio of a
detector. D* is inversely proportional to NEP. Larger D* indicates better sensing
element.
In addition, wavelength region or temperature to be measured, response time, cooling
mechanism, active area, no of elements, package, linearity, stability, temperature
characteristics, etc. are important parameters which need attention while selecting IR
detectors.
e. Signal Processing
Since detector outputs are typically very small, preamplifiers with associated circuitry are
used to further process the received signals.
2.3.7 7805 VOLTAGE REGULATOR
A. DESCRIPTION
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed
linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and
would not give the fixed voltage output. The voltage regulator IC maintains the output
voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is
designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable
values can be connected at input and output pins depending upon the respective voltage
levels.Each type employs internal current limiting, thermal shut-down, and safe operating
area protection. If adequate heat sinking is provided, they can deliver over 1 A output
current. Although designed primarily as fixedvoltage regulators, these devices can be
used with external components for adjustable voltages and currents as shown in fig
no.2.13.
33
Fig no.2.14 CIRCUIT OF 7805 VOLTAGE REGULATOR
B. FEATURES
 Output Current up to 1 A
 Output Voltages: 5, 6, 8, 9, 10, 12, 15, 18, 24 V
 Thermal Overload Protection
 Short-Circuit Protection
 Output Transistor Safe
 Operating Area Protection as in fig no.2.14.
Fig no.2.15 VOLTAGE REGULATOR
C. TABLE FOR FUNCTION OF VOLTAGE REGULATOR
Table no.2.6 FUNCTION OF VOLTAGE REGULATOR
Pin No Function Name
1 Input voltage (5V-18V) Input
2 Ground (0V) Ground
3 Regulated output; 5V (4.8V-5.2V) Output
34
2.3.8 CAPACITOR:-
A capacitor is formed from two conducting plates separated by a thin insulating layer. If a
current i flows, positive change, q, will accumulate on the upper plate. To preserve
charge neutrality, a balancing negative charge will be present on the lower plate.
A capacitor is formed from two conducting plates separated by a thin insulating layer. If a
current i flows, positive change, q, will accumulate on the upper plate. To preserve
charge neutrality, a balancing negative charge will be present on the lower plate. There
will be a potential energy difference (or voltage v) between the plates proportional to q. v
= dAǫ q where A is the area of the plates, d is their separation and ǫ is the permittivity of
the insulating layer (ǫ0 = 8.85 pF/m for a vacuum).
A. TYPES OF CAPACITORS
There are a very, very large variety of different types of capacitor available in the market
place and each one has its own set of characteristics and applications, from very small
delicate trimming capacitors up to large power metal-can type capacitors used in high
voltage power correction and smoothing circuits.
The comparisons between the the differenttypes of capacitor is generally made with
regards to the dielectric used between the plates. Like resistors, there are also variable
types of capacitors which allow us to vary their capacitance value for use in radio or
“frequency tuning” type circuits.
Commercial types of capacitors are made from metallic foil interlaced with thin sheets of
either paraffin-impregnated paper or Mylar as the dielectric material. Some capacitors
look like tubes, this is because the metal foil plates are rolled up into a cylinder to form a
small package with the insulating dielectric material sandwiched in between them.
a. Dielectric Capacitors
They are usually of the variable type were a continuous variation of capacitance is
required for tuning transmitters, receivers and transistor radios. Variable dielectric
capacitors are multi-plate air-spaced types that have a set of fixed plates (the stator vanes)
and a set of movable plates (the rotor vanes) which move in between the fixed plates.
35
The position of the moving plates with respect to the fixed plates determines the overall
capacitance value. The capacitance is generally at maximum when the two sets of plates
are fully meshed together. High voltage type tuning capacitors have relatively large
spacings or air-gaps between the plates with breakdown voltages reaching many
thousands of volts.
b. Film Capacitors
They are the most commonly available of all types of capacitors, consisting of a
relatively large family of capacitors with the difference being in their dielectric
properties. These include polyester (Mylar), polystyrene, polypropylene, polycarbonate,
metalised paper, Teflon etc. Film type capacitors are available in capacitance ranges from
as small as 5pF to as large as 100uF depending upon the actual type of capacitor and its
voltage rating.
c. Ceramic Capacitors or Disc Capacitors
They are generally called, are made by coating two sides of a small porcelain or ceramic
disc with silver and are then stacked together to make a capacitor. For very low
capacitance values a single ceramic disc of about 3-6mm is used. Ceramic capacitors
have a high dielectric constant (High-K) and are available so that relatively high
capacitance’s can be obtained in a small physical size.Ceramic types of capacitors
generally have a 3-digit code printed onto their body to identify their capacitance value in
pico-farads. Generally the first two digits indicate the capacitors value and the third digit
indicates the number of zero’s to be added. For example, a ceramic disc capacitor with
the markings 103 would indicate 10 and 3 zero’s in pico-farads which is equivalent
to 10,000 pF or 10nF.
Likewise, the digits 104 would indicate 10 and 4 zero’s in pico-farads which is equivalent
to 100,000 pF or 100nF and so on. So on the image of the ceramic capacitor above the
numbers 154 indicate 15 and 4 zero’s in pico-farads which is equivalent to 150,000
36
pF or 150nF or 0.15uF. Letter codes are sometimes used to indicate their tolerance value
such as: J = 5%, K = 10% or M = 20% etc. The figure is shown in fig no.2.15.
d. Electrolytic Capacitors
These are generally used when very large capacitance values are required. Here instead of
using a very thin metallic film layer for one of the electrodes, a semi-liquid electrolyte
solution in the form of a jelly or paste is used which serves as the second electrode
(usually the cathode).The dielectric is a very thin layer of oxide which is grown electro-
chemically in production with the thickness of the film being less than ten microns. This
insulating layer is so thin that it is possible to make capacitors with a large value of
capacitance for a small physical size as the distance between the plates, d is very small.
The figure is shown in fig no.2.16.
Fig no.2.16 CERAMIC CAPACITOR Fig no.2.17 ELECTROLYTIC CAPACITOR
2.3.9 RESISTOR
The resistors that you would most likely see if you opened up a CD player, VCR, or other
electronic device.
 They basically look like little cylinders with colored lines painted on them.
 The colored lines tell you the resistance and error range (tolerance) for a resistor
according to the following rules and table of numbers. You do NOT have to
memorize this table… it will be given to you if you need it.
 To use the table you need to remember the following rules:
1. The first line is the first digit
2. The second line is the second digit
3. The third line is the multiplier
4. The last line (if any) is the tolerance
37
 Some resistors may have additional colored bands, but we will ignore them here.
 They usually have something to do with measuring things like failure rates or
temperature coefficients.
A. TYPES OF RESISTORS
Resistors can be broadly classified based on the following criteria: the type of material
used, the power rating and resistance value.
a. Carbon Composition Resistors:
These resistors are cylindrical rods which are a mixture of carbon granules and powdered
ceramic. The resistor value depends on the composition of the ceramic material. A higher
quantity of ceramic content will result in more resistance. Since the rod is coated with an
insulated material, there are chances of damage due to excessive heat caused
by soldering.
High current and voltage can also damage the resistor. These factors bring irreversible
changes in the resistance power of these resistors. This type of resistor is rarely used
nowadays due to their high cost and are only preferred in power supply and welding
circuits. The figure is shown in fig no.2.17.
Fig no.2.18 CARBON COMPOSITION RESISTORS
38
b. Carbon film resistors:
This resistor is formed by depositing a carbon film layer on an insulating substrate.
Helical cuts are then made through the carbon film to trace a long and helical resistive
path. The resistance can be varied by using different resistivity carbon material and
modifying the shape of the resistor. The helical resistive path make these resistors highly
inductive and of little use for RF applications. The figure is shown in fig no.2.18.
They exhibit a temperature coefficient between -100 and -900 ppm/ °C. The carbon film
is protected either by a conformal epoxy coating or a ceramic tube. The operation of
these resistors requires high pulse stability.
Fig no.2.19 CARBON FILM RESISTORS
Obviously, it would be impractical to have available resistors of every possible value for
example, 1Ω,2Ω, 3Ω, 4Ω etc, because literally tens of hundreds of thousands, if not tens
of millions of different resistors would need to exist to cover all the possible values.
Instead, resistors are manufactured in what are called “preferred values” with their
resistance value printed onto their body in coloured ink.
B. RESISTOR COLOUR BAND
The resistance value, tolerance, and wattage rating are generally printed onto the body of
the resistor as numbers or letters when the resistors body is big enough to read the print,
39
such as large power resistors. But when the resistor is small such as a 1/4W carbon or
film type, these specifications must be shown in some other manner as the print would be
too small to read.
So to overcome this, small resistors use coloured painted bands to indicate both their
resistive value and their tolerance with the physical size of the resistor indicating its
wattage rating. These coloured painted bands produce a system of identification generally
known as a Resistors Colour Code.
An international and universally accepted resistor colour code scheme was developed
many years ago as a simple and quick way of identifying a resistors ohmic value no
matter what its size or condition. It consists of a set of individual coloured rings or bands
in spectral order representing each digit of the resistors value.
The resistor colour code markings are always read one band at a time starting from the
left to the right, with the larger width tolerance band oriented to the right side indicating
its tolerance. By matching the colour of the first band with its associated number in the
digit column of the colour chart below the first digit is identified and this represents the
first digit of the resistance value.
Again, by matching the colour of the second band with its associated number in the digit
column of the colour chart we get the second digit of the resistance value and so on. Then
the resistor colour code is read from left to right as illustrated in fig no.2.19:
a. The Standard Resistor Colour Code Chart:
Colour Digit Multiplier Tolerance
Black 0 1
40
Brown 1 10 ± 1%
Red 2 100 ± 2%
Orange 3 1,000
Yellow 4 10,000
Green 5 100,000 ± 0.5%
Blue 6 1,000,000 ± 0.25%
Violet 7 10,000,000 ± 0.1%
Grey 8 ± 0.05%
White 9
41
Gold 0.1 ± 5%
Silver 0.01 ± 10%
None ± 20%
Fig no.2.20 RESISTOR COLOUR BAND
b. Resistor Colour Code
This system is all well and good but we need to understand how to apply it in order to get
the correct value of the resistor. The “left-hand” or the most significant coloured band is
the band which is nearest to a connecting lead with the colour coded bands being read
from left-to-right as follows;
Digit, Digit, Multiplier = Colour, Colour x 10 colour
in Ohm’s (Ω’s)
For example, a resistor has the following coloured markings;
Yellow Violet Red = 4 7 2 = 4 7 x 102
= 4700Ω or 4k7.
The fourth and fifth bands are used to determine the percentage tolerance of the resistor.
Resistor tolerance is a measure of the resistors variation from the specified resistive value
and is a consequence of the manufacturing process and is expressed as a percentage of its
“nominal” or preferred value.
Typical resistor tolerances for film resistors range from 1% to 10% while carbon resistors
have tolerances up to 20%. Resistors with tolerances lower than 2% are called precision
resistors with the or lower tolerance resistors being more expensive.
42
Most five band resistors are precision resistors with tolerances of either 1% or 2% while
most of the four band resistors have tolerances of 5%, 10% and 20%. The colour code
used to denote the tolerance rating of a resistor is given as;
Brown = 1%, Red = 2%, Gold = 5%, Silver = 10 %
If resistor has no fourth tolerance band then the default tolerance would be at 20%.
It is sometimes easier to remember the resistor colour code by using mnemonics or
phrases that have a separate word in the phrase to represent each of the Ten + Two
colours in the code. However, these sayings are often very crude but never the less
effective for remembering the resistor colours. Here are just a few of the more “cleaner”
versions but many more exist:
 Bad Booze Rots Our Young Guts But Vodka Goes Well
 Bad Boys Ring Our Young Girls But Vicky Goes Without
 Bad Boys Ring Our Young Girls But Vicky Gives Willingly —
Get Some Now (This one is only slightly better because it includes the tolerance
bands of Gold, Silver, and None).
As an added bonus, why not download and make our handy DIY Resistor Colour Code
Wheel as a free and handy reference guide to help work out those resistor colour codes.
43
CHAPTER 3
INTRODUCTION TO AVR SERIES
3.1 INTRODUCTION
 It is a combination of Hardware and Software that is built to control one or a few
dedicated functions, and is not designed to be programmed by the end user in the
same way that a desktop computer is as shown in fig no.2.20.
 Contains processing cores that are either Micro-Controllers or Digital Signal
Processors.
 An embedded system is designed to run on its own without human intervention,
and may be required to respond to events in real time.
Fig no.3.1 EMBEDDED SYSTEM
3.2 OVERVIEW
The ATmega-16 is a low-power CMOS 8-bit microcontroller based on the AVR
enhanced RISC architecture. By executing powerful instructions in a single clock cycle,
the ATmega-16 achieves throughputs approaching 1 MIPS per MHz allowing the
designer to optimize power consumption 0versus processing speed.
44
3.3 FEATURES
 High-performance, Low-power AVR® 8-bit Microcontroller
 Advanced RISC Architecture
– 131 Powerful Instructions – Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier
 Nonvolatile Program and Data Memories
– 16K Bytes of In-System Self-Programmable Flash
 Endurance: 10,000 Write/Erase Cycles
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
– 512 Bytes EEPROM
 Endurance: 100,000 Write/Erase Cycles
– 1K Byte Internal SRAM
– Programming Lock for Software Security
 JTAG (IEEE std. 1149.1 Compliant) Interface
– Boundary-scan Capabilities According to the JTAG Standard
– Extensive On-chip Debug Support
– Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface
 Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
 Mode
– Real Time Counter with Separate Oscillator
– Four PWM Channels
– 8-channel, 10-bit ADC
45
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Programmable Gain at 1x, 10x, or 200x
– 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
– Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby
and Extended Standby
 I/O and Packages
– 32 Programmable I/O Lines
– 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
 Operating Voltages
– 2.7 - 5.5V for ATmega16L
– 4.5 - 5.5V for ATmega16
 Speed Grades
– 0 - 8 MHz for ATmega16L
– 0 - 16 MHz for ATmega16
 Power Consumption @ 1 MHz, 3V, and 25°C for ATmega16L
– Active: 1.1 mA
– Idle Mode: 0.35 mA
– Power-down Mode: < 1 Μa
46
3.4 PIN DESCRIPTION
The pin description of ATMEGA-16 is given in fig no.3.1.
Fig no.3.2 PIN CONFIGURATION OF ATMEGA 16
47
3.5 BLOCK DIAGRAM
The AVR core combines a rich instruction set with 32 general purpose working registers.
All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing
two independent registers to be accessed in one single instruction executed in one clock
cycle. The resulting architecture is more code efficient while achieving throughputs up to
ten times faster than conventional CISC microcontrollers. The figure is shown in fig
no.3.2.
Fig no.3.3 BLOCK DIAGRAM OF ATMEGA 16
48
The ATmega16 provides the following features: 16K bytes of In-System Programmable
Flash Program memory with Read-While-Write capabilities, 512 bytes EEPROM, 1K
byte SRAM, 32 general purpose I/O lines, 32 general purpose working registers, a JTAG
interface for Boundary-scan, On-chip Debugging support and programming, three
flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial
programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit
ADC with optional differential input stage with programmable gain (TQFP package
only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and
six software selectable power saving modes. The Idle mode stops the CPU while
allowing the USART, Two-wire interface, A/D Converter, SRAM, Timer/Counters, SPI
port, and interrupt system to continue functioning. The Power-down mode saves the
register contents but freezes the Oscillator, disabling all other chip functions until the
next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous
Timer continues to run, allowing the user to maintain a timer base while the rest of the
device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules
except Asynchronous Timer and ADC, to minimize switching noise during ADC
conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of
the device is sleeping. This allows very fast start-up combined with low-power
consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous
Timer continue to run.
The device is manufactured using Atmel’s high density nonvolatile memory technology.
The On-chip ISP Flash allows the program memory to be reprogrammed in-system
through an SPI serial interface, by a conventional nonvolatile memory programmer, or by
an On-chip Boot program running on the AVR core. The boot program can use any
interface to download the application program in the Application Flash memory.
Software in the Boot Flash section will continue to run while the Application Flash
section is updated, providing true Read-While-Write operation. By combining an 8-bit
RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel
ATmega16 is a powerful microcontroller that provides a highly-flexible and cost-
effective solution to many embedded control applications.
49
The ATmega16 AVR is supported with a full suite of program and system development
tools including: C compilers, macro assemblers, program debugger/simulators, in-circuit
emulators, and evaluation kits.
A. Pin Descriptions:-
VCC Digital supply voltage.
GND Ground.
Port A (PA7..PA0)
Port A serves as the analog inputs to the A/D
Converter.
Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.
Port pins can provide internal pull-up resistors (selected for each bit). The Port A output
buffers have symmetrical drive characteristics with both high sink and source capability.
When pins PA0 to PA7 are used asinputs and are externally pulled low, they will source
current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a
reset condition becomes active, even if the clock is not running.
Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port B output
buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port B pins that
are externally pulled low will source current if the pull-up
resistors are activated. The Port B pins are tri-stated when a
reset condition becomes active, even if the clock is not
running.
Port B also serves the functions of various special features
of the ATmega16 as listed on page 58.
50
Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port C output
buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port C pins that
are externally pulled low will source current if the pull-up
resistors are activated. The Port C pins are tri-stated when a
reset condition becomes active, even if the clock is not
running. If the JTAG interface is enabled, the pull-up
resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will
be activated even if a reset occurs.
Port C also serves the functions of the JTAG interface and
other special features of the ATmega16 as listed on page
61.
Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-
up resistors (selected for each bit). The Port D output
buffers have symmetrical drive characteristics with both
high sink and source capability. As inputs, Port D pins that
are externally pulled low will source current if the pull-up
resistors are activated. The Port D pins are tri-stated when a
reset condition becomes active, even if the clock is not
running.
Port D also serves the functions of various special features
of the ATmega16 as listed on page 63.
RESET Reset Input. A low level on this pin for longer than the minimum pulse
length will generate a reset, even if the clock is not running. The minimum
pulse length is given in Table 15 on page 38. Shorter pulses are not
guaranteed to generate a reset.
XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock
51
operating circuit.
XTAL2 Output from the inverting Oscillator amplifier.
AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is
used, it should be connected to VCC through a low-pass filter.
b. Memory configuration
The memory spaces in the AVRarchitecture are all linear and regular memory maps.
A flexible interrupt module has its control registers in the I/O space with an additional
global interrupt enable bit in the Status Register. All interrupts have a separate interrupt
vector in the interrupt vector table. The interrupts have priority in accordance with their
interrupt vector position. The lower the interrupt vector address, the higher the priority.
ALU – Arithmetic Logic The high-performance AVR ALU operates in direct connection
with all the 32 general unit purpose working registers. Within a single clock cycle,
arithmetic operations between general purpose registers or between a register and an
immediate are executed. The ALU operations are divided into three main categories –
arithmetic, logical, and bit-functions. Some implementations of the architecturealso provide
a powerful multiplier supporting both signed/unsigned multiplication and fractional format.
See the “Instruction Set” section for a detailed description.
Status Register The Status Register contains information about the result of the most
recently executed arithmetic instruction. This information
can be used for altering program flow in order to perform
conditional operations. Note that the Status Register is
updated after all ALU operations, as specified in the
Instruction Set Reference. This will in many cases remove
the need for using the dedicated compare instructions,
resulting in faster and more compact code.
52
The Status Register is not automatically stored when entering an
interrupt routine and restored when returning from an interrupt. This
must be handled by software.
The AVR Status Register – SREG – is defined as:
Bit 7 6 5 4 3 2 1 0
SREG
Read/W
rite R/W R/W R/W R/W R/W R/W R/W
R/W
Initial Value 0 0 0 0 0
0 0 0
• Bit 7 – I: Global Interrupt Enable
The Global Interrupt Enable bit must be set for the interrupts to be enabled. The
individual interrupt enable control is then performed in separate control registers. If the
Global Interrupt Enable Register is cleared, none of the interrupts are enabled
independent of the individual interrupt enable settings. The I-bit is cleared by hardware
after an interrupt has occurred, and is set by the RETI instructionto enable subsequent
interrupts. The Ibit can also be set and cleared by the application with the SEI and CLI
instructions, as described in the instruction set reference.
• Bit 6 – T: Bit Copy Storage
The Bit Copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T-bit as source
or destination for the operated bit. A bit from a register in the Register File can be
copied into T by the BST instruction, and a bit in T can be copied into a bit in a register
in the Register File by the BLD instruction.
• Bit 5 – H: Half Carry Flag
I T H S V N Z C
53
The Half Carry Flag H indicates a Half Carry in some arithmetic operations. Half Carry is
useful in BCD arithmetic. See the “Instruction Set Description” for detailed
information.
• Bit 4 – S: Sign Bit, S = N ⊕ V
The S-bit is always an exclusive or between the Negative Flag N and the Two’s
Complement Overflow Flag V. See the “Instruction Set Description” for detailed
information.
• Bit 3 – V: Two’s Complement Overflow Flag
The Two’s Complement Overflow Flag V supports two’s complement arithmetics. See
the “Instruction Set Description” for detailed information.
• Bit 2 – N: Negative Fla
The Negative Flag N indicates a negative result in an arithmetic or logic operation. See
the “Instruction Set Description” for detailed information.
• Bit 1 – Z: Zero Flag
The Zero Flag Z indicates a zero result in an arithmetic or logic operation. See the
“Instruction Set Description” for detailed information.
• Bit 0 – C: Carry Flag
The Carry Flag C indicates a carry in an arithmetic or logic operation. See the
“Instruction Set Description” for detailed information.
54
CHAPTER 4
SOFTWARES USED
4.1 INTRODUCTION
The software used for making this project are:
 AVR Studio 4
 Win AVR 2010
 SinaProg
 USBasp Driver
4.2 AVR STUDIO 4:-
AVR Applications in Windows Environments. AVR Studio provides a project
management tool, source file editor, simulator, assembler and front-end for C/C++,
programming, emulation and on-chip debugging.
It is used for writing and debugging AVR Applications in Windows
9x/ME/NT/2000/XP/VISTA/7/8/8.1. AVR Studio provides a project management tool,
source file editor, simulator, assembler and front-end for C/C++, programming,
emulation and on-chip debugging.
AVR Studio is an Integrated Development Environment (IDE) for writing and debugging
AVR Studio supports the complete range of ATMEL AVR tools and each release will
always contain the latest updates for both the tools and support of new AVR devices.
AVR Studio 4 has a modular architecture, which allows even more interaction with 3rd
party as shown in fig no. 4.1.
55
Fig no.4.1 AVR STUDIO 4
A. System Requirements
Supported Operating Systems:
• Windows XP (x86) with Service Pack 3 - all editions except Starter Edition
• Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except Starter
Edition
• Windows XP (x64) with Service Pack 2
• Windows Vista (x64) with Service Pack 1, Service Pack 2
• Windows 7 (x86 and x64)
• Windows 8 & 8.1 (x86 and x64)
B. Hardware Requirements:
• Computer that has a 1.6GHz or faster processor
• 1 GB RAM for x86
• 2 GB RAM for x64
• An additional 512 MB RAM if running in a Virtual Machine
56
• 2GB of available hard disk space
• 5400 RPM hard disk drive
• DirectX 9-capable video card that runs at 1024 x 768 or higher display resolution
We always recommend to have the latest OS versions and service packs installed.
We also recommend Internet Explorer 6 or later.
4.3 WINAVR 2010:-
WinAVR 2010 is a suite of executable, open source software development tools for the
Atmel AVR series of RISC microprocessors hosted on the Windows platform.The
toolbox includes the GCC compiler for applications written in C or C++.
The suite also includes the avrdude utility that allows you to write the EEPROM memory
chip of the controller. It is used by AVR Studio for compiling programs/applications.
a.Supported Operating Systems
• Windows XP (x86) with Service Pack 3 - all editions except Starter Edition
• Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except Starter
Edition
• Windows XP (x64) with Service Pack 2
• Windows Vista (x64) with Service Pack 1, Service Pack 2
• Windows 7 (x86 and x64)
• Windows 8 & 8.1 (x86 and x64)
Hardware Requirements:
• Computer that has a 1.6GHz or faster processor
• 1 GB RAM for x86
• 2 GB RAM for x64
• An additional 512 MB RAM if running in a Virtual Machine
• 2GB of available hard disk space
• 5400 RPM hard disk drive
57
4.4 SINAPROG:-
SinaProg is a burner software with simple user interface. It also incorporates an AVR
Fuse calculator. It uses improved AVRDUDE 5.10 & supports new devices &
new programmers. It lists only the available ports & Baud rate selection is possible.
It is a standalone simple software & no installation is required.
Fig no.4.2 SINAPROG
A.System Requirements
Supported Operating Systems:
 Windows XP (x86) with Service Pack 3 - all editions except Starter Edition
 Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except
Starter Edition
 Windows XP (x64) with Service Pack 2
 Windows Vista (x64) with Service Pack 1, Service Pack 2
58
 Windows 7 (x86 and x64)
 Windows 8/8.1 (x86 and x64)
Hardware Requirements:
Computer that has a 1.6GHz or faster processor
• 1 GB RAM for x86
• 2 GB RAM for x64
• An additional 512 MB RAM if running in a Virtual Machine
• 2GB of available hard disk space
• 5400 RPM hard disk drive
4.5 USBasp Driver:-
USBasp Driver is firmware-only USB driver that is needed by USB based AVR
programmers to download hex file from the PC/Laptop to the target device
(Microcontroller).
Operating Systems Supported
 Window 98
 Window NT
 Window XP
 Window Vista
 Window 7(32-Bit& 64-Bit)
 Window 8/8.1(32-Bit &64-Bit)
For Windows 8 or higher version Windows, the “Device Driver Signature Enforcement”
is Enabled by default, for which the USBasp Driver can’t be installed directly. First you
have to disable this Signature Enforcement and then you can install the USBasp Driver.
59
CHAPTER 5
ANALYSIS OF THE PROJECT
5.1 INTRODUCTION
The total project consists of four sections i.e
 Displaying the measured parameters(V,I,N,T) of a DC motor
 Giving limit values for protection purpose
 Graphical observation of respective parameters(N~I, V~t)
5.2 BLOCK DIAGRAM:-
Fig no 5.1 BLOCK DIAGRAM OF MEASUREMENT, PROTECTION AND GRAPHICAL
OBSERVATION OF DC MOTOR
Note: Power supply unit is not shown here, it is connected to each blocks.
60
5.3 CIRCUIT DIAGRAM:-
Fig no.5.2 CIRCUIT DIAGRAM FOR MEASUREMENT, PROTECTION AND
GRAPHICAL OBSERVATION OF DC MOTOR
5.4 DESCRIPTION
A. Displaying measured parameters of DC motor:-
The project is done to measure the basic parameters of the DC motor i.e. voltage, current, speed
and torque which are the most important parameters for different loads. The different parameters
are measured by different techniques.
61
The voltage is measured across the supply terminals of motor by using voltage divider circuit and
ADC converter. The (0-12)V voltage level of motor is compared with (0-5)V of the uc voltage
level and according to that uc sends the voltage value by doing the comparison. The current flows
through motor is measured by ACS712 current sensor which is connected to the 39th
and 40th
pin
of microcontroller as shown in circuit diagram. It is connected in series in between motor driver
and the DC motor so that the current flows through it. The speed is counted by using a IR sensor
which provides increment of counter value per rotation by doing a small circle in wheel. Finally it
provides the number of rotations counted in one minute. The required torque parameter value is
calculated by ATMEGA-16 microcontroller by the required equation
Fig no.5.3 16X4 LCD
B. Giving limit values for protection purpose:-
A dc motor should be protected against the parameters like current, voltage, speed, torque, etc.
The voltage is measured and given as input to the microcontroller. Here power supply circuit is
supplied through a 12V, 1 amp adapter so voltage level will not exceed to 12V. SO the voltage
62
limit is given as 8V below which uc is programmed to stop the motor. Similarly the ACS712
current sensor gives the current value in milliampare. It is programmed to protect the motor
against over current. The limit value given is 200 mamp. The uc will stop the motor if I value
exceeds the limit. The speed sensor gives thr rpm value as input to the uc and the limit value is
given 100 below which the uc stops the motor. Similarly the maximum torque value is given 90
N-cm.
C. Graphical observation of respective parameters
A 128X64 graphical LCD is used for graphical observation of the motor characteristics and the
parameters. Here the LCD is programmed to divide into two parts horizontally. One part will
show the different characteristics of dc motor like N~I, T~I, N~T and the other part will show any
required different parameters like here it is programmed in the AVR STUDIO-
4 for the voltage in X-axis and time in Y-axis as in fig no.5.4.
Fig no.5.4 128x64 GRAPHICAL LCD
As,
So it is observed that torque is directly proportional to the armature current. Also,
From the equations torque (T) is inversely proportional to speed (N) and torque (T) is directly
proportional to current (I) so that speed (N) and current (I) are inversely proportional to each
other.
63
CHAPTER 6
RESULTS AND DISCUSSIONS
6.1 INTRODUCTION
The project model is supplied with 12V adapter through the dc socket. When the power switch is
switched ON the 3 pins of 7805 voltage regulator provides three voltage levels i.e +12V, +5V and
ground. From the three pins the total circuit is supplied according to the requirement.
6.2 DISCUSSIONS
The ATMEGA-16A microcontroller is supplied with +5V. And the L293D motor driver is
connected with the three pins of power supply unit. The motor starts rotating and all the
measuring elements starts to measure the parameter values. LCD is displaying name of the
parameters and both the measured values and limit values in first, second and third column
respectively. From this experiment two graphs are plotted in GLCD from the observation values.
The first graph is plotted by programming N~I out of the three characteristics curves. Figure-4
shows the graphical observation of N~I curve where speed is inversely proportional to current.
The second graph is plotted by programming for any parameters. Here it is taken voltage vs time.
The figure shows that voltage is constant with respect to time. The graph can be changed by
taking any parameters according to the requirement by changing the variable names in X-axis and
Y-axis respectively in the program. The figure is shown in fig no.6.1.
Fig no. 6.1 GRAPHICAL DISPLAYING OF MEASURED VALUE IN 128x64 LCD
64
CHAPTER 7
CONCLUSION AND FUTURE APPLICATIONS
The basic goal of this project is to calculate parameters, to provide protection, to control the speed
and to draw graphs according to respective parameters. In large industries it the same task is done
using different panels which are very costly and are not affordable for small applications which
are mentioned in introduction part. In this project the total four objectives are operated by a single
ATMEGA-16 microcontroller. So it is very cheap compared to the total operations done by it. For
this reason it can be used as an application in different products like in drill machines for over
current protection, mixer machine for speed control, in lathe and spinning and weaving machines
to show the speed of operation and limit value for smooth operation, in research centers for
graphical observations, in boring mills to show speed and torque, etc. Also in future it can be
implemented like a product by interfacing a keypad to the total circuit through which the limit
values can be entered for different product applications according to their voltage, current, speed
and torque ratings. So it can be modified as a displaying, protecting, speed controlling and
graphical curve plotting product for universal dc motor based applications.
65
REFERENCES
[1] www.alldatasheet.com/datasheet-pdf/pdf/78532/.../ATMEGA16.html
[2] www.ti.com/lit/ds/symlink/l293.pdf
[3] www.allegromicro.com/~/media/Files/Datasheets/ACS712-Datasheet.ashx
[4] http://www.datasheetcatalog.com/datasheets_pdf/L/C/D/-/LCD-016M004A.shtml
[5] http://www.engineersgarage.com/electronic-components/graphics-lcd
[6] http://planetcalc.com/1908/
[7]http://www.ablab.in/128x64-graphical-lcd-interfacing-with-avr-atmega16-
microcontroller/
[8]http://www.engineersgarage.com/tutorials/resistors
[9] http://www.engineersgarage.com/electronic-components/graphics-lcd
[10] http://www.engineersgarage.com/articles/infrared-sensors
[11] http://www.rakeshmondal.info/IC-7805-Voltage-Regulator
[12]http://www.etlogics.com/skin/frontend/default/ma_camerastore/img/sensors/ir/IR_senso
r.jpg
[13]http://www.datasheetlib.com/datasheet/164899/acs712_allegromicrosystems.html?page
3

More Related Content

What's hot

Automatic Door Opener using PIR Sensor
Automatic Door Opener using PIR SensorAutomatic Door Opener using PIR Sensor
Automatic Door Opener using PIR SensorRAGHUVARMA09
 
Ec2308 mini project
Ec2308 mini projectEc2308 mini project
Ec2308 mini projectunnimaya_k
 
Smart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharSmart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharShivnaresh Likhar
 
Automatic room light controller using microcontroller and visitor counter
Automatic room light controller using microcontroller and visitor counterAutomatic room light controller using microcontroller and visitor counter
Automatic room light controller using microcontroller and visitor countereSAT Journals
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARHarshit Jain
 
Hand Gesture Controlled Wireless Robot
Hand Gesture Controlled Wireless RobotHand Gesture Controlled Wireless Robot
Hand Gesture Controlled Wireless Robotsiddhartha muduli
 
Automatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingAutomatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingIRJET Journal
 
Digital Tachometer using Aurdino
Digital Tachometer using AurdinoDigital Tachometer using Aurdino
Digital Tachometer using Aurdinoijtsrd
 
Hand gesture controlled robot with arduino
Hand gesture controlled robot with arduinoHand gesture controlled robot with arduino
Hand gesture controlled robot with arduinoAnindyaAdhikary3
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2DIPAN GHOSH
 
Bidirectional visitor counter & home automation by Jitendra Dhaka
Bidirectional visitor counter & home automation by Jitendra DhakaBidirectional visitor counter & home automation by Jitendra Dhaka
Bidirectional visitor counter & home automation by Jitendra DhakaNIT srinagar
 
Three-Axis Auto Stabilizing Video Camera Platform
Three-Axis Auto Stabilizing Video Camera PlatformThree-Axis Auto Stabilizing Video Camera Platform
Three-Axis Auto Stabilizing Video Camera PlatformEklavya Sharma
 
Gesture Controlled Robot
Gesture Controlled RobotGesture Controlled Robot
Gesture Controlled RobotSujit Singh
 
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET Journal
 
Hand gesture controlled wheel chair
Hand gesture controlled wheel chairHand gesture controlled wheel chair
Hand gesture controlled wheel chairRanju Varughese
 
IRJET- Solar Powered Transmission Line Inspection Robot
IRJET- Solar Powered Transmission Line Inspection RobotIRJET- Solar Powered Transmission Line Inspection Robot
IRJET- Solar Powered Transmission Line Inspection RobotIRJET Journal
 
Accelerometer controlled robot
Accelerometer controlled robotAccelerometer controlled robot
Accelerometer controlled robotMohit Keshav
 

What's hot (20)

Automatic Door Opener using PIR Sensor
Automatic Door Opener using PIR SensorAutomatic Door Opener using PIR Sensor
Automatic Door Opener using PIR Sensor
 
Ec2308 mini project
Ec2308 mini projectEc2308 mini project
Ec2308 mini project
 
Visitor counter
Visitor counterVisitor counter
Visitor counter
 
Smart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likharSmart door project ppt shivnaresh likhar
Smart door project ppt shivnaresh likhar
 
Automatic room light controller using microcontroller and visitor counter
Automatic room light controller using microcontroller and visitor counterAutomatic room light controller using microcontroller and visitor counter
Automatic room light controller using microcontroller and visitor counter
 
ACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CARACCELEROMETER BASED GESTURE ROBO CAR
ACCELEROMETER BASED GESTURE ROBO CAR
 
Hand Gesture Controlled Wireless Robot
Hand Gesture Controlled Wireless RobotHand Gesture Controlled Wireless Robot
Hand Gesture Controlled Wireless Robot
 
Automatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler ServicingAutomatic Inspection System for Two Wheeler Servicing
Automatic Inspection System for Two Wheeler Servicing
 
Digital Tachometer using Aurdino
Digital Tachometer using AurdinoDigital Tachometer using Aurdino
Digital Tachometer using Aurdino
 
Hand gesture controlled robot with arduino
Hand gesture controlled robot with arduinoHand gesture controlled robot with arduino
Hand gesture controlled robot with arduino
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
 
Bidirectional visitor counter & home automation by Jitendra Dhaka
Bidirectional visitor counter & home automation by Jitendra DhakaBidirectional visitor counter & home automation by Jitendra Dhaka
Bidirectional visitor counter & home automation by Jitendra Dhaka
 
Three-Axis Auto Stabilizing Video Camera Platform
Three-Axis Auto Stabilizing Video Camera PlatformThree-Axis Auto Stabilizing Video Camera Platform
Three-Axis Auto Stabilizing Video Camera Platform
 
Gesture Controlled Robot
Gesture Controlled RobotGesture Controlled Robot
Gesture Controlled Robot
 
Spark
SparkSpark
Spark
 
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
IRJET- Testing the Induction Motor Voltage, Current, Torque, Speed, Power and...
 
Hand gesture controlled wheel chair
Hand gesture controlled wheel chairHand gesture controlled wheel chair
Hand gesture controlled wheel chair
 
IRJET- Solar Powered Transmission Line Inspection Robot
IRJET- Solar Powered Transmission Line Inspection RobotIRJET- Solar Powered Transmission Line Inspection Robot
IRJET- Solar Powered Transmission Line Inspection Robot
 
Accelerometer controlled robot
Accelerometer controlled robotAccelerometer controlled robot
Accelerometer controlled robot
 

Viewers also liked

pfe sans gas calculation
pfe sans gas calculationpfe sans gas calculation
pfe sans gas calculationOmar Omrane
 
2015 latest IEEE electrical project list for BTech, Mtech, Phd
2015 latest IEEE electrical project list for BTech, Mtech, Phd 2015 latest IEEE electrical project list for BTech, Mtech, Phd
2015 latest IEEE electrical project list for BTech, Mtech, Phd Asoka Technologies
 
project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded systemram avtar
 
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...ijscmcjournal
 
Configuration of pid controller for speed control of dc motor utilizing optim...
Configuration of pid controller for speed control of dc motor utilizing optim...Configuration of pid controller for speed control of dc motor utilizing optim...
Configuration of pid controller for speed control of dc motor utilizing optim...Santosh Suman
 
Persistence of Vision Display
Persistence of Vision DisplayPersistence of Vision Display
Persistence of Vision DisplayUday Wankar
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Ramadan Ramadan
 
Hand movements based control of an intelligent wheelchair Using Accelerometer...
Hand movements based control of an intelligent wheelchair Using Accelerometer...Hand movements based control of an intelligent wheelchair Using Accelerometer...
Hand movements based control of an intelligent wheelchair Using Accelerometer...IJERD Editor
 
Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Pham Hoang
 
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...Καλλιεργώ / Kalliergo
 
Marcas más Populares México Febrero2012
Marcas más Populares México   Febrero2012Marcas más Populares México   Febrero2012
Marcas más Populares México Febrero2012IAB México
 
Труд медицинских работников в годы ВОВ
Труд медицинских работников в годы ВОВТруд медицинских работников в годы ВОВ
Труд медицинских работников в годы ВОВИрина Колдышева
 
15 Top Web Design Trends for 2014
15 Top Web Design Trends for 201415 Top Web Design Trends for 2014
15 Top Web Design Trends for 2014mbeatrizoliveira
 
Saddleback Publications - 2013
Saddleback Publications - 2013Saddleback Publications - 2013
Saddleback Publications - 2013K.C. Boyd
 
Tabela inss 2011
Tabela inss 2011Tabela inss 2011
Tabela inss 2011Joaoce2011
 

Viewers also liked (20)

pfe sans gas calculation
pfe sans gas calculationpfe sans gas calculation
pfe sans gas calculation
 
2015 latest IEEE electrical project list for BTech, Mtech, Phd
2015 latest IEEE electrical project list for BTech, Mtech, Phd 2015 latest IEEE electrical project list for BTech, Mtech, Phd
2015 latest IEEE electrical project list for BTech, Mtech, Phd
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded system
 
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...
OPTIMAL PID CONTROLLER DESIGN FOR SPEED CONTROL OF A SEPARATELY EXCITED DC MO...
 
Configuration of pid controller for speed control of dc motor utilizing optim...
Configuration of pid controller for speed control of dc motor utilizing optim...Configuration of pid controller for speed control of dc motor utilizing optim...
Configuration of pid controller for speed control of dc motor utilizing optim...
 
Persistence of Vision Display
Persistence of Vision DisplayPersistence of Vision Display
Persistence of Vision Display
 
Timer & Interrupt Atmega16
Timer & Interrupt Atmega16Timer & Interrupt Atmega16
Timer & Interrupt Atmega16
 
Hand movements based control of an intelligent wheelchair Using Accelerometer...
Hand movements based control of an intelligent wheelchair Using Accelerometer...Hand movements based control of an intelligent wheelchair Using Accelerometer...
Hand movements based control of an intelligent wheelchair Using Accelerometer...
 
Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16Điều khiển động cơ sử dụng atmega16
Điều khiển động cơ sử dụng atmega16
 
KLEENEZE Uk Text Ewb 24
KLEENEZE Uk Text Ewb 24KLEENEZE Uk Text Ewb 24
KLEENEZE Uk Text Ewb 24
 
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...
Ντομάτα / Καλλιέργεια,πότισμα,εχθροί και ασθένειες,αποστάσεις σποράς,τι έδαφο...
 
Marcas más Populares México Febrero2012
Marcas más Populares México   Febrero2012Marcas más Populares México   Febrero2012
Marcas más Populares México Febrero2012
 
Труд медицинских работников в годы ВОВ
Труд медицинских работников в годы ВОВТруд медицинских работников в годы ВОВ
Труд медицинских работников в годы ВОВ
 
15 Top Web Design Trends for 2014
15 Top Web Design Trends for 201415 Top Web Design Trends for 2014
15 Top Web Design Trends for 2014
 
Saddleback Publications - 2013
Saddleback Publications - 2013Saddleback Publications - 2013
Saddleback Publications - 2013
 
Kleeneze 2011 ewb 10
Kleeneze 2011 ewb 10Kleeneze 2011 ewb 10
Kleeneze 2011 ewb 10
 
Healthy Hilltowns
Healthy Hilltowns Healthy Hilltowns
Healthy Hilltowns
 
Tabela inss 2011
Tabela inss 2011Tabela inss 2011
Tabela inss 2011
 
Monitorizare mai 2013
Monitorizare mai 2013Monitorizare mai 2013
Monitorizare mai 2013
 

Similar to final report

AIR BAG CRASH USING MEMS
AIR BAG CRASH USING MEMS AIR BAG CRASH USING MEMS
AIR BAG CRASH USING MEMS Ganesh Gani
 
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation Board
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation BoardPerformance Optimization for Brushless DC Motor Using DRV8312 Evaluation Board
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation BoardIRJET Journal
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGIRJET Journal
 
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLER
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLERSOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLER
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLERIRJET Journal
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_ReportVansh Kumar
 
Microcontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversMicrocontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversVinny Chweety
 
IRJET - The Implementation of Arduino based Single Axis Solar Tracking Sy...
IRJET -  	  The Implementation of Arduino based Single Axis Solar Tracking Sy...IRJET -  	  The Implementation of Arduino based Single Axis Solar Tracking Sy...
IRJET - The Implementation of Arduino based Single Axis Solar Tracking Sy...IRJET Journal
 
Project Report-Design of a PLC System for health monitoring of DC drive throu...
Project Report-Design of a PLC System for health monitoring of DC drive throu...Project Report-Design of a PLC System for health monitoring of DC drive throu...
Project Report-Design of a PLC System for health monitoring of DC drive throu...Abhishek Sharma
 
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAYRAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY18231GaddamSanjay
 
Automatic liquid filling and mixing process using PLC
Automatic liquid filling and mixing process using PLCAutomatic liquid filling and mixing process using PLC
Automatic liquid filling and mixing process using PLCAMIT KUMAR SINGH
 
Smart E Glasses for Voltage Measurement
Smart E Glasses for Voltage MeasurementSmart E Glasses for Voltage Measurement
Smart E Glasses for Voltage MeasurementIRJET Journal
 
Controlofmachines 130110181054-phpapp01
Controlofmachines 130110181054-phpapp01Controlofmachines 130110181054-phpapp01
Controlofmachines 130110181054-phpapp01limenih muluneh
 
Doc a.7-tlc report
Doc a.7-tlc reportDoc a.7-tlc report
Doc a.7-tlc report9951081577
 

Similar to final report (20)

AIR BAG CRASH USING MEMS
AIR BAG CRASH USING MEMS AIR BAG CRASH USING MEMS
AIR BAG CRASH USING MEMS
 
Front
FrontFront
Front
 
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation Board
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation BoardPerformance Optimization for Brushless DC Motor Using DRV8312 Evaluation Board
Performance Optimization for Brushless DC Motor Using DRV8312 Evaluation Board
 
SEM 6th final 1
SEM 6th final 1SEM 6th final 1
SEM 6th final 1
 
My project
My projectMy project
My project
 
TRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORINGTRANSFORMER FAULT DETECTION AND MONITORING
TRANSFORMER FAULT DETECTION AND MONITORING
 
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLER
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLERSOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLER
SOLAR ENERGY MEASUREMENT USING PIC MICROCONTROLLER
 
Minor_Project_Report
Minor_Project_ReportMinor_Project_Report
Minor_Project_Report
 
Microcontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken driversMicrocontroller based automatic engine locking system for drunken drivers
Microcontroller based automatic engine locking system for drunken drivers
 
Alcohol report
Alcohol reportAlcohol report
Alcohol report
 
Simulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC DriveSimulation of Automatic speed control DC Drive
Simulation of Automatic speed control DC Drive
 
IRJET - The Implementation of Arduino based Single Axis Solar Tracking Sy...
IRJET -  	  The Implementation of Arduino based Single Axis Solar Tracking Sy...IRJET -  	  The Implementation of Arduino based Single Axis Solar Tracking Sy...
IRJET - The Implementation of Arduino based Single Axis Solar Tracking Sy...
 
Project Report-Design of a PLC System for health monitoring of DC drive throu...
Project Report-Design of a PLC System for health monitoring of DC drive throu...Project Report-Design of a PLC System for health monitoring of DC drive throu...
Project Report-Design of a PLC System for health monitoring of DC drive throu...
 
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAYRAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY
RAIN SENSING AUTOMATIC CAR WIPER BY GADDAM SANJAY
 
Automatic liquid filling and mixing process using PLC
Automatic liquid filling and mixing process using PLCAutomatic liquid filling and mixing process using PLC
Automatic liquid filling and mixing process using PLC
 
Home automation system
Home automation systemHome automation system
Home automation system
 
Smart E Glasses for Voltage Measurement
Smart E Glasses for Voltage MeasurementSmart E Glasses for Voltage Measurement
Smart E Glasses for Voltage Measurement
 
Controlofmachines 130110181054-phpapp01
Controlofmachines 130110181054-phpapp01Controlofmachines 130110181054-phpapp01
Controlofmachines 130110181054-phpapp01
 
report.pdf
report.pdfreport.pdf
report.pdf
 
Doc a.7-tlc report
Doc a.7-tlc reportDoc a.7-tlc report
Doc a.7-tlc report
 

final report

  • 1. MEASUREMENT, PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR BY USING ATMEGA-16 USING EMBEDDED SYSTEM A Project Report Submitted by: NADIMINTI SAROJA KUMAR (1201210503) DIGVIJAY KUMAR (1201210537) MANIKA NAYAK (1201210527) In partial fulfillment for the award of the Degree Of BACHELOR IN TECHNOLOGY IN ELECTRICAL AND ELECTRONICS ENGINEERING Under the esteemed guidance of Mr. MANOJ KUMAR SWAIN Asst. Prof., EEE AT 2012-2016 DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING GANDHI INSTITUTE OF ENGINEERING AND TECHNOLOGY GUNUPUR – 765022 2012-2016
  • 2. ii DECLARATION We hereby declare that the project entitled “MEASUREMENT, PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR BY USING ATMEGA-16 USING EMBEDDED SYSTEM” submitted for the B.Tech. Degree is our original work and the project has not formed on the basis for the award of any degree, associate-ship, fellowship or any other similar titles. Signature of the Students: 1. 2. 3. Place: Date:
  • 3. iii Gandhi Institute of Engineering & Technology GUNUPUR – 765 022, Dist: Rayagada (Orissa), India (Approved by AICTE, Govt. of Orissa and Affiliated to Biju Patnaik University of Technology) 06857 – 250172(Office), 251156(Principal), 250232(Fax), e-mail: gandhi_giet@yahoo.com visit us at www.giet.org DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING CERTIFICATE ISO 9001:2 000 Certified Institute This is to certify that the project work entitled “MEASUREMENT,PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR BY USING ATMEGA-16 USING EMBEDDED SYSTEM ”is the bonafide work carried out by NADIMINTI SAROJA KUMAR (1201210503), DIGVIJAY KUMAR(1201210537),MANIKA NAYAK(1201210527) students of BACHELOR IN TECHNOLOGY, GANDHI INSTITUTE OF ENGINEERING AND TECHNOLOGY during the academic year 2012-16 in partial fulfilment of the requirements for the award of the Degree of BACHELOR IN TECHNOLOGY in ELECTRICAL & ELECTRONICS ENGINEERING. Mr. Manoj Kumar Swain Mr. Rati Ranjan Sabat Asst. Prof. (EEE) and Guide HOD (EEE ) EXTERNAL EXAMINER
  • 4. 4
  • 5. 4 ACKNOWLEDGEMENT It is our privilege to express our sincerest regards to the project guide, Mr. Manoj Kumar Swain, Asst Prof.(EEE), for his valuable inputs, able guidance, encouragement, whole-hearted cooperation and constructive criticism throughout the duration of our project. It is deeply expressed our sincere thanks to Mr. Ch. Venkateswara Rao, Prof. & Asst HOD(EEE), Mr. R.R Sabat Prof. & HOD (EEE), Dr. M. Muralidhara Rao Principal & all the teachers for encouraging and allowing us to present the project on the topic “MEASUREMENT,PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR BY USING ATMEGA-16 USING EMBEDDED SYSTEM “at the department premises for the partial fulfilment of the requirements leading to the award of B-Tech degree. It is taken this opportunity to thank all the lecturers and non teaching staffs who have directly or indirectly helped us in this project. It is our respects and love to our parents and all other family members and friends for their love and encouragement throughout our career. Last but not the least it is expressed our thanks to friends for their cooperation and support. NADIMINTI SAROJA KUMAR DIGVIJAY KUMAR MANIKA NAYAK
  • 6. 5 ABSTRACT The objective of the project is to design a circuit which is applicable for multiple purposes of a dc motor. DC motors are widely used not only in the industries but also in daily life applications like drills, shapers, vacuum cleaner, spinning and weaving machines etc. So it is required to observe the basic parameters like voltage, current, speed and torque by measuring the values of those parameters. The experimental values are measured using different techniques and displayed in a 16x4 alphanumeric LCD (Liquid Crystal Display).The limit values are given for each parameters above which the circuit does not work, it will directly stop the motor for the protection purpose. Two graphs have been plotted in 124X64 graphical LCD by taking the respective parameter values. The first graph is one of the characteristics curves of dc motor (N~I, T~I and N~T). And the second graph is drawn for observation of any parameter according to the users wish. In this project the first graph is plotted for N~I characteristics curve and the second curve is plotted by taking voltage vs time for observation of voltage parameter. The total circuitry is connected with a dc supply through a adapter which supplies 12V dc to the motor and 5V to the ATMEGA-16 microcontroller through the 7805 voltage regulator.
  • 7. 6 TABLE OF CONTENT Chapter no. Subject Page no 1. 1.1 INTRODUCTION 08 1.2 OBJECTIVE OF THE PROJECT 08 1.3 ORGANISATION OF THE WORK 09 2. COMPONENTS DESCRIPTION 2.1 INTRODUCTION 10 2.2 COMPONENTS USED 10 2.3 COMPONENT DESCRIPTION 11 2.3.1 DC MOTOR 11 2.3.2 ATMEGA 16 MICROCONTROLLER 15 2.3.3 16x4 ALPHANUMERIC LCD 20 2.3.4 128x64 GRAPHICAL LCD 22 2.3.5 L293D MOTOR DRIVER 25 2.3.6 ACS712 CURRENT SENSOR 27 2.3.7 7805 VOLTAGE REGULATOR 32 2.3.8 CAPACITOR 34 2.3.9 RESISTOR 36 3. INTRODUCTION TO AVR SERIES 3.1 INTRODUCTION 43 3.2 OVERVIEW 43 3.3 FEATURES 44 3.4 PIN DESCRIPTION 46 3.5 BLOCK DIAGRAM 4. SOFTWARES USED 4.1 INTRODUCTION 54 4.2 AVR STUDIO 4 54 4.3 WINAVR 2010 56 4.4 SINAPROG 57 4.5 USBasp DRIVER 58 5. ANALYSIS OF THE PROJECT 5.1 INTRODUCTION 59 5.2 BLOCK DIAGRAM 59 5.3 CIRCUIT DIAGRAM 60 5.4 DESCRIPTION 60 6. RESULTS AND DISCUSSIONS 6.1 INTRODUCTION 63 6.2 DISCUSSION 63 7. CONCLUSION & FUTURE APPLICATIONS 64 REFERENCE 65 PUBLICATIONS
  • 8. 7 LIST OF FIGURES FIG.NO NAME OF THE FIG. PAGE NO. 2.1 CLASSIFICATION OF DC MOTOR 11 2.2 DC MOTOR 14 2.3 OVERALL DIAGRAM OF ATMEGA-16 16 2.4 PIN CONFIGURATION OF ATMEGA-16 17 2.5 16X4 LCD 20 2.6 LCD INTERFACING WITH ATMEGA-16 22 2.7 128X64 GRAPHICAL LCD 23 2.8 GLCD INTERFACING WITH ATMEGA 16 25 2.9 PIN DESRIPTION OF L293D 26 2.10 IR SENSOR CIRCUIT 29 2.11 IR SENSOR 29 2.12 BLOCK DIAGRAM OF INFRARED DETECTION 30 2.13 WAVELENGTH IN MM 31 2.14 CIRCUIT DIAGRAM OF 7805 VOLTAGE REGU 33 2.15 VOLTAGE REGULATOR 33 2.16 CERAMIC CAPACITOR 36 2.17 ELECTROLYTIC CAPACITOR 36 2.18 CARBON COMPOSITION RESISTORS 37 2.19 CARBON FILM RESISTORS 38 3.1 EMBEDDED SYSTEM 43 3.2 PIN CONFIGURATION OF ATMEGA-16 46 3.3 BLOCK DIAGRAM OF ATMEGA-16 47 4.1 AVR STUDIO 4 55 4.2 SINAPROG 57 5.1 BLOCK DIAGRAM OF MEASUREMENT, PROTECTION AND G-OBSERVATION OF DC MOTOR 59 5.2 CIRCUIT OF MEASUREMENT, PROTECTION AND G-OBSERVATION OF DC MOTOR 60 5.3 16X4V LCD 61 5.4 128X64 GRAPHICAL LCD 62 6.1 G-DISPLAYING OF MEASURED VALUESS 63
  • 9. 8 CHAPTER 1 INTRODUCTION 1.1 INTRODUCTION The main objective of this project is to measure, protect, speed control and graphical observation of different parameters of a DC motor with a minimum cost, portable, reliable, easy operation and low power application. Large scale industries use different electric panels for controlling and smooth operation of high voltage DC motors. But it is difficult to invest that much of huge amount in small industrial labs, institutional labs, research centers, robotics clubs etc. It is neither affordable to use for daily life appliances like drills, hair driers, mixer, sewing machines, vacuum cleaners nor in small business purposed motor applications like lathes, boring mills, spinning and weaving machines, elevators, etc. So power electronics components and technology can be used both for improving the performance of the motor and implementation in its practical fields with the protection of the motor. It is also applicable to control the speed of the motor used in the machine by using PWM technique. This project is done using ATMEGA-16 microcontroller. 1.2 OBJECTIVE OF THE PROJECT The objective of the present paper is to design a circuit which is applicable for multiple purposes of a dc motor. DC motors are widely used not only in the industries but also in daily life applications like drills, shapers, vacuum cleaner, spinning and weaving machines etc. So it is required to observe the basic parameters like voltage, current, speed and torque by measuring the values of those parameters. The experimental values are measured using different techniques and displayed in a 16x4 LCD. Two graphs have been plotted in 124X64 graphical LCD by taking the respective parameter values. The total project consists of three sections i.e A. Displaying the measured parameters (V,I,N,T) of a DC motor B. Giving limit values for protection purpose C. Graphical observation of respective parameters (N~I, V~t)
  • 10. 9 1.3 ORGANISATION OF THE WORK The different components and its functional pin configurations are explained in chapter-2 and the features of AVR FAMILY is discussed in chapter-3. Experimental Investigation is explained in chapter-4 where the step by step experimental procedure is shown. Experimental results is discussed in chapter-5. Discussion of results is explained in chapter 5, chapter 6 deals with the conclusion and future applications.
  • 11. 10 CHAPTER 2 COMPONENTS DESCRIPTION 2.1 INTRODUCTION The components used in this project are mostly related to embedded systems. They have a multiple functionality in according to the need of the user. So these components can be used for making different type of application. 2.2 COMPONENTS USED Table no.2.1 COMPONENTS USED Sl.no Name of components Specifications Quantity 1. DC motor with clamp and screw 12V, 1 amp, 200 rpm 1,1,4 2. ATMEGA-16 5V, 8- bit, 40 pin 1 3. Alphanumeric LCD 16x4 1 4. Graphical LCD 128x64 1 5. Motor driver (L293D) 4.5V-36V, 1.2 amp 1 6. Current sensor (ACS712) 2.1 kVRMS, 20 amp 1 7. Speed sensor (IR sensor) 2.2V-5.5V 1 8. Voltage regulator (7805) 1.5 amp, 3-pin 1 9. DC socket and power switch 12V, 1amp 1,1 10. Reset switch 1.6V-5.5V, 140ms 1 11. Wheel with screw . 7c.m.x2c.m. 1 12. Capacitor (Electrolyte) 10uF, 100uF 1,1 13. Capacitor (Ceramic) 0.1F 3 14. Resistor 220, 0.6k, 1k, 1.5k, 10k 1 each
  • 12. 11 2.3 COMPONENTS DESCRIPTION 2.3.1 DC MOTOR An electric motor is a machine which converts electric energy into mechanical energy. Its action is based on the principle that when a current carrying conductor is placed in magnetic field, it experiences a mechanical force whose direction is given by Flemings left hand rule and magnitude is given by F= BIl Newton. The primary classification ofDC motor can be tabulated as shown in Fig no. 2.1 Fig no. 2.1 CLASSIFICATION OF DC MOTOR 15. LED 5V, 20 mamp 1 16. Reset switch 5V 1 17. LCD Preset 0-5 V 1 18. Header pins Male 52 19. Zero PCB 10x10, 10x5, 7.5x5 1,2,2 20. Connecting wires 0.5 mm As per required
  • 13. 12 A. ADVANTAGES OF DC MOTOR: The different advantages for which DC motors are used widely are given below:  Speed control over a wide range both above and below the rated speed: The attractive feature of the dc motor is that it offers the wide range of speed control both above and below the rated speeds. This can be achieved in dc shunt motors by methods such as armature control method and field control method. This is one of the main applications in which dc motors are widely used in fine speed applications such as in rolling mills and in paper mills.  High starting torque: dc series motors are termed as best suited drives for electrical traction applications used for driving heavy loads in starting conditions. DC series motors will have a staring torque as high as 500% compared to normal operating torque. Therefore dc series motors are used in the applications such as in electric trains and cranes.  Accurate steep less speed with constant torque: Constant torque drives is one such the drives will have motor shaft torque constant over a given speed range. In such drives shaft power varies with speed.  Quick starting, stopping, reversing and acceleration  Free from harmonics, reactive power consumption and many factors which makes dc motors more advantageous compared to ac induction motors. B. APPLICATIONS OF DC MOTOR:- The different applications of different types of DC motor are described below: a. D.C Shunt Motors: It is a constant speed motor.Where the speed is required to remain almost constant from noload to full load.Where the load has to be driven at a number of speeds and any one of which is nearly constant.
  • 14. 13 Industrial use:  Lathes  Drills  Boring mills  Shapers  Spinning and Weaving machines. b.D.CSeriesmotor: It is a variable speed motor. The speed is low at high torque. At light or no load ,the motor speed attains dangerously high speed. The motor has a high starting torque.(elevators, electric traction) Industrial Uses:  Electric traction  Cranes  Elevators  Air compressor  Vacuum cleaner  Hair drier  Sewing machine c. D.C Compound motor: Differential compound motors are rarely used because of its poor torque characteristics. Industrial uses:  Presses Shears  Reciprocating machine. 200RPM Centre Shaft Economy Series DC Motor is high quality low cost DC geared motor. It has steel gears and pinions to ensure longer life and better wear and tear properties. The gears are fixed on hardened steel spindles polished to a mirror finish. The
  • 15. 14 output shaft rotates in a plastic bushing. The whole assembly is covered with a plastic ring. Gearbox is sealed and lubricated with lithium grease and require no maintenance. The motor is screwed to the gear box from inside. Although motor gives 200 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide range of RPM, and torque. Tables below gives fairly good idea of the motor’s performance in terms of RPM and no load current as a function of voltage and stall torque, stall current as a function of voltage. For compatible wheels refer to Wheels and Accessories product category. You can also mount this motor on the chassis using Motor Mount for Centre Shaft Economy Series DC Motor For adding Position Encoder, refer to Encoder Kit for Centre Shaft Economy Series DC Motor as shown in fig no. 2.2. C. SPECIFICATION OF THE MOTOR USED  DC supply: 4 to 12V  RPM: 200 at 12V  Total length: 46mm  Motor diameter: 36mm  Motor length: 25mm  Brush type: Precious metal  Gear head diameter: 37mm  Gear head length: 21mm  Output shaft: Centred  Shaft diameter: 6mm  Shaft length: 22mm Fig no. 2.2 DC MOTOR  Gear assembly: Spur  Motor weight: 90gms
  • 16. 15 D. PRATICAL ANALYSIS Motor performance in terms of RPM and no load current as a function of input voltage Motor performance in terms of stall torque and stall current as a function of input voltage Voltage (V) RPM (No Load) Current (A) 4 59 0.029 5 78 0.030 6 95 0.031 7 106 0.047 8 124 0.051 9 141 0.052 10 160 0.052 11 179 0.052 12 198 0.052 Voltage (V) Stall torque (Kg/cm) Stall Current (A) 4 1.827 0.412 5 2.171 0.522 6 2.666 0.611 7 3.397 0.735 8 3.569 0.839 9 4.020 0.924 10 4.515 1.030 11 4.794 1.121 12 4.966 1.204 Note: Motors’s data can vary by ±10% 2.3.2 ATMEGA-16 MICROCONTROLLER:- A microcontroller is a computer present in a single integrated circuit which is dedicated to perform one task and execute one specific application. It contains memory, programmable input/output peripherals as well a processor. Microcontrollers are mostly designed for embedded applications and are heavily used in automatically controlled electronic devices such as cellphones, cameras, microwave ovens, washing machines, etc.
  • 17. 16 A.SPECIFICATION Fig no. 2.3 OVERALL DIAGRAM OF ATMEGA-16 In our journey with the AVR we will be working on Atmega16 microcontroller, which is a 40-pin IC and belongs to the mega AVR category of AVR family. The overall diagram for atmega 16 is shown in Fig no. 2.3. Some of the features of Atmega16 are:  16KB of Flash memory  1KB of SRAM  512 Bytes of EEPROM  Available in 40-Pin DIP  8-Channel 10-bit ADC  Two 8-bit Timers/Counters  One 16-bit Timer/Counter  4 PWM Channels.  In System Programmer (ISP)  Serial USART  SPI Interface  Digital to Analog Comparator
  • 18. 17 B. PIN DIAGRAM The pin diagram of ATMEGA-16 microcontroller is given in Fig no. 2.4. Fig no. 2.4 PIN CONFIGURATION OF ATMEGA-16
  • 19. 18 C. PIN DESCRIPTION PIN NO PINS DESCRIPTION 10 VCC Digital supply voltage. 11,31 GND Ground 33-40 Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. When pins PA0 to PA7 are used as inputs and are externally pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. 1-7 Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.
  • 20. 19 22-29 Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs. Port C also serves the functions of the JTAG interface. 14-21 Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. 9 RESET Reset Input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to
  • 21. 20 2.3.3 16x4 ALPHANUMERIC LCD:- A.DESCRIPTION A 16 x 4 character LCD display with green backlit LCD. It is having 4 rows and each row is having 16 columns. So it can display in 4 lines and in each line it can display upto 16 characters. It can display both the alphabetic and numbers. So it is called as alphanumeric LCD. Standard Hitachi HD44780 compatible interface for easy connection to microcontrollers as shown in fig no.2.5. B. FEATURES • Type: Character • Display format: 16 x 4 characters • Built-in controller: ST 7066 (or equivalent) • Duty cycle: 1/16 • 5 x 8 dots includes cursor • + 5 V power supply (also available for + 3 V) • B/L to be driven by pin 1, pin 2, pin 15, pin 16 or A and K • N.V. optional for + 3 V power supply • Connected pin no: 20 Fig no. 2.5 16x4 LCD
  • 22. 21 C. TERMINAL LIST TABLE Table no. 2.2 TERMINAL LIST OF 16X4 LCD INTERFACE PIN FUNCTION PIN NO. SYMBOL FUNCTION 1 VSS Ground 2 VDD + 3 V or + 5 V 3 V0 Contrast adjustment 4 RS H/L register select signal 5 R/W H/L read/write signal 6 E H L enable signal 7 DB0 H/L data bus line 8 DB1 H/L data bus line 9 DB2 H/L data bus line 10 DB3 H/L data bus line 11 DB4 H/L data bus line D. INTERFACING WITH ATMEGA-16 LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. These modules are preferred over seven segments and other multi segment LEDs. When you start working with LCD modules you will start feeling the real power of MCU and your imaginations will be touching sky. The alphanumeric LCD that we are going to interface is a 16X4 alphanumeric LCD. It means the LCD can display 16 characters in each row and it has four rows as shown in fig no.2.6. It is a HD44780 controller based LCD. There are two methods to interface any alphanumeric LCD with AVR ATmega16 microcontroller: 8-bit and 4-bit interfacing method. In 8-bit interfacing method, all the eight data pins of the alphanumeric LCD are used and in 4-bit interfacing method, only the upper 4 data pins (D4, D5, D6 and D7) of the alphanumeric LCD are used to send 8-bit data (or command) to the alphanumeric LCD from the microcontroller. In 8-bit method, the 8-bit data (or command) is sent at a time using the 8 data lines of the alphanumeric LCD but in 4-bit method, the 8-bit data (or command) cannot be sent at a
  • 23. 22 time to the alphanumeric LCD. So, the upper 4 bits of data (or command) are sent first and the lower 4 bits are sent later. FIG NO. 2.6 LCD INTERFACING WITH ATMEGA-16 2.3.4 128x64 GRAPHICAL LCD A. DESCRIPTION Various graphical LCDs are available in the market with different sizes. Here JHD12864E Graphical LCD has been explained. This LCD has a display format of 128x64 dots and has yellow-green colour backlight. Each LCD needs a controller to execute its internal operations. This LCD uses twoKS0108 controllers. The 128x64 LCD is divided into two equal halves with each half being controlled by a separate KS0108 controller. Such LCDs (using KS0108 controller) involve paging scheme, i.e., whole LCD is divided equally into pages. The paging scheme of the graphical LCD can be easily understood from fig no.2.7.
  • 24. 23 B. FEATURES • Type: Graphic • Display format: 128 x 64 dots • Built-in controller: Samsung KS 0107/KS 0108 (or equivalent) • Duty cycle: 1/64 • + 5 V power supply • N.V. built-in • Compliant to RoHS directive 2002/95/EC Fig no. 2.7 128X64 GRAPHICAl LCD C. TERMINAL LIST TABLE Table no. 2.3 TERMINAL LIST OF 128x64 GRAPHICAL LCD PIN NUMBER SYMBOL FUNCTION 1 Vss GND 2 Vdd Power Supply (+ 5V) 3 Vo Contrast Adjustment 4 D/L Data/Instruction 5 R/W Data Read/Write 6 E H → L Enable Signal 7 DB0 Data Bus Line 8 DB1 Data Bus Line 9 DB2 Data Bus Line 10 DB3 Data Bus Line 11 DB4 Data Bus Line 12 DB5 Data Bus Line 13 DB6 Data Bus Line
  • 25. 24 14 DB7 Data Bus Line 15 CS1 Chip Select for IC1 16 CS2 Chip Select for IC2 17 RST Reset 18 Vee Negative Voltage Output 19 A Power Supply for LED (4.2V) 20 K Power Supply for LED (0V) D. INTERFACING WITH ATMEGA-16 User friendly visual displays are used nowadays to keep track of working of any device. Such a visual display can be anything ranging from old Analog meters to new and smart Digital meters. In digital world, to keep track of devices, LCD is very commonly used. LCDs are easy to program and prove to be a better display unit as compared to other devices like seven segments and LED display units. The graphics LCDs are preferred over the character LCDs for those applications where both character and graphical representation are required. The use of a graphical LCD (GLCD) drastically changes the look of any device. The 128x 64 Graphical LCD has 128 horizontal pixels and 64 vertical pixels resolution and it is based on KS0108 controller. The 128×64 graphical LCD is divided vertically into two sections, each with a resolution of 64×64 and separate controllers are provided for each section for its functioning. Now, each section is again divided horizontally into 8 pages, each with a resolution of 64×8. In this project, we will learn How to interface a 128X64 Graphical LCD with AVR ATmega16 microcontroller. Here, the microcontroller will write 8 bytes of binary data in the 1st page of both left and right section of 128X64 Graphical LCD. In the Left section, the microcontroller will write : 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 respectively and in the right section it will write : 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 respectively. Now, see the output in the graphical LCD. It is shown in fig no.2.8.
  • 26. 25 Fig no. 2.8 GRAPHICAL LCD INTERFACING WITH ATMEGA-16 2.3.5 L293D MOTOR DRIVER A. DESRIPTION:- L293D as shown in fig no.2.9 is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors. L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions, respectively. Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable input is high, the associated driver gets enabled. As a result,
  • 27. 26 the outputs become active and work in phase with their inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are off and in the high-impedance state. The terminal list table for L293D is given in table no. 2.3. B. PIN DESCRIPTION Fig no.2.9 PIN DESCRIPTION OF L293D C. TERMINAL LIST TABLE Table no.2.4 TERMINAL LIST TABLE FOR L293D Pin No Function Name 1 Enable pin for Motor 1; active high Enable 1,2 2 Input 1 for Motor 1 Input 1 3 Output 1 for Motor 1 Output 1 4 Ground (0V) Ground 5 Ground (0V) Ground
  • 28. 27 6 Output 2 for Motor 1 Output 2 7 Input 2 for Motor 1 Input 2 8 Supply voltage for Motors; 9-12V (up to 36V) Vcc 2 9 Enable pin for Motor 2; active high Enable 3,4 10 Input 1 for Motor 1 Input 3 11 Output 1 for Motor 1 Output 3 12 Ground (0V) Ground 13 Ground (0V) Ground 14 Output 2 for Motor 1 Output 4 15 Input2 for Motor 1 Input 4 16 Supply voltage; 5V (up to 36V) Vcc 1 2.3.6 ACS712 CURRENT SENSOR A. DESCRIPTION The Allegro™ ACS712 provides economical and precise solutions for AC or DC current sensing in industrial, commercial, and communications systems. The device package allows for easy implementation by the customer. Typical applications include motor control, load detection and management, switch mode power supplies, and over current fault protection. The device is not intended for automotive applications. The device consists of a precise, low-offset, linear Hall circuit with a copper conduction path located near the surface of the die. Applied current lowing through this copper conduction path generates a magnetic field which the Hall IC converts into a proportional voltage. Device accuracy is optimized through the close proximity of the magnetic signal to the Hall transducer. A precise, proportional voltage is provided by the low-offset, chopper- stabilized BiCMOS Hall IC, which is programmed for accuracy after packaging.
  • 29. 28 B. FEATURES  Low-noise analog signal path  Device bandwidth is set via the new FILTER pin  5 μs output rise time in response to step input current  80 kHz bandwidth  Total output error 1.5% at TA = 25°C  Small footprint, low-profile SOIC8 package  1.2 mΩ internal conductor resistance  2.1 kVRMS minimum isolation voltage from pins 1-4 to pins 5-8  5.0 V, single supply operation  66 to 185 mV/A output sensitivity  Output voltage proportional to AC or DC currents  Factory-trimmed for accuracy  Extremely stable output offset voltage  Nearly zero magnetic hysteresis C. TERMINAL LIST TABLE Table no.2.5 TERMINAL LIST TABLE FOR ACS712 Number Name Description 1 and 2 IP+ Terminals for current being sampled; fused internally 3 and 4 IP– Terminals for current being sampled; fused internally 5 GND Signal ground terminal 6 FILTER Terminal for external capacitor that sets bandwidth 7 VIOUT Analog output signal 8 VCC Device power supply terminal
  • 30. 29 D. IR SENSOR FOR SPEED MEASUREMENT:-  IR sensor works on the principle of emitting IR rays and receiving the reflected ray by a receiver (Photo Diode).  IR source (LED) is used in forward bias.  IR Receiver (Photodiode) is used in reverse bias. E. IR SENSOR CIRCUIT (Fig no.2.10) Fig no.2.10 IR SENSOR CIRCUIT Fig no.2.11 IR SENSOR A ir sensor is shown in fig no.2.11. When the IR receiver does not receive a signal, the potential at the inverting input goes higher than that non-inverting input of the comparator IC (LM339). Thus the output of the comparator goes low, but the LED does not glow. When the IR receiver module receives signal to the potential at the inverting
  • 31. 30 input goes low. Thus the output of the comparator (LM 339) goes high and the LED starts glowing. Resistor R1 (100 ), R2 (10k ) and R3 (330) are used to ensure that minimum 10 mA current passes through the IR LED Devices like Photodiode and normal LEDs respectively. Resistor VR2 (preset=5k ) is used to adjust the output terminals. Resistor VR1 (preset=10k) is used to set the sensitivity of the circuit Diagram. Read more about IR sensors. F.ELEMENTS OF INFRARED DETECTION SYSTEM A typical system for detecting infrared radiation is given in fig no.2.11 Fig no.2.12 BLOCK DIAGRAM OF INFRARED DETECTION a. Infrared Source All objects above 0 K radiate infrared energy and hence are infrared sources. Infrared sources also include blackbody radiators, tungsten lamps, silicon carbide, and various others. For active IR sensors, infrared Lasers and LEDs of specific IR wavelengths are used as IR sources. b. Transmission Medium Three main types of transmission medium used for Infrared transmission are vacuum, the atmosphere, and optical fibers. The transmission of IR – radiation is affected by presence of CO2, water vapour and other elements in the atmosphere. Due to absorption by molecules of water carbon dioxide, ozone, etc. the atmosphere highly attenuates most IR wavelengths leaving some
  • 32. 31 important IR windows in the electromagnetic spectrum; these are primarily utilized by thermal imaging/ remote sensing applications.  Medium wave IR (MWIR:3-5 µm)  Long wave IR (LWIR:8-14 µm) Fig no.2.13 WAVELENGTH IN MM. c. Optical Components. Often optical components are required to converge or focus infrared radiations, to limit spectral response, etc. To converge/focus radiations, optical lenses made of quartz, CaF2, Ge and Si, polyethylene Fresnel lenses, and mirrors made of Al, Au or a similar material are used. For limiting spectral responses, bandpass filters are used. Choppers are used to pass/ interrupt the IR beams. d. Infrared detectors. Various types of detectors are used in IR sensors. Important specifications of detectors are Photosensitivity or Responsivity Responsivity is the Output Voltage/Current per watt of incident energy. Higher the better. Noise Equivalent Power (NEP)
  • 33. 32 Detectivity(D*: D-star) D* is the photosensitivity per unit area of a detector. It is a measure of S/N ratio of a detector. D* is inversely proportional to NEP. Larger D* indicates better sensing element. In addition, wavelength region or temperature to be measured, response time, cooling mechanism, active area, no of elements, package, linearity, stability, temperature characteristics, etc. are important parameters which need attention while selecting IR detectors. e. Signal Processing Since detector outputs are typically very small, preamplifiers with associated circuitry are used to further process the received signals. 2.3.7 7805 VOLTAGE REGULATOR A. DESCRIPTION 7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels.Each type employs internal current limiting, thermal shut-down, and safe operating area protection. If adequate heat sinking is provided, they can deliver over 1 A output current. Although designed primarily as fixedvoltage regulators, these devices can be used with external components for adjustable voltages and currents as shown in fig no.2.13.
  • 34. 33 Fig no.2.14 CIRCUIT OF 7805 VOLTAGE REGULATOR B. FEATURES  Output Current up to 1 A  Output Voltages: 5, 6, 8, 9, 10, 12, 15, 18, 24 V  Thermal Overload Protection  Short-Circuit Protection  Output Transistor Safe  Operating Area Protection as in fig no.2.14. Fig no.2.15 VOLTAGE REGULATOR C. TABLE FOR FUNCTION OF VOLTAGE REGULATOR Table no.2.6 FUNCTION OF VOLTAGE REGULATOR Pin No Function Name 1 Input voltage (5V-18V) Input 2 Ground (0V) Ground 3 Regulated output; 5V (4.8V-5.2V) Output
  • 35. 34 2.3.8 CAPACITOR:- A capacitor is formed from two conducting plates separated by a thin insulating layer. If a current i flows, positive change, q, will accumulate on the upper plate. To preserve charge neutrality, a balancing negative charge will be present on the lower plate. A capacitor is formed from two conducting plates separated by a thin insulating layer. If a current i flows, positive change, q, will accumulate on the upper plate. To preserve charge neutrality, a balancing negative charge will be present on the lower plate. There will be a potential energy difference (or voltage v) between the plates proportional to q. v = dAǫ q where A is the area of the plates, d is their separation and ǫ is the permittivity of the insulating layer (ǫ0 = 8.85 pF/m for a vacuum). A. TYPES OF CAPACITORS There are a very, very large variety of different types of capacitor available in the market place and each one has its own set of characteristics and applications, from very small delicate trimming capacitors up to large power metal-can type capacitors used in high voltage power correction and smoothing circuits. The comparisons between the the differenttypes of capacitor is generally made with regards to the dielectric used between the plates. Like resistors, there are also variable types of capacitors which allow us to vary their capacitance value for use in radio or “frequency tuning” type circuits. Commercial types of capacitors are made from metallic foil interlaced with thin sheets of either paraffin-impregnated paper or Mylar as the dielectric material. Some capacitors look like tubes, this is because the metal foil plates are rolled up into a cylinder to form a small package with the insulating dielectric material sandwiched in between them. a. Dielectric Capacitors They are usually of the variable type were a continuous variation of capacitance is required for tuning transmitters, receivers and transistor radios. Variable dielectric capacitors are multi-plate air-spaced types that have a set of fixed plates (the stator vanes) and a set of movable plates (the rotor vanes) which move in between the fixed plates.
  • 36. 35 The position of the moving plates with respect to the fixed plates determines the overall capacitance value. The capacitance is generally at maximum when the two sets of plates are fully meshed together. High voltage type tuning capacitors have relatively large spacings or air-gaps between the plates with breakdown voltages reaching many thousands of volts. b. Film Capacitors They are the most commonly available of all types of capacitors, consisting of a relatively large family of capacitors with the difference being in their dielectric properties. These include polyester (Mylar), polystyrene, polypropylene, polycarbonate, metalised paper, Teflon etc. Film type capacitors are available in capacitance ranges from as small as 5pF to as large as 100uF depending upon the actual type of capacitor and its voltage rating. c. Ceramic Capacitors or Disc Capacitors They are generally called, are made by coating two sides of a small porcelain or ceramic disc with silver and are then stacked together to make a capacitor. For very low capacitance values a single ceramic disc of about 3-6mm is used. Ceramic capacitors have a high dielectric constant (High-K) and are available so that relatively high capacitance’s can be obtained in a small physical size.Ceramic types of capacitors generally have a 3-digit code printed onto their body to identify their capacitance value in pico-farads. Generally the first two digits indicate the capacitors value and the third digit indicates the number of zero’s to be added. For example, a ceramic disc capacitor with the markings 103 would indicate 10 and 3 zero’s in pico-farads which is equivalent to 10,000 pF or 10nF. Likewise, the digits 104 would indicate 10 and 4 zero’s in pico-farads which is equivalent to 100,000 pF or 100nF and so on. So on the image of the ceramic capacitor above the numbers 154 indicate 15 and 4 zero’s in pico-farads which is equivalent to 150,000
  • 37. 36 pF or 150nF or 0.15uF. Letter codes are sometimes used to indicate their tolerance value such as: J = 5%, K = 10% or M = 20% etc. The figure is shown in fig no.2.15. d. Electrolytic Capacitors These are generally used when very large capacitance values are required. Here instead of using a very thin metallic film layer for one of the electrodes, a semi-liquid electrolyte solution in the form of a jelly or paste is used which serves as the second electrode (usually the cathode).The dielectric is a very thin layer of oxide which is grown electro- chemically in production with the thickness of the film being less than ten microns. This insulating layer is so thin that it is possible to make capacitors with a large value of capacitance for a small physical size as the distance between the plates, d is very small. The figure is shown in fig no.2.16. Fig no.2.16 CERAMIC CAPACITOR Fig no.2.17 ELECTROLYTIC CAPACITOR 2.3.9 RESISTOR The resistors that you would most likely see if you opened up a CD player, VCR, or other electronic device.  They basically look like little cylinders with colored lines painted on them.  The colored lines tell you the resistance and error range (tolerance) for a resistor according to the following rules and table of numbers. You do NOT have to memorize this table… it will be given to you if you need it.  To use the table you need to remember the following rules: 1. The first line is the first digit 2. The second line is the second digit 3. The third line is the multiplier 4. The last line (if any) is the tolerance
  • 38. 37  Some resistors may have additional colored bands, but we will ignore them here.  They usually have something to do with measuring things like failure rates or temperature coefficients. A. TYPES OF RESISTORS Resistors can be broadly classified based on the following criteria: the type of material used, the power rating and resistance value. a. Carbon Composition Resistors: These resistors are cylindrical rods which are a mixture of carbon granules and powdered ceramic. The resistor value depends on the composition of the ceramic material. A higher quantity of ceramic content will result in more resistance. Since the rod is coated with an insulated material, there are chances of damage due to excessive heat caused by soldering. High current and voltage can also damage the resistor. These factors bring irreversible changes in the resistance power of these resistors. This type of resistor is rarely used nowadays due to their high cost and are only preferred in power supply and welding circuits. The figure is shown in fig no.2.17. Fig no.2.18 CARBON COMPOSITION RESISTORS
  • 39. 38 b. Carbon film resistors: This resistor is formed by depositing a carbon film layer on an insulating substrate. Helical cuts are then made through the carbon film to trace a long and helical resistive path. The resistance can be varied by using different resistivity carbon material and modifying the shape of the resistor. The helical resistive path make these resistors highly inductive and of little use for RF applications. The figure is shown in fig no.2.18. They exhibit a temperature coefficient between -100 and -900 ppm/ °C. The carbon film is protected either by a conformal epoxy coating or a ceramic tube. The operation of these resistors requires high pulse stability. Fig no.2.19 CARBON FILM RESISTORS Obviously, it would be impractical to have available resistors of every possible value for example, 1Ω,2Ω, 3Ω, 4Ω etc, because literally tens of hundreds of thousands, if not tens of millions of different resistors would need to exist to cover all the possible values. Instead, resistors are manufactured in what are called “preferred values” with their resistance value printed onto their body in coloured ink. B. RESISTOR COLOUR BAND The resistance value, tolerance, and wattage rating are generally printed onto the body of the resistor as numbers or letters when the resistors body is big enough to read the print,
  • 40. 39 such as large power resistors. But when the resistor is small such as a 1/4W carbon or film type, these specifications must be shown in some other manner as the print would be too small to read. So to overcome this, small resistors use coloured painted bands to indicate both their resistive value and their tolerance with the physical size of the resistor indicating its wattage rating. These coloured painted bands produce a system of identification generally known as a Resistors Colour Code. An international and universally accepted resistor colour code scheme was developed many years ago as a simple and quick way of identifying a resistors ohmic value no matter what its size or condition. It consists of a set of individual coloured rings or bands in spectral order representing each digit of the resistors value. The resistor colour code markings are always read one band at a time starting from the left to the right, with the larger width tolerance band oriented to the right side indicating its tolerance. By matching the colour of the first band with its associated number in the digit column of the colour chart below the first digit is identified and this represents the first digit of the resistance value. Again, by matching the colour of the second band with its associated number in the digit column of the colour chart we get the second digit of the resistance value and so on. Then the resistor colour code is read from left to right as illustrated in fig no.2.19: a. The Standard Resistor Colour Code Chart: Colour Digit Multiplier Tolerance Black 0 1
  • 41. 40 Brown 1 10 ± 1% Red 2 100 ± 2% Orange 3 1,000 Yellow 4 10,000 Green 5 100,000 ± 0.5% Blue 6 1,000,000 ± 0.25% Violet 7 10,000,000 ± 0.1% Grey 8 ± 0.05% White 9
  • 42. 41 Gold 0.1 ± 5% Silver 0.01 ± 10% None ± 20% Fig no.2.20 RESISTOR COLOUR BAND b. Resistor Colour Code This system is all well and good but we need to understand how to apply it in order to get the correct value of the resistor. The “left-hand” or the most significant coloured band is the band which is nearest to a connecting lead with the colour coded bands being read from left-to-right as follows; Digit, Digit, Multiplier = Colour, Colour x 10 colour in Ohm’s (Ω’s) For example, a resistor has the following coloured markings; Yellow Violet Red = 4 7 2 = 4 7 x 102 = 4700Ω or 4k7. The fourth and fifth bands are used to determine the percentage tolerance of the resistor. Resistor tolerance is a measure of the resistors variation from the specified resistive value and is a consequence of the manufacturing process and is expressed as a percentage of its “nominal” or preferred value. Typical resistor tolerances for film resistors range from 1% to 10% while carbon resistors have tolerances up to 20%. Resistors with tolerances lower than 2% are called precision resistors with the or lower tolerance resistors being more expensive.
  • 43. 42 Most five band resistors are precision resistors with tolerances of either 1% or 2% while most of the four band resistors have tolerances of 5%, 10% and 20%. The colour code used to denote the tolerance rating of a resistor is given as; Brown = 1%, Red = 2%, Gold = 5%, Silver = 10 % If resistor has no fourth tolerance band then the default tolerance would be at 20%. It is sometimes easier to remember the resistor colour code by using mnemonics or phrases that have a separate word in the phrase to represent each of the Ten + Two colours in the code. However, these sayings are often very crude but never the less effective for remembering the resistor colours. Here are just a few of the more “cleaner” versions but many more exist:  Bad Booze Rots Our Young Guts But Vodka Goes Well  Bad Boys Ring Our Young Girls But Vicky Goes Without  Bad Boys Ring Our Young Girls But Vicky Gives Willingly — Get Some Now (This one is only slightly better because it includes the tolerance bands of Gold, Silver, and None). As an added bonus, why not download and make our handy DIY Resistor Colour Code Wheel as a free and handy reference guide to help work out those resistor colour codes.
  • 44. 43 CHAPTER 3 INTRODUCTION TO AVR SERIES 3.1 INTRODUCTION  It is a combination of Hardware and Software that is built to control one or a few dedicated functions, and is not designed to be programmed by the end user in the same way that a desktop computer is as shown in fig no.2.20.  Contains processing cores that are either Micro-Controllers or Digital Signal Processors.  An embedded system is designed to run on its own without human intervention, and may be required to respond to events in real time. Fig no.3.1 EMBEDDED SYSTEM 3.2 OVERVIEW The ATmega-16 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega-16 achieves throughputs approaching 1 MIPS per MHz allowing the designer to optimize power consumption 0versus processing speed.
  • 45. 44 3.3 FEATURES  High-performance, Low-power AVR® 8-bit Microcontroller  Advanced RISC Architecture – 131 Powerful Instructions – Most Single-clock Cycle Execution – 32 x 8 General Purpose Working Registers – Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz – On-chip 2-cycle Multiplier  Nonvolatile Program and Data Memories – 16K Bytes of In-System Self-Programmable Flash  Endurance: 10,000 Write/Erase Cycles – Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation – 512 Bytes EEPROM  Endurance: 100,000 Write/Erase Cycles – 1K Byte Internal SRAM – Programming Lock for Software Security  JTAG (IEEE std. 1149.1 Compliant) Interface – Boundary-scan Capabilities According to the JTAG Standard – Extensive On-chip Debug Support – Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface  Peripheral Features – Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes – One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture  Mode – Real Time Counter with Separate Oscillator – Four PWM Channels – 8-channel, 10-bit ADC
  • 46. 45 8 Single-ended Channels 7 Differential Channels in TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x – 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 – Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby  I/O and Packages – 32 Programmable I/O Lines – 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF  Operating Voltages – 2.7 - 5.5V for ATmega16L – 4.5 - 5.5V for ATmega16  Speed Grades – 0 - 8 MHz for ATmega16L – 0 - 16 MHz for ATmega16  Power Consumption @ 1 MHz, 3V, and 25°C for ATmega16L – Active: 1.1 mA – Idle Mode: 0.35 mA – Power-down Mode: < 1 Μa
  • 47. 46 3.4 PIN DESCRIPTION The pin description of ATMEGA-16 is given in fig no.3.1. Fig no.3.2 PIN CONFIGURATION OF ATMEGA 16
  • 48. 47 3.5 BLOCK DIAGRAM The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The figure is shown in fig no.3.2. Fig no.3.3 BLOCK DIAGRAM OF ATMEGA 16
  • 49. 48 The ATmega16 provides the following features: 16K bytes of In-System Programmable Flash Program memory with Read-While-Write capabilities, 512 bytes EEPROM, 1K byte SRAM, 32 general purpose I/O lines, 32 general purpose working registers, a JTAG interface for Boundary-scan, On-chip Debugging support and programming, three flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit ADC with optional differential input stage with programmable gain (TQFP package only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and six software selectable power saving modes. The Idle mode stops the CPU while allowing the USART, Two-wire interface, A/D Converter, SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous Timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except Asynchronous Timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption. In Extended Standby mode, both the main Oscillator and the Asynchronous Timer continue to run. The device is manufactured using Atmel’s high density nonvolatile memory technology. The On-chip ISP Flash allows the program memory to be reprogrammed in-system through an SPI serial interface, by a conventional nonvolatile memory programmer, or by an On-chip Boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the Application Flash section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel ATmega16 is a powerful microcontroller that provides a highly-flexible and cost- effective solution to many embedded control applications.
  • 50. 49 The ATmega16 AVR is supported with a full suite of program and system development tools including: C compilers, macro assemblers, program debugger/simulators, in-circuit emulators, and evaluation kits. A. Pin Descriptions:- VCC Digital supply voltage. GND Ground. Port A (PA7..PA0) Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. When pins PA0 to PA7 are used asinputs and are externally pulled low, they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull- up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port B also serves the functions of various special features of the ATmega16 as listed on page 58.
  • 51. 50 Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull- up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs. Port C also serves the functions of the JTAG interface and other special features of the ATmega16 as listed on page 61. Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull- up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port D also serves the functions of various special features of the ATmega16 as listed on page 63. RESET Reset Input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. The minimum pulse length is given in Table 15 on page 38. Shorter pulses are not guaranteed to generate a reset. XTAL1 Input to the inverting Oscillator amplifier and input to the internal clock
  • 52. 51 operating circuit. XTAL2 Output from the inverting Oscillator amplifier. AVCC AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. b. Memory configuration The memory spaces in the AVRarchitecture are all linear and regular memory maps. A flexible interrupt module has its control registers in the I/O space with an additional global interrupt enable bit in the Status Register. All interrupts have a separate interrupt vector in the interrupt vector table. The interrupts have priority in accordance with their interrupt vector position. The lower the interrupt vector address, the higher the priority. ALU – Arithmetic Logic The high-performance AVR ALU operates in direct connection with all the 32 general unit purpose working registers. Within a single clock cycle, arithmetic operations between general purpose registers or between a register and an immediate are executed. The ALU operations are divided into three main categories – arithmetic, logical, and bit-functions. Some implementations of the architecturealso provide a powerful multiplier supporting both signed/unsigned multiplication and fractional format. See the “Instruction Set” section for a detailed description. Status Register The Status Register contains information about the result of the most recently executed arithmetic instruction. This information can be used for altering program flow in order to perform conditional operations. Note that the Status Register is updated after all ALU operations, as specified in the Instruction Set Reference. This will in many cases remove the need for using the dedicated compare instructions, resulting in faster and more compact code.
  • 53. 52 The Status Register is not automatically stored when entering an interrupt routine and restored when returning from an interrupt. This must be handled by software. The AVR Status Register – SREG – is defined as: Bit 7 6 5 4 3 2 1 0 SREG Read/W rite R/W R/W R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0 • Bit 7 – I: Global Interrupt Enable The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the Global Interrupt Enable Register is cleared, none of the interrupts are enabled independent of the individual interrupt enable settings. The I-bit is cleared by hardware after an interrupt has occurred, and is set by the RETI instructionto enable subsequent interrupts. The Ibit can also be set and cleared by the application with the SEI and CLI instructions, as described in the instruction set reference. • Bit 6 – T: Bit Copy Storage The Bit Copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T-bit as source or destination for the operated bit. A bit from a register in the Register File can be copied into T by the BST instruction, and a bit in T can be copied into a bit in a register in the Register File by the BLD instruction. • Bit 5 – H: Half Carry Flag I T H S V N Z C
  • 54. 53 The Half Carry Flag H indicates a Half Carry in some arithmetic operations. Half Carry is useful in BCD arithmetic. See the “Instruction Set Description” for detailed information. • Bit 4 – S: Sign Bit, S = N ⊕ V The S-bit is always an exclusive or between the Negative Flag N and the Two’s Complement Overflow Flag V. See the “Instruction Set Description” for detailed information. • Bit 3 – V: Two’s Complement Overflow Flag The Two’s Complement Overflow Flag V supports two’s complement arithmetics. See the “Instruction Set Description” for detailed information. • Bit 2 – N: Negative Fla The Negative Flag N indicates a negative result in an arithmetic or logic operation. See the “Instruction Set Description” for detailed information. • Bit 1 – Z: Zero Flag The Zero Flag Z indicates a zero result in an arithmetic or logic operation. See the “Instruction Set Description” for detailed information. • Bit 0 – C: Carry Flag The Carry Flag C indicates a carry in an arithmetic or logic operation. See the “Instruction Set Description” for detailed information.
  • 55. 54 CHAPTER 4 SOFTWARES USED 4.1 INTRODUCTION The software used for making this project are:  AVR Studio 4  Win AVR 2010  SinaProg  USBasp Driver 4.2 AVR STUDIO 4:- AVR Applications in Windows Environments. AVR Studio provides a project management tool, source file editor, simulator, assembler and front-end for C/C++, programming, emulation and on-chip debugging. It is used for writing and debugging AVR Applications in Windows 9x/ME/NT/2000/XP/VISTA/7/8/8.1. AVR Studio provides a project management tool, source file editor, simulator, assembler and front-end for C/C++, programming, emulation and on-chip debugging. AVR Studio is an Integrated Development Environment (IDE) for writing and debugging AVR Studio supports the complete range of ATMEL AVR tools and each release will always contain the latest updates for both the tools and support of new AVR devices. AVR Studio 4 has a modular architecture, which allows even more interaction with 3rd party as shown in fig no. 4.1.
  • 56. 55 Fig no.4.1 AVR STUDIO 4 A. System Requirements Supported Operating Systems: • Windows XP (x86) with Service Pack 3 - all editions except Starter Edition • Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except Starter Edition • Windows XP (x64) with Service Pack 2 • Windows Vista (x64) with Service Pack 1, Service Pack 2 • Windows 7 (x86 and x64) • Windows 8 & 8.1 (x86 and x64) B. Hardware Requirements: • Computer that has a 1.6GHz or faster processor • 1 GB RAM for x86 • 2 GB RAM for x64 • An additional 512 MB RAM if running in a Virtual Machine
  • 57. 56 • 2GB of available hard disk space • 5400 RPM hard disk drive • DirectX 9-capable video card that runs at 1024 x 768 or higher display resolution We always recommend to have the latest OS versions and service packs installed. We also recommend Internet Explorer 6 or later. 4.3 WINAVR 2010:- WinAVR 2010 is a suite of executable, open source software development tools for the Atmel AVR series of RISC microprocessors hosted on the Windows platform.The toolbox includes the GCC compiler for applications written in C or C++. The suite also includes the avrdude utility that allows you to write the EEPROM memory chip of the controller. It is used by AVR Studio for compiling programs/applications. a.Supported Operating Systems • Windows XP (x86) with Service Pack 3 - all editions except Starter Edition • Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except Starter Edition • Windows XP (x64) with Service Pack 2 • Windows Vista (x64) with Service Pack 1, Service Pack 2 • Windows 7 (x86 and x64) • Windows 8 & 8.1 (x86 and x64) Hardware Requirements: • Computer that has a 1.6GHz or faster processor • 1 GB RAM for x86 • 2 GB RAM for x64 • An additional 512 MB RAM if running in a Virtual Machine • 2GB of available hard disk space • 5400 RPM hard disk drive
  • 58. 57 4.4 SINAPROG:- SinaProg is a burner software with simple user interface. It also incorporates an AVR Fuse calculator. It uses improved AVRDUDE 5.10 & supports new devices & new programmers. It lists only the available ports & Baud rate selection is possible. It is a standalone simple software & no installation is required. Fig no.4.2 SINAPROG A.System Requirements Supported Operating Systems:  Windows XP (x86) with Service Pack 3 - all editions except Starter Edition  Windows Vista (x86) with Service Pack 1, Service Pack 2 - all editions except Starter Edition  Windows XP (x64) with Service Pack 2  Windows Vista (x64) with Service Pack 1, Service Pack 2
  • 59. 58  Windows 7 (x86 and x64)  Windows 8/8.1 (x86 and x64) Hardware Requirements: Computer that has a 1.6GHz or faster processor • 1 GB RAM for x86 • 2 GB RAM for x64 • An additional 512 MB RAM if running in a Virtual Machine • 2GB of available hard disk space • 5400 RPM hard disk drive 4.5 USBasp Driver:- USBasp Driver is firmware-only USB driver that is needed by USB based AVR programmers to download hex file from the PC/Laptop to the target device (Microcontroller). Operating Systems Supported  Window 98  Window NT  Window XP  Window Vista  Window 7(32-Bit& 64-Bit)  Window 8/8.1(32-Bit &64-Bit) For Windows 8 or higher version Windows, the “Device Driver Signature Enforcement” is Enabled by default, for which the USBasp Driver can’t be installed directly. First you have to disable this Signature Enforcement and then you can install the USBasp Driver.
  • 60. 59 CHAPTER 5 ANALYSIS OF THE PROJECT 5.1 INTRODUCTION The total project consists of four sections i.e  Displaying the measured parameters(V,I,N,T) of a DC motor  Giving limit values for protection purpose  Graphical observation of respective parameters(N~I, V~t) 5.2 BLOCK DIAGRAM:- Fig no 5.1 BLOCK DIAGRAM OF MEASUREMENT, PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR Note: Power supply unit is not shown here, it is connected to each blocks.
  • 61. 60 5.3 CIRCUIT DIAGRAM:- Fig no.5.2 CIRCUIT DIAGRAM FOR MEASUREMENT, PROTECTION AND GRAPHICAL OBSERVATION OF DC MOTOR 5.4 DESCRIPTION A. Displaying measured parameters of DC motor:- The project is done to measure the basic parameters of the DC motor i.e. voltage, current, speed and torque which are the most important parameters for different loads. The different parameters are measured by different techniques.
  • 62. 61 The voltage is measured across the supply terminals of motor by using voltage divider circuit and ADC converter. The (0-12)V voltage level of motor is compared with (0-5)V of the uc voltage level and according to that uc sends the voltage value by doing the comparison. The current flows through motor is measured by ACS712 current sensor which is connected to the 39th and 40th pin of microcontroller as shown in circuit diagram. It is connected in series in between motor driver and the DC motor so that the current flows through it. The speed is counted by using a IR sensor which provides increment of counter value per rotation by doing a small circle in wheel. Finally it provides the number of rotations counted in one minute. The required torque parameter value is calculated by ATMEGA-16 microcontroller by the required equation Fig no.5.3 16X4 LCD B. Giving limit values for protection purpose:- A dc motor should be protected against the parameters like current, voltage, speed, torque, etc. The voltage is measured and given as input to the microcontroller. Here power supply circuit is supplied through a 12V, 1 amp adapter so voltage level will not exceed to 12V. SO the voltage
  • 63. 62 limit is given as 8V below which uc is programmed to stop the motor. Similarly the ACS712 current sensor gives the current value in milliampare. It is programmed to protect the motor against over current. The limit value given is 200 mamp. The uc will stop the motor if I value exceeds the limit. The speed sensor gives thr rpm value as input to the uc and the limit value is given 100 below which the uc stops the motor. Similarly the maximum torque value is given 90 N-cm. C. Graphical observation of respective parameters A 128X64 graphical LCD is used for graphical observation of the motor characteristics and the parameters. Here the LCD is programmed to divide into two parts horizontally. One part will show the different characteristics of dc motor like N~I, T~I, N~T and the other part will show any required different parameters like here it is programmed in the AVR STUDIO- 4 for the voltage in X-axis and time in Y-axis as in fig no.5.4. Fig no.5.4 128x64 GRAPHICAL LCD As, So it is observed that torque is directly proportional to the armature current. Also, From the equations torque (T) is inversely proportional to speed (N) and torque (T) is directly proportional to current (I) so that speed (N) and current (I) are inversely proportional to each other.
  • 64. 63 CHAPTER 6 RESULTS AND DISCUSSIONS 6.1 INTRODUCTION The project model is supplied with 12V adapter through the dc socket. When the power switch is switched ON the 3 pins of 7805 voltage regulator provides three voltage levels i.e +12V, +5V and ground. From the three pins the total circuit is supplied according to the requirement. 6.2 DISCUSSIONS The ATMEGA-16A microcontroller is supplied with +5V. And the L293D motor driver is connected with the three pins of power supply unit. The motor starts rotating and all the measuring elements starts to measure the parameter values. LCD is displaying name of the parameters and both the measured values and limit values in first, second and third column respectively. From this experiment two graphs are plotted in GLCD from the observation values. The first graph is plotted by programming N~I out of the three characteristics curves. Figure-4 shows the graphical observation of N~I curve where speed is inversely proportional to current. The second graph is plotted by programming for any parameters. Here it is taken voltage vs time. The figure shows that voltage is constant with respect to time. The graph can be changed by taking any parameters according to the requirement by changing the variable names in X-axis and Y-axis respectively in the program. The figure is shown in fig no.6.1. Fig no. 6.1 GRAPHICAL DISPLAYING OF MEASURED VALUE IN 128x64 LCD
  • 65. 64 CHAPTER 7 CONCLUSION AND FUTURE APPLICATIONS The basic goal of this project is to calculate parameters, to provide protection, to control the speed and to draw graphs according to respective parameters. In large industries it the same task is done using different panels which are very costly and are not affordable for small applications which are mentioned in introduction part. In this project the total four objectives are operated by a single ATMEGA-16 microcontroller. So it is very cheap compared to the total operations done by it. For this reason it can be used as an application in different products like in drill machines for over current protection, mixer machine for speed control, in lathe and spinning and weaving machines to show the speed of operation and limit value for smooth operation, in research centers for graphical observations, in boring mills to show speed and torque, etc. Also in future it can be implemented like a product by interfacing a keypad to the total circuit through which the limit values can be entered for different product applications according to their voltage, current, speed and torque ratings. So it can be modified as a displaying, protecting, speed controlling and graphical curve plotting product for universal dc motor based applications.
  • 66. 65 REFERENCES [1] www.alldatasheet.com/datasheet-pdf/pdf/78532/.../ATMEGA16.html [2] www.ti.com/lit/ds/symlink/l293.pdf [3] www.allegromicro.com/~/media/Files/Datasheets/ACS712-Datasheet.ashx [4] http://www.datasheetcatalog.com/datasheets_pdf/L/C/D/-/LCD-016M004A.shtml [5] http://www.engineersgarage.com/electronic-components/graphics-lcd [6] http://planetcalc.com/1908/ [7]http://www.ablab.in/128x64-graphical-lcd-interfacing-with-avr-atmega16- microcontroller/ [8]http://www.engineersgarage.com/tutorials/resistors [9] http://www.engineersgarage.com/electronic-components/graphics-lcd [10] http://www.engineersgarage.com/articles/infrared-sensors [11] http://www.rakeshmondal.info/IC-7805-Voltage-Regulator [12]http://www.etlogics.com/skin/frontend/default/ma_camerastore/img/sensors/ir/IR_senso r.jpg [13]http://www.datasheetlib.com/datasheet/164899/acs712_allegromicrosystems.html?page 3