Chapter 1: Introduction: 1.1 Preamble of The Project
Chapter 1: Introduction: 1.1 Preamble of The Project
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and perfor
mance. Some embedded systems are mass-produced, benefiting from economies of scale.
Physically embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants. Complexity varies from low, with a single
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most systems have
some element of extensibility or programmability. For example, handheld computers share
some elements with embedded systems such as the operating systems and microprocessors
which power them, but they allow different applications to be loaded and peripherals to be
connected. Moreover, even systems which don't expose programmability as a primary feature
generally need to support software updates. On a continuum from "general purpose" to
"embedded", large application systems will have subcomponents at most points even if the
system as a whole is "designed to perform one or a few dedicated functions", and is thus
appropriate to call "embedded".
In many ways, programming for an embedded system is like programming PC 15 years
ago. The hardware for the system is usually chosen to make the device as cheap as possible.
Spending an extra dollar a unit in order to make things easier to program can cost millions.
Hiring a programmer for an extra month is cheap in comparison.This means the programmer
must make do with slow processors and low memory, while at the same time battling a need
for efficiency not seen in most PC applications. Below is a list of issues specific to the
embedded field.
least 10 to 15 centimeters. Of course, more opened windows, and finally completely opened
windows gives the best results, but 15 to 25 centimeters is optimal regarding inside
temperature drop, energy consummation and safety concerns.
It can be summarized that this project, although only a prototype, is completely functional
device that performs its function safely, reliably and efficiently. Possibility of application is
not limited only to the vehicle ventilation. The module is extremely expandable in both ways:
it is upgradeable for new tasks as well as compatible for integration into some existing
systems. Nearly every component can be used for several other functions, which can be
achieved only by software upgrade. Upgrading hardware opens even greater possibility to
upgrade the software and there are countless capabilities
is not done in a particular time period then there is a cause of damage to the entire equipment.
Eg: consider a system in which we have to open a valve within 30 milliseconds. If this
valve is not opened in 30 ms this may cause damage to the entire equipment. So in such cases
we use embedded systems for doing automatic operations.
These embedded systems follow a relative dead line time period i.e.., if the task is not
done in a particular time that will not cause damage to the equipment.
Eg: Consider a TV remote control system,if the remote control takes a few milliseconds
delay it will not cause damage either to the TV or to the remote control. These systems which
will not cause damage when they are not operated at considerable time period those systems
comes under soft real-time embedded systems.
Different Types of Processing Units
The central processing unit (C.P.U) can be any one of the following microprocessor,
micro controller, digital signal processing.
Among these Microcontroller is of low cost processor and one of the main
advantage of microcontrollers is, the components such as memory, serial
communication interfaces, analog to digital converters etc., all these are built on a
single chip. The numbers of external components that are connected to it are very
less according to the application.
Microprocessors are more powerful than microcontrollers. They are used in major
applications with a number of tasking requirements. But the microprocessor
requires many external components like memory, serial communication, hard
disk, input output ports etc.., so the power consumption is also very high when
compared to microcontrollers.
Digital signal processing is used mainly for the applications that particularly
involved with processing of signals.
ARM7
Temperature Sensor
Humidity sensor
LCD
LED
PIR Sensor
MAX 232
4.2 Hardware Module Description:
4.2.1 Arm 7 Based Lpc 2148
The LPC2148 microcontrollers are designed based on a 32/16 bit ARM7TDMI-S CPU
with real-time emulation and embedded trace support, which combines the microcontroller
with an embedded systems memory ranging from 32 KB to 512 KB. An interface of 128-bit
wide memory and an accelerator of unique architecture will enable the 32-bit code execution
with a maximum clock rate. For complex code size applications, the 16-bitalternative Thumb
mode will reduces code by more than 30 % with having minimum performance penalty.
Because of their small size and less power consumption properties, LPC2141/2/4/6/8 is ideal
for applications. A number of serial communications interfaces having different ranges and
SSP SPI I2Cs and static RAM all these devices made this controller suitable for different
communications.
4.2.2 Features of Arm
interfaces.
The LPC2146/8 provides 8 KB of on-chip RAM accessible to USB by DMA.In
addition USB 2.0 Full Speed compliant Device Controller with 2 KB of endpoint
RAMS.
One or two (LPC2141/2 vs. LPC2144/6/8) 10-bit A/D converters provide a total of 6/14
10
GPIO will give the direction control (whether the selected pin is used as input pin or
output pin) of individual bits. It can be achieved by IODIR.
2.
We can set the values of register by writing one, produces high at the corresponding
port pins, whereas writing zero will have no effect. It can be done by using IOSET.
Whenever we use i.e. when we set any value we have to clear those bit using IOCLR.
IOCLR will clear the particular bits we have selected.
3.
After reset, by default all the I/O will act as input pins.
Port0 has 32 pins and all can be used as input/output. All pins of this port can be used
as general purpose input/output. The number of pins available for input/output
operation will depends on the use of alternate functions i.e. if we use less alternate
functions more are the available input/outputs. Port Pins P0.24,P0.26,P0.27 are not
available.
11
Port1 has16 pins and all can be used as input/output. All pins of this port can be used
as general purpose input/output. This is same as port0, only difference is this port has
only 16pins where as port0 has 32 pins.
4.2.2.6 Switch
A switch is a mechanical device used to connect and disconnect an electric circuit at
will. Switches cover a wide range of types, from subminiature up to industrial plant switching
megawatts of power on high voltage distribution lines.
In applications where multiple switching options are required (e.g., a telephone
service), mechanical switches have long been replaced by electronic switching devices which
can be automated and intelligently controlled. Different types of switches are shown in figure
The switch is referred to as a "gate" when abstracted to mathematical form. In the
philosophy of logic, operational arguments are represented as logic gates. The use of
electronic gates to function as a system of logical gates is the fundamental basis for the
computer i.e. a computer is a system of electronic switches which function as logical gates. A
railroad switch is not electrical, but a mechanical device to divert a train from one track to
another.
12
13
15
4.2.3.5 Applications
A PIR Sensor is a Passive Infrared Sensor which controls the switching on/off of the
time.
During the day, the built in photocell sensor saves electricity by deactivating the
knob (LUX).
An adjustable time knob lets you select how long the light stays on after activation.
The PIR Sensor senses the motion of a human body by the change in surrounding
16
17
Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it
is even possible to produce a readout using the 5X7 dots plus cursor of the display. They
have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For
a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4).
When the LCD display is not enabled, data lines are tri-state and they do not interfere with
the operation of the microcontroller.
8, 16,
20, 24,
32 and
40
charact
ers are
all
standar
d,
18
one,
two
in
An LCD consists of two glass panels, with the liquid crystal material sand witched in
between them. The inner surface of the glass plates are coated with transparent
electrodes which define the character, symbols or patterns to be displayed polymeric
layers are present in between the electrodes and the liquid crystal, which makes the
liquid crystal molecules to maintain a defined orientation angle.
One each polarizers are pasted outside the two glass panels. This polarizers would
rotate the light rays passing through them to a definite angle, in a particular direction.
When the LCD is in the off state, light rays are rotated by the two polarizers and the
liquid crystal, such that the light rays come out of the LCD without any orientation, and
hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal molecules would
be aligned in a specific direction. The light rays passing through the LCD would be
rotated by the polarizers, which would result in activating/ highlighting the desired
characters.
The LCDs are lightweight with only a few millimeters thickness. Since the LCDs
consume less power, they are compatible with low power electronic circuits, and can be
powered for long durations.
The LCD does dont generate light and so light is needed to read the display. By using
backlighting, reading is possible in the dark. The LCDs have long life and a wide
operating temperature range.
Changing the display size or the layout size is relatively simple which makes the LCDs
more customers friendly.
The LCDs used exclusively in watches, calculators and measuring instruments are the
simple seven-segment displays, having a limited amount of numeric data. The recent
advances in technology have resulted in better legibility, more information displaying
capability and a wider temperature range. These have resulted in the LCDs being
extensively used in telecommunications and entertainment electronics. The LCDs have
even started replacing the cathode ray tubes (CRTs) used for the display of text and
graphics, and also in small TV applications.
19
This section describes the operation modes of LCDs then describe how to program and
interface an LCD to 8051 using Assembly and C.
Relieving the CPU of the task of refreshing the LCD. In the contrast,
The LED must be refreshed by the CPU to keep displaying the data.
The LCD discussed in this section has 14 pins. The function of each pins is given in
table 3.1
4.2.3.9 Uses
The LCDs used exclusively in watches, calculators and measuring instruments are the
simple seven-segment displays, having a limited amount of numeric data. The recent
advances in technology have resulted in better legibility, more information displaying
capability and a wider temperature range. These have resulted in the LCDs being extensively
used in telecommunications and entertainment electronics. For 161 LCD, the address
locations are shown in figure 3.6.The LCDs have even started replacing the cathode ray tubes
(CRTs) used for the display of text and graphics, and also in small TV applications.
20
Symbol
I/O
Description
Vss
--
Ground
Vcc
--
VEE
--
RS
R/W
I/O
Enable
DB0
I/O
DB1
I/O
DB2
I/O
10
DB3
I/O
11
DB4
I/O
12
DB5
I/O
13
DB6
I/O
14
DB7
I/O
4.2.3.10 Features
Interface with either 4-bit or 8-bit microprocessor.
Display data RAM
80X8 bits (80 characters).
Character generator ROM
160 different 5 X7 dot-matrix character patterns.
Character generator RAM
8 different users programmed 5 X7 dot-matrix patterns.
Display data RAM and character generator RAM may be accessed by the
microprocessor.
Numerous instructions
Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,Blink Character,
Cursor Shift, Display Shift.
improved contrast and viewing angle over the older twisted pneumatic types. Some
modules are available with back lighting, so that they can be viewed in dimly-lit conditions.
The back lighting may be either electro-luminescent, requiring a high voltage inverter
circuit, or simple LED illumination.
22
23
24
.
4.2.5
type substrates, while less common, occur as well. Many commercial LEDs, especially
GaN/InGaN, also use sapphire substrate.
4.2.5.2 Common Package Shapes
The encapsulation may also be clear or semi opaque to improve contrast and viewing angle.
Different sizes LEDs are shown in figure 3.10
26
Flashing LEDs
Flashing LEDs are used as attention seeking indicators where it is desired to
avoid the complexity of external electronics. Flashing LEDs resemble standard LEDs
but they contain an integrated multivibrator circuit inside which causes the LED to
flash with a typical period of one second. In diffused lens LEDs this is visible as a
small black dot. Most flashing LEDs emit light of a single color, but more sophisticated
devices can flash between multiple colors and even fade through a color sequence using
RGB color mixing.
(HPLED) can be driven at more than one ampere of current and give out large amounts of
light. Since overheating destroys any LED the HPLEDs must be highly efficient to minimize
excess heat, furthermore they are often mounted on a heat sink to allow for heat dissipation.
If the heat from a HPLED is not removed the device will burn out in seconds.
27
Multi-color LEDs
A bi-color LED is actually two different LEDs in one case. It consists of two dies
connected to the same two leads but in opposite directions. Current flow in one direction
produces one color, and current in the opposite direction produces the other color.
Alternating the two colors with sufficient frequency causes the appearance of a third
color. A tri-color LED is also two LEDs in one case, but the two LEDs are connected to
separate leads so that the two LEDs can be controlled independently and lit simultaneously.
RGB LEDs contain red, green and blue emitters, generally using a four-wire connection
with one common (anode or cathode). The Taiwanese LED manufacturer ever light has
introduced a 3 watt RGB package capable of driving each die at 1 watt
d)
Alphanumeric LEDs
LED displays are available in seven-segment and starburst format. Seven-segment
displays handle all numbers and a limited set of letters. Starburst displays can display all
letters.
Seven-segment LED displays were in widespread use in the 1970s and 1980s, but
increasing use of liquid crystal displays, with their lower power consumption and greater
display flexibility, has reduced the popularity of numeric and alphanumeric LED displays.
Applications
28
Items
2.
Rated voltage
AC 1Vrms (1 kHz)
3.
Rated power
AC 0.22Mw
4.
Operating temperature
0-600C
5.
Operating humidity
20-95%RH
29
6.
Standard characteristics
7.
Storage temperature
-30850C
8.
Storage humidity
within 95%RH
9.
Humidity accuracy
10.
<60sec (40-8-%RH)
11.
Hysteresis
30
4.2.5.6 BUZZER:
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles,
household appliances such as a microwave oven, or game shows.It most commonly consists
of a number of switches or sensors connected to a control unit that determines if and which
button was pushed or a preset time has lapsed, and usually illuminates a light on the
appropriate button or control panel, and sounds a warning in the form of a continuous or
intermittent buzzing or beeping sound. Initially this device was based on an
electromechanical system which was identical to an electric bell without the metal gong .
Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding
31
board. Another implementation with some AC-connected devices was to implement a circuit
to make the AC current into a noise loud enough to drive a loudspeaker and hook this circuit
up to a cheap 8-ohm speaker. Nowadays, it is more popular to use a ceramic-based
piezoelectric sounder like a Son alert which makes a high-pitched tone. Usually these were
hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and
off.
In game shows it is also known as a "lockout system," because when one person
signals ("buzzes in"), all others are locked out from signaling. Several game shows
have large buzzer buttons which are identified as "plungers".
The word "buzzer" comes from the rasping noise that buzzers made when they were
electromechanical devices, operated from stepped-down AC line voltage at 50 or 60
cycles. Other sounds commonly used to indicate that a button has been pressed are a
ring or a beep.
integrated into the modules main electronic circuit, connectors for their signals are located
inside the module.
However, what is not mentioned so far are a lot of buttons, switches and LEDs that can
be seen alongside input and output connectors. With buttons, switches and LEDs, this
prototype module becomes the simulator as well inside the module are simulators of all
input and output signals that make this prototype even more convenient for the further
development and testing. Although this is just a module prototype, it satisfies all requirements
for working in real conditions and can be implemented in any vehicle.
Considering different characteristics of individual microcontroller pins and the various
possible upgrades, important criterion was to place and connect components in a logical and
calculated order, with respect to all present and possible hardware or software upgrades so it
is important to be careful while designing and connecting all electronic circuits, inputs,
outputs and electronic components in general. Integration of certain electronic components
protects module against different sort of nuisances that exist or could appear in real
circumstances.
Electronic circuit was developed parallel with the program code to achieve even better
congruence between individual components and operations. Besides all the attention that was
given in the hardware development, a lot of attention was committed to the software
segments that improve quality work of module and protect system against contingent
situations. Aesthetic appearance of the assembly was also taken into consideration. Result is a
complete product that is ready for real use. Of course, the software can still significantly
improve in order to obtain a more intelligent and efficient module, but it is efficient
enough, functional, reliable and safe to use.
5.1.1 Types of Switches :
A pair of contacts is said to be 'closed' when there is no space between them, allowing
electricity to flow from one to the other. When the contacts are separated by an insulating air
gap, an air space, they are said to be 'open', and no electricity can flow at typical voltages.
Switches can be and are classified according to the arrangement of their contacts in
electronics field, but electricians in the electrical wiring service business and their electrical
33
The PIR Sensor senses the motion of a human body by the change in surrounding
34
microprocessor.
Numerous instructions
Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,Blink Character,
Cursor Shift, Display Shift.
35
5.2. 2 BUZZER: This section consists of a Buzzer. The buzzer is used to alert / indicate the
completion of process. It is sometimes used to indicate the start of the embedded syste by
alerting during start-up.
BUZZER MODULE
36
Schematic diagram
Flashing LEDs are used as attention seeking indicators where it is desired to
avoid the complexity of external electronics. Flashing LEDs resemble standard LEDs
but they contain an integrated multivibrator circuit inside which causes the LED to
flash with a typical period of one second. In diffused lens LEDs this is visible as a
small black dot. Most flashing LEDs emit light of a single color, but more sophisticated
devices can flash between multiple colors and even fade through a color sequence using
RGB color mixing.
37
Software description
Keil Software:
Installing the Keil software on a Windows PC
On most computers, the CD will auto run, and you will see the Keil installation
menu. If the menu does not appear, manually double click on the Setup icon, in the
root directory: you will then see the Keil menu.
On the Keil menu, please select Install Evaluation Software. (You will not require a
license number to install this software).
The example projects for this book are NOT loaded automatically when you
install the Keil compiler.
These files are stored on the CD in a directory /Pont. The files are arranged by chapter: for
example, the project discussed in Chapter 3 is in the directory /Pont/Ch03_00-Hello.
Rather than using the projects on the CD (where changes cannot be saved), please copy the
files from CD onto an appropriate directory on your hard disk.
38
Note: you will need to change the file properties after copying: file transferred from the CD
will be read only.
Configuring the Simulator
Open the Keil Vision
39
CHAPTER 6: RESULTS
Module has been tested under real operating conditions in few vehicles on outside
temperatures in range of 21C to 27C. Mid position sensors were set on few different levels.
Also, temperatures inside vehicles while fully opened/closed windows were measured for
better comparison. The samples were collected during longer period of time. Comparing
measured inside temperatures it is concluded that slightly opened windows (up to 5 cm) do
not get satisfying results. To achieve quality ventilation it was necessary to lower windows at
least 10 to 15 centimeters. Of course, more opened windows, and finally completely opened
windows gives the best results, but 15 to 25 centimeters is optimal regarding inside
temperature drop, energy consummation and safety concerns.
direct sunlight, outside temperature and windows position directly affect ventilation process;
weather conditions have significant influence on the ventilation process e.g., wind
noticeably accelerates and enhances ventilation. Further, size of the vehicle, even vehicle
body color and vehicle orientation relative to the sun makes noticeable difference. Figure 7.1
shows design and implementation of module.
41
CHAPTER 7 CONCLUSION
7.1.CONCLUSION AND FUTURE SCOPE:
Despite all the positive sides of this project, the question remains whether it can find
its application in the market. Since the module is impracticable as a physical unit (because of
peripheral unit), it is necessary to adapt it to any individual vehicle. Thus its individual
installation is not cost-effective. It could find its purpose and economic efficiency if it would
be serially mounted in same type of vehicle.
It can be summarized that this project, although only a prototype, is completely functional
device that performs its function safely, reliably and efficiently. Possibility of application is
not limited only to the vehicle ventilation. The module is extremely expandable in both ways:
it is upgradeable for new tasks as well as compatible for integration into some existing
systems. Nearly every component can be used for several other functions, which can be
achieved only by software upgrade. Upgrading hardware opens even greater possibility to
upgrade the software and there are countless capabilities
42
BIBLIOGRAPHY
REFERENCES
[1]
[2]
BaburaoKodavati,
V.K.RajuARM
BASED
VEHICLE
LOCATION
AND
[4]
[5]
[6]
[7]
Hans Burklin, The whole electronics Main catalog 92, datasheet, 1991
[8]
43