Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
In this paper, we propose the parameters like the temperature of the steam, the
level of water, control of feed water pump, Pressure of the steam has to be
measured and critically monitored for reliable and safe operation of the generation
unit. This kind of operation with critical importance can be carried out efficiently
and implemented employing Programmable Logic Controller (PLC).Experimental
results are presented.
1
LIST OF TABLES
2
LIST OF FIGURES
4.1 Microcontroller 14
4.4 ADC 26
3
Microcontroller) Block
Diagram
4.7 Buzzer 31
LIST OF SYMBOLS
4
1. INTRODUCTION
Programmable Logic Controls can provide the right solution at the right time.
Using the PLC can extend your performance gains across the business with, the
only integrated control and information platform that runs discrete, motion, drives,
process and safety control, assuring the different automation technologies work
together. While using PLC the entire manufacturing cycle will be simple and
power full technology.
In this system we have to measure load with the help of CT (in case of AC/DC
Motor) or PT (in case of Steam Turbine/ Hydraulic drive) & water is measure by
The Water Flow Meter & all above input are feed to PLC. Controller is calculating
with input & set point. On the controller’s output Control valve will be operating &
you will find the actual result as per you get.
In this project the water level of the boiler tank is monitored with the aid of an
analog interface with the Programmable logic controller (PLC).The level is then
controlled by controlling the feed water input which is affected on a DC motor.
The temperature in the same way is measured using a temperature sensor and the
measured analog value is interfaced with the PLC. The response given by the PLC
to control the temperature is carried out by controlling the induction heater. The
control action required to stabilize the temperature and the level within the safe
limits can be effectively optimized by using Programmable Logic Controller
(PLC).Thus the boiler management system is designed in this project using PLC.
5
1.1 BLOCK DIAGRAM:
Pressure
Sensor
Temperature Buzzer
Sensor
Power Programmable
Supply Logic Controller
DC Motor
Liquid Level
Sensor
Power
Supply
6
2. VOLATILE ORGANIC COMPOUNDS
2.1 DEFINITION
Some VOCs, such as styrene and limonene, can react with nitrogen oxides or with
ozone to produce new oxidation products and secondary aerosols, which can cause
7
sensory irritation symptoms. Unspecified VOCs are important in the creation of
smog.
8
3 PIR SENSOR
3.2 Features
Alarm Systems
Halloween Props
Robotics
Pyroelectric devices, such as the PIR sensor, have elements made of a crystalline
material that generates an electric charge when exposed to infrared radiation. The
changes in the amount of infrared striking the element change the voltages
generated, which are measured by an on-board amplifier. The device contains a
special filter called a Fresnel lens, which focuses the infrared signals onto the
element. As the ambient infrared signals change rapidly, the on-board amplifier
trips the output to indicate motion.
9
3.5 Pin Definitions and Ratings
Connect the 3-pin header to your circuit so that the minus (-) pin connects to
ground or Vss, the plus (+) pin connects to +5 volts or Vdd and the OUT pin
connects to your microcontroller’s I/O pin. One easy way to do this would be to
use a standard servo/LCD extension cable, available separately from Parallax
(#805-00002). This cable makes it easy to plug sensor into the servo headers on
our Board Of Education or Professional Development Board. If you use the Board
Of Education, be sure the servo voltage jumper (located between the 2 servo
header blocks) is in the Vdd position, not Vin. If you do not have this jumper on
your board you should manually connect to Vdd through the breadboard.
You may also plug the sensor directly into the edge of the breadboard and connect
the signals from there. Remember the position of the pins when you plug the
sensor into the breadboard.
Once the sensor warms up (settles) the output will remain low until there is motion,
at which time the output will swing high for a couple of seconds, then return low.
If motion continues the output will cycle in this manner until the sensors line of
sight of still again.
10
3.7 Calibration
The PIR Sensor requires a ‘warm-up’ time in order to function properly. This is
due to the settling time involved in ‘learning’ its environment. This could be
anywhere from 10-60 seconds. During this time there should be as little motion as
possible in the sensors field of view.
3.8 Sensitivity
The PIR Sensor has a range of approximately 20 feet. This can vary with
environmental conditions. The sensor is designed to adjust to slowly changing
conditions that would happen normally as the day progresses and the
environmental conditions change, but responds by toggling its output when sudden
changes occur, such as when there is motion
PIR SENSOR
11
FEATURES:-
S.NO. PARAMETER VALUE
1 Power source 220-240V/AC,100-
130V/AC
2 Rated load 100W(max.)
3 Detection distance 8m(max.<24)
4 Detection range 100°/360°
5 Ambient light <2Lux-daylight
6 Duration time 5-480S
7 Power frequency 50-60Hz
8 Switch function auto / off / on
12
4 HARDWARE REQUIREMENTS
• Microcontroller
• PIR
• ADC
• Buzzer
• PC
13
4.1 MICROCONTROLLER:-
14
AT89s52 Microcontroller:
Features:
15
Description:
16
Figure 4.2 Pin Diagram for 40-lead PDIP Microcontroller.
17
Figure 4.3 Architecture of Microcontroller.
18
Pin Description
GND Ground.
Port 0
Port 1
19
Table 4.1 Alternate Functions of Port 1 of Microcontroller.
Port 2
Port 3
21
RST
ALE/PROG
PSEN
22
PSEN activations are skipped during each access to
external data memory.
EA/VPP
XTAL1
XTAL2
Memory Organization
Program Memory
23
If the EA pin is connected to GND, all program
fetches are directed to external memory. On the
AT89S52, if EA is connected to VCC, program fetches to
addresses 0000H through 1FFFH are directed to internal
memory and fetches to addresses 2000H through FFFFH
are to external memory.
Data Memory
24
Watchdog Timer Reset (WDTRST) SFR. The WDT is
defaulted to disable from exiting reset. To enable the
WDT, a user must write 01EH and 0E1H in sequence to
the WDTRST register (SFR location 0A6H). When the WDT
is enabled, it will increment every machine cycle while
the oscillator is running. The WDT timeout period is
dependent on the external clock frequency. There is no
way to disable the WDT except through reset (either
hardware reset or WDT overflow reset). When WDT over-
flows, it will drive an output RESET HIGH pulse at the RST
pin.
25
WDT during Power-down and Idle
26
27
4.2 ADC
28
ADC 0808/0809:
General Description
Features
29
Operates ratio metrically or with 5 VDC or analog
span
Adjusted voltage reference
No zero or full-scale adjust required
8-channel multiplexer with address logic
0V to 5V input range with single 5V power supply
Outputs meet TTL voltage level specifications
Standard hermetic or molded 28-pin DIP package
28-pin molded chip carrier package
ADC0808 equivalent to MM74C949
ADC0809 equivalent to MM74C949-1
Key Specifications
Resolution 8 Bits
Total Unadjusted Error ±1⁄2 LSB and ±1 LSB
Single Supply 5 VDC
Low Power 15 mW
Conversion Time 100 μs
Block Diagram:
30
Figure 4.5 ADC Block Diagram.
Pin Diagram:
31
Figure 4.6 Pin Diagram for ADC.
Functional Description:
Multiplexer:
32
The device contains an 8-channel single-ended
analog signal multiplexer. A particular input channel is
selected by using the address decoder. Table 1 shows the
input states for the address lines to select any channel.
The address is latched into the decoder on the low-to-
high transition of the address latch enable signal.
4.3 BUZZER
33
Figure 4.7 Buzzer.
Features
• Rated Frequency: 3,100Hz
• Operating Voltage: 3 - 20Vdc
• Current Consumption: 14mA @ 12Vdc
• Sound Pressure Level (30cm): 73dB @ 12Vdc
34
• King State Buzzer - KPE-200
• Dimensions: 22.5mm Diameter, 19mm High, 29mm between mounting holes
• Output Current up to 1A
• Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V
• Thermal Overload Protection
• Short Circuit Protection
• Output Transistor Safe Operating Area Protection
35
Figure 4.9 Internal Block Diagram for Voltage Regulator.
Description:
The KA78XX/KA78XXA series of three-terminal
positive regulator are available in the TO-220/D-PAK
package and with several fixed output voltages, making
them useful in a wide range of applications. Each type
employs internal current limiting, thermal shut down and
safe operating area protection, making it essentially
indestructible. If adequate heat sinking is provided, they
can deliver over 1A output current. Although designed
primarily as fixed voltage regulators, these devices can
be used with external components to obtain adjustable
voltages and currents.
36
4.5 POWER SUPPLY:
37
constant circuit is added to discharge all the capacitors
quickly. To ensure the power supply a LED is connected
for indication purpose.
38
OVERALL CIRCUIT DIAGRAM
39
5 MARKOV MODEL OF DIGITAL APPROXIMATION
6 SOFTWARE REQUIREMENTS
1. EMBEDDED C
2. Lab VEIW
43
6.1 INTRODUCTION
The C programming language is perhaps the most popular programming language
for programming embedded systems.
Most C programmers are spoiled because they program in environments where not
only is there a standard library implementation, but there are frequently a number
of other libraries available for use. The cold fact is, that in embedded systems,
there rarely are many of the libraries that programmers have grown used to, but
occasionally an embedded system might not have a complete standard library, if
there is a standard library at all. Few embedded systems have capability for
dynamic linking, so if standard library functions are to be available at all, they
often need to be directly linked into the executable. Oftentimes, because of space
concerns, it is not possible to link in an entire library file, and programmers are
often forced to "brew their own" standard c library implementations if they want to
use them at all. While some libraries are bulky and not well suited for use on
microcontrollers, many development systems still include the standard libraries
which are the most common for C programmers.
C remains a very popular language for micro-controller developers due to the code
efficiency and reduced overhead and development time. C offers low-level control
and is considered more readable than assembly. Many free C compilers are
available for a wide variety of development platforms. The compilers are part of an
IDEs with ICD support, breakpoints, single-stepping and an assembly window.
The performance of C compilers has improved considerably in recent years, and
they are claimed to be more or less as good as assembly, depending on who you
ask. Most tools now offer options for customizing the compiler optimization.
Additionally, using C increases portability, since C code can be compiled for
different types of processors.
EXAMPLE:
An example of using C to change a bit is below
Clearing Bits
44
PORTH &= ~0x0A; // Same as above but using inverting the bit mask - easier to see which bits
are cleared
Setting Bits
Setting Bits
Bit Fields
Bit fields are a topic that few C programmers have any experience with, although it
has been a standardized part of the language for some time now. Bit fields allow
the programmer to access memory in unaligned sections, or even in
sections smaller than a byte. Let us create an example:
struct _bitfield {
flagA : 1;
flagB : 1;
nybbA : 4;
byteA : 8;
}
The colon separates the name of the field from its size in bits, not bytes. Suddenly
it becomes very important to know what numbers can fit inside fields of what
length. For instance, the flagA and flagB fields are both 1 bit, so they can only hold
45
boolean values (1 or 0). the nybbA field can hold 4 bits, for a maximum value of
15 (one hexadecimal digit).
fields in a bitfield can be addressed exactly like regular structures. For instance, the
following statements are all valid:
The individual fields in a bit field do not take storage types, because you are
manually defining how many bits each field takes. I wish that's how Richie had
done it. However, I'm pretty sure that: Each bit field requires a storage type such
as "unsigned". However, the fields in a bitfield may be qualified with the
keywords "signed" or "unsigned", although "signed" is implied, if neither is
specified.
If a 1-bit field is marked as signed, it has values of +1 and 0
It is important to note that different compilers may order the fields differently in a
bitfield, so the programmer should never attempt to access the bitfield as an integer
object. Without trial and error testing on your individual compiler, it is impossible
to know what order the fields in your bitfield will be in.
Also bitfields are aligned, like any other data object on a
given machine, to a certain boundary.
Perhaps the biggest difference between C compilers for embedded systems and C
compilers for desktop computers is the distinction between the "platform" and the
"target". The "platform" is where the C compiler runs -- perhaps a laptop running
Linux or a desktop running Windows. The "target" is where the executable code
generated by the C compiler will run -- the CPU in the embedded system, often
without any underlying operating system.
46
The GCC compiler is the most popular C compiler for embedded systems. GCC
was originally developed for 32-bit Princeton architecture CPUs. So it was
relatively easily ported to target ARM core microcontrollers such as XScale and
Atmel AT91RM9200; Atmel AVR32 AP7 family; MIPS core microcontrollers
such as the Microchip PIC32; and Freescale 68k/ColdFire processors.
The people who write compilers have also (with more difficulty) ported GCC to
target the Texas Instruments MSP430 16-bit MCUs; the Microchip PIC24 and
dsPIC 16-bit Microcontrollers; the 8-bit Atmel AVR microcontrollers; the 8-bit
Freescale 68HC11 microcontrollers.
Other microcontrollers are very different from a 32-bit Princeton architecture CPU.
Many compiler writers have decided it would be better to develop an independent
C compiler rather than try to force the round peg of GCC into the square hole of 8-
bit Harvard architecture microcontroller targets:
SDCC - Small Device C Compiler for the Intel 8051, Maxim 80DS390, Zilog Z80,
Motorola 68HC08, Microchip PIC16, Microchip
There are some highly respected companies that sell commercial C compilers. You
can find such a commercial C compiler for practically every microcontroller,
including the above-listed microcontrollers. Popular microcontrollers not already
listed (i.e., microcontrollers for which the only known C compiler is a commercial
C compiler) include the Cypress M8C MCUs; Microchip PIC10 and Microchip
PIC12 MCUs; etc
SPECIAL FEATURES:
47
Bit Fields
Bit fields are a topic that few C programmers have any experience with, although it
has been a standardized part of the language for some time now. Bit fields allow
the programmer to access memory in unaligned sections, or even in
sections smaller than a byte. Let us create an example:
struct _bitfield {
flagA : 1;
flagB : 1;
nybbA : 4;
byteA : 8;
}
The colon separates the name of the field from its size in bits, not bytes. Suddenly
it becomes very important to know what numbers can fit inside fields of what
length. For instance, the flagA and flagB fields are both 1 bit, so they can only hold
boolean values (1 or 0). the nybbA field can hold 4 bits, for a maximum value of
15 (one hexadecimal digit).
fields in a bitfield can be addressed exactly like regular structures. For instance, the
following statements are all valid:
The individual fields in a bit field do not take storage types, because you are
manually defining how many bits each field takes. I wish that's how Richie had
done it. However, I'm pretty sure that: Each bit field requires a storage type such
as "unsigned". However, the fields in a bitfield may be qualified with the
keywords "signed" or "unsigned", although "signed" is implied, if neither is
specified.
If a 1-bit field is marked as signed, it has values of +1 and 0 .It is important to note
that different compilers may order the fields differently in a bitfield, so the
programmer should never attempt to access the bitfield as an integer object.
48
Without trial and error testing on your individual compiler, it is impossible to
know what order the fields in your bitfield will be in.
Also bitfields are aligned, like any other data object on a given machine, to a
certain boundary.
const
, it is a promise by the programmer who wrote that function that the function will
not modify any items in the structure, array, or string. (If that header file is
properly #included in the file that implements that function, then the compiler will
check that promise when that implementation is compiled, and give an error if that
promise is violated).
On a desktop application, such a program would compile to exactly the same
executable if all the "const" declarations were deleted from the source code -- but
then the compiler would not check the promises.
When some other programmer has an important piece of data he wants to pass to
that function, he can be sure simply by reading the header file that that function
will not modify those items. Without that "const", he would either have to go
through the source code of the function implementation to make sure his data isn't
modified (and worry about the possibility that the next update to that
implementation might modify that data), or else make a temporary copy of the data
to pass to that function, keeping the original version unmodified.
49
6.2 LabVIEW
50
WORKING OF LabVIEW
VIs contains an interactive user interface, which is called the front Panel,
because it simulates the panel of a physical instrument. The front panel can
contain knobs, push buttons, graphs, and other controls and indicators. You
input data using a keyboard and mouse, and then view the results on the
computer screen.
VIs receives instructions from a block diagram, which you construct in G.
The block diagram supplies a pictorial solution to a programming problem.
The block diagram contains the source code for the VI.
VIs use a hierarchical and modular structure. You can use them as top-level
programs, or as subprograms within other programs or subprograms. A VI
within another VI is called a subVI.The icon and connector pane of a VI
work like a graphical parameter list so that other VIs can pass data to it as a
subVI.
51
Virtual Instruments
Lab VIEW programs are called virtual instruments (VIs). VIs has three main parts:
the front panel, the block diagram, and the icon/connector.
OBJECTIVE
To open, examine, and operate a Vi and to familiarize yourself with the basic
concepts of a virtual instrument.
LabVIEW Programs Are Called Virtual Instruments(VIs):-
Front Panel
Controls = Inputs
Indicators = Outputs
52
Block Diagram
Accompanying“program”for front panel Components“wired” together
53
VI Block Diagram
Block
Diagram
Toolbar
SubVI
54
OPERATION ON VIs.
Creating a VI
Front Panel Window
55
Control Indicator Terminals
56
6.3 PROGRAM USED
#include<reg51.h>
sfr adcout=0xa0;
sbit A1=P1^0;
sbit B1=P1^1;
sbit C1=P1^2;
sbit relay1=P1^3;
sbit relay2=P1^4;
void delay(unsigned char value2);
void adata(unsigned int);
unsigned char a,b,c,d;
void serialint()
{
SCON=0x50;
TMOD=0X20;
TH1=0XFD;
TR1=1;
}
void txs(unsigned char kk)
{
TI=0;
SBUF=kk;
while(TI==0);
TI=0;
}
void conv(unsigned int value1)
{
unsigned int huns,tens,ones;
huns=(value1/100);
57
txs(huns+0x30);
tens=((value1/10)%10);
txs(tens+0x30);
ones=(value1%10);
txs(ones+0x30);
}
void adata(unsigned int adcout)
{
unsigned char val=0;
val=val|(adcout&0x80)>>7;
val=val|(adcout&0x40)>>5;
val=val|(adcout&0x20)>>3;
val=val|(adcout&0x10)>>1;
val=val|(adcout&0x8)<<1;
val=val|(adcout&0x4)<<3;
val=val|(adcout&0x2)<<5;
val=val|(adcout&0x1)<<7;
conv(val);
}
void delay(unsigned char value2)
{
int i,j;
for(i=0;i<=value2;i++)
{
for(j=0;j<=1000;j++)
{
}
}
}
void main()
58
{
relay1=relay2=0;
serialint();
while(1)
{
while(RI==0)
{
A1=0;B1=0;C1=0;
delay(50);
txs('P');
adata(adcout);
delay(100);
A1=1;B1=0;C1=0;
delay(50);
txs('Q');
adata(adcout);
delay(100);
}
switch(SBUF)
{
case 'B': relay1=1;RI=0;break;
case 'C': relay2=1;RI=0;break;
case 'D': relay1=0;RI=0;break;
case 'E': relay2=0;RI=0;break;
}
}
}
59
2)
<html>
<body>
<pre>
<h1>µVision3 Build Log</h1>
<h2>Project:</h2>
C:\Documents and Settings\Embedded02\Desktop\BACK
UP\Atmel Pgm\ADC+Serial\AJENT.uv2
Project File Date: 11/20/2010
<h2>Output:</h2>
60
7 EXPERIMENTAL RESULTS
62
8 CONCLUSION
63
REFERENCES
64
traces,http://w1.siemens.com/innovation/en/news_events/ct_pres
semitteilungen/index/e_research_news/2009/e_22_resnews_091
htm, Accessed at May 2009.
65
66