Project Report on Automatic Weather Control of Car Air-Conditioning System

Description
Project Report on Automatic Weather Control of Car Air-Conditioning System

i
Automatic Weather Control of Car
Air-Conditioning System
A PROJECT REPORT

Submitted by:

Sanjaykumar. N (71004105037)
Srikumar. S (71004105045)
Silambarasan. R (71004105060)
Deo Raymond Ignatius (71004105501)

I n partial fulfillment for the award of the degree
of
BACHELOR OF ENGINEERING
in

ELECTRICAL AND ELECTRONICS ENGINEERING



KARPAGAM COLLEGE OF ENGINEERING,
COIMBATORE – 32

ANNA UNIVERSITY :: CHENNAI 600 025

April 2008
ii

BONAFIDE CERTIFICATE

Certified that this project report “AUTOMATIC WEATHER CONTROL
OF CAR AIR-CONDITIONING SYSTEM”, is the bonafide work of
“N. Sanjaykumar, S. Srikumar, R. Silambarasan, Deo Raymond Ignatius”,
who carried out the project work under my supervision.






SIGNATURE SIGNATURE

HEAD OF THE DEPARTMENT SUPERVISOR
Electrical and Electronics Engineering LECTURER
Karpagam College of Engineering, Electrical and Electronics Engineering
Coimbatore – 32. Karpagam College of Engineering,
Coimbatore – 32.

Submitted for the University Project viva voce Conducted on ___________



INTERNAL EXAMINER EXTERNAL EXAMINER


iii
ACKNOWLEDGEMENT

We express our sincere thanks to our almighty, the guiding light of our life for
giving us the potency and courage to complete this project successfully.

We extend our sincere thanks to the Chairman and Managing Trustee of
Karpagam Educational Institutions, Dr. R. VASANTHAKUMAR, for providing
essential infrastructure.

We would like to express our gratitude to the Principal of our college,
Dr. K.M. MOHANA SUNDARAM, for being out the project successfully and for
strengthening the ray of hope.

We are highly indebted to R. S. BALASUBRAMANIAN, Head of the
Department, Electrical and Electronics Engineering Department, for his
suggestions that have been invaluable for the project development and improvement.

We would like to extend a special thanks to our Project Guide,
Mr. C. DINESH PALAPPAN, Lecturer, Electrical and Electronics Engineering
Department, for his inspirational guidance and constructive criticism.

We also thank all other Staff Members and Technical Assistants for their
co-operation and valuable guidance.

Finally we thank our College Library for providing us with many informative
books that help us to enrich our knowledge to bring out the project successfully.

iv






ABSTRACT


This project entitled “AUTOMATIC WEATHER CONTROL OF CAR AIR-
CONDITIONING SYSTEM”, is designed and implemented using PIC
microcontroller, an IC manufactured by Microchip Corporation.

In this project, according to the external and cabin temperature, the hot air
from the heater and cold air from the Air Conditioner is mixed automatically and
hence easy and efficient Air Conditioning is achieved. This mechanism involves
the control of the duct mechanism present in the Air Conditioner setup by using a
stepper motor.

The advantages of our project are

? Economical
? Easy Installation
? Compact


v
TABLE OF CONTENTS


CHAPTER
NO
TITLE PAGE NO

ACKNOWLEDGEMENT iii

ABSTRACT iv

LIST OF FIGURES viii

LIST OF TABLES ix
1. INTRODUCTION 1

1.1 Synopsis 1
2. INTRODUCTION TO EMBEDDED SYSTEM 2

2.1 Embedded System Tools
2.1.1 Microprocessor
2.1.2 Microcontroller
2.1.3 Advantages Of Using Microcontroller Over
Microprocessor
2
2
3
3


2.2 Design of Embedded Systems 5
3. MICRO CONTROLLER PIC 16F877A 7

3.1 General 7

3.2 Pin Diagram of PIC 16F874A/877A 10

3.3 Applications 11

3.4 Ports
3.4.1 PORTB and TRISB
2.1.2 PORTA and TRISA
11
12
14

3.5 Functional Block Diagram of PIC 16F877A

16
4. SOFTWARE DESCRIPTION 17

4.1 Software Tools
4.1.1 MPLAB Integration
17
17
vi
4.1.2 Introduction to Embedded ‘C’:
4.1.3 Embedded C Compiler

18
19

4.2 Embedded Development Environment

19

4.3 Embedded System Tools
4.3.1 Assembler
4.3.2 Simulator
4.3.3 UMPS
4.3.3.1 UMPS Key Features
4.3.4 Compiler
4.3.4.1 Phases Of Compiler
20
20
21
21
21
22
23
5. PROJECT DESCRIPTION 25
5.1 Block Diagram 25

5.2 Circuit Diagram
5.2.1 Hardware Circuit Diagram Explanation
26
27

5.3 Components and its Function:
5.3.1 Resistors
5.3.2 Capacitor
28
28
28

5.4. Power Supply
5.4.1 Power Supply Layout
5.4.2 General
5.4.3 IC Voltage Regulators
5.4.4 Three-Terminal Voltage Regulators
5.4.5 Fixed Positive Voltage Regulators
31
31
32
33
33
34

5.5 Printed Circuit Board
5.5.1 Introduction
5.5.1.1 Advantages of PCB
5.5.1.2 Types of PCB
5.5.1.3 Do’s and Don’ts
5.5.1.4 Tips to Simplify PCB Manufacturing
35
35
35
36
36
36
vii
5.5.2 PCB Layout 38

5.6 Liquid Crystal Display:
5.6.1 Liquid Crystal and Other Display
5.6.1.1 General
5.6.1.2 Filament Display
5.6.1.3 Gas Discharge Display
5.6.1.4 Fluorescent Vacuum Display
5.6.2 Interfacing with Hitachi 44780
39
39
39
39
40
40
41

5.7 LM35 Precision Centigrade Temperature Sensors
5.7.1 General Description
5.7.2 Features
5.7.3 Absolute Maximum Ratings
5.7.4 Connection Diagrams
5.7.5 Electrical Characteristics
5.7.6 Typical Performance Characteristics
5.7.7 Temperature Rise of LM35 Due to Self-Heating
5.7.8 Applications
53
53
53
53
54
55
56
7
57
5.8 Stepper Motor Description 58
5.9 High-Voltage, High-Current Darlington Arrays 67
6. CONCLUSION 69
3.1 Discussion of Results
3.2 Future Work
69
69

APPENDIX-I
Sample Coding


70



APPENDIX-II
Abbreviations

79
REFERENCES 80

viii




LIST OF FIGURES

Figure No. Figure Name Page No.
3.1 PIC16F84 Microcontroller Outline 8
3.2 Harvard vs Von Neuman Block Architectures 9
3.3 Pin Diagram of PIC 16F874A/877A 10
3.4 Functional Block Diagram of PIC 16F877A 16
4.1 Compiler Block Diagram 22
4.2 Phases of a Compiler 24
5.1 Project - Block Diagram 25
5.2 Project - Hardware Circuit 26
5.3 Power Supply Unit layout 31
5.4 Power Supply Unit - with description 31
5.5 PCB Layout 38
5.6 PCB layout – with description 38
5.7 Character Coding of LCD 48
5.8 Connection Diagrams 55
5.9 Typical Performance Characteristics 57
5.10 ULN2003A Circuit Diagram

68




ix










LIST OF TABLES
Table No. Table Name Page No.
3.1 PORT B Configuration 14
3.2 PORT A Configuration 15
5.1 Positive Voltage Regulators in 7800 series 34
5.2 Pin Details of LCD 41
5.3 Instruction Table of LCD 42
5.4 LCD Configurations 46
5.5 Electrical Characteristics 56
5.6 Temperature Rise of LM35 58
x


INTRODUCTION

1.1 SYNOPSIS

In India, most of the low budget cars are not equipped with prominent
technologies. Our motivation is to implement one such technology named
‘AUTOMATIC WEATHER CONTROL IN CAR A/C’ at a very low budget such
that it could be afforded by all class of people.


This technology is available only in class A and class B cars. Not all people
could afford such cars but the hatchback type of cars which are more in India. In
none of the hatchbacks, this technology is available. So our project as a product
would be a great demand in the automotive market especially for the hatchbacks.


We have developed a prototype which can be customized according to the
A/C setup of the manufacturer. Hatchbacks are produced by Hyundai, Maruti, Tata,
Opel etc., We have studied the A/C setup and working of the Getz model Hyundai
car for our project.







2 INTRODUCTION TO EMBEDDED SYSTEM
xi

2.1 EMBEDED SYSTEM TOOLS
Before knowing about the embedded system we shall know about the
microprocessors and microcontrollers.

2.1.1 MICROPROCESSOR
Microprocessor is a chip that contains a CPU. In the world of personal
computers CPU and microprocessors are used interchangeably. At the heart of all
personal computers and workstations sits a microprocessor. Microprocessors also
control the logic of almost all digital devices, from clock radios to fuel-injection
systems for automobiles.
Three basic characteristics differentiate microprocessors;
? Instruction set: The set of instructions that the microprocessor can execute.
? Bandwidth: The number of bits processed in a single instruction
? Clock speed: Given in megahertz (MHz), the clock speed determines how
many instructions per second the processor can execute.

In both cases higher the value, the more powerful the CPU. For example, a
32-bit microprocessor that runs at 50 MHz is more powerful than 16-bit
microprocessor that runs at 25 MHz. In addition to bandwidth and clock speed,
microprocessors are classified as being either RISC (Reduced Instruction Set
Computer) or CISC (Complex Instruction Set Computer).


2.1.2 MICROCONTROLLER
xii
A computer-on-a-chip is a variation of microprocessor which combines
the processor core (CPU), some memory, and I/O (input/output) lines, all on one
chip. The computer-on-a-chip is called the microcomputer whose proper meaning is
a computer using a (number of) microprocessor (s) as its CPUs, while the concept of
the microcomputer is known to be a microcontroller.

2.1.3 ADVANTAGES OF USING MICROCONTROLLER OVER
MICROPROCESSOR:
A designer will use a microcontroller to
? Gather input from various sensors
? Process this input into a set of actions
? Use the output mechanism on the microcontroller to do something useful
? RAM and ROM are inbuilt in the MC
? Cheap compared to MP
? Multi machine control is possible simultaneously
Examples:
8051 (ATMAL), PIC (Microchip), Motorola (Motorola), ARM Processor,
Applications:
Cell phones, Computers, Robots, Interfacing to two pc’s.

Microcontroller Core Features:
xiii
• High-performance RISC CPU.
• Only 35 single word instructions to learn.
• All single cycle instructions except for program branches which are two cycle.
• Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle.
• Up to 8K x 14 words of FLASH Program Memory, Up to 368 x 8 bytes of Data
Memory (RAM) Up to 256 x 8 bytes of EEPROM data memory.
• Pin out compatible to the PIC16C73B/74B/76/77
• Interrupt capability (up to 14 sources)
• Eight level deep hardware stack
• Direct, indirect and relative addressing modes.
• Power-on Reset (POR).
• Power-up Timer (PWRT) and Oscillator Start-up Timer (OST).
• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation.
• Programmable code-protection.
• Power saving SLEEP mode.
• Selectable oscillator options.
• Low-power, high-speed CMOS FLASH/EEPROM technology.
• Fully static design.
• In-
• Single 5V In-Circuit Serial Programming capability.
xiv
• In-Circuit Debugging via two pins.
• Processor read/write access to program memory.
• Wide operating voltage range: 2.0V to 5.5V.
• High Sink/Source Current: 25 mA.
• Commercial and Industrial temperature ranges.
• Low-power consumption.
In this project we used PIC 16f877A microcontroller. PIC means Peripheral
Interface Controller. The PIC family is having different series. The series are 12-
Series, 14- Series, 16- Series, 18- Series, and 24- Series. We used 16 Series PIC
microcontrollers.

2.2 DESIGN OF EMBEDDED SYSTEMS:
A system is something that maintains its existence and functions as a
whole through the interaction of its parts.

Example:
Body, Mankind, Access Control, etc.

A system is a part of the world that a person or group of persons during some
time interval and for some purpose choose to regard as a whole consisting of
interrelated components, each component characterized by properties that are
selected as being relevant to the purpose.
? Embedded system is a combination of hardware and software used to achieve
a single specific task.
xv
? Embedded systems are computer systems that monitor, respond to, or control
and external environment.
? Environment connected to systems through sensors, actuators and other I/O
interfaces.
? Embedded system must meet timing and other constraints imposed on it by
environment.

3 MICRO CONTROLLER PIC 16F877A
3.1 GENERAL
PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture.
Its general structure is shown on the following map representing basic blocks.

Program memory (FLASH)- for storing a written program. Since memory made in
FLASH technology can be programmed and cleared more than once, it makes this
microcontroller suitable for device development.

EEPROM - data memory that needs to be saved when there is no supply. It is
usually used for storing important data that must not be lost if power supply
suddenly stops. For instance, one such data is an assigned temperature in
temperature regulators. If during a loss of power supply this data was lost, we would
have to make the adjustment once again upon return of supply. Thus our device
looses self-reliance.

RAM - data memory used by a program during its execution.
In RAM are stored all inter-results or temporary data during run-time.
xvi
PORTA and PORTB are physical connections between the microcontroller and the
outside world. Port A has five, and port B has eight pins.

FREE-RUN TIMER is an 8-bit register inside a microcontroller that works
independently of the program. On every fourth clock of the oscillator it increments
its value until it reaches the maximum (255), and then it starts counting over again
from zero. As we know the exact timing between each two increments of the timer
contents, timer can be used for measuring time which is very useful with some
devices.

CENTRAL PROCESSING UNIT has a role of connective element between other
blocks in the microcontroller. It coordinates the work of other blocks and executes
the user program.


xvii

Figure [3.1] PIC16F84 Microcontroller Outline







Figure [3.2] Harvard vs Von Neuman Block Architrctures
xviii
CISC AND RISC:
It has already been said that PIC16F84 has a RISC architecture. This term is often
found in computer literature, and it needs to be explained here in more detail.
Harvard architecture is a newer concept than von-Neumann's. It rose out of the need
to speed up the work of a microcontroller. In Harvard architecture, data bus and
address bus are separate. Thus a greater flow of data is possible through the central
processing unit, and of course, a greater speed of work. Separating a program from
data memory makes it further possible for instructions not to have to be 8-bit words.
PIC16F84 uses 14 bits for instructions which allows for all instructions to be one
word instructions. It is also typical for Harvard architecture to have fewer
instructions than von-Neumann's, and to have instructions usually executed in one
cycle.

Microcontrollers with Harvard architecture are also called "RISC microcontrollers".
RISC stands for Reduced Instruction Set Computer. Microcontrollers with von-
Neumann’s architecture are called 'CISC microcontrollers'. CISC stands for
Complex Instruction Set Computer.
Since PIC16F84 is a RISC microcontroller, that means that it has a reduced set of
instructions, more precisely 35 instructions. (Example: Intel's and Motorola's
microcontrollers have over hundred instructions) All of these instructions are
executed in one cycle except for jump and branch instructions. According to what its
maker says, PIC16F84 usually reaches results of 2:1 in code compression and 4:1 in
speed in relation to other 8-bit microcontrollers in its class.
3.2 PIN DIAGRAM OF PIC 16F874A/877A
xix

Fig [3.3] Pin Diagram of PIC 16F874A/877A

3.3 APPLICATIONS
PIC16F84 perfectly fits many uses, from automotive industries and controlling home
appliances to industrial instruments, remote sensors, electrical door locks and safety
devices. It is also ideal for smart cards as well as for battery supplied devices
because of its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where
permanent storage of various parameters is needed (codes for transmitters, motor
speed, receiver frequencies, etc.). Low cost, low consumption, easy handling and
flexibility make PIC16F84 applicable even in areas where microcontrollers had not
xx
previously been considered (example: timer functions, interface replacement in
larger systems, coprocessor applications, etc.).
In System Programmability of this chip (along with using only two pins in data
transfer) makes possible the flexibility of a product, after assembling and testing
have been completed. This capability can be used to create assembly-line
production, to store calibration data available only after final testing, or it can be
used to improve programs on finished products.
3.4 PORTS
Term "port" refers to a group of pins on a microcontroller which can be accessed
simultaneously, or on which we can set the desired combination of zeros and ones,
or read from them an existing status. Physically, port is a register inside a
microcontroller which is connected by wires to the pins of a microcontroller. Ports
represent physical connection of Central Processing Unit with an outside world.
Microcontroller uses them in order to monitor or control other components or
devices. Due to functionality, some pins have twofold roles like PA4/TOCKI for
instance, which is in the same time the fourth bit of port A and an external input for
free-run counter. Selection of one of these two pin functions is done in one of the
configuration registers. An illustration of this is the fifth bit T0CS in OPTION
register. By selecting one of the functions the other one is disabled.
All port pins can be designated as input or output, according to the needs of a device
that's being developed. In order to define a pin as input or output pin, the right
combination of zeros and ones must be written in TRIS register. If the appropriate
bit of TRIS register contains logical "1", then that pin is an input pin, and if the
opposite is true, it's an output pin. Every port has its proper TRIS register. Thus, port
xxi
A has TRISA, and port B has TRISB. Pin direction can be changed during the
course of work which is particularly fitting for one-line communication where data
flow constantly changes direction. PORTA and PORTB state registers are located in
bank 0, while TRISA and TRISB pin direction registers are located in bank 1.
3.4.1 PORTB and TRISB
PORTB have adjoined 8 pins. The appropriate register for data direction is TRISB.
Setting a bit in TRISB register defines the corresponding port pin as input, and
resetting a bit in TRISB register defines the corresponding port pin as output.

Figure [3.6] Port B Register block
Each PORTB pin has a weak internal pull-up resistor (resistor which defines a line
to logic one) which can be activated by resetting the seventh bit RBPU in OPTION
register. These 'pull-up' resistors are automatically being turned off when port pin is
xxii
configured as an output. When a microcontroller is started, pull-ups are disabled.

Four pins PORTB, RB7:RB4 can cause an interrupt which occurs when their status
changes from logical one into logical zero and opposite. Only pins configured as
input can cause this interrupt to occur (if any RB7:RB4 pin is configured as an
output, an interrupt won't be generated at the change of status.) This interrupt option
along with internal pull-up resistors makes it easier to solve common problems we
find in practice like for instance that of matrix keyboard. If rows on the keyboard are
connected to these pins, each push on a key will then cause an interrupt.
A microcontroller will determine which key is at hand while processing an interrupt
it is not recommended to refer to port B at the same time that interrupt is being
processed.
bsf STATUS, RP0 ;Bank1
movlw 0x0F ;Defining input and output pins
movwf TRISB ;Writing to TRISB register
bcf STATUS, RP0 ;Bank0
bsf PORTB, 4 ;PORTB <7:4>=0
bsf PORTB, 5
bsf PORTB, 6
bsf PORTB, 7
Table [3.1] PORT B Configuration
The above example shows how pins 0, 1, 2, and 3 are designated input, and pins 4,
5, 6, and 7 for output, after which PORTB output pins are set to one.

xxiii
3.4.2 PORTA and TRISA

PORTA have 5 adjoining pins. The corresponding register for data direction is
TRISA at address 85h. Like with port B, setting a bit in TRISA register defines also
the corresponding port pin as input, and clearing a bit in TRISA register defines the
corresponding port pin as output.
It is important to note that PORTA pin RA4 can be input only. On that pin is also
situated an external input for timer TMR0. Whether RA4 will be a standard input or
an input for a counter depends on T0CS bit (TMR0 Clock Source Select bit). This pin
enables the timer TMR0 to increment either from internal oscillator or via external
impulses on RA4/T0CKI pin.
Configuring port A:
bsf STATUS, RP0 ;Bank1
movlw b'11111100' ;Defining input and output pins
movwf TRISA ;Writing to TRISA register
bcf STATUS, RP0 ;Bank0
Table [3.2] PORT A Configuration
Example shows how pins 0, 1, 2, 3, and 4 are designated inputs, and pins 5, 6, and 7
as output. After this, it is possible to read the pins RA2, RA3, RA4, and to set logical
zero or one to pins RA0 and RA1.
xxiv

Figure [3.5] Port A Register block


3.5 FUNCTIONAL BLOCK DIAGRAM OF PIC 16F877A
xxv

Fig [3.4] Functional Block Diagram of PIC 16F877A

4 SOFTWARE DESCRIPTION:
4.1 SOFTWARE TOOLS:
xxvi
1. MPLAB
2. Protel
3. Propic
4. HI-Tech PIC C Compiler

4.1.1 MPLAB INTEGRATION:
MPLAB Integrated Development Environment (IDE) is a free, integrated
toolset for the development of embedded applications employing Microchip's PIC
micro and dsPIC microcontrollers. MPLAB IDE runs as a 32-bit application on MS
Windows, is easy to use and includes a host of free software components for fast
application development and super-charged debugging. MPLAB IDE also serves as
a single, unified graphical user interface for additional Microchip and any third party
software and hardware development tools. Moving between tools is a snap, and
upgrading from the free simulator to MPLAB ICD 2 or the MPLAB ICE emulator is
done in a flash because MPLAB IDE has the same user interface for all tools.
Choose MPLAB C18, the highly optimized compiler for the PIC18 series
microcontrollers, or try the newest Microchip's language tools compiler, MPLAB
C30, targeted at the high performance PIC24 and dsPIC digital signal controllers.
Or, use one of the many products from third party language tools vendors. They
integrate into MPLAB IDE to function transparently from the MPLAB project
manager, editor and compiler.




xxvii
4.1.2 INTRODUCTION TO EMBEDDED ‘C’:

Example:
Hitec – c, Keil – c
HI-TECH Software makes industrial-strength software development tools and
C compilers that help software developers write compact, efficient embedded
processor code.
For over two decades HI-TECH Software has delivered the industry's most
reliable embedded software development tools and compilers for writing efficient
and compact code to run on the most popular embedded processors. Used by tens of
thousands of customers including General Motors, Whirlpool, Qualcomm, John
Deere and many others, HI-TECH's reliable development tools and C compilers,
combined with world-class support have helped serious embedded software
programmers to create hundreds of breakthrough new solutions.
Whichever embedded processor family you are targeting with your software,
whether it is the ARM, PICC or 8051 series, HI-TECH tools and C compilers can
help you write better code and bring it to market faster.
HI-TECH PIC C is a high-performance C compiler for the Microchip PIC
micro 10/12/14/16/17 series of microcontrollers. HI-TECH PICC is an industrial-
strength ANSI C compiler - not a subset implementation like some other PIC
compilers. The PICC compiler implements full ISO/ANSI C, with the exception of
recursion. All data types are supported including 24 and 32 bit IEEE standard
floating point. HI-TECH PICC makes full use of specific PIC features and using an
intelligent optimizer, can generate high-quality code easily rivaling hand-written
xxviii
assembler. Automatic handling of page and bank selection frees the programmer
from the trivial details of assembler code.

4.1.3 EMBEDDED C COMPILER:
? ANSI C - full featured and portable
? Reliable - mature, field-proven technology
? Multiple C optimization levels
? An optimizing assembler
? Full linker, with overlaying of local variables to minimize RAM usage
? Comprehensive C library with all source code provided
? Includes support for 24-bit and 32-bit IEEE floating point and 32-bit long data
types
? Mixed C and assembler programming
? Unlimited number of source files
? Listings showing generated assembler
? Compatible - integrates into the MPLAB

IDE, MPLAB ICD and most 3rd-
party development tools
? Runs on multiple platforms: Windows, Linux, UNIX, Mac OS X, Solaris

4.2 EMBEDDED DEVELOPMENT ENVIRONMENT:
PICC can be run entirely from the. This environment allows you to manage all
of your PIC projects. You can compile, assemble and link your embedded
application with a single step.
xxix
Optionally, the compiler may be run directly from the command line, allowing
you to compile, assemble and link using one command. This enables the compiler to
be integrated into third party development environments, such as Microchip's
MPLAB IDE.

4.3 EMBEDDED SYSTEM TOOLS:
4.3.1 ASSEMBLER:
An assembler is a computer program for translating assembly language —
essentially, a mnemonic representation of machine language — into object code. A
cross assembler (see cross compiler) produces code for one type of processor, but
runs on another. The computational step where an assembler is run is known as
assembly time. Translating assembly instruction mnemonics into opcodes,
assemblers provide the ability to use symbolic names for memory locations (saving
tedious calculations and manually updating addresses when a program is slightly
modified), and macro facilities for performing textual substitution — typically used
to encode common short sequences of instructions to run inline instead of in a
subroutine. Assemblers are far simpler to write than compilers for high-level
languages.

Assembly language has several benefits:
? Speed: Assembly language programs are generally the fastest programs
around.
? Space: Assembly language programs are often the smallest.
? Capability: You can do things in assembly which are difficult or impossible
in High level languages.
xxx
? Knowledge: Your knowledge of assembly language will help you write better
programs, even when using High level languages. An example of an
assembler we use in our project is RAD 51.

4.3.2 SIMULATOR:
Simulator is a machine that simulates an environment for the purpose of training or
research. We use a UMPS simulator for this purpose in our project.

4.3.3 UMPS:
Universal microprocessor program simulator simulates a microcontroller with its
external environment. UMPS is able to simulate external components connected to
the microcontroller. Then, debug step is dramatically reduced. UMPS is not
dedicated to only one microcontroller family, it can simulate all kind of
microcontrollers. The main limitation is to have less than 64K-Bytes of RAM and
ROM space and the good microcontroller library. UMPS provide all the facilities
other low-cost simulator does not have. It offers the user to see the "real effect" of a
program and a way to change the microcontroller family without changing IDE.
UMPS provide a low-cost solution to the problems. UMPS is really the best solution
to your evaluation.

4.3.3.1 UMPS KEY FEATURES:
- The speed, UMPS can run as fast as 1/5 the real microcontroller speed. No
need to wait 2 days to see the result of a LCD routine access. All the microcontroller
parts are simulated, interrupts, communication protocol, parallel handshake, timer
and so on.
xxxi
- UMPS have an integrated assembler/disassembler and debugger. It is able to
accept an external assembler or compiler. It has a text editor which is not limited to
64K-bytes and shows keyword with color. It can also communicate with an external
compiler to integrate all the debug facilities you need.
- UMPS is universal, it can easily be extended to other microcontroller with a
library. Ask us for toolkit development.
- External resource simulation is not limited. It can be extended to your proper
needs by writing your own DLL.
- UMPS allows you to evaluate at the lowest cost the possibility to build a
microcontroller project without any cable. - UMPS include a complete
documentation on each microcontroller which describe special registers and each
instruction
4.3.4 Compiler:
A compiler is a program that reads a program in one language, the source language
and translates into an equivalent program in another language, the target language.
The translation process should also report the presence of errors in the source
program.

Source
Program
? Compiler ?
Target
Program


?


xxxii


Error
Messages


Fig [4.1] Compiler Block Diagram

There are two parts of compilation. The analysis part breaks up the source program
into constant piece and creates an intermediate representation of the source program.
The synthesis part constructs the desired target program from the intermediate
representation.

The cousins of the compiler are:
1. Preprocessor.
2. Assembler.
3. Loader and Link-editor.
A naive approach to that front end might run the phases serially.
1. Lexical analyzer takes the source program as an input and produces a
long string of tokens.
2. Syntax Analyzer takes an out of lexical analyzer and produces a large
tree.
Semantic analyzer takes the output of syntax analyzer and produces another tree.
Similarly, intermediate code generator takes a tree as an input produced by semantic
analyzer and produces intermediate code
xxxiii

4.3.4.1 PHASES OF COMPILER:
The compiler has a number of phases plus symbol table manager and an
error handler.



xxxiv

Fig [4.2] Phases of Compiler - Block Diagram
Input Source
Program
Lexical
Analyzer
Syntax
Analyzer
Semantic
Analyzer
Intermediate
Code
Generator
Code
Optimizer
Code
Generator
Out Target
Program
Error Handler Symbol Table
Manager
xxxv
5. PROJECT DESCRIPTION:

5.1 BLOCK DIAGRAM:






Fig [5.1] Project - Block Diagram



xxxvi
5.2 CIRCUIT DIAGRAM:

Fig [5.2] Project - Hardware Circuit
xxxvii




5.2.1 HARDWARE CIRCUIT DIAGRAM EXPLANATION:

Two analog temperature sensors LM35 are used as inputs one for sensing
internal temperature inside the car and other for sensing external temperature.
The internal LM35 is given as input to the portA RA0 and the external LM35 is
given as input to the portA RA1.

The sensors sense the temperature and given to PIC as given below,

For 1 degree temperature it produces 10 millivolt to PIC controller
Full range centigrade temperature sensor

V
out
=+1500mv at 150 degree celcius

=+250mv at 25 degree celcius

=-550mv at -55 degree celcius

The controller converts that analog signals fetched from the sensors and
convert it into digital data and displayed in the 16* 2 LCD which was connected to
the port C and D.

According to the intelligence provided in the PIC controller the stepper motor
gets drive which was connected in the port B, these controlling is done by PIC with
the help of ULN 2003 driver IC.





xxxviii
5.3 COMPONENTS AND ITS FUNCTION:
5.3.1 RESISTORS
Resistors are the most commonly used component in electronics and their purpose is
to create specified values of current and voltage in a circuit.
The unit for measuring resistance is the OHM. (The Greek letter ? - called Omega).
Higher resistance values are represented by "k" (kilo-ohms) and M (mega ohms).
For example, 120 000 ? is represented as 120k, while 1 200 000 ? is represented as
1M2. The dot is generally omitted as it can easily be lost in the printing process. In
some circuit diagrams, a value such as 8 or 120 represents a resistance in ohms.
Another common practice is to use the letter E for resistance in ohms. The letter R
can also be used. For example, 120E (120R) stands for 120 ?, 1E2 stands for 1R2
etc.
Resistor Markings
Resistance value is marked on the resistor body. Most resistors have 4 bands. The
first two bands provide the numbers for the resistance and the third band provides
the number of zeros. The fourth band indicates the tolerance. Tolerance values of
5%, 2%, and 1% are most commonly available
5.3.2 CAPACITOR
Capacitors are common components of electronic circuits, used almost as
frequently as resistors. The basic difference between the two is the fact that capacitor
resistance (called reactance) depends on the frequency of the signal passing through
the item.
xxxix
The symbol for reactance is X
c
and it can be calculated using the following
formula:

f representing the frequency in Hz and C representing the capacitance in Farads.
For example, 5nF-capacitor's reactance at f=125 kHz equals:

while, at f=1.25MHz, it equals:

A capacitor has an infinitely high reactance for direct current, because f=0.
Capacitors are used in circuits for many different purposes. They are common
components of filters, oscillators, power supplies, amplifiers, etc.
The basic characteristic of a capacitor is its capacity - the higher the capacity, the
higher is the amount of electricity it can hold. Capacity is measured in Farads (F).
As one Farad represents fairly high capacity, smaller values such as microfarad (µF),
nanofarad (nF) and picofarad (pF) are commonly used. As a reminder, relations
between units are:
1F=10
6
µF=10
9
nF=10
12
pF
xl
that is 1µF=1000nF and 1nF=1000pF. It is essential to remember this
notation, as same values may be marked differently in some circuits.
For example, 1500pF is the same as 1.5 nF, 100nF is 0.1µF.
A simpler notation system is used as with resistors. If the mark on the capacitor is
120 the value is 120pF, 1n2 stands for 1.2nF, n22 stands for 0.22nF, while .1µ (or
.1u) stands for 0.1µF.
Capacitors come in various shapes and sizes, depending on their capacity, working
voltage, type of insulation, temperature coefficient and other factors. All capacitors
can divided in two groups: those with changeable capacity values and those with
fixed capacity values.




















xli
5.4. POWER SUPPLY
5.4.1 POWER SUPPLY LAYOUT


Fig [5.3] Power Supply Unit Layout


Fig [5.4] Power Supply Unit - with description





xlii
5.4.2 GENERAL:
The present chapter introduces the operation of power supply circuits built using
filters, rectifiers, and then voltage regulators. Starting with an ac voltage, a steady
dc voltage is obtained by rectifying the ac voltage, then filtering to a dc level, and
finally, regulating to obtain a desired fixed dc voltage. The regulation is usually
obtained from an IC voltage regulator unit, which takes a dc voltage and provides
a somewhat lower dc voltage, which remains the same even if the input dc
voltage varies, or the output load connected to the dc voltage changes.
A block diagram containing the parts of a typical power supply and the voltage at
various points in the unit is shown in fig 19.1. The ac voltage, typically 120 V
rms, is connected to a transformer, which steps that ac voltage down to the level
for the desired dc output. A diode rectifier then provides a full-wave rectified
voltage that is initially filtered by a simple capacitor filter to produce a dc
voltage. This resulting dc voltage usually has some ripple or ac voltage variation.
A regulator circuit can use this dc input to provide a dc voltage that not only has
much less ripple voltage but also remains the same dc value even if the input dc
voltage varies somewhat, or the load connected to the output dc voltage changes.
This voltage regulation is usually obtained using one of a number of popular
voltage regulator IC units.


Transformer Rectifier Filter IC Load
Regulator


xliii


5.4.3 IC VOLTAGE REGULATORS:
Voltage regulators comprise a class of widely used ICs. Regulator IC units
contain the circuitry for reference source, comparator amplifier, control device,
and overload protection all in a single IC. Although the internal construction of
the IC is somewhat different from that described for discrete voltage regulator
circuits, the external operation is much the same. IC units provide regulation of
either a fixed positive voltage, a fixed negative voltage, or an adjustably set
voltage.
A power supply can be built using a transformer connected to the ac supply
line to step the ac voltage to desired amplitude, then rectifying that ac voltage,
filtering with a capacitor and RC filter, if desired, and finally regulating the dc
voltage using an IC regulator. The regulators can be selected for operation with load
currents from hundreds of milli amperes to tens of amperes, corresponding to power
ratings from milli watts to tens of watts.

5.4.4 THREE-TERMINAL VOLTAGE REGULATORS:
Fig shows the basic connection of a three-terminal voltage regulator IC to a
load. The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to
one input terminal, a regulated output dc voltage, Vo, from a second terminal, with
the third terminal connected to ground. For a selected regulator, IC device
specifications list a voltage range over which the input voltage can vary to maintain
a regulated output voltage over a range of load current. The specifications also list
xliv
the amount of output voltage change resulting from a change in load current (load
regulation) or in input voltage (line regulation).




5.4.5 Fixed Positive Voltage Regulators:





GND

The series 78 regulators provide fixed regulated voltages from 5 to 24 V.
Figure 19.26 shows how one such IC, a 7812, is connected to provide voltage
regulation with output from this unit of +12V dc. An unregulated input voltage Vi is
filtered by capacitor C1 and connected to the IC’s IN terminal. The IC’s OUT
terminal provides a regulated + 12V which is filtered by capacitor C2 (mostly for
any high-frequency noise). The third IC terminal is connected to ground (GND).
While the input voltage may vary over some permissible voltage range, and the
output load may vary over some acceptable range, the output voltage remains
constant within specified voltage variation limits. These limitations are spelled out in
the manufacturer’s specification sheets. A table of positive voltage regulated ICs are
provided in table 5.1.
IC Part
Output Voltage(V) Minimum Vi (V)
7805 +5 7.3
7806 +6 8.3
7808 +8 10.5
From
Transformer
secondry
IN OUT
7805
GND
xlv
7810 +10 12.5
TABLE 5.1 Positive Voltage Regulators in 7800 series

5.5 PRINTED CIRCUIT BOARD:
5.5.1 INTRODUCTION
A printed circuit is a wiring arrangement that is fabricated by means of foil
runs on the circuit board. Printed circuits can be mass produced inexpensively and
efficiently. Printed circuits allow extreme miniaturization and high reliability. Most
electronic devices today are built using Printed –Circuit technology, although high
power circuits still use point to point wiring methods.
Printed circuits are fabricated by first drawing and etching pattern. This
pattern is then photograph and reproduced on clear plastic sheet. The plastic sheet is
placed over a copper coated glass epoxy or phenolithic copper board, and the
assembly under goes a photochemical process. And the resulting copper coated
board consists of the printed tracks which interconnects the components as per the
schematic design.

5.5.1.1 Advantages of PCB
? Size of the circuit is greatly reduced.
? Assembly of the components is very easier.
? Production time is greatly reduced.
? Trouble shooting is very easier and faster.
? It reduces the failure rate of the components due to rigid assembly.
? Since the component assembly is very easier using unskilled labors reduces
the production costs.
xlvi
? PCB’s allow integration of small value of capacitance, resistance and
inductors to be formed with the tracks itself. So, external components with
lower values can be reduced significantly.


? Using PCB’s although reduces the sizes of the product; it also increases the
aesthetic appearance of it.
? PCB’s also serve as support for other assemblies in rare cases.

5.5.1.2 Types of PCB
Single side board
Double side board
Multilayer Board

5.5.1.3 Do’s and Don’ts
? The room should be well ventilated an exhaust fan should be installed in the
room where a continuous work of PCB production goes on.
? Unnecessary contact with the solvents should be avoided.
? No operation should be carried out near open flames or in the presence of
excessive heat.
? Containers for resist, developer, dye, thinner and rinse should be of glass,
stainless steel of enamelware. Plastic should not be used while handling these
chemicals.
? The containers and tanks should be kept covered when not in use.
? Water should not come in contact with these chemicals before use.
xlvii
? The room should be lightened with a low-wattage yellow colored lamp for
preparation of the board before exposure and for developing after exposure.

5.5.1.4 Tips to Simplify PCB Manufacturing
PCB making can be real simple and fun too! Yet, you can expect almost
professional results, if you are careful. To begin with, collect the following items.
PCB Sheet:-
Paper base is cheaper and should be enough for most of the projects.

Hand-drill and bit:-
Small type in the workbench with a 0.8mm bit should do. Be careful in
handling. Don’t try to ‘press’ the hole with the drill-bit to drill it.

Quick-Set Etch Resistant Paint:-
The French polish is equally good and they set quickly than the others.
Enamel paints take much longer to get dry.

Painting Brush:-
Water-color type, Go for something pointed, to draw narrow lines.

Etching Solution:-
Ferric chloride (FeCl3) available in 500g packing can be used. Very pure
quality is not required.

Dish:-
xlviii
Take an enameled dish, flat at the bottom and wide enough to accept the work
piece. Avoid aluminium, steel etc. since warming on a heater may be required,
plastic is out of question.






5.5.2 PCB LAYOUT:


Fig [5.5] PCB Layout
xlix

Fig [5.6] PCB layout – with description


5.6 LIQUID CRYSTAL DISPLAY
5.6.1 LIQUID CRYSTAL AND OTHER DISPLAY
5.6.1.1 GENERAL
LCDs also are used as numerical indicators, especially in digital watches
where their much smaller current needs than LED displays (microamperes compared
with milliamperes) prolong battery life. Liquid crystals are organic (carbon)
compounds, which exhibit both solid and liquid properties. A ‘cell’ with transparent
metallic conductors, called electrodes, on opposite daces, containing a liquid crystal,
and on which light falls, goes ‘dark’ when a voltage is applied across the electrodes.
The effect is due to molecular rearrangement within the liquid crystal.
The pattern of the conducting electrodes on a seven-segment LCD decimal
display for producing the numbers 0 to 9 is shown. Only the liquid crystal under
those electrodes to which the voltage is applied goes ‘dark’. The display has a
silvered background which reflects back incident light and it is against this
continuously visible background (except in darkness when it has to be illuminated)
l
that the numbers shown up as dark segments. An LED display is lit only when
required. LCDs require an a.c. supply to drive them using special circuitry. They are
more expensive than LED displays.

5.6.1.5 Filament display:
This was one of the first seven-segment displays and is commonly used in
petrol pumps. Like a domestic electric filament lamp, the segments consist of short-
coiled lengths of tungsten wire, which get white hot and emit light when current
passes through them. However, by operating at lower temperatures (e.g.. 1500
0
C)
their working life up to 100 000 hours. Each segment needs about 15mA at 5V.

5.6.1.6 Gas discharge display (GDD):
Each segment of a GDD consists of a glass tube containing mainly neon gas at
low pressure, which produces a bright orange glow when a current is passed through
it. Although about 170V is required to start the display, the current taken by a
segment may only be about 200?A.

5.6.1.7 Fluorescent vacuum display:
Blue-green light is produced when electrons, emitted from an electrically
heated filament and controlled by the voltage on a wire mesh (the grid), strike a
fluorescent screen in an evacuated glass tube. This type of display is used for some
calculators.
LED, filament, gas discharge and fluorescent display generate their own light,
i.e., are ‘active’ display and are most easily seen if the surrounding (ambient) light
level is low. LCDs are ‘passive’ display, viewed best in bright light since they are
seen by reflected ambient light.


li









5.6.2 INTERFACING WITH HITACHI 44780
The purpose of this page is to give a brief tutorial on how to interface with Hitachi
44780 based LCDs.
The most common connector used for the 44780 based LCDs is 14 pins in a row,
with pin centers 0.100" apart. The pins are wired as:
Pins Description
1 Ground
2 Vcc
3 Contrast Voltage
4 "R/S" _Instruction/Register Select
5 "R/W" _Read/Write LCD Registers
6 "E" Clock
7 - 14 Data I/O Pins
Table 5.2 Pin Details of LCD
As you would probably guess from this description, the interface is a parallel bus,
allowing simple and fast reading/writing of data to and from the LCD.
lii
This waveform will write an ASCII Byte out to the LCD's screen. The ASCII code
to be displayed is eight bits long and is sent to the LCD either four or eight bits at a
time. If four bit mode is used, two "nybbles" of data (Sent high four bits and then
low four bits with an "E" Clock pulse with each nybble) are sent to make up a full
eight bit transfer. The "E" Clock is used to initiate the data transfer within the LCD.
Sending parallel data as either four or eight bits are the two primary modes of
operation. While there are secondary considerations and modes, deciding how to
send the data to the LCD is most critical decision to be made for an LCD interface
application.
Eight bit mode is best used when speed is required in an application and at least ten
I/O pins are available. Four bit mode requires a minimum of six bits. To wire a
microcontroller to an LCD in four bit mode, just the top four bits (DB4-7) are
written to.
The "R/S" bit is used to select whether data or an instruction is being transferred
between the microcontroller and the LCD. If the Bit is set, then the byte at the
current LCD "Cursor" Position can be read or written. When the Bit is reset, either
an instruction is being sent to the LCD or the execution status of the last instruction
is read back (whether or not it has completed).
The different instructions available for use with the 44780 are shown in the table
below:
R/S R/W D7 D6 D5 D4 D3 D2 D1 D0 Instruction/Description
4 5 14 13 12 11 10 9 8 7 Pins
0 0 0 0 0 0 0 0 0 1 Clear Display
0 0 0 0 0 0 0 0 1 * Return Cursor and LCD to Home Position
0 0 0 0 0 0 0 1 ID S Set Cursor Move Direction
0 0 0 0 0 0 1 D C B Enable Display/Cursor
0 0 0 0 0 1 SC RL * * Move Cursor/Shift Display
0 0 0 0 1 DL N F * * Set Interface Length
0 0 0 1 A A A A A A Move Cursor into CGRAM
0 0 1 A A A A A A A Move Cursor to Display
0 1 BF * * * * * * * Poll the "Busy Flag"
1 0 D D D D D D D D Write a Character to the Display at the
liii
Current Cursor Position
1 1 D D D D D D D D
Read the Character on the Display at the
Current Cursor Position
Table 5.3 Instruction Table of LCD
The bit descriptions for the different commands are:
"*" - Not Used/Ignored. This bit can be either "1" or "0"

Set Cursor Move Direction:
ID - Increment the Cursor after Each Byte Written to Display if Set
S - Shift Display when Byte Written to Display

Enable Display/Cursor
D - Turn Display On(1)/Off(0)
C - Turn Cursor On(1)/Off(0)
B - Cursor Blink On(1)/Off(0)

Move Cursor/Shift Display
SC - Display Shift On(1)/Off(0)
RL - Direction of Shift Right(1)/Left(0)

Set Interface Length
DL - Set Data Interface Length 8(1)/4(0)
N - Number of Display Lines 1(0)/2(1)
F - Character Font 5x10(1)/5x7(0)

Poll the "Busy Flag"
BF - This bit is set while the LCD is processing

Move Cursor to CGRAM/Display
A - Address

Read/Write ASCII to the Display
D - Data

Reading Data back is best used in applications which required data to be moved
back and forth on the LCD (such as in applications which scroll data between lines).
liv
The "Busy Flag" can be polled to determine when the last instruction that has been
sent has completed processing. In most applications, I just tie the "R/W" line to
ground because I don't read anything back. This simplifies the application because
when data is read back, the microcontroller I/O pins have to be alternated between
input and output modes.
For most applications, there really is no reason to read from the LCD. I usually tie
"R/W" to ground and just wait the maximum amount of time for each instruction
(4.1 msecs for clearing the display or moving the cursor/display to the "home
position", 160 ?secs for all other commands). As well as making my application
software simpler, it also frees up a microcontroller pin for other uses. Different
LCDs execute instructions at different rates and to avoid problems later on (such as
if the LCD is changed to a slower unit), I recommend just using the maximum
delays given above.
In terms of options, I have never seen a 5x10 LCD display. This means that the "F"
bit in the "Set Interface Instruction" should always be reset (equal to "0").
Before you can send commands or data to the LCD module, the Module must be
initialized. For eight bit mode, this is done using the following series of operations:
1. Wait more than 15 milliseconds after power is applied.
2. Write 0x030 to LCD and wait 5 milliseconds for the instruction to complete
3. Write 0x030 to LCD and wait 160 microseconds for instruction to complete
4. Write 0x030 AGAIN to LCD and wait 160 microseconds or Poll the Busy
Flag
5. Set the Operating Characteristics of the LCD
o Write "Set Interface Length"
o Write 0x010 to turn off the Display
o Write 0x001 to Clear the Display
o Write "Set Cursor Move Direction" Setting Cursor Behaviour Bits
o Write "Enable Display/Cursor" & enable Display and Optional Cursor
In describing how the LCD should be initialized in four bit mode, I will specify
writing to the LCD in terms of nybbles. This is because initially, just single nybbles
are sent (and not two, which make up a byte and a full instruction). As I mentioned
above, when a byte is sent, the high nybble is sent before the low nybble and the "E"
pin is toggled each time four bits is sent to the LCD. To initialize in four bit mode:
1. Wait more than 15 msecs after power is applied.
2. Write 0x03 to LCD and wait 5 msecs for the instruction to complete
lv
3. Write 0x03 to LCD and wait 160 usecs for instruction to complete
4. Write 0x03 AGAIN to LCD and wait 160 usecs (or poll the Busy Flag)
5. Set the Operating Characteristics of the LCD
o Write 0x02 to the LCD to Enable Four Bit Mode
All following instruction/Data Writes require two nybble writes.
o Write "Set Interface Length"
o Write 0x01/0x00 to turn off the Display
o Write 0x00/0x01 to Clear the Display
o Write "Set Cursor Move Direction" Setting Cursor Behaviour Bits
o Write "Enable Display/Cursor" & enable Display and Optional Cursor

Once the initialization is complete, the LCD can be written to with data or
instructions as required. Each character to display is written like the control bytes,
except that the "R/S" line is set. During initializiation, by setting the "S/C" bit during
the "Move Cursor/Shift Display" command, after each character is sent to the LCD,
the cursor built into the LCD will increment to the next position (either right or left).
Normally, the "S/C" bit is set (equal to "1") along with the "R/L" bit in the "Move
Cursor/Shift Display" command for characters to be written from left to right (as
with a "Teletype" video display).
One area of confusion is how to move to different locations on the display and, as a
follow on, how to move to different lines on an LCD display. The following table
shows how different LCD displays that use a single 44780 can be set up with the
addresses for specific character locations. The LCDs listed are the most popular
arrangements available and the "Layout" is given as number of columns by number
of lines:





lvi








LCD
Layout
Top Left
Character
Ninth
Character
Second
Line
Third
Line
Fourth
Line
Comments
8x1 0 N/A N/A N/A N/A
Single 44780/No
Support Chip
16x1 0 0x040 N/A N/A N/A
Single 44780/No
Support Chip
16x1 0 8 N/A N/A N/A
44780 with Support
Chip. This is quite
rare
8x2 0 N/A 0x040 N/A N/A
Single 44780/No
Support Chip
10x2 0 8 0x040 N/A N/A
44780 with Support
Chip
16x2 0 8 0x040 N/A N/A
44780 with Support
Chip
20x2 0 8 0x040 N/A N/A
44780 with Support
Chip
24x2 0 8 0x040 N/A N/A
44780 with Support
Chip
30x2 0 8 0x040 N/A N/A
44780 with Support
Chip
32x2 0 8 0x040 N/A N/A 44780 with Support
lvii
Chip
40x2 0 8 0x040 N/A N/A
44780 with Support
Chip
16x4 0 8 0x040 0x020 0x060
44780 with Support
Chip
20x4 0 8 0x040 0x020 0x060
44780 with Support
Chip
40x4 U/N U/N U/N U/N U/N
Two 44780 with
Support Chips.
Addressing is device
specific
Table 5.4 LCD CONFIGURATIONS
The "Ninth Character" is the position of the Ninth character on the first line.
Most LCD displays have a 44780 and support chip to control the operation of the
LCD. The 44780 is responsible for the external interface and provides sufficient
control lines for sixteen characters on the LCD. The support chip enhances the I/O
of the 44780 to support up to 128 characters on an LCD. From the table above, it
should be noted that the first two entries ("8x1", "16x1") only have the 44780 and
not the support chip. This is why the ninth character in the 16x1 does not "appear" at
address 8 and shows up at the address that is common for a two line LCD.
I've included the 40 character by 4 line ("40x4") LCD because it is quite common.
Normally, the LCD is wired as two 40x2 displays. The actual connector is normally
sixteen bits wide with all the fourteen connections of the 44780 in common, except
for the "E" (Strobe) pins. The "E" strobes are used to address between the areas of
the display used by the two devices. The actual pinouts and character addresses for
this type of display can vary between manufacturers and display part numbers.
Note that when using any kind of multiple 44780 LCD display, you should probably
only display one 44780's Cursor at a time.
Cursors for the 44780 can be turned on as a simple underscore at any time using the
"Enable Display/Cursor" LCD instruction and setting the "C" bit. I don't recommend
using the "B" ("Block Mode") bit as this causes a flashing full character square to be
displayed and it really isn't that attractive.
lviii
The LCD can be thought of as a "Teletype" display because in normal operation,
after a character has been sent to the LCD, the internal "Cursor" is moved one
character to the right. The "Clear Display" and "Return Cursor and LCD to Home
Position" instructions are used to reset the Cursor's position to the top right character
on the display.
To move the Cursor, the "Move Cursor to Display" instruction is used. For this
instruction, bit 7 of the instruction byte is set with the remaining seven bits used as
the address of the character on the LCD the cursor is to move to. These seven bits
provide 128 addresses, which matches the maximum number of LCD character
addresses available. The table above should be used to determine the address of a
character offset on a particular line of an LCD display.
The Character Set available in the 44780 is basically ASCII. I say "basically"
because some characters do not follow the ASCII convention fully (probably the
most significant difference is 0x05B or "\" is not available). The ASCII Control
Characters (0x008 to 0x01F) do not respond as control characters and may display
funny (Japanese) characters. The LCD Character Set shown below is courtesy of
Peer Ouwehand and his excellent LCD page:











lix
Fig [5.7] Character Coding of LCD
Eight programmable characters are available and use codes 0x000 to 0x007. They
are programmed by pointing the LCD's "Cursor" to the Character Generator RAM
("CGRAM") Area at eight times the character address. The next eight characters
written to the RAM are each line of the programmable character, starting at the top.
I like to represent this as eight squares by five as is shown in the diagram to the
right. Above, I noted that most displays were 7 pixels by 5 for each character, so the
extra row may be confusing. Each LCD character is actually eight pixels high, with
the bottom row normally used for the underscore cursor. The bottom row can be
used for graphic characters, although if you are going to use a visible underscore
cursor and have it at the character, I recommend that you don't use it (ie set the line
to 0x000).
Using this box, you can draw in the pixels that define your special character and then
use the bits to determine what the actual data codes are. When I do this, I normally
use a piece of graph paper and then write hex codes for each line, as I show in the
lower right diagram. This diagram shows the first character used in the "Walking
Man" "Animate" examples that can be found below.
For the "Animate" applications, I use "character" rotation for the animations. This
means that instead of changing the
character each time the man moves, I
simply display a different character.
Doing this means that only two bytes
(moving the cursor to the character and
the new character to display) have to be
sent to the LCD. If animation was
accomplished by redefining the
characters, then ten characters would
have to be sent to the LCD (one to move
into the CGRAM space, the eight
defining characters and an instruction
returning to display RAM). If multiple
characters are going to be used or more
than eight pictures for the animation,
then you will have to rewrite the
character each time.
lx
The user defined character line information is saved in the LCD's "CGRAM" area.
This sixty four bytes of memory is accessed using the "Move Cursor into CGRAM"
instruction in a similar manner to that of moving the cursor to a specific address in
the memory with one important difference.
This difference is that each character starts at eighth times it's character value. This
means that user definable character 0 has it's data starting at address 0 of the
CGRAM, character 1 starts at address 8, character 2 starts at address 0x010 (16) and
so on. To get a specific line within the user definable character, its offset from the
top (the top line has an offset of 0) is added to the starting address. In most
applications, characters are written to all at one time with character 0 first. In this
case, the instruction 0x040 is written to the LCD followed by all the user-defined
characters.
A special note for Wirz Electronics "SLI-OEM" users. When the new characters are
defined, it is a good idea to make sure that the upper three bits are set in the user
defined character byte. When the "Move Cursor into CGRAM" instruction is
received, the SLI-OEM goes into a special
mode where the character row counter is not
updated when a new character is received. This
mode is turned off when a new instruction is
sent to the SLI-OEM or an ASCII
"Backspace", "Carriage Return", "Line Feed"
or "Form Feed" character is received. Since all
these characters are valid LCD user defined
character line definitions, you will find that the
SLI-OEM is not interpreting the data correctly.
If I was making the "Man" symbol above for
displaying on the SLI-OEM, I would use the
byte 0x0EE for the first line instead of 0x00E.
The last aspect of the LCD to discuss is how to
specify a contrast voltage to the Display. I typically use a potentiometer wired as a
voltage divider. This will provide an easily variable voltage between Ground and
V
cc
, which will be used to specify the contrast (or "darkness") of the characters on
the LCD screen. You may find that different LCDs work differently with lower
voltages providing darker characters in some and higher voltages do the same thing
in others.
lxi
There are a variety of different ways of wiring up an LCD. Above, I noted that the
44780 can interface with four or eight bits. To simplify the demands in
microcontrollers, a shift register is often used (as is shown in the diagram below) to
reduce the number of I/O pins to three.




This can be further reduced by using the circuit shown below in which the serial data
is combined with the contents of the shift register to produce the "E" strobe at the
appropriate interval.
This circuit "ANDs" (using the 1K resistor and IN914 diode) the output of the sixth
"D-Flip Flop" of the 74LS174 and the "Data" bit from the device writing to the LCD
to form the "E" Strobe. This method requires one less pin than the three wire
interface and a few more instructions of code.

lxii
I normally use a 74LS174 wired as a shift register (as is shown in the schematic
diagram) instead of a serial-in/parallel-out shift register. This circuit should work
without any problems
with a dedicated
serial-in/parallel-out
shift register chip, but
the timings/clock
polarities may be
different. When the
74LS174 is used, note
that the data is
latched on the rising
(from logic "low" to
"high") edge of the
clock signal.
In the diagram to the
right, I have shown
how the shift register is written to for this circuit to work. Before data can be written
to it, the shift register is cleared by loading every latch with zeros. Next, a "1" (to
provide the "E" Gate) is written followed by the "R/S" bit and the four data bits.
Once it is loaded in correctly, the "Data" line is pulsed to Strobe the "E" bit. The
biggest difference between the three wire and two wire interface is that the shift
register has to be cleared before it can be loaded and the two wire operation requires
more than twice the number of clock cycles to load four bits into the LCD.
I've used this circuit with the PICMicro, 8051 and AVR and it really makes the
wiring of an LCD to a microcontroller very simple. A significant advantage of using
a shift register, like the two circuits shown here, data to the LCD is the lack of
timing sensitivity that will be encountered. The biggest issue to watch for is to make
sure the "E" Strobe's timing is within specification (ie greater than 450 nsecs), the
shift register loads can be interrupted without affecting the actual write. This circuit
will not work with Open-Drain only outputs (something that catches up many
people).
One note about the LCD's "E" Strobe is that in some documentation it is specified as
"high" level active while in others, it is specified as falling edge active. It seems to
be falling edge active, which is why the 2-wire LCD interface presented below
works even if the line ends up being high at the end of data being shifted in. If the
lxiii
falling edge is used (like in the 2-wire interface) then make sure that before the "E"
line is output on "0", there is at least a 450 nsecs delay with no lines changing state.

















5.7 LM35 PRECISION CENTIGRADE TEMPERATURE SENSORS

5.7.1 GENERAL DESCRIPTION
The LM35 series are precision integrated-circuit temperature sensors, whose
output voltage is linearly proportional to the Celsius (Centigrade) temperature. The
LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin,
as the user is not required to subtract a large constant voltage from its output to
obtain convenient Centigrade scaling. The LM35 does not require any external
calibration or trimming to provide typical accuracies of ±1?4°C at room temperature
and ±3?4°C over a full ?55 to +150°C temperature range. Low cost is assured by
trimming and calibration at the wafer level. The LM35’s low output impedance,
linear output, and precise inherent calibration make interfacing to readout or control
circuitry especially easy. It can be used with single power supplies, or with plus and
minus supplies. As it draws only 60 ?A from its supply, it has very low self-heating,
less than 0.1°C in still air. The LM35 is rated to operate over a ?55° to +150°C
temperature range, while the LM35C is rated for a ?40° to +110°C range (?10° with
improved accuracy). The LM35 series is available packaged in hermetic TO-46
transistor packages, while the LM35C, LM35CA, and LM35D are also available in
the plastic TO-92 transistor package. The LM35D is also available in an 8-lead
surface mount small outline package and a plastic TO-220 package.
lxiv

5.7.2 FEATURES
? Calibrated directly in ° Celsius (Centigrade)
? Linear + 10.0 mV/°C scale factor
? 0.5°C accuracy guaranteeable (at +25°C)
? Rated for full ?55° to +150°C range
? Suitable for remote applications
? Low cost due to wafer-level trimming
? Operates from 4 to 30 volts
? Less than 60 ?A current drain
? Low self-heating, 0.08°C in still air
? Nonlinearity only ±1?4°C typical
? Low impedance output, 0.1 ohms

5.7.3 ABSOLUTE MAXIMUM RATINGS
? Supply Voltage +35V to ?0.2V
? Output Voltage +6V to ?1.0V
? Output Current 10 mA

? Storage Temp.;
o TO-46 Package, ?60°C to +180°C
o TO-92 Package, ?60°C to +150°C
o SO-8 Package, ?65°C to +150°C
o TO-220 Package, ?65°C to +150°C
? Lead Temp.:
o TO-46 Package, (Soldering, 10 seconds) 300°C
o TO-92 and TO-220 Package, (Soldering, 10 seconds) 260°C
o SO Package ,
? Vapor Phase (60 seconds) 215°C
? Infrared (15 seconds) 220°C
? ESD Susceptibility (Note 11) 2500V
? Specified Operating Temperature Range: TMIN to T MAX
o LM35, LM35A ?55°C to +150°C
o LM35C, LM35CA ?40°C to +110°C
o LM35D 0°C to +100°C

5.7.4 CONNECTION DIAGRAMS


lxv



















Fig [5.8] Connection Diagrams
5.7.5 ELECTRICAL CHARACTERISTICS






lxvi



Table [5.5] Electrical Characteristics






5.7.6 TYPICAL PERFORMANCE CHARACTERISTICS


lxvii

Fig [5.9] Typical Performance Characteristics




5.7.7 TEMPERATURE RISE OF LM35 DUE TO SELF-HEATING
(THERMAL RESISTANCE,?
JA
)



lxviii



Table 5.6 Temperature Rise of LM35

5.7.8 APPLICATIONS

The LM35 can be applied easily in the same way as other integrated-circuit
temperature sensors. It can be glued or cemented to a surface and its temperature
will be within about 0.01°C of the surface temperature. This presumes that the
ambient air temperature is almost the same as the surface temperature; if the air
temperature were much higher or lower than the surface temperature, the actual
temperature of the LM35 die would be at an intermediate temperature between the
surface temperature and the air temperature. This is expecially true for the TO-92
plastic package, where the copper leads are the principal thermal path to carry heat
into the device, so its temperature might be closer to the air temperature than to the
surface temperature. To minimize this problem, be sure that the wiring to the LM35,
as it leaves the device, is held at the same temperature as the surface of interest. The
easiest way to do this is to cover up these wires with a bead of epoxy which will
insure that the leads and wires are all at the same temperature as the surface, and that
the LM35 die’s temperature will not be affected by the air temperature. The TO-46
metal package can also be soldered to a metal surface or pipe without damage. Of
course, in that case the V? terminal of the circuit will be grounded to that metal.
Alternatively, the LM35 can be mounted inside a sealed-end metal tube, and can
then be dipped into a bath or screwed into a threaded hole in a tank. As with any IC,
the LM35 and accompanying wiring and circuits must be kept insulated and
dry, to avoid leakage and corrosion. This is especially true if the circuit may operate
at cold temperatures where condensation can occur. Printed-circuit coatings and
varnishes such as Humiseal and epoxy paints or dips are often used to insure that
moisture cannot corrode the LM35 or its connections.
These devices are sometimes soldered to a small light-weight heat fin, to decrease
the thermal time constant and speed up the response in slowly-moving air. On the
lxix
other hand, a small thermal mass may be added to the sensor, to give the steadiest
reading despite small deviations in the air temperature.

5.8 STEPPER MOTOR DESCRIPTION
5.8.1 INTRODUCTION
Stepping motors come in two varieties, permanent magnet and variable reluctance
(there are also hybrid motors, which are indistinguishable from permanent magnet
motors from the controller's point of view). Lacking a label on the motor, you can
generally tell the two apart by feel when no power is applied. Permanent magnet
motors tend to "cog" as you twist the rotor with your fingers, while variable
reluctance motors almost spin freely (although they may cog slightly because of
residual magnetization in the rotor). You can also distinguish between the two
varieties with an ohmmeter. Variable reluctance motors usually have three
(sometimes four) windings, with a common return, while permanent magnet motors
usually have two independent windings, with or without center taps. Center-tapped
windings are used in unipolar permanent magnet motors.
Stepping motors come in a wide range of angular resolution. The coarsest motors
typically turn 90 degrees per step, while high resolution permanent magnet motors
are commonly able to handle 1.8 or even 0.72 degrees per step. With an appropriate
controller, most permanent magnet and hybrid motors can be run in half-steps, and
some controllers can handle smaller fractional steps or microsteps.
For both permanent magnet and variable reluctance stepping motors, if just one
winding of the motor is energised, the rotor (under no load) will snap to a fixed
angle and then hold that angle until the torque exceeds the holding torque of the
motor, at which point, the rotor will turn, trying to hold at each successive
equilibrium point.



5.8.2 VARIABLE RELUCTANCE MOTORS
lxx

If your motor has three windings, typically connected as shown in the schematic
diagram in Figure 1.1, with one terminal common to all windings, it is most likely a
variable reluctance stepping motor. In use, the common wire typically goes to the
positive supply and the windings are energized in sequence.
The cross section shown in Figure 1.1 is of 30 degree per step variable reluctance
motor. The rotor in this motor has 4 teeth and the stator has 6 poles, with each
winding wrapped around two opposite poles. With winding number 1 energised, the
rotor teeth marked X are attracted to this winding's poles. If the current through
winding 1 is turned off and winding 2 is turned on, the rotor will rotate 30 degrees
clockwise so that the poles marked Y line up with the poles marked 2. An animated
GIF of figure 1.1 is available.
To rotate this motor continuously, we just apply power to the 3 windings in
sequence. Assuming positive logic, where a 1 means turning on the current through
a motor winding, the following control sequence will spin the motor illustrated in
Figure 1.1 clockwise 24 steps or 2 revolutions:
Winding 1 1001001001001001001001001
Winding 2 0100100100100100100100100
Winding 3 0010010010010010010010010
time --->
The section of this tutorial on Mid-Level Control provides details on methods for
generating such sequences of control signals, while the section on Control Circuits
discusses the power switching circuitry needed to drive the motor windings from
such control sequences.
There are also variable reluctance stepping motors with 4 and 5 windings, requiring
5 or 6 wires. The principle for driving these motors is the same as that for the three
winding variety, but it becomes important to work out the correct order to energise
the windings to make the motor step nicely.
lxxi
The motor geometry illustrated in Figure 1.1, giving 30 degrees per step, uses the
fewest number of rotor teeth and stator poles that performs satisfactorily. Using
more motor poles and more rotor teeth allows construction of motors with smaller
step angle. Toothed faces on each pole and a correspondingly finely toothed rotor
allows for step angles as small as a few degrees.
5.8.3 UNIPOLAR MOTORS



Unipolar stepping motors, both Permanent magnet and hybrid stepping motors with
5 or 6 wires are usually wired as shown in the schematic in Figure 1.2, with a center
tap on each of two windings. In use, the center taps of the windings are typically
wired to the positive supply, and the two ends of each winding are alternately
grounded to reverse the direction of the field provided by that winding. An animated
GIF of figure 1.2 is available.
The motor cross section shown in Figure 1.2 is of a 30 degree per step permanent
magnet or hybrid motor -- the difference between these two motor types is not
relevant at this level of abstraction. Motor winding number 1 is distributed between
the top and bottom stator pole, while motor winding number 2 is distributed between
the left and right motor poles. The rotor is a permanent magnet with 6 poles, 3 south
and 3 north, arranged around its circumfrence.
For higher angular resolutions, the rotor must have proportionally more poles. The
30 degree per step motor in the figure is one of the most common permanent magnet
motor designs, although 15 and 7.5 degree per step motors are widely available.
Permanent magnet motors with resolutions as good as 1.8 degrees per step are made,
and hybrid motors are routinely built with 3.6 and 1.8 degrees per step, with
resolutions as fine as 0.72 degrees per step available.
lxxii
As shown in the figure, the current flowing from the center tap of winding 1 to
terminal a causes the top stator pole to be a north pole while the bottom stator pole is
a south pole. This attracts the rotor into the position shown. If the power to winding
1 is removed and winding 2 is energised, the rotor will turn 30 degrees, or one step.
To rotate the motor continuously, we just apply power to the two windings in
sequence. Assuming positive logic, where a 1 means turning on the current through
a motor winding, the following two control sequences will spin the motor illustrated
in Figure 1.2 clockwise 24 steps or 2 revolutions:
Winding 1a 1000100010001000100010001
Winding 1b 0010001000100010001000100
Winding 2a 0100010001000100010001000
Winding 2b 0001000100010001000100010
time --->

Winding 1a 1100110011001100110011001
Winding 1b 0011001100110011001100110
Winding 2a 0110011001100110011001100
Winding 2b 1001100110011001100110011
time --->
Note that the two halves of each winding are never energized at the same time. Both
sequences shown above will rotate a permanent magnet one step at a time. The top
sequence only powers one winding at a time, as illustrated in the figure above; thus,
it uses less power. The bottom sequence involves powering two windings at a time
and generally produces a torque about 1.4 times greater than the top sequence while
using twice as much power.
The section of this tutorial on Mid-Level Control provides details on methods for
generating such sequences of control signals, while the section on Control Circuits
discusses the power switching circuitry needed to drive the motor windings from
such control sequences.
The step positions produced by the two sequences above are not the same; as a
result, combining the two sequences allows half stepping, with the motor stopping
alternately at the positions indicated by one or the other sequence. The combined
sequence is as follows:
Winding 1a 11000001110000011100000111
Winding 1b 00011100000111000001110000
lxxiii
Winding 2a 01110000011100000111000001
Winding 2b 00000111000001110000011100
time --->
5.8.4 BIPOLAR MOTORS

Bipolar permanent magnet and hybrid motors are constructed with exactly the same
mechanism as is used on unipolar motors, but the two windings are wired more
simply, with no center taps. Thus, the motor itself is simpler but the drive circuitry
needed to reverse the polarity of each pair of motor poles is more complex. The
schematic in Figure 1.3 shows how such a motor is wired, while the motor cross
section shown here is exactly the same as the cross section shown in Figure 1.2.
The drive circuitry for such a motor requires an H-bridge control circuit for each
winding; these are discussed in more detail in the section on Control Circuits.
Briefly, an H-bridge allows the polarity of the power applied to each end of each
winding to be controlled independently. The control sequences for single stepping
such a motor are shown below, using + and - symbols to indicate the polarity of the
power applied to each motor terminal:
Terminal 1a +---+---+---+--- ++--++--++--++--
Terminal 1b --+---+---+---+- --++--++--++--++
Terminal 2a -+---+---+---+-- -++--++--++--++-
Terminal 2b ---+---+---+---+ +--++--++--++--+
time --->
Note that these sequences are identical to those for a unipolar permanent magnet
motor, at an abstract level, and that above the level of the H-bridge power switching
electronics, the control systems for the two types of motor can be identical.
Note that many full H-bridge driver chips have one control input to enable the output
and another to control the direction. Given two such bridge chips, one per winding,
lxxiv
the following control sequences will spin the motor identically to the control
sequences given above:
Enable 1 1010101010101010 1111111111111111
Direction 1 1x0x1x0x1x0x1x0x 1100110011001100
Enable 2 0101010101010101 1111111111111111
Direction 2 x1x0x1x0x1x0x1x0 0110011001100110
time --->
To distinguish a bipolar permanent magnet motor from other 4 wire motors, measure
the resistances between the different terminals. It is worth noting that some
permanent magnet stepping motors have 4 independent windings, organized as two
sets of two. Within each set, if the two windings are wired in series, the result can be
used as a high voltage bipolar motor. If they are wired in parallel, the result can be
used as a low voltage bipolar motor. If they are wired in series with a center tap, the
result can be used as a low voltage unipolar motor.
5.8.5 BIFILAR MOTORS
Bifilar windings on a stepping motor are applied to the same rotor and stator
geometry as a bipolar motor, but instead of winding each coil in the stator with a
single wire, two wires are wound in parallel with each other. As a result, the motor
has 8 wires, not four.
In practice, motors with bifilar windings are always powered as either unipolar or
bipolar motors. Figure 1.4 shows the alternative connections to the windings of such
a motor.

To use a bifilar motor as a unipolar motor, the two wires of each winding are
connected in series and the point of connection is used as a center-tap. Winding 1 in
Figure 1.4 is shown connected this way.
lxxv
To use a bifilar motor as a bipolar motor, the two wires of each winding are
connected either in parallel or in series. Winding 2 in Figure 1.4 is shown with a
parallel connection; this allows low voltage high-current operation. Winding 1 in
Figure 1.4 is shown with a series connection; if the center tap is ignored, this allows
operation at a higher voltage and lower current than would be used with the
windings in parallel.
It should be noted that essentially all 6-wire motors sold for bipolar use are actually
wound using bifilar windings, so that the external connection that serves as a center
tap is actually connected as shown for winding 1 in Figure 1.4. Naturally, therefore,
any unipolar motor may be used as a bipolar motor at twice the rated voltage and
half the rated current as is given on the nameplate.
The question of the correct operating voltage for a bipolar motor run as a unipolar
motor, or for a bifilar motor with the motor windings in series is not as trivial as it
might first appear. There are three issues: The current carrying capacity of the wire,
cooling the motor, and avoiding driving the motor's magnetic circuits into saturation.
Thermal considerations suggest that, if the windings are wired in series, the voltage
should only be raised by the square root of 2. The magnetic field in the motor
depends on the number of ampere turns; when the two half-windings are run in
series, the number of turns is doubled, but because a well-designed motor has
magnetic circuits that are close to saturation when the motor is run at its rated
voltage and current, increasing the number of ampere-turns does not make the field
any stronger. Therefore, when a motor is run with the two half-windings in series,
the current should be halved in order to avoid saturation; or, in other words, the
voltage across the motor winding should be the same as it was.
For those who salvage old motors, finding an 8-wire motor poses a challenge!
Which of the 8 wires is which? It is not hard to figure this out using an ohm meter,
an AC volt meter, and a low voltage AC source. First, use the ohm meter to identify
the motor leads that are connected to each other through the motor windings. Then,
connect a low-voltage AC source to one of these windings. The AC voltage should
be below the advertised operating voltage of the motor; voltages under 1 volt are
recommended. The geometry of the magnetic circuits of the motor guarantees that
the two wires of a bifilar winding will be strongly coupled for AC signals, while
there should be almost no coupling to the other two wires. Therefore, probing with
an AC volt meter should disclose which of the other three windings is paired to the
winding under power.

lxxvi
5.8.6 MULTIPHASE MOTORS


A less common class of permanent magnet or hybrid stepping motor is wired with
all windings of the motor in a cyclic series, with one tap between each pair of
windings in the cycle, or with only one end of each motor winding exposed while
the other ends of each winding are tied together to an inaccessible internal
connection. In the context of 3-phase motors, these configurations would be
described as Delta and Y configurations, but they are also used with 5-phase motors,
as illustrated in Figure 1.5. Some multiphase motors expose all ends of all motor
windings, leaving it to the user to decide between the Delta and Y configurations, or
alternatively, allowing each winding to be driven independently.
Control of either one of these multiphase motors in either the Delta or Y
configuration requires 1/2 of an H-bridge for each motor terminal. It is noteworthy
that 5-phase motors have the potential of delivering more torque from a given
package size because all or all but one of the motor windings are energised at every
point in the drive cycle. Some 5-phase motors have high resolutions on the order of
0.72 degrees per step (500 steps per revolution).
Many automotive alternators are built using a 3-phase hybrid geometry with either a
permanent magnet rotor or an electromagnet rotor powered through a pair of slip-
rings. These have been successfully used as stepping motors in some heavy duty
industrial applications; step angles of 10 degrees per step have been reported.

With a 5-phase motor, there are 10 steps per repeat in the stepping cycle, as shown
below:
Terminal 1 +++-----+++++-----++
Terminal 2 --+++++-----+++++---
Terminal 3 +-----+++++-----++++
lxxvii
Terminal 4 +++++-----+++++-----
Terminal 5 ----+++++-----+++++-
time --->
With a 3-phase motor, there are 6 steps per repeat in the stepping cycle, as shown
below:
Terminal 1 +++---+++---
Terminal 2 --+++---+++-
Terminal 3 +---+++---++
time --->
Here, as in the bipolar case, each terminal is shown as being either connected to the
positive or negative bus of the motor power system. Note that, at each step, only one
terminal changes polarity. This change removes the power from one winding
attached to that terminal (because both terminals of the winding in question are of
the same polarity) and applies power to one winding that was previously idle. Given
the motor geometry suggested by Figure 1.5, this control sequence will drive the
motor through two revolutions.
To distinguish a 5-phase motor from other motors with 5 leads, note that, if the
resistance between two consecutive terminals of the 5-phase motor is R, the
resistance between non-consecutive terminals will be 1.5R.
Note that some 5-phase motors have 5 separate motor windings, with a total of 10
leads. These can be connected in the star configuration shown above, using 5 half-
bridge driver circuits, or each winding can be driven by its own full-bridge. While
the theoretical component count of half-bridge drivers is lower, the availability of
integrated full-bridge chips may make the latter approach preferable.






lxxviii
5.9 HIGH-VOLTAGE, HIGH-CURRENT DARLINGTON ARRAYS

Ideally suited for interfacing between low-level logic circuitry and multiple
peripheral power loads, the Series ULN20xxA/L high-voltage, high-current
Darlington arrays feature continuous load current ratings to 500 mA for each of the
seven drivers. At an appropriate duty cycle depending on ambient temperature and
number of drivers turned ON simultaneously, typical power loads totaling over
230 W (350 mA x 7, 95 V) can be controlled.

Typical loads include relays, solenoids, stepping motors, magnetic print
hammers, multiplexed LED and incandescent displays, and heaters. All devices
feature open-collector outputs with integral clamp diodes.

The ULN2003A/L and ULN2023A/L have series input resistors selected for
operation directly with 5 V TTL or CMOS. These devices will handle numerous
interface needs — particularly those beyond the capabilities of standard logic
buffers.

The ULN2004A/L and ULN2024A/L have series input resistors for operation
directly from 6 to 15 V CMOS or PMOS logic outputs.

The ULN2003A/L and ULN2004A/L are the standard Darlington arrays. The
outputs are capable of sinking 500 mA and will withstand at least 50 V in the OFF
state. Outputs may be paralleled for higher load current capability. The
ULN2023A/L and ULN2024A/L will withstand 95 V in the OFF state.

These Darlington arrays are furnished in 16-pin dual in-line plastic packages
(suffix “A”) and 16-lead surface-mountable SOICs (suffix “L”). All devices are
pinned with outputs opposite inputs to facilitate ease of circuit board layout. All
devices are rated for operation over the temperature range of -20?C to +85?C. Most
(see matrix, next page) are also available for operation to -40?C; to order, change the
prefix from “ULN” to “ULQ”.




lxxix

Fig [5.10] ULN2003A Circuit Diagram


5.9.1 FEATURES

? TTL, DTL, PMOS, or CMOS-Compatible Inputs
? Output Current to 500 mA
? Output Voltage to 95 V
? Transient-Protected Outputs
? Dual In-Line Plastic Package or Small-Outline IC Package


5.9.2 ABSOLUTE MAXIMUM RATINGS

? Output Voltage, V
CE

(ULN200xA and ULN200xL) .....50 V
(ULN202xA and ULN202xL) .....95 V
? Input Voltage, V
IN
......................30 V
? Continuous Output Current,
I
C
.................................................500 mA
Continuous Input Current, IIN.....25 mA
? Power Dissipation, PD
(One Darlington pair) ...................1.0 W
? Operating Temperature Range,
T
A
............................................. -20°C to +85°C
? Storage Temperature Range,
T
S
............................................. -55°C to +150°C


lxxx


6 CONCLUSION

6.1 DISCUSSION OF RESULTS

We have presented a method for making the air-conditioning system in a car,
run efficiently and automatically. Our Automatic weather control system has
provided a simpler way of air-condition control.


6.2 FUTURE WORK

This efficient control mechanism can be further developed to control the Air
Conditioner throw by controlling the blower motor.

The vent mechanism in the car Air Conditioner can also be automated by this
efficient method













lxxxi



REFERENCES

1. Hyundai Training Guide, Hyundai Motors India
2. Programming and Customizing PIC Microcontrollers, Myke Predko,
McGraw-Hill 2002.
3. http://www.datasheet4u.com
4. http://www.familycar.com
5. http://www.autorepair.about.com




doc_129782649.pdf
 

Attachments

Back
Top