Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
In chapter 1 we discuss about introduction of Embedded Systems, Problem
Statement, Project Objective, Project Scope and Project Outline
1.1 INTRODUCTION
The main aim of this paper is use the touch screen in the speed control system of
AC motor and DC motors. In this paper the resistive touch screen, where the user has to
physically touch the screen with slight impact on the screen, this variation in the
resistance is read by the touch screen controller, this in turns sends the data to the micro
controller using the signal conditioning circuit. The micro controller will read the data
obtained from the touch screen controller and will decode the message and depending on
the data decoded it will perform the specified task of driving the speed of the motor.
The software developed in the CPLD will read the data from wireless network
and will decode the same, after which it will drive the CPLD unit connected to the SCR
control unit, which then drives the motor speed or if the bulb is connected it will drive the
intensity of the bulb. The user on touching the screen at particular position the speed of
the motor is controlled and like this at different position the different speed is controlled.
The motive of this paper is to design an accurate, precise control, less area in
memory and easy way of controlling of single phase induction motor.
1.2 PROBLEM STATEMENT
This system installed for the four wheelers, Vehicle tracking usually used in navy
operators for navy management functions, routing, send off, on board information and
security. The applications include monitoring driving performance of a parent with a teen
driver. Vehicle tracking systems accepted in consumer vehicles as a theft prevention and
retrieval device. If the theft identified, the system sends the SMS to the vehicle owner.
After that vehicle owner sends the SMS to the controller, issue the necessary signals to
stop the motor.
1
1.3 PROJECT OBJECTIVE
The Touch Screen based Speed Control of Single Phase Induction Motor view
analysis, the built system can segment features of moving objects from moving
background and offer a collision word of warning on real-time. All the devices such as
16X2 LCD, GSM modem, Vibration sensor, Relay, Buzzer, Ignition lock and power
supply are connected to microcontroller.
engine is stopped.
2
CHAPTER2
LITERATURE REVIEW
In this chapter we discuss about EMBEDDED SYSTEMS and about the LPC2148
microcontroller.
3
processor and software and is designed to perform a specific function. For example, the
modem is designed to send and receive digital data over analog telephone line. That's it
and all of the other devices can be summarized in a single sentence as well.
Given the definition of embedded systems earlier is this chapter; the first such
systems could not possibly have appeared before 1971. That was the year Intel introduced
the world's first microprocessor. This chip, the 4004, was designed for use in a line of
business calculators produced by the Japanese Company Busicom. In 1969, Busicom
asked Intel to design a set of custom integrated circuits-one for each of their new
calculator models. The 4004 was Intel's response rather than design custom hardware for
each calculator, Intel proposed a general-purpose circuit that could be used throughout
the entire line of calculators. Intel's idea was that the software would give each calculator
its unique set of features.
The microcontroller was an overnight success, and its use increased steadily over
the next decade. Early embedded applications included unmanned space probes,
computerized traffic lights, and aircraft flight control systems. In the 1980s, embedded
systems quietly rode the waves of the microcomputer age and brought microprocessors
into every part of our kitchens (bread machines, food processors, and microwave ovens),
living rooms (televisions, stereos, and remote controls), and workplaces (fax machines,
pagers, laser printers, cash registers, and credit card readers).
4
It seems inevitable that the number of embedded systems will continue to increase
rapidly. Already there are promising new embedded devices that have enormous market
potential; light switches and thermostats that can be central computer, intelligent air-bag
systems that don't inflate when children or small adults are present, pal-sized electronic
organizers and personal digital assistants (PDAs), digital cameras, and dashboard
navigation systems. Clearly, individuals who possess the skills and desire to design the
next generation of embedded systems will be in demand for quite some time.
All of the topics and examples presented in this book are applicable to the
designers of real-time system who is more delight in his work. He must guarantee reliable
operation of the software and hardware under all the possible conditions and to the degree
that human lives depend upon three system's proper execution, engineering calculations
and descriptive paperwork.
5
2.1.3 Application Areas
The office automation products using embedded systems are copying machine,
fax machine, key telephone, modem, printer, scanner etc.
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific
tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and
then take appropriate action based on the monitored levels to control other devices or to
send information to a centralized monitoring station. In hazardous industrial environment,
where human presence has to be avoided, robots are used, which are programmed to do
6
specific jobs. The robots are now becoming very powerful and carry out many interesting
and complicated tasks such as hardware assembly.
2.1.3.6 Telecommunications
7
2.1.3.7 Wireless technologies
2.1.3.8 Insemination
Testing and measurement are the fundamental requirements in all scientific and
engineering activities. The measuring equipment we use in laboratories to measure
parameters such as weight, temperature, pressure, humidity, voltage, current etc. are all
embedded systems. Test equipment such as oscilloscope, spectrum analyzer, logic
analyzer, protocol analyzer, radio communication test set etc. are embedded systems built
around powerful processors. Thank to miniaturization, the test and measuring equipment
are now becoming portable facilitating easy testing and measurement in the field by
field-personnel.
2.1.3.9 Security
Security of persons and information has always been a major issue. We need to
protect our homes and offices; and also the information we transmit and store.
Developing embedded systems for security applications is one of the most lucrative
businesses nowadays. Security devices at homes, offices, airports etc. for authentication
and verification are embedded systems. Encryption devices are nearly 99 per cent of the
processors that are manufactured end up in~ embedded systems. Embedded systems find
applications in every industrial segment-consumer electronics, transportation, avionics,
biomedical engineering, manufacturing, process control and industrial automation, data
communication, telecommunication, defense, security etc., used to encrypt the data/voice
being transmitted on communication links such as telephone lines. Biometric systems
8
using fingerprint and face recognition are now being extensively used for user
authentication in banking applications as well as for access control in high security
buildings.
2.1.3.10 Finance
Financial dealing through cash and checks are now slowly paving way for
transactions using smart cards and ATM (Automatic Teller Machine, also expanded as
Any Time Money) machines. Smart card, of the size of a credit card, has a small micro-
controller and memory; and it interacts with the smart card reader! ATM machine and
acts as an electronic wallet. Smart card technology has the capability of ushering in a
cashless society. Well, the list goes on. It is no exaggeration to say that eyes wherever
you go, you can see, or at least feel, the work of an embedded system!
System runs above the hardware, and the application software runs above the
operating system. The same architecture is applicable to any computer including a
9
desktop computer. However, there are significant differences. It is not compulsory to
have an operating system in every embedded system. For small appliances such as remote
control units, air conditioners, toys etc., there is no need for an operating system and you
can write only the software specific to that application. For applications involving
complex processing, it is advisable to have an operating system. In such a case, you need
to integrate the application software with the operating system and then transfer the entire
software on to the memory chip.Once the software is transferred to the memory chip, the
software will continue to run for a long time you don’t need to reload new software.
Now, let us see the details of the various building blocks of the hardware of an
embedded system. As shown in Fig 2.2 the building blocks are:
Central Processing Unit (CPU)
Memory (Read-only Memory and Random Access Memory)
Input Devices
Output devices
Communication interfaces
Application-specific circuitry
The Central Processing Unit (processor, in short) can be any of the following:
microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is
10
a low-cost processor. Its main attraction is that on the chip itself, there will be many other
components such as memory, serial communication interface, analog-to digital converter
etc. So, for small applications, a micro-controller is the best choice as the number of
external components required will be very less. On the other hand, microprocessors are
more powerful, but you need to use many external components with them. D5P is used
mainly for applications in which signal processing is involved such as audio and video
processing.
2.1.4.2 Memory
The memory is categorized as Random Access 11emory (RAM) and Read Only Memory
(ROM). The contents of the RAM will be erased if power is switched off to the chip,
whereas ROM retains the contents even if the power is switched off. So, the firmware is
stored in the ROM. When power is switched on, the processor reads the ROM; the
program is program is executed.
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse, and hence interacting with the
embedded system is no easy task. Many embedded systems will have a small keypad-you
press one key to give a specific command. A keypad may be used to input only the digits.
Many embedded systems used in process control do not have any input device for user
interaction; they take inputs from sensors or transducers 1’fnd produce electrical signals
that are in turn fed to other systems.
The output devices of the embedded systems also have very limited capability.
Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the
health status of the system modules, or for visual indication of alarms. A small Liquid
Crystal Display (LCD) may also be used to display some important parameters.
11
2.1.4.5 Communication interfaces
The embedded systems may need to, interact with other embedded systems at
they may have to transmit data to a desktop. To facilitate this, the embedded systems are
provided with one or a few communication interfaces such as RS232, RS422, RS485,
Universal Serial Bus (USB), and IEEE 1394, Ethernet etc.
Sensors, transducers, special processing and control circuitry may be required fat
an embedded system, depending on its application. This circuitry interacts with the
processor to carry out the necessary work. The entire hardware has to be given power
supply either through the 230 volts main supply or through a battery. The hardware has to
design in such a way that the power consumption is minimized.
2.1.4.7 Conclusions
Embedded Systems plays a vital role in our day today life. They are used for
household appliances like microwave oven to the satellite applications. They provide
good man to machine interface.
Automation is the further step in the world of Embedded Systems, which includes
the elimination of the human being in the mundane applications. They are cost effective,
accurate and can work in any conditions and round the clock.
2.2 Microcontoller
Microcontrollers as the name suggests are small controllers. They are like single
chip computers that are often embedded into other systems to function as
processing/controlling unit. For example the remote control you are using probably has
microcontrollers inside that do decoding and other controlling functions. They are also
used in automobiles, washing machines, microwave ovens, toys ... etc, where automation
is needed.
12
Micro-controllers are useful to the extent that they communicate with other
devices, such as sensors, motors, switches, keypads, displays, memory and even other
micro-controllers. Many interface methods have been developed over the years to solve
the complex problem of balancing circuit design criteria such as features, cost, size,
weight, power consumption, reliability, availability, manufacturability. Many
microcontroller designs typically mix multiple interfacing methods. In a very simplistic
form, a micro-controller system can be viewed as a system that reads from (monitors)
inputs, performs processing and writes to (controls) outputs.
Embedded system means the processor is embedded into the required application.
An embedded product uses a microprocessor or microcontroller to do one task only. In an
embedded system, there is only one application software that is typically burned into
ROM. Example: printer, keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other components
such as memory, or components for receiving and sending data must be added to it. In
short that means that microprocessor is the very heart of the computer. On the other hand,
microcontroller is designed to be all of that in one. No other external components are
needed for its application because all necessary peripherals are already built into it. Thus,
we save the time and space needed to construct devices.
13
a complete computer (e.g., RAM, ROM, serial interface, parallel interface, timer,
and interrupt handling circuit).
Microprocessor instruction sets are processing Intensive.
Their instructions operate on nibbles, bytes, words, or even double words.
Addressing modes provide access to large arrays of data using pointers and
offsets.
They have instructions to set and clear individual bits and perform bit operations.
They have instructions for input/output operations, event timing, enabling and
setting priority levels for interrupts caused by external stimuli.
Processing power of a microcontroller is much less than a microprocessor.
2.2.2 Applications
14
Microprocessor instruction sets are processing Intensive.
Their instructions operate on nibbles, bytes, words, or even double words.
Addressing modes provide access to large arrays of data using pointers and
offsets.
They have instructions to set and clear individual bits and perform bit
operations.
They have instructions for input/output operations, event timing, enabling and
setting priority levels for interrupts caused by external stimuli.
Processing power of a microcontroller is much less than a microprocessor.
A third 16-bit timer, capable of a number of new operation modes and 16-bit reloads.
15
2.3.1Functional block diagram of 8051 microcontroller
16
Figure: block diagram of 8051
GND: Ground.
17
Port 0: Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each
pin can sink eight TTL inputs. When 1sare written to port 0 pins, the pins can be
used as high impedance inputs. Port 0 can also be configured to be the multiplexed
low order address/data bus during accesses to external program and data memory. In
this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash
programming and outputs the code bytes during program verification. External pull-
ups are required during program verification
Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1
Output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins,
they are pulled high by the internal pull-ups and can be used as inputs. In addition,
P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins,
they are pulled high by the internal pull-ups and can be used as inputs. Port 2 emits
the high-order address byte during fetches from external program memory and
during accesses to external data memory that use 16-bit addresses (MOVX
@DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s.
Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3
18
output buffers can sink/source four TTL inputs. When 1s are writt 1s are written to
Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 3 pins that are externally being pulled low will source current (IIL)
because of the pull-ups. Port 3 also serves the functions of various special features of
the AT89S52, as shown in the following table.Port 3 also receives some control
signals for Flash programming
RST:Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low
byte of the address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming. In normal operation, ALE is emitted
at a constant rate of1/6 the oscillator frequency and may be used for external timing
or clocking purposes. Note, however, that one ALE pulse is skipped during each
access to external data Memory. If desired, ALE operation can be disabled by setting
bit 0 of SFR location.
PSEN: Program Store Enable (PSEN) is the read strobe to external program
memory. When the AT89S52 is executing code from external program memory,
PSEN is activated twice each machine cycle, except that two PSEN activations are
skipped during each access to external data memory.
19
EA/VPP:External Access Enable. EA must be strapped to GND in order to enable
the device to fetch code from external program memory locations starting at 0000H
up to FFFFH.Note, however, that if lock bit 1 is programmed, EA will be internally
latched on reset. A should be strapped to VCC for internal program executions. This
pin also receives the 12-voltProgramming enables voltage (VPP) during Flash
programming.
XTAL1: Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier that can be configured for use as an on-chip oscillator, as shown in Figure
1. Either a quartz crystal or ceramic resonator may be used. To drive the device from
an External clock source, XTAL2 should be left unconnected while XTAL1 is
driven, as shown in Figure 2.
20
The Accumulator:
The “R” registers: The “R” registers are a set of eight registers that are named R0,
R1. Etc up to R7. These registers are used as auxiliary registers in many operations.
The “B” registers: The “B” register is very similar to the accumulator in the sense
that it may hold an 8-bit (1-byte) value. Two only uses the “B” register 8051
instructions: MUL AB and DIV AB.
The Data Pointer: The Data pointer (DPTR) is the 8051’s only user accessible 16-
bit (2Bytes) register. The accumulator, “R” registers are all 1-Byte values. DPTR, as
the name suggests, is used to point to data. It is used by a number of commands,
which allow the 8051 to access external memory.
The program counter (PC) is a 2-byte address, which tells the 8051 where the next
instruction to execute is found in memory. The stack pointer like all registers except
DPTR and PC may hold an 8-bit (1-Byte) value
ADDRESSING MODES:
An “addressing mode” refers that you are addressing a given memory location.
In summary, the addressing modes are as follows, with an example of each:
Indexed Addressing
21
a. External Direct MOVX A, @DPTR
Direct Addressing:
For example:
MOV A, 30h
This instruction will read the data out of internal RAM address
30(hexadecimal) and store it in the Accumulator. Direct addressing is generally fast
since, although the value to be loaded isn’t included in the instruction, it is quickly
accessible since it is stored in the 8051’s internal RAM. It is also much more flexible
than Immediate Addressing since the value to be loaded is whatever is found at the
given address which may variable.
Indirect Addressing:
MOV A, @R0:
This instruction causes the 8051 to analyze Special Function Register (SFR)
Memory:
Special Function Registers (SFRs) are areas of memory that control specific
functionality of the 8051 processor. For example, four SFRs permit access to the
22
8051’s 32 input/output lines. Another SFR allows the user to set the serial baud rate,
control and access timers, and configure the 8051’s interrupt system.
Timer 2 Registers:
Control and status bits are contained in registers T2CON and T2MOD
for Timer 2. The register pair (RCAP2H , RCAP2L) are the Capture / Reload
registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode.
Interrupt Registers:
The individual interrupt enable bits are in the IE registe . Two priorities
can be set for each of the six interrupt sources in the IP register.
Timer 2:Timer 2 is a 16-bit Timer / Counter that can operate as either a timer or
an event counter. The type of operation is selected by bit C/T2 in the SFR
T2CON . Timer 2 has three operating Modes : capture , auto-reload ( up or down
Counting ) , and baud rate generator . The modes are selected by bits in T2CON.
Timer 2 consists of two 8-bit registers , TH2 and TL2 . In the Timer function, the
TL2 register is incremented every machine cycle .
23
Timer 0:Timer 0 functions as either a timer or event counter in four modes of
operation . Timer 0 is controlled by the four lower bits of the TMOD register and
bits 0, 1, 4 and 5 of the TCON register Mode 0 ( 13-bit Timer)
Mode 0 configures timer 0 as a 13-bit timer which is set up
as an 8-bit timer (TH0 register) with a modulo 32 prescaler implemented with
the lower five bits of the TL0 register . The upper three bits of TL0 register
are indeterminate and should be ignored . Prescaler overflow increments the
TH0 register.
Mode 1 ( 16-bit Timer ): Mode 1 is the same as Mode 0, except that the
Timer register is being run with all 16 bits . Mode 1 configures timer 0 as
a 16-bit timer with the TH0 and TL0 registers connected in cascade . The
selected input increments the TL0 register
Mode 3 ( Two 8-bit Timers ): Mode 3 configures timer 0 so that registers TL0
and TH0 operate as separate 8-bit timers. This mode is provided for applications
requiring an additional 8-bit timer or counter .
Mode 3 (Halt): Placing Timer 1 in mode 3 causes it to halt and hold its count.
This can be used to halt Timer 1 when TR1 run control bit is not available
i.e. , when Timer 0 is in mode 3 .
Baud Rates: The baud rate in Mode 0 is fixed. The baud rate in Mode 2
depends on the value of bit SMOD in Special Functio Register PCON. If
SMOD = 0 (which is its value on reset), the baud rate is 1/64 the oscillator
frequency. If SMOD = 1, the baud rate is 1/32 the oscillator frequency.
24
TCON REGISTER: Timer/counter Control Register
25
2.3.3 AT89S52 Features:
• 3 16-bit Timer/Counters
• Watchdog Timer
• Power-off Flag
26
CHAPTER 3
DESIGN APPROACH
In this chapter we discuss about the block diagram of Touch Screen based Speed
Control of Single Phase Induction Motor hardware requirements and software
requirements.
POWER
TOUCH SUPPLY
DRIVER
CIRCUIT
LCD DISPLAY
TOUCH
SCREEN AT89S52 DRIVER
CIRCUIT
INDUCTON
MOTOR
27
Figure 3.1: block diagram Touch Screen based Speed Control of Single
Phase Induction Motor
The AC main Block is the power supply, which is of single-phase 230V ac. This
should be give to step down transformer to reduce the 230V ac voltage to low voltage.
i.e., to 6V or 12V ac this value depends on the transformer inner winding. The output of
the transformer is give to the rectifier circuit. This rectifier converts ac voltage to dc
voltage. Nevertheless, the voltage may consist of ripples or harmonics.
To avoid these ripples the output of the rectifier is connect to filter. The filter thus
removes the harmonics. This is the exact dc voltage of the given specification. However,
the circuit operates at 5V dc voltage. Therefore, we need a regulator to reduce the
voltage. 7805 regulator produces 5V dc voltage.
28
a.c components present even after rectification. Now, this voltage is given to a voltage
regulator to obtain a pure constant dc voltage.
3.3.1.2 Rectifier
29
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a
bridge rectifier is used because of its merits like good stability and full wave rectification.
The Bridge rectifier is a circuit, which converts an ac voltage to dc voltage using
both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure.
30
3.3.1.3 Filter
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the output
stage.
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing
LEDs. It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols etc
3.3.2.1 Pins Functions
There are the pins used for connection to the microcontroller.
31
Table 3.1: LCD pins description
Pin
Function Name Logic State Description
Number
Ground 1 Vss - 0V
8 D1 0/1 Bit 1
9 D2 0/1 Bit 2
10 D3 0/1 Bit 3
Data /
commands Bit 4
11 D4 0/1
12 D5 0/1 Bit 5
13 D6 0/1 Bit 6
32
3.3.2.2 LCD BASIC COMMANDS
Execution
Command RS RW D7 D6 D5 D4 D3 D2 D1 D0
Time
33
0 = Decrement (by 1) 0 = Shift left
Depending on how many lines are used for connection to the microcontroller,
there are 8-bit and 4-bit LCD modes. The appropriate mode is determined at the
beginning of the process in a phase called “initialization”. In the first case, the data are
transferred through outputs D0-D7 as it has been already explained. In case of 4-bit LED
mode, for the sake of saving valuable I/O pins of the microcontroller, there are only 4
higher bits (D4-D7) used for communication, while other may be left unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent first
(that normally would be sent through lines D4-D7), four lower bits are sent afterwards.
With the help of initialization, LCD will correctly connect and interpret each data
received. Besides, with regards to the fact that data are rarely read from LCD (data
mainly are transferred from microcontroller to LCD) one more I/O pin may be saved by
simple connecting R/W pin to the Ground. Such saving has its price. Even though
message displaying will be normally performed, it will not be possible to read from busy
flag since it is not possible to read from display.
34
3.3.2.4 LCD INITIALIZATION
Once the power supply is turned on, LCD is automatically cleared. This process
lasts for approximately 15mS. After that, display is ready to operate. The mode of
operating is set by default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. Mainly but not
always! If for any reason power supply voltage does not reach full value in the course of
10mS, display will start perform completely unpredictable? If voltage supply unit can not
meet this condition or if it is needed to provide completely safe operating, the process of
initialization by which a new reset enabling display to operate normally must be applied.
Contrast control
To have a clear view of the characters on the LCD, contrast should be adjusted.
To adjust the contrast, the voltage should be varied. For this, a preset is used which can
behave like a variable voltage device. As the voltage of this preset is varied.
35
Figure 3.8 : Variable resistors
Potentiometer
Variable resistors used as potentiometers have all three terminals connected. This
arrangement is normally used to vary voltage, for example to set the switching point of a
circuit with a sensor, or control the volume (loudness) in an amplifier circuit. If the
terminals at the ends of the track are connected across the power supply, then the wiper
terminal will provide a voltage which can be varied from zero up to the maximum of the
supply.
Presets
These are miniature versions of the standard variable resistor. They are
designed to be mounted directly onto the circuit board and adjusted only when the circuit
is built. For example to set the frequency of an alarm tone or the sensitivity of a light-
sensitive circuit. A small screwdriver or similar tool is required to adjust presets. Presets
are much cheaper than standard variable resistors so they are sometimes used in projects
where a standard variable resistor would normally be used.
They are usually used to regulate current flowing through a circuit or is used to
control the other factors such as other components, some devices in the circuit. The term
is often used, for example, for a specialized integrated circuit that controls high-
power switches in switched-mode power converters. An amplifier can also be considered
a driver for loudspeakers, or a constant voltage circuit that keeps an attached component
operating within a broad range of input voltages.
36
Typically the driver stage(s) of a circuit requires different characteristics to other
circuit stages. For example in a transistor power amplifier, typically the driver circuit
requires current gain, often the ability to discharge the following transistor bases rapidly,
and low output impedance to avoid or minimize distortion.
37
extensively for smaller loads, such as household appliances like fans. Although
traditionally used in fixed-speed service, induction motors are increasingly being used
with variable-frequency drives (VFDs) in variable-speed service. VFDs offer especially
important energy savings opportunities for existing and prospective induction motors in
variable-torquecentrifugal fan, pump and compressor load applications. Squirrel cage
induction motors are very widely used in both fixed-speed andvariable-frequency
drive (VFD) applications. Variable voltage and variable frequency drives are also used in
variable-speed service.
TRIACs belong to the thyristor family and are closely related to Silicon-controlled
rectifiers (SCR). However, unlike SCRs, which are unidirectional devices (i.e. can
conduct current only in one direction), TRIACs are bidirectional and so current can flow
through them in either direction. Another difference from SCRs is that TRIACs can be
triggered by either a positive or a negative current applied to its gate electrode, whereas
SCRs can be triggered only by currents going into the gate. In order to create a triggering
38
current, a positive or negative voltage has to be applied to the gate with respect to the A1
terminal (otherwise known as MT1).
Once triggered, the device continues to conduct until the current drops below a
certain threshold, called the holding current.
Touch screens are a clear sheet of plastic with tiny sensors that detect pressure
from either a finger tip or a pointing device. When these sensors are pressed, they
perform, they perform the functions found with the traditional mouse; single click, double
click and drag. A software utility needs to be installed on the computer hard drive to
further customize the different settings. Touch screens are great for the cause and effect
and software applications that require direct select.
Four-wire resistive touch technology consists of a glass or acrylic panel that is
coated with electrically conductive and resistive layers. The thin layers are separated by
invisible separator dots. When operating, an electrical current moves through the screen.
When pressure is applied to the screen the layers are pressed together, causing a change
in the electrical current and a touch event to be registered. 4-Wire resistive type touch
screens are generally the most affordable.
39
3.4.1 EMBEDDED 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.
40
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
Compatible - integrates into the MPLAB IDE, MPLAB ICD and most 3rd-party
development tools
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.
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.
ASSEMBLER
41
instructions to run inline instead of in a subroutine. Assemblers are far simpler to write
than compilers for high-level languages.
Speed: Assembly language programs are generally the fastest programs around.
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.
SIMULATOR
42
Projects
The user of KEIL centers on “projects”. A project is a list of all the source files
required to build a single application, all the tool options which specify exactly how to
build the application, and – if required – how the application should be simulated. A
project contains enough information to take a set of source files and generate exactly the
binary code required for the application. Because of the high degree of flexibility
required from the tools, there are many options that can be set to configure the tools to
operate in a specific manner. It would be tedious to have to set these options up every
time the application is being built; therefore they are stored in a project file. Loading the
project file into KEIL informs KEIL which source files are required, where they are, and
how to configure the tools in the correct way. KEIL can then execute each tool with the
correct options. It is also possible to create new projects in KEIL. Source files are added
to the project and the tool options are set as required. The project can then be saved to
preserve the settings. The project is reloaded and the simulator or debugger started, all the
desired windows are opened. KEIL project files have the extension
Simulator/Debugger:
The simulator/ debugger in KEIL can perform a very detailed simulation of a
micro controller along with external signals. It is possible to view the precise execution
time of a single assembly instruction, or a single line of C code, all the way up to the
entire application, simply by entering the crystal frequency. A window can be opened for
each peripheral on the device, showing the state of the peripheral. This enables quick
trouble shooting of mis-configured peripherals. Breakpoints may be set on either
assembly instructions or lines of C code, and execution may be stepped through one
instruction or C line at a time. The contents of all the memory areas may be viewed along
with ability to find specific variables. In addition the registers may be viewed allowing a
detailed view of what the microcontroller is doing at any point in time.
ABOUT KEILARM:
1. Click on the Keil u Vision3 Icon on Desktop
2. The following fig will appear
43
3.Click on the Project menu from the title bar
4.Then Click on New Project
5.Save the Project by typing suitable project name with no extension in u r own folder
sited in either C:\ or D:\
44
6.Then Click on Save button above.
7.Select the component for u r project. i.e.NXP……
8.Click on the + Symbol beside of NXP
45
10.Then Click on “OK”
11.The Following fig will appear
46
14.Now double click on the Target1, you would get another option “Source group 1”
as shown in next page.
15.Click on the file option from menu bar and select “new”
47
16.The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
19.Now right click on Source group 1 and click on “Add files to Group Source”
48
20.Now you will get another window, on which by default “C” files will appear
49
21.Now select as per your file extension given while saving the file
22.Click only one time on option “ADD”
23.Now Press function key F7 to compile. Any error will appear if so happen.
50
27.Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below
29. Now keep Pressing function key “F11” slowly and observe.
30. You are running your program successfully
51
CHAPTER 4
RESULT
In chapter 4 we discuss about Result, Applications and advantages
52
Figure 4.2: IMPLEMENTATION OF TOUCH SCREEN BASED SPEED
CONTROL OF SINGLE PHASE INDUCTION MOTOR KIT IMAGE
53
Working
Vehicle tracking and locking system based on gsm and gps consists of transmitter
and receiver section separately. Mainly this project is used for reducing human effect and for
increasing water usage in the field of agriculture automatically.
First these kits are connected to the main supply (230V A.C).then it is step down to
5V d.c supply. 230V A.C supply is given as input to the step down transformer then it is step
down that voltage to some 18V A.C supply. Then it is given to the Bridge wave Rectifier.
This converts A.C to Pulsating D.C. then this is given to the filter circuit. Here capacitive
filter is used. So it converts that pulsating D.C to pure D.C. next this is connected to 7805
regulator. It produces our required 5V D.C supply.
4.2 ADVANTAGES
4.3 APPLICATIONS
Field Application
Industrial Applications
Protocol based Applications
Communication applications
54
CHAPTER 5
CODING
Transmitter section code:-
/* MODULES :
LPC2148 Microcntroller
LCD(4-bit data) RS-P1.16,EN-P1.17,DATA -P1.18-P1.19
Zigbee (UART0)
TEMPURATURE SENSOR (P0.28)
Humidity sensor (P0.29)
soil Sensor (P0.30)
Water level 1 (P0.13) //LOW
Water level 2 (P0.14) //MID
Water level 2 (P0.15) //FUL
BUZZER (P0.23)
/*************************HEADDERFILES*******************************/
#include <LPC214X.H>
#include "lcd.h"
#include "UART0.h"
#include "ADC0.h"
#include <string.h>
/************************** PIN CONNECTIONS *******************/
#define ir1_entry 20
#define buzzer (1<<23)
#define motor (1<<16)
/************** VARIABLE DECLARATIONS *********************/
unsigned int temp,soil,mask,humidity;
unsigned char s,l,e,x,f3,f4,b[50];
unsigned char level,level1,level2;
/************ Function declarations *******/
void convert(unsigned int t,unsigned char k);
55
/********************* CONVERT FUNCTION ***********************/
void convert(unsigned int t,unsigned char k)
{
unsigned int d1,d2,d3;
d1=t%10;
t=t/10;
d2=t%10;
t=t/10;
d3=t%10;
if(k==0)
{
lcddata(d3+0x30);
lcddata(d2+0x30);
lcddata(d1+0x30);
}
else if(k==1)
{
serial_char0(d3+0x30);
delay(10);
serial_char0(d2+0x30);
delay(10);
serial_char0(d1+0x30);
delay(10);
}
}
/************************* MAIN FUNCTION *************/
int main()
{
/************ LCDINTILISATIONS *****************/
lcdint();
disp_loc(0x80," WELCOME TO ");
56
disp_loc(0xc0," THE PROJECT ");
delay(5000);
delay(1000);
lcdcmd(0x0c);
serialint0();
delay(100);
serial0("AT");
serial_char0(0x0d);
delay(200);
serial0("AT+DMODE");
serial_char0(0x0d);
VICIntEnable=0x40;
U0IER=0x01;
VICVectAddr0=(unsigned)zigbee;
VICVectCntl0=0x26;
delay(200);e=0;s=0;
level1=0;level2=0;
f3=0;f4=0;
while(1)
{
lcdcmd(0x01);l=0;
disp_loc(0x80,"TMP: ");disp_loc(0x88,"LVL: ");
disp_loc(0xC0,"HUM: ");
disp_loc(0xC8,"SOIL: ");
level=0;level1=0;level2=0;
delay(1000);
temp=ADC0(1); // channel 1 of ADC0 i.e. P0.28
lcdcmd(0x84);
57
if(temp>0x30)
{
IOSET0=buzzer;
}
else
{
IOCLR0=buzzer;
}
convert(temp,0);
delay(1000);
58
delay(1000);
if(soil>100)
{disp_loc(0xCD,"DRY");delay(500);s=0;
if(l==0){IOCLR0=motor;}
else{IOSET0=motor; }
}
else
{disp_loc(0xCD,"WET");delay(500);s=1;IOCLR0=motor;}
serial_char0('@');
serial0("TEMP:");
convert(temp,1);
serial0("LVL:");
switch(l)
{
case (0) : serial0("NIL");
59
break;
case (1) : serial0("LOW");
break;
case (2) : serial0("MID");
break;
case (3) : serial0("FUL");
break;
default : break;
}
serial0("HUM:");
convert(humidity,1);
serial0("SOIL:");
switch(s)
{
case (0) : serial0("DRY");
break;
case (1) : serial0("WET");
break;
default : break;
}
serial0("IR:");
if(e==1)
{
serial0("F");
}
else
{
serial0("N");
}
serial_char0('*');
delay(5000);
60
}
}
Receiver section code
/**************************HEADDER FILES *******************/
#include <LPC214X.H>
#include "lcd.h"
#include "UART.h"
#include "eeprom.h"
#include <string.h>
#include <math.h>
/**************** FUNCTION DELCARATIONS ****************/
void gsmint( void );
void message (unsigned char *);
void convert1( unsigned char ,unsigned char );
61
serial1("AT+CGDCONT=1,\"IP\",\"airtelgprs.com\""); // command to convert to text
mode
serial_char1(0x0d);
delay(3000);
serial1("AT+CIPSTART=\"TCP\",\"49.204.0.253\",\"9998\""); //2014 command to
receive b
serial_char1(0x0d);
delay(5000);
lcdcmd(0xc0);
lcd_str("GPRS CONNECTED ");
delay(5000);
}
void send1()
{
lcdcmd(0x01);
lcdcmd(0x80);
lcd_str("DATA Sending");
serial1("AT+CIPSEND"); // command to receive b
serial_char1(0x0d);
delay(500);
serial1("FIELD");
serial_char1(',');
serial1("STATUS");
serial_char1('$');
serial1("TEMP");
serial_char1(',');
convert1(temp,1);
serial_char1('$');
serial1("HUM");
serial_char1(',');
convert1(hum,1);
62
serial_char1('$');
serial1("WLEVEL");
serial_char1(',');
switch(l)
{
case (0) : serial1("NILL");
break;
case (1) : serial1("LOW");
break;
case (2) : serial1("MIDDLE");
break;
case (3) : serial1("FULL");
break;
default : break;
}
serial1("SOIL");
serial_char1(',');
convert1(sl,1);
serial_char1('$');
serial_char1('$');
serial1("FIELD");
serial_char1(',');
switch(s)
{
case (0) :serial1("DRY");
if(l==0)
{
serial_char1('$');
serial1("MOTOR");
serial_char1(',');
serial1("OFF");
63
serial_char1('$');
serial1("NO");
serial_char1(',');
serial1("WATER");
}
if(l==1)
{
serial_char1('$');
serial1("MOTOR");
serial_char1(',');
serial1("OFF");
serial_char1('$');
serial1("LOW");
serial_char1(',');
serial1("WATER");
}
else
{
serial_char1('$');
serial1("MOTOR");
serial_char1(',');
serial1("ON");}
break;
case (1) :serial1("WET");
serial_char1('$');
serial1("MOTOR");
serial_char1(',');
serial1("OFF");
break;
default : break;
}
64
if(temp>50)
{
serial_char1('$');
serial1("FAN");
serial_char1(',');
serial1("ON");
}
else
{
serial_char1('$');
serial1("FAN");
serial_char1(',');
serial1("OFF");
}
delay(8000);
serial_char1('$');
serial1("INTRUDER");serial_char1(',');
if(p==1)
{
serial1("FOUND");
}
else
{
serial1("NONE");
}
serial_char1(0x0d);
serial_char1(0x1A);
delay(8000);
lcdcmd(0xc0);
lcd_str("DATA UPDATED");
delay(1000);
65
}
void convert1(unsigned char t,unsigned char k)
{
unsigned char d0,d1,d2;
d0=t%10;
t=t/10;
d1=t%10;
d2=t/10;
if(k==0)
{
lcddata(d2+0x30);
serial_char0(d2+0x30);
lcddata(d1+0x30);
serial_char0(d1+0x30);
lcddata(d0+0x30);
serial_char0(d0+0x30);
}
else if(k==1)
{
serial_char1(d2+0x30);
serial_char1(d1+0x30);
serial_char1(d0+0x30);
}
}
/************************** MAIN FUNCTION
************************************/
int main( void )
{
/************ LCDINTILISATIONS *****************/
rtcinit();
delay(1000);
66
lcdint();
disp_loc(0x80," WELCOME TO ");
disp_loc(0xc0," THE PROJECT ");
delay(5000);
serialint0();
serial0("AT");
serial_char0(0x0d);
serial0("AT+DMODE");
serial_char0(0x0d);
serialint1();
delay(1000);
gprsint();
lcdcmd(0x01);
disp_loc(0x80," WELCOME TO ");
disp_loc(0xc0," THE PROJECT ");
f1=0;f2=0;f3=0;f4=0;
l=0;s=0;p=0;
while(1)
{
l=0;s=0;p=0;
if(f4==1)
{
lcdcmd(0x01);
disp_loc(0x80,"TMP ");
disp_loc(0x8C,"LV ");
disp_loc(0x85,"HUM ");
disp_loc(0x89,"SOIL: ");
disp_loc(0x8F,"S");
temp=(b[5]-0x30)*100+(b[6]-0x30)*10+(b[7]-0x30);
hum=(b[19]-0x30)*100+(b[20]-0x30)*10+(b[21]-0x30);
sl=(b[27]-0x30)*100+(b[28]-0x30)*10+(b[29]-0x30);
67
lvl=b[12];
soil=(b[30]);
itr=(b[33]);
lcdcmd(0xc0);
convert1(temp,0);
lcddata(temp);
if (lvl=='L')
{
lcdcmd(0xCC);
lcd_str("LOW ");
l=1;
}
else if (lvl=='F')
{
lcdcmd(0xCC);
lcd_str("FUL");l=3;
}
else if (lvl=='M')
{
lcdcmd(0xCC);
lcd_str("MID ");
l=2;
}
else
{
lcdcmd(0xCC);
lcd_str("NIL ");
l=0;
}
lcdcmd(0xc5);
convert(hum,0);
68
lcddata(hum);
lcdcmd(0xc9);
convert(sl,0);
lcddata(sl);
lcdcmd(0xCF);
lcddata(' ');
if (soil=='W')
{
lcdcmd(0xCD);
lcd_str("WET");
s=1;
}
else if (soil=='D')
{
lcdcmd(0xCD);
lcd_str("DRY");
s=0;
}
if (itr=='F')
{
lcdcmd(0x01);p=1;
lcdcmd(0x80);
lcd_str("INTRUDER FOUND");
}
f1=0;f2=0;f3=0;f4=0;
delay(2000);
send1();
delay(1000);
}
}
}
69
CHAPTER 5
CONCLUSION
In this project work, we have studied and implemented a complete working model
using a Microcontroller. The programming and interfacing of microcontroller has been
mastered during the implementation. This work includes the study of GSM modem using
sensors.
In this project we are using Touch Screen in order to control electrical equipments
like AC/DC motor, electric bulbs. By making use of this technology, we can control the
equipment in a safe and simpler manner. It is easy to operate and can be operated by any
one. The danger of electric shock with conventional switches is also eliminated by using
technology. The power consumed is relatively low compared to switches. With constant
improvement in touch screen technology it would be more feasible to use touch screen
than the conventional switches. Use of this type of control would make the systems more
reliable and long life.
5.1 FUTURE ENHANCEMENT
The main advantages of this system are user friendly, no dangers associated with
switching, longlife, more reliable, consumes less power, easy control of speed and
compact in size.
70
APPENDIX
REFERENCE
71
[8]. S.MuhammadUmair, R. Usman,”Automation Of Irrigation System Using Ann Based
Controller,” International Journal Of Electrical Computer Sciences Ijecs-Ijens Vol: 10
No: 02.May2010.
Web sites
[1].http://www.garmin.com/products/gps35
[2].http://www.alldatasheet.com
[3].http://www.mathworks.com
[5].http://www.national.com/ds/LM/LM35.pdf
[6]. http://www.nxp.com/documents/user_manual/UM10139.pdf
72