Beruflich Dokumente
Kultur Dokumente
INDEX
CHAPTER TITLE PAGE NO
DESCRIPTION
- ABSTRACT
- BLOCK DIAGRAM
CHAPTER 1 INTRODUCTION
2.0 INTRODUCTION
2.1 APPLICATION
6.0 CONCLUSION
6.1 FUTURE DIRECTIONS
BIBLIOGRAPHY
AIM:
The original intention of design of short-range wireless communication network is to provide short-
distance broadband wireless access to mobile environment or formulation of temporary network; it is the
further development of internet in mobile environment.
PURPOSE:
The purpose is to provide short-range wireless communication network for lower cost and more
flexible use, wireless receiver module of multi-point short-range wireless data collection and
transmission network, which provides a low-powered and high-performance wireless data
communication system.
METHODOLOGY:
BLOCK DIAGRAM:
TRANSMITTER SECTION:
LCD
POWER SUPPLY
TEMPARATURE
H HC-05
MICRO LDR
C CONTROLLER T
D
RESET C
GAS SENSOR
SMART
MOBILE
PHONE
POWER SUPPLY:
DESCRIPTION:
Data Acquisition system is an embedded system, which collects the data at predefined time
intervals from different sensors for different physical measurements like temperature, light, Smoke etc.,
This project presents a new development of wireless Communication for data transmission. These
systems not only provide the ability to easily design and develop, but also display the collected data in
transmitter and receiver.
This project consists of two sections. One is Transmitter section and the other is Receiver section.
In transmitter section, the sensors regarding the respective parameters are made to available such as
temperature sensor, Smoke Sensor, LDR etc. In the Receiver section, the parameters are displayed in
mobile phone.
SOFTWARES:
1. Embedded C
2. Keil IDE
3. Uc-Flash
HARDWARE COMPONENTS:
1. Microcontroller
2. Power supply
4. Temperature Sensor
5. LDR
6. GAS SENSOR
7. LCD
8. FIRE SENSOR
RESULT:
With this project we can implement data acquisition and transmission design.
CHAPTER 1
INTRODUCTION
This includes many data acquisition devices such as plug-in boards or serial
communication systems which use a computer as a real time data recording system. However,
most instrument manufacturers consider a data Acquisition a stand alone device that can read
various types of electrical signals and store the data in internal memory for later download to a
computer.
Data loggers vary between general purpose types for a range of measurement
applications to very specific devices for measuring in one environment only. It is common for
general purpose types to be programmable however many remains as static machines with only
a limited number of changeable parameters. Electronic data loggers have replaced chart records
in many applications.
COMPONENTS REQUIRED:
HARDWARE:
o Microcontroller (AT89S52)
o Gas Sensor
o Temperature Sensor
o Humidity Sensor
o Multi 10k Pot
o Reset switch
o LCD
CHAPTER 2
EMBEDDED SYSTEMS
EMBEDDED SYSTEMS
2.0 INTRODUCTION:
An embedded system is a system which is going to do a predefined specified task is the
embedded system and is even defined as combination of both software and hardware.
Embedded
System
Software
Hardware
ALP Processor
C Peripherals
VB memory
Etc.,
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory.
Micro Processor (µp): It is an electronic chip which performs arithmetic and logical
operations with assistance of internal memory.
ALU ALU
CU
MEMORY
Micro Controller (µc): It is a highly integrated micro processor designed for specific use
in embedded systems.
ALU
CU
MEMORY
EEPROM,
ADC,
DAC,
TIMERS,
USART,
OSCILLATORS
Etc.
BLOCK DIAGRAM OF MICRO CONTROLLER (µC)
2.1 APPLICATIONS OF EMBEDDED SYSTEM:
Embedded controllers may be found in many different kinds of system and are used for
many different applications. The list, which follows, is indicative rather than exhaustive.
An item in the list may be relevant to a particular company because either (a) it is or
involves a core process or product, (b) it is or involves an ancillary function or service
performed by the company or (c) it refers to a product or service provided by a contractor
under some form of agreement and the vulnerability of the supplier may need to be
considered.
Multi-loop control and monitoring - DCS, SCADA, telemetry Panel mounted devices -
Control, display, recording and operations.
Safety and security - Alarm and trip systems, fire and gas systems, buildings and facilities
security.
The Year 2000 problem in embedded systems differs from the problem in
commercial / database / transaction processing systems (often referred to as IT systems)
in a number of ways. Firstly the user's problem may much lie much deeper than packages
or applications software. It may lie in and be inseparable from systems and operating
software and from hardware, i.e. in the platform on which the application software is
based. When users of IT systems have hardware or operating software problems they can
and should be made the concern of the computer supplier: typically, this is not the case
with microprocessors and devices based on them.
Secondly in embedded systems the concern is often with intervals rather than with
specific dates: the need may be for an event to occur at 100-day intervals rather than on
the 5th day of each month. This has the implication that Year 2000 problems may reveal
themselves both before and for some time after 1 January 2000 and not at all on the date
itself.
POWER SUPPLY:
The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,
230V from the mains supply is step down by the transformer to 12V and is fed to a
rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to
get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any
a.c components present even after rectification. Now, this voltage is given to a voltage
regulator to obtain a pure constant dc voltage.
230V AC D.C
50Hz Output
The step down transformer is used to step down the main supply voltage from 230V AC
to lower value. This 230V AC voltage cannot be used directly, thus it is stepped down. The
transformer consists of primary and secondary coils. To reduce or step down the voltage the
transformer is designed to contain less number of turns in its secondary core. The output from
the secondary coil is also in AC form. Thus the conversion from AC to DC is essential. This
conversion is achieved by using the rectifier circuit.
FIG: TRANSFORMER
RECTIFIER:
The rectifier circuit is used to convert the AC voltage into its corresponding DC voltage. There
are half wave and full wave rectifiers available for this specific function. The most important
simple device used in rectifier circuit is the diode the simple function of the diode is to conduct
when forward biased and not to conduct in reverse bias. The efficient circuit used is the full wave
bridge rectifier circuit. The output voltage of the rectifier is in ripple form. The ripples from the
obtained DC voltages are removed by using the filter circuit.
INPUT FILTER:
Capacitors are used as filters. The ripples from the DC voltage are removed and pure DC
voltage is obtained. The primary action performed by capacitor is charging and discharging; it
charges in positive half cycle of the AC voltage and discharges during the negative half cycle. So
it allows only the AC voltage and does not allow DC voltage. This filter is fixed before the
regulator thus the output is free from ripples.
REGULATOR UNIT:
Regulator regulates the output voltage to be always constant. The output voltage is
maintained constant irrespective of the fluctuations in the input AC voltage. When the internal
resistance of the power supply is greater than 30ohms the output gets fluctuated. Thus this can be
successfully reduced here. The regulators are mainly classified for low voltage and for high
voltage.
Positive regulator – regulates the positive voltage.
Negative regulator – regulates the negative voltage.
The series 78XX regulators provide fixed regulated voltages from +5V to +24V. Figure shows
how one such IC, a 7805, is connected to provide voltage regulation with output from this unit
of +5V DC. An unregulated input voltage Vi is filtered by capacitor Ci and connected to the IC’s
IN terminal. The IC’s OUT terminal provides a regulated +5V, which is filtered by capacitor Co
(mostly for any high frequency noise). The third terminal of IC 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.
IC PART OUTPUT
MINIMUM Vi(V)
VOLTAGE(V)
7805 +5 7.3
7806 +6 8.3
7808 +8 10.5
7810 +10 12.5
7812 +12 14.6
7815 +15 17.7
7818 +18 21.0
7824 +24 27.1
OUTPUT FILTER:
The filter circuit is often fixed after the regulator circuit. Capacitor is most often used as
filter. The principle of the capacitor is to charge and discharge. It charges during the positive half
cycle of the AC voltage and discharges during the negative half cycle. So it allows only the AC
voltage and does not allow the DC voltage. This filter is fixed after the regulator circuit to filter
any of the possibly found ripples in the output received finally. The output at this stage is 5V and
is given to the micro controller PIC16F877.
3.1 INTRODUCTION TO MICROCONTROLLER:
Microcontroller is a true computer on a chip the design incorporates all
of the features found in a microprocessor CPU: arithmetic and logic unit, stack
pointer, program counter and registers. It has also had added additional features
like RAM, ROM, serial I/O, counters and clock circuit.
The microcontroller is concerned with getting the data from and on to its
own pins; the architecture and instruction set are optimized to handle data in bit
and byte size.
FEATURES:
DESCRIPTION:
The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port,
and interrupt system to continue functioning. The Power-down mode saves the RAM
contents but freezes the oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
PIN CONFIGURATION:
PIN DESCRIPTION:
VCC:
Supply
voltage.
GND:
Ground.
PORT 0:
Port 0 is an 8-bit
open drain
bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are
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 pullups. Port 0 also receives the
code bytes during Flash programming and outputs the code bytes during program
verification. External pullups are required during program verification.
PORT 1:
Port 1 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups and can be used as inputs. As inputs, Port 1 pins that are externally
being pulled low will source current (IIL) because of the internal pullups. In addition,
P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2)
and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the
following table. Port 1 also receives the low-order address bytes during Flash
programming and verification.
PORT 2:
Port 2 is an 8-bit bidirectional I/O port with internal pullups. 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 pullups and can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current (IIL) because of the internal pullups. 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. During accesses to
external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents
of the P2 Special Function Register. Port 2 also receives the high-order address bits and
some control signals during Flash programming and verification.
PORT 3:
Port 3 is an 8-bit bidirectional I/O port with internal pullups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high
by the internal pullups and can be used as inputs. As inputs, Port 3 pins that are externally
being pulled low will source current (IIL) because of the pullups. 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 and verification.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives High for 96 oscillator periods after the Watchdog times
out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In
the default state of bit DISRTO, the RESET HIGH out feature is enabled.
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 of 1/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 8EH. With the bit
set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in
external execution mode.
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.
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.
EA should be strapped to VCC for internal program executions. This pin also receives the
12-volt programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2:
Output from the inverting oscillator amplifier. 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. 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 the below figure. There are no requirements on the
duty cycle of the external clock signal, since the input to the internal clocking circuitry is
through a divide-by-two flip-flop, but minimum and maximum voltage high and low time
specifications must be observed.
FIG: OSCILLATOR CONNECTIONS
The microcontroller memory is divided into Program Memory and Data Memory.
Program Memory (ROM) is used for permanent saving program being executed, while
Data Memory (RAM) is used for temporarily storing and keeping intermediate results
and variables. Depending on the model in use (still referring to the whole 8052
microcontroller family) at most a few Kb of ROM and 128 or 256 bytes of RAM can be
used. However…
All 8052 microcontrollers have 16-bit addressing bus and can address 64 kb memory. It is
neither a mistake nor a big ambition of engineers who were working on basic core
development. It is a matter of very clever memory organization which makes these
controllers a real “programmers’ tidbit“.
PROGRAM MEMORY :
The oldest models of the 8052 microcontroller family did not have any internal program
memory. It was added from outside as a separate chip. These models are recognizable by
their label beginning with 803 (for ex. 8031 or 8032). All later models have a few Kbytes
ROM embedded, Even though it is enough for writing most of the programs, there are
situations when additional memory is necessary. A typical example of it is the use of so
called lookup tables. They are used in cases when something is too complicated or when
there is no time for solving equations describing some process. The example of it can be
totally exotic (an estimate of self-guided rockets’ meeting point) or totally common
(measuring of temperature using non-linear thermo element or asynchronous motor speed
control). In those cases all needed estimates and approximates are executed in advance
and the final results are put in the tables (similar to logarithmic tables).
How does the microcontroller handle external memory depend on the pin EA logic
state?
EA=0 In this case, internal program memory is completely ignored, only a program
stored in external memory is to be executed.
EA=1 In this case, a program from built-in ROM is to be executed first (to the last
location). Afterwards, the execution is continued by reading additional memory.
in both cases, P0 and P2 are not available to the user because they are used for data and
address transmission. Besides, the pins ALE and PSEN are used too.
DATA MEMORY :
As already mentioned, Data Memory is used for temporarily storing and keeping data and
intermediate results created and used during microcontroller’s operating. Besides, this
microcontroller family includes many other registers such as: hardware counters and
timers, input/output ports, serial data buffers etc. The previous versions have the total
memory size of 256 locations, while for later models this number is incremented by
additional 128 available registers. In both cases, these first 256 memory locations
(addresses 0-FFh) are the base of the memory common to all types of the 8052
microcontrollers. Locations available to the user occupy memory space with addresses
from 0 to 7Fh. First 128 registers and this part of RAM is divided in several blocks.
The first block consists of 4 banks each including 8 registers designated as R0 to R7.
Prior to access them, a bank containing that register must be selected. Next memory
block (in the range of 20h to 2Fh) is bit- addressable, which means that each bit being
there has its own address from 0 to 7Fh. Since there are 16 such registers, this block
contains in total of 128 bits with separate addresses (The 0th bit of the 20h byte has the
bit address 0 and the 7th bit of the 2Fh byte has the bit address 7Fh). The third groups of
registers occupy addresses 2Fh-7Fh (in total of 80 locations) and does not have any
special purpose or feature.
In order to satisfy the programmers’ permanent hunger for Data Memory, producers have
embedded an additional memory block of 128 locations into the latest versions of the
8052 microcontrollers. Naturally, it’s not so simple…The problem is that electronics
peIRorming addressing has 1 byte (8 bits) on disposal and due to that it can reach only
the first 256 locations. In order to keep already existing 8-bit architecture and
compatibility with other existing models a little trick has been used.
Using trick in this case means that additional memory block shares the same addresses
with existing locations intended for the SFRs (80h- FFh). In order to differentiate
between these two physically separated memory spaces, different ways of addressing are
used. A direct addressing is used for all locations in the SFRs, while the locations from
additional RAM are accessible using indirect addressing.
FIG: MICROCONTROLLER INTERNAL STRUCTURE
How to extend memory?
In case on-chip memory is not enough, it is possible to add two external memory chips
with capacity of 64Kb each. I/O ports P2 and P3 are used for their addressing and data
transmission.
From the users’ perspective, everything functions quite simple if properly connected
because the most operations are peIRormed by the microcontroller itself. The 8052
microcontroller has two separate reading signals RD#(P3.7) and PSEN#. The first one is
activated byte from external data memory (RAM) should be read, while another one is
activated to read byte from external program memory (ROM). These both signals are
active at logical zero (0) level. A typical example of such memory extension using special
chips for RAM and ROM is shown on the previous picture. It is called Harward
architecture.
Even though the additional memory is rarely used with the latest versions of the
microcontrollers, it will be described here in short what happens when memory chips are
connected according to the previous scheme. It is important to know that the whole
process is performed automatically, i.e. with no intervention in the program.
When the program during execution encounters the instruction which resides
in external memory (ROM), the microcontroller will activate its control output ALE and
set the first 8 bits of address (A0-A7) on P0. In this way, IC circuit 74HCT573 which
"lets in" the first 8 bits to memory address pins is activated.
A signal on the pin ALE closes the IC circuit 74HCT573 and immediately
afterwards 8 higher bits of address (A8-A15) appear on the port. In this way, a desired
location in additional program memory is completely addressed. The only thing left over
is to read its content.
Pins on P0 are configured as inputs, the pin PSEN is activated and the
microcontroller reads content from memory chip. The same connections are used both for
data and lower address byte.
Similar occurs when it is a needed to read some location from external Data Memory.
Now, addressing is performed in the same way, while reading or writing is performed via
signals which appear on the control outputs RD or WR.
ADDRESSING :
While operating, processor processes data according to the program instructions. Each
instruction consists of two parts. One part describes what should be done and another part
indicates what to use to do it. This later part can be data (binary number) or address
where the data is stored. All 8052 microcontrollers use two ways of addressing depending
on which part of memory should be accessed:
DIRECT ADDRESSING :
On direct addressing, a value is obtained from a memory location while the address of
that location is specified in instruction. Only after that, the instruction can process data
(how depends on the type of instruction: addition, subtraction, copy…). Obviously, a
number being changed during operating a variable can reside at that specified address.
For example:
Since the address is only one byte in size ( the greatest number is 255), this is how only
the first 255 locations in RAM can be accessed in this case the first half of the basic
RAM is intended to be used freely, while another half is reserved for the SFRs.
INDIRECT ADDRESSING:
SFRs are a kind of control table used for running and monitoring microcontroller’s
operating. Each of these registers, even each bit they include, has its name, address in the
scope of RAM and clearly defined purpose ( for example: timer control, interrupt, serial
connection etc.). Even though there are 128 free memory locations intended for their
storage, the basic core, shared by all types of 8052 controllers, has only 21 such registers.
Rest of locations are intensionally left free in order to enable the producers to further
improved models keeping at the same time compatibility with the previous versions. It
also enables the use of programs written a long time ago for the microcontrollers which
are out of production now.
A REGISTER (ACCUMULATOR)
This is a general-purpose register which serves for storing intermediate results during
operating. A number (an operand) should be added to the accumulator prior to execute an
instruction upon it. Once an arithmetical operation is preformed by the ALU, the result is
placed into the accumulator. If a data should be transferred from one register to another, it
must go through accumulator. For such universal purpose, this is the most commonly
used register that none microcontroller can be imagined without (more than a half 8052
microcontroller's instructions used use the accumulator in some way).
B REGISTER :
During programming, each of registers is called by name so that their exact address
is not so important for the user. During compiling into machine code (series of
hexadecimal numbers recognized as instructions by the microcontroller), PC will
automatically, instead of registers’ name, write necessary addresses into the
microcontroller.
R REGISTERS (R0-R7) :
This is a common name for the total 8 general purpose registers (R0, R1, R2 ...R7). Even
they are not true SFRs, they deserve to be discussed here because of their purpose. The
bank is active when the R registers it includes are in use. Similar to the accumulator, they
are used for temporary storing variables and intermediate results. Which of the banks will
be active depends on two bits included in the PSW Register. These registers are stored in
four banks in the scope of RAM.
DESCRIPTION:
The CPU takes a certain number of clock cycles to execute an instruction. In the 8052
family, these clock cycles are referred to as machine cycles. The length of the machine
cycle depends on the frequency of the crystal oscillator. The crystal oscillator, along with
on-chip circuitry, provides the clock source for the 8052 CPU.
The frequency can vary from 4 MHz to 30 MHz, depending upon the chip rating and
manufacturer. But the exact frequency of 11.0592 MHz crystal oscillator is used to make
the 8052 based system compatible with the serial port of the IBM PC.
In the original version of 8052, one machine cycle lasts 12 oscillator periods. Therefore,
to calculate the machine cycle for the 8052, the calculation is made as 1/12 of the crystal
frequency and its inverse is taken.
It is important to know that each diode will be immediately destroyed unless its current is
limited. This means that a conductor must be connected in parallel to a diode. In order to
correctly determine value of this conductor, it is necessary to know diode’s voltage drop
in forward direction, which depends on what material a diode is made of and what color
it is. Values typical for the most frequently used diodes are shown in table below: As
seen, there are three main types of LEDs. Standard ones get full brightness at current of
20mA. Low Current diodes get full brightness at ten times lower current while Super
Bright diodes produce more intensive light than Standard ones.
Since the 8052 microcontrollers can provide only low input current and since their pins
are configured as outputs when voltage level on them is equal to 0, direct connecting to
LEDs is carried out as it is shown on figure (Low current LED, cathode is connected to
output pin).
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line
LCDs which have only 1 controller and support at most of 80 characters, whereas LCDs
supporting more than 80 characters make use of 2 HD44780 controllers.
FIG: PIN DESCRIPTION OF LCD
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two pins are extra in both for back-light LED connections). Pin description is shown in
the table below
In recent years the LCD is finding widespread use replacing LED s (seven-segment
LED s or other multi-segment LED s).This is due to the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in contrast to
LED which is limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by relieving the
CPU of the task of refreshing the LCD. In the case of LED s, they must be
refreshed by the CPU to keep on displaying the data.
4. Ease of programming for characters and graphics.
All data transferred to LCD through outputs D0-D7 will be interpreted as commands or
as data, which depends on logic state on pin RS:
RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in
processor addresses built in “map of characters” and displays corresponding symbols.
Displaying position is determined by DDRAM address. This address is either previously
defined or the address of previously transferred character is automatically incremented.
RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands
which LCD recognizes are given in the table below:
3.3.2 LCD CONNECTION :
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.
3.3.5 POTENTIOMETER:
3.3.6 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.
MULTITURN PRESETS:
These are used where very precise adjustments must be made. The screw must be turned
many times (10+) to move the slider from one end of the track to the other, giving very
fine control.
PRESET SYMBOL
3.3.7 LCD INTERFACING WITH THE MICROCONTROLLER:
SERIAL CORDS:
The serial cables are required to interface the PC to the transmitter circuit. It is a 9-pin
serial extension cord. They are connected to the pc comport via male-female connector.
The cords serially transmit the data. The schematic of connector is shown in the figure
[1].
The pin diagram is shown in the following figure [2]. It is 16 pin IC package. It can also
formed by using pair of transistors. But we have used specialized interface IC like the
MAX232.
FIG.2 PIN DIAGRAM
It receives the data from comport and transfer it serially to the RF modulator. The
schematic of interfacing of pc with max 232 driver circuit is shown in fig.[2.3]. This
circuit features the best noise rejection and is very reliable and protected against
discharges and short-circuits. RS-232 is simple, universal and well understood. RS232
data is bi-polar.... +3 TO +12 volts indicates an "ON or 0-state (SPACE) condition" while
A -3 to -12 volts indicates an "OFF" 1-state (MARK) condition. Modern computer
equipment ignores the negative level and accepts a zero voltage level as the "OFF" state.
In fact, the "ON" state may be achieved with lesser positive potential. This means circuits
powered by 5 VDC are capable of driving RS232 circuits directly.
FIG.3 INTERFACING OF PC WITH MAX 232 DRIVER CIRCUIT
This project uses IC LM35 as a sensor for detecting accurate centigrade temperature. Linearity
defines how well over a range of temperature a sensor’s output consistently changes. Unlike thermistor,
Linearity of a precision IC Sensors are very good of 0.5°C accuracy and has wide temperature range. its
output voltage is linearly proportional to the Celsius (Centigrade) temperature.
The LM35 is rated to operate over a -55° to +150°C temperature range.It draws only 60 µA from its
supply, it has very low self-heating, less than 0.1°C in still air. LM35 Operates from 4 to 30 volts.
Output of IC is 10mv/degree centigrade for eg if the output of sensor is 280 mV then temperature is 28
degree C. so by using a Digital multimeter we can easily calculate the degree temperature. For trigger
point you should set the voltage of pin 2 of IC 741 by using preset or potentiometer.
Our aim of this project is not to construct a thermometer but to activate or deactivate a device at a
particular margin temperature. For simplicity we have used 2 LED for indication of both low (Green) and
high (Red) temperature.
Circuit Diagram of temperature sensor
Working: The output of IC2 increases in proportion to the temperature by 10 mV per degree. This
varying voltage is feed to a comparator IC 741 (OP Amplifier). OP Amplifier are among the most widely
used electronic devices today.The op-amp is one type of differential amplifier. It has two input inverting
(-) and non-inverting (+) and one output pin. We have used IC741 as non-inverting amplifier which
means pin 3 is the input and the output is not reversed. This circuit amplifies the difference between its
input terminals.
Part list:
IC LM35, IC LM741
Resistance: 10K Ohms, 470 Ohms X 2Pcs
Preset or P.O.T of 2K Ohms
LED 2pcs (Red and Green)
9V Battery with Snap
Switch, wire
*By making this Temperature Sensor Project, student will be capable of making many similar project i.e
Automatic room heater controller, determine hotness of Tea or Coffee to avoid burning your
tongue,Automatic Fan Controller etc.
3.8 LDR
A Light Dependent Resistor (aka LDR, photoconductor, or photocell) is a device which has a
resistance which varies according to the amount of light falling on its surface.
Crystal Oscillator:
It provide clock pulses of 11.0592 Mhz frequency. It can be used as UART clock
(6×1.8432 MHz). It allows integer division to common baud rates (96×115200 baud or
96×96×1,200 baud). It is a common clock for Intel 8051 microprocessors It uses the
mechanical resonance of a vibrating crystal of piezoelectric material to create an
electrical signal with a very precise frequency. This frequency is commonly used to keep
track of time, to provide a stable clock signal for digital integrated circuits, and to
stabilize frequencies for radio transmitters and receivers. The most common type of
piezoelectric resonator used is the quartz crystal, so oscillator circuits incorporating them
became known as crystal oscillators. The crystal oscillator circuit sustains oscillation by
taking a voltage signal from the quartz resonator, amplifying it, and feeding it back to the
resonator. The rate of expansion and contraction of the quartz is the resonant frequency,
and is determined by the cut and size of the crystal. When the energy of the generated
output frequencies matches the losses in the circuit, an oscillation can be sustained. One
of the most important traits of the crystal oscillator is that it exhibits very low phase
noise. In the crystal oscillator, the crystal mostly vibrates in one axis, therefore only one
phase is dominant. This property of low phase noise makes them particularly useful in
telecommunications where stable signals are needed, and in scientific equipment where
very precise time references are needed. The result is that a quartz crystal behaves like a
circuit composed of an inductor, capacitor and resistor, with a precise resonant frequency
FEATURES:
- The crystal oscillator circuit sustains oscillation by taking a voltage signal from the
quartz resonator, amplifying it, and feeding it
back to the resonator
- It provides clock pulses of 11.0592 MHz frequency.
- The popularity of the crystals is due to low cost.
FIRE SENSOR
There are several types of flame detector. The optical flame detector is a detector that uses optical
sensors to detect flames. There are also ionization flame detectors, which use current flow in the flame
to detect flame presence, and thermocouple flame detectors.
Infrared Flame Detector
Infrared (IR) flame detectors work within the infrared spectral band. Hot gases emit a specific spectral
pattern in the infrared region, which can be sensed with a thermal imaging camera (TIC) a type
of thermo graphic. False alarms can be caused by other hot surfaces and background thermal radiation in
the area as well as blinding from water and solar energy. A typical frequency where single frequency IR
flame detector is sensitive is in the 4.4 micrometer range. Typical response time is 3-5 seconds.
GAS DETECTOR:
A Gas detector also called a smoke alarm is a device that detects smoke, typically as an indicator of fire.
Commercial, industrial, and mass residential devices issue a signal to a fire alarm system, while
household detectors, known as smoke alarms, generally issue a local audible or visual alarm from the
detector itself.
INCLUDEPICTURE "http://i00.i.aliimg.com/wsphoto/v1/595802680_1/MQ-2-Gas-Sensor-LPG-i-
butane-propane-methane-alcohol-13073.jpg_350x350.jpg" \* MERGEFORMATINET
INCLUDEPICTURE "http://i00.i.aliimg.com/wsphoto/v1/595802680_1/MQ-2-Gas-Sensor-LPG-i-
butane-propane-methane-alcohol-13073.jpg_350x350.jpg" \* MERGEFORMATINET
INCLUDEPICTURE
"http://www.elecfreaks.com/wiki/images/thumb/d/d2/MQ-0205-04.jpg/500px-MQ-0205-04.jpg" \*
MERGEFORMATINET INCLUDEPICTURE
"http://www.elecfreaks.com/wiki/images/thumb/d/d2/MQ-0205-04.jpg/500px-MQ-0205-04.jpg" \*
MERGEFORMATINET
Gas detectors are typically housed in a disk-shaped plastic enclosure about 150 millimeters (6 in) in
diameter and 25 millimeters (1 in) thick, but the shape can vary by manufacturer or product line. Most
smoke detectors work either by optical detection (photoelectric) or by physical process (ionization),
while others use both detection methods to increase sensitivity to smoke. Sensitive alarms can be used to
detect, and thus deter, smoking in areas where it is banned such as toilets and schools. Smoke detectors
in large commercial, industrial, and residential buildings are usually powered by a central fire alarm
system, which is powered by the building power with a battery backup. However, in many single family
detached and smaller multiple family housings, a smoke alarm is often powered only by a single
disposable battery.
In the United States, the National Fire Protection Association estimates that nearly two-thirds of deaths
from home fires occur in properties without working smoke alarms/detectors.
CHAPTER-4
SOFTWARE TOOLS
4.0 KEIL SOFTWARE:
Keil compiler is a software used where the machine language code is written and
compiled. After compilation, the machine source code is converted into hex code which
is to be dumped into the microcontroller for further processing. Keil compiler also
supports C language code.
2. After installation, an icon will be created with the name “Keil uVision3”. Just drag this
icon onto the desktop so that it becomes easy whenever you try to write programs in keil.
4. A page opens with different options in it showing the project workspace at the leftmost
corner side, output window in the bottom and an ash coloured space for the program to be
written.
6. A small window opens showing the options like new project, import project, open
project etc. Click on “New project”.
7. A small window with the title bar “Create new project” opens. The window asks the
user to give the project name with which it should be created and the destination location.
The project can be created in any of the drives available. You can create a new folder and
then a new file or can create directly a new file.
8. After the file is saved in the given destination location, a window opens where a list of
vendors will be displayed and you have to select the device for the target you have
created.
9. The most widely used vendor is Atmel. So click on Atmel and now the family of
microcontrollers manufactured by Atmel opens. You can select any one of the
microcontrollers according to the requirement.
10. When you click on any one of the microcontrollers, the features of that particular
microcontroller will be displayed on the right side of the page. The most appropriate
microcontroller with which most of the projects can be implemented is the AT89S52.
Click on this microcontroller and have a look at its features. Now click on “OK” to select
this microcontroller.
11. A small window opens asking whether to copy the startup code into the file you have
created just now. Just click on “No” to proceed further.
12. Now you can see the TARGET and SOURCE GROUP created in the project
workspace.
13. Now click on “File” and in that “New”. A new page opens and you can start writing
program in it.
14. After the program is completed, save it with any name but with the .asm extension.
Save the program in the file you have created earlier.
15. You can notice that after you save the program, the predefined keywords will be
highlighted in bold letters.
16. Now add this file to the target by giving a right click on the source group. A list of
options open and in that select “Add files to the source group”. Check for this file where
you have saved and add it.
17. Right click on the target and select the first option “Options for target”. A window
opens with different options like device, target, output etc. First click on “target”.
18. Since the set frequency of the microcontroller is 11.0592 MHz to interface with the
PC, just enter this frequency value in the Xtal (MHz) text area and put a tick on the Use
on-chip ROM. This is because the program what we write here in the keil will later be
dumped into the microcontroller and will be stored in the inbuilt ROM in the
microcontroller.
19. Now click the option “Output” and give any name to the hex file to be created in the
“Name of executable” text area and put a tick to the “Create HEX file” option present in
the same window. The hex file can be created in any of the drives. You can change the
folder by clicking on “Select folder for Objects”.
20. Now to check whether the program you have written is errorless or not, click on the
icon exactly below the “Open file” icon which is nothing but Build Target icon. You can
even use the shortcut key F7 to compile the program written.
21. To check for the output, there are several windows like serial window, memory
window, project window etc. Depending on the program you have written, select the
appropriate window to see the output by entering into debug mode.
22. The icon with the letter “d” indicates the debug mode.
23. Click on this icon and now click on the option “View” and select the appropriate
window to check for the output.
24. After this is done, click the icon “debug” again to come out of the debug mode.
25. The hex file created as shown earlier will be dumped into the microcontroller with the
help of another software called Proload.
4.2 PROLOAD:
Proload is a software which accepts only hex files. Once the machine code is
converted into hex code, that hex code has to be dumped into the microcontroller placed
in the programmer kit and this is done by the Proload. Programmer kit contains a
microcontroller on it other than the one which is to be programmed. This microcontroller
has a program in it written in such a way that it accepts the hex file from the keil
compiler and dumps this hex file into the microcontroller which is to be programmed. As
this programmer kit requires power supply to be operated, this power supply is given
from the power supply circuit designed above. It should be noted that this programmer kit
contains a power supply section in the board itself but in order to switch on that power
supply, a source is required. Thus this is accomplished from the power supply board with
an output of 12volts or from an adapter connected to 230 V AC.
2. Now connect the Programmer kit to the PC (CPU) through serial cable.
4. Now place the microcontroller in the GIF socket provided in the programmer kit.
5. Click on the Proload icon in the PC. A window appears providing the information like
Hardware model, com port, device type, Flash size etc. Click on browse option to select
the hex file to be dumped into the microcontroller and then click on “Auto program” to
program the microcontroller with that particular hex file.
6. The status of the microcontroller can be seen in the small status window in the bottom
of the page.After this process is completed, remove the microcontroller from the
programmer kit and place it in your system board. Now the system board behaves
according to the program written in the microcontroller.
Note: you will need to change the file properties after copying: file transferred from the CD will be ‘read
only’.
Building the Target. Build the target as illustrated in the figure below
Running the Simulation. Having successfully built the target, we are now ready to start the debug
session and run the simulator. First start a debug session
The flashing LED we will view will be connected to Port 1. We therefore want to observe the
Go to Debug - Go
While the simulation is running, view the performance analyzer to check the delay durations.
The major difference between a data acquisition and a recorder, however, is the
way the data itself is stored, analyzed and recorded. A common recorder accepts an input,
and compares it to a full scale value. The pen arm is then deflected across the recording
width, to produce the appropriate ratio of the actual input to the full scale input.
For example, using a recorder with a 1 Volt full scale, an input of 0.5 Volts would
move the pen 0.5/1 or 50% of the distance across the recording width. In comparison, a
data logger accepts an input which is fed into an analog-to-digital converter prior to
analysis and storage. This method has advantages in accuracy and resolution, while only
a recorder can provide a truly continuous trend recording.
Data loggers are implicitly stand-alone devices, while typical data acquisition system
must remain tethered to a computer to acquire data. This stand-alone aspect of data loggers
implies on-board memory that is used to store acquired data. Sometimes this memory is very
large to accommodate many days, or even months, of unattended recording. This memory may
be battery-backed static random access memory, flash memory or EEPROM. Earlier data
loggers used magnetic tape punched paper tape, or directly viewable records such as “strip chart
recorders”.
Given the extended recording times of data loggers, they typically feature a time-and
date-stamping mechanism to ensure that each recorded data value is associated with a date and
time of acquisition. As such, data loggers typically employ built-in real-time clocks whose
published drift can be an important consideration when choosing between data loggers.
The unattended and remote nature of many data logger applications implies the need in
some applications to operate from a DC power source, such as battery. Solar power may be used
to supplement these power sources. These constraints have generally led the data logger industry
to ensure that the devices they market are extremely power efficient relative to computers. In
many cases they are required to operate in harsh environmental conditions where computers will
not function reliably.
This unattended nature also dictates that the data loggers must be extremely reliable.
Since they may operate for long periods nonstop with little or no human supervision, and may
be installed in harsh or remote locations, it is imperative that so long as they have power, they
will not fail to log data for any reason. Manufacturers go to great length to ensure that the
devices can be depended on in these applications. As such data loggers are almost completely
immune to the problems that might affect a general-purpose computer in the same application,
such as program crashes and the instability of some operating systems.
Unattended hydrographic recording (such as water level, water depth, water flow, water
PH, water conductivity).
Environmental monitoring.
Vehicle testing
DISADVANTAGES
Continuous Monitoring has to be done
Cost of equipment is high.
CHAPTER 6.
CONCLUSION &
FUTURE DIRECTIONS
6.0 CONCLUSION:
Data Acquisition is not limited for any particular application, it can be used any
where in a process industries with little modifications in software coding according to the
requirements. This concept not only ensures that our work will be usable in the future but
also provides the flexibility to adapt and extend, as needs change.
Basically, Data Acquisition is a stand alone device but we can even connect it to a
PC by using RS232.We can also use Agilent VEE Pro software which is a graphical
programming environment optimized for use with electronic instruments for providing
the lab view of the parameters measured using Data Acquisition