ee 20070303051616
DESCRIPTION
.TRANSCRIPT
-
5/26/2018 Ee 20070303051616
1/66
EE2006-4
463040764-4 463040957-3
4
..2549
-
5/26/2018 Ee 20070303051616
2/66
Project Report No. EE2006-4
Energy Conservation Technology in office-room
Miss. Nawarat Piladaeng ID.463040764-4
Miss. Siriporn Thakam ID.463040957-3
This is the report of fourth year project assignment submitted in partial
fulfillment of requirement for the Degree of Bachelor of Engineering.
Department of Electrical Engineering
Faculty of Engineering, Khon Kaen University
2006
-
5/26/2018 Ee 20070303051616
3/66
Energy Conservation Technology in office-room
1. 430040764-42. 463040957-3
________________________________
(. )
________________________________
(. )
__________________________________
(.)
7 2550
-
5/26/2018 Ee 20070303051616
4/66
. . .
-
5/26/2018 Ee 20070303051616
5/66
- -2-
-
, -
-
5/26/2018 Ee 20070303051616
6/66
ABSTRACT
This project was made to present the electric energy arrangement method
which will be appropriate for energy use and energy using demand. To take the
most worth, this project will apply the existing technology to design the circuit
which is to turn on/off the electric appliances, for instance the light, fan and air-
conditioner by using the two conditions, the number of people and room
temperature, to control turning the electric appliances on and off.
This project was made in model to demonstrate the procedure controlling
the electric appliances which are in line with the conditions in accordance with
the use appropriation.
Due to the assumption, this project achieves that the process worksfollowing the above conditions. The sensor detects the human motion in kind of
coming in-out the room, as a result, the number of people and temperature will
be changed and indicated by the light.
-
5/26/2018 Ee 20070303051616
7/66
ABSTRACT 1 1
1.1 11.2 11.3 1
1.4 21.5 31.6 3
2 42.1 42.2 52.3 92.4 LCD 112.5 Infrared 13
2.6 143 17
3.1 173.2 - , 22
4 25
4.1 254.2 274.3 , 284.4 31
-
5/26/2018 Ee 20070303051616
8/66
4.5 334.6 LCD 33
5 365.1 365.2 365.3 37
-
5/26/2018 Ee 20070303051616
9/66
2.1 AT89C5 62.2 AT89C 72.3 82.4 92.5 DS 1820 92.6 DS 1820 102.7 DS1820 MCS-51 112.8 LCD 122.9 LCD display 122.10 LED 14
2.11 38 kHz (TSOP 4838) 142.12 12V 142.13 152.14 152.15 0 162.16 1 16
3.1 173.2 SensorDS 1820 19
3.3 - 203.4 233.5 38 kHz 233.6 , 24
4.1 264.2 264.3 274.4 28
-
5/26/2018 Ee 20070303051616
10/66
4.5 , 29)
4.6 , 304.7 , 30
4.8 314.9 324.10 334.11 344.12 1-3 34
4.13 4-10 344.14 10 354.15 1-10 354.16 11 35
-
5/26/2018 Ee 20070303051616
11/66
1.1 23.1 Sensor DS 1820 183.2 - 21
-
5/26/2018 Ee 20070303051616
12/66
1
1
1.1
( E n e r g yConservation Technology in office-room)
-, -, ,
1.2 1.2.1 1.2.2 1.2.3 --1.2.4 -1.2.5 --,,
1.3 1.3.1 1.3.2 , --,
,
1.3.3 , --
-
5/26/2018 Ee 20070303051616
13/66
2
1.3.4 , -
1.3.5 1.3.6
1.4
1.1
..49
..49
..49
..49
..49
..49
...49
..50
1. 2. --3. -
4. --,,
5. -
6. -
-7. -8. --,, 9.
-
5/26/2018 Ee 20070303051616
14/66
3
1.51.5.1 1.5.2 --
1.5.3 -1.5.4 --,
, 1.5.5
1.6 1.6.1
- DS 1820 1 148.57 - AT89S52 1 69.00 - Sensor () 6 134.00 - Relay 4 100.00 - Switch Reset 4 20.00 - 2 10.00 - R pack 3 15.00 - Connector 12 55.00 - 1.5 mm 2 20.00 - 4 32.00 - 4 40.00 - - 1 20.00 - Opto coupler 4 40.00 - 4 8.00
1.6.2 - (, , ) 235.00 - 1400.00 - 289.00 - 76.00 - 200.00 - 3 400.00
3311.57
-
5/26/2018 Ee 20070303051616
15/66
4
2
2.1
3 1. 2. 3.
2.1.1
1. ,2.
3. 4.
5.
1,200
1
1 5
5 25,000 4
- 25 ( 1 0 %
-
5/26/2018 Ee 20070303051616
16/66
5
)-
15 -
15
-
- ,
- 1 6
2.1.2
3
- 2
-
-
-
-
2.2 AT89C51 A T 8 9 C 5 1
M C S - 5 1 8
4 1 2 8 40 2.1 2.2
-
5/26/2018 Ee 20070303051616
17/66
6
2.1 AT89C51
-
5/26/2018 Ee 20070303051616
18/66
7
2.2 AT89C51
2.2.1 AT89C51- MCS-51- 41,000 - 4 5.5- 3 - 128- 32
-
5/26/2018 Ee 20070303051616
19/66
8
- 16 3- 8 -
2.2.2
C1 C2 20 40 pF 2.3
2.3
2.2.3 1 Reset
2 112
1 = 1 /
12 MHz 1 = 1 / 12 x 106= 0.08333 sec
1 = 12 x = 12 x 0.08333 = 1 sec
2 = 2 x 1= 2 sec
1 2 sec
-
5/26/2018 Ee 20070303051616
20/66
9
2.4
2.3 DS1820DS18201 3 DQ
, ,DS1820
(Scratchpad)9 0 1
DS1820 16 0.5 0.9 -55+125 -67+257 200 2 3
2.5 DS1820
GND
DQ
+Vcc
-
5/26/2018 Ee 20070303051616
21/66
10
2.6 DS1820
2.3.1 DS1820 DS1820 DS1820
3 1. (Skip ROM)
DS1820DS1820 DS1820
0CCH2. (Convert T)44H DS1820
200 DS 1820
3. (Read Scratchpad)0BEH DS18209
2.3.2 MCS-51 1 DS1820 4.7
+5V
-
5/26/2018 Ee 20070303051616
22/66
11
2.7 DS1820 MCS-51
2.4LCD
2.4.1 LCDLCD 2x16 (2 16 )16
I/O 2.4 - V
SS1:
- VDD2: +5V
- VO3:- RS 4:
0 1
- R/w 5: LCD 0 1
- E6: LCD)- D0 - D7 7-14: LCD 8 - A/NV15: Power supply for LED backlight (+) / Negative voltage output- K 16: Power supply for LED backlight (GND)
-
5/26/2018 Ee 20070303051616
23/66
12
2.8 LCD
2.4.2 LCD display LCD module LCD Module Show
Test Running Shift DisplayRight and Left LCD moduleWrite CharacterCursor and Blink Hello World ML09
2.4.3 LCD display15, 16 (LED backlight) VR 10kLCDmodule
4031
9
18 19
20
10uF
8.2k
RST
+5V
D7 D6 D5 D4 D3 D2 D1 D0
RS
E
R/W
LCD 16X2
P0.7
P0.6
P0.5
P0.4
P0.3
P0.2
P0.1
P0.0
+5V
5
6
4
14 13 12 11 10 9 8 7
1
+5V
P3.7
P3.6
22/33pF22/33pF12MHz
3
2
VR
10k
reset
10k x 8
16
17
32
33
34
35
36
37
38
39
2.9 LCD display
1516114 213 12 11 10 9 8 7 6 5 4 3
-
5/26/2018 Ee 20070303051616
24/66
13
2.5 Infrared
Infrared (IR) 1,011 1,014 10-310-6(Millimeter waves) 10-4
1. 2.
3.
4. 5. 30-80 10-30 6. 7. IrDa (Infrared Data Association)
1 5 8.
Infrared Infrared
- 1. 2.
2.5.1 LED 5
940 38 kHz LED
-
5/26/2018 Ee 20070303051616
25/66
14
2.10 LED
2.5.2 38 kHz (38kHz Infrared Receiver module: TSOP 4838) 3
1 Data, 2 GND 3 VCC
38 kHz38kHz
1 38kHz 0
2.11 38 kHz (TSOP 4838)
2.6
Electromagnetic
2.12 12V
1
2 3
-
5/26/2018 Ee 20070303051616
26/66
15
2.13
2.13 sw 1 (Common) (Normal Close) sw 1 (Normal Open) Vcc 9 Vdc 9
2.14
-
5/26/2018 Ee 20070303051616
27/66
16
ULN 2803 ULN 2803 500 mA 8
2.15 0
2.15
0
ULN 2803
2.16 1
2.16 1 ULN 2803
-
5/26/2018 Ee 20070303051616
28/66
17
3
3.1
Microcontroller
-
-2 -
2
-1 2()
Microcontroller,
-2 1
()
MicrocontrollerMicrocontroller
LCD
LCD
3.1
-
5/26/2018 Ee 20070303051616
29/66
18
Microcontroller2 - -
3.1.1 2
1.
-
2. LCD
3.1 Sensor DS 1820
(C)
DS 1820
(C)
5 5.0
10 10.5
15 14.5
20 20.0
25 25.5
30 30.5
35 34.5
40 39.5
45 45.5
50 50.5
55 55.0
60 59.5
-
5/26/2018 Ee 20070303051616
30/66
19
0
10
20
30
40
50
60
70
5 10 15 20 25 30 35 40 45 50 55 60
( C)
DS1
820(
C)
3.2 SensorDS 1820
3.1.2 -2
1.
2. LCD
2 -
2
- 1 2 ()
Microcontroller ,LCD
- 2 1()
Microcontroller Microcontroller
LCD
3.1.3 - ,
-,
1. 2. 1-3 25
-
5/26/2018 Ee 20070303051616
31/66
20
25
3.
4-10
25
25 1
4. 11 25 1 25
5. 10 - () -
3.1.4 -
2
3.3 -
1 3
& Tem 25
Light Open / Fan, Air A, B Close
= 0& Tem = ##
YES
NO
NO
YES
YES
Light, Fan Open /Air A, B Close
Light, Fan Open / Air A, B Close
NOLight, Air A Open / Fan, Air B Close
Light, Air A Open / Fan, Air B Close
Light, Air A, B Open / Fan Close
Set Time Relay =10 MinAll Close
YES
10& Tem 25
310
& Tem 25
-
5/26/2018 Ee 20070303051616
32/66
21
3.2 -
Light Fan Air-condition A Air-condition B
YES Close Close Close1 3& Temp 25 NO Close Close
YES Close Close3 < < 10& Temp 25 NO Close Close
YES Close Close 10& Temp 25 NO Close
= 0& Temp = ## YES Close Close Close Close
- 2
2
3.1.5 -
-
10 -
3.1.6 -2
- 2
-
5/26/2018 Ee 20070303051616
33/66
22
10
3.2 -,
3.2.1 Hardware
Hardware 3 part 1. Hardware 3 module
- 1A, 12Vac- 1A, 15Vac- (BRIDGE DIOD)- (L7812CV22012
)
- (MC7805CT2205)
2. Hardware 3 module - - ()- (LED: TOIR-50B94)
3. Hardware , 6 module
- - ()- LCD (16x2) , - (DS1820)- (: TSOP4838)- 12()ULN2803
- opto coupler
-
5/26/2018 Ee 20070303051616
34/66
23
3.2.2 21. 38 kHz
2.
- LCD- ,
- (DS1820)- (: TSOP4838)
3.4
3.5 38 kHz
-
5/26/2018 Ee 20070303051616
35/66
24
3.6 ,
-
5/26/2018 Ee 20070303051616
36/66
25
4
4.1
- 121 1- 151 1- BRIDGE DIOD 4 1 - (L7812CV) 1 _ (MC7805CT) 1
- 470 F/50 V 2
- 100 F/50 V 2 - Connector 2 (: 2.54 ) 2 - 2x1.5 1 1- 1- () 1 1 - () 1 1
4.1
-
5/26/2018 Ee 20070303051616
37/66
26
4.1
4.2
-
5/26/2018 Ee 20070303051616
38/66
27
4.2 - (AT89C51) 1 - (LED: TOIR-50B94) 2
- 10 k 1
- 1 k 2
- 100 2 - Crystal oscillator 12 MHz 1 - 39 pF 2
- 1 F/50 V 1 - 4 1 - 2N2222A 2 - Connector 2 (: 2.54 ) 1 - Connector 2 () 2 - 2 (1 ) 2- Socket 40 1
4.3 +5V
4.3
-
5/26/2018 Ee 20070303051616
39/66
28
4.4
4.3 , - (AT89C51) 1 - (DS1820) 1 - (: TSOP4838) 2 - LCD 16 x 2 1
- (R-PACK) 10 k 1 - 4.7 k 1
- 1 k 4
- 10 k 3
- 100 3
- 3 10 k 1 - 39 pF 2
- 0.1 F 2
- 1 F/50 V 2 - Crystal oscillator 12 MHz 1
-
5/26/2018 Ee 20070303051616
40/66
29
- 4.7 F/50 V 2 - ULN2803 1- 12() 4 - 3 (1 ) 3- Connector 2 (: 2.54 ) 2 - Connector 3 () 3 - Connector 2 (5 ) 5 - 4 1 - Opto coupler4 4 - Socket 40 1 - Socket 18
2
- 4 - 5V 1
4.5 +5V, , +12V,ULN2803
4.5 ,
-
5/26/2018 Ee 20070303051616
41/66
30
4.6 ,
4.7 ,
Light FAN Air-Con1 Air-Con2
-
5/26/2018 Ee 20070303051616
42/66
31
4.4 - 8 2 - 6 65 x 40 1- 1x1 3 1 - 3/5 W 4 - 4 - 1- 1x1 1 1- () 10
- () 1x1 1 - 2 - () 1 - 1 - 1 - 3 - - 2 - 2
4.8
-
5/26/2018 Ee 20070303051616
43/66
32
4.9
Light
Air-Con1
FAN
Air-Con2
-
5/26/2018 Ee 20070303051616
44/66
33
4.10
4.5 Build Project
READ51 ()
4.6 LCD
Temp. = XXC P = X L, F, a, A ,
Temp = (C)L = Light ()F = Fan ()
-
5/26/2018 Ee 20070303051616
45/66
34
a = Air condition 1(1)A = Air condition 2(2)1 = Status Open
0 = Status Close
4.11
4.6.1 25 C
4.12 1-3
4.13 4-10
-
5/26/2018 Ee 20070303051616
46/66
35
4.14 10
4.6.2 25 C
4.15 1-10
4.16 11
-
5/26/2018 Ee 20070303051616
47/66
36
5
5.1
- () - - 2 - - -
3- 3 LCD -- 2 LCD
5.2 5.2.1 IC 555
5.2.2 220v220 v
LCD
-
5/26/2018 Ee 20070303051616
48/66
37
5.3 5.3.1
-5.3.2
5.3.3 5.3.4 5.3.5 Keypad
5.3.6
-
5/26/2018 Ee 20070303051616
49/66
1. , , MCS-51, ,
2. , 2546, (), 6,, ...3. EE 2001-51 -
4. EE 2004-15
5. , 2549,1, ,
...
6. , 2549,2, ,...
7. www.es.co.th8. www.alldatasheet.com9. http://161.200.33.15/eriweb/index.asp?type=categories&csql=10.http://www.teenet.chula.ac.th/conserv/11.http://www.emac.or.th/modules.php?name=index 12.http://teenet.chiangmai.ac.th/emac/journal/2005/29/11.pdf#search=%22%E0%B8%AD%E
0%B8%99%E0%B8%B8%E0%B8%A3%E0%B8%B1%E0%B8%81%E0%B8%A9%E0%B9%8C%E0%B8%9E%E0%B8%A5%E0%B8%B1%E0%B8%87%E0%B8%87%E0%B8%B
2%E0%B8%99%22
13.www.adisak51.com14.www.thaiio.com15.www.ett.co.th16.http://webserv.kmitl.ac.th/~s5050884/
-
5/26/2018 Ee 20070303051616
50/66
-
5/26/2018 Ee 20070303051616
51/66
- 2 -
DS1820#include
// DEFINES ==========================================================
#define DQ P1_7 //pin 1-Wire Interface
// END DEFINES ======================================================
void ow_delay(int useconds);
char ow_reset(void);
char read_bit(void);
void write_bit(char bitval);
char ReadByte(void);
void WriteByte(char val);
void ReadTemp_DS1820(int *temp, int *decimal);
// Prototypes =======================================================
//****************************************************** ow_delay()
// 1-wire delay
void ow_delay(int useconds){
int s;
for(s=0; s
-
5/26/2018 Ee 20070303051616
52/66
- 3 -
//****************************************************** read_bit()
char read_bit(void)
{
char i;
DQ = 0; // pull DQ low to start timeslot
DQ = 1; // then return high
for(i=0; i
-
5/26/2018 Ee 20070303051616
53/66
- 4 -
char i;
char temp;
for(i=0; i>i; // shifts val right 'i' spaces
temp &= 0x01; // copy that bit to temp
write_bit(temp); // write bit in temp into
}
ow_delay(5);
}
//************************************************* ReadTemp_DS1820
// Read Temperature DS1820
void ReadTemp_DS1820(int *temp, int *decimal)
{
char get[10];
char temp_lsb, temp_msb;
char k;
ow_reset();
WriteByte(0xCC); // Skip ROM
WriteByte(0x44); // Start Conversionow_delay(5);
ow_reset();
WriteByte(0xCC); // Skip ROM
WriteByte(0xBE); // Read Scratch Pad
for(k=0; k
-
5/26/2018 Ee 20070303051616
54/66
- 5 -
temp_lsb = temp_lsb = (-1)*temp_lsb;
}
*temp = (int)temp_lsb;
*decimal = (int)k;
}
// END Prototypes ===================================================
4
#include // DEFINES ==========================================================
#define LCD_DATA P0 // Dataport of LCD-Display (D4..D7)
#define LCD_EN P0_3 // Enable of LCD-Display
#define LCD_RS P0_2 // Register Select of LCD-Display
// END DEFINES ======================================================
void lcd_delay(int);
void time1ms();
void lcd_init();
void lcd_cmd(char cmd);
void lcd_dat(char dat);
void lcd_gotoxy(unsigned char x,unsigned char y);
void lcd_clrscr();
void lcd_putchar(char ch);
void lcd_putstr(char *str);
void putchar(char c);
// Prototypes =======================================================
void time1ms()
{
int i;
for (i = 0; i
-
5/26/2018 Ee 20070303051616
55/66
- 6 -
return;
}
void lcd_init()
{
char init[]={0x33,0x32,0x28,0x06,0x0C,0x01,0x80}; // 4-bit interface
char count;
for (count = 0; count
-
5/26/2018 Ee 20070303051616
56/66
- 7 -
LCD_EN = 0;
time1ms();
return;
}
void lcd_gotoxy(unsigned char x,unsigned char y)
{
if ((y - 1) == 0)
lcd_cmd(0x80 | (x - 1));
else
lcd_cmd(0xC0 | (x - 1));
return;
}
void lcd_clrscr()
{
lcd_cmd(0x01);
lcd_delay(5);
return;
}
void lcd_putchar(char ch)
{lcd_dat(ch);
return;
}
void lcd_putstr(char *str)
{
while(*str)
{
lcd_putchar(*str++);
}
return;
}
void putchar(char c) // Define "putchar" for "printf"
{
lcd_dat(c);
return;
}
// END Prototypes ===================================================
-
5/26/2018 Ee 20070303051616
57/66
- 8 -
-,
#include
#include
#include "lcd4bit.c"
#include "ds1820.c"
#define s1 P3_2 //P1_0
#define s2 P3_3 //P1_1
#define l P2_0
#define f P2_1#define a1 P2_2
#define a2 P2_3
void delay(int t);
void check(int,int,int,int,int,int);
int people=0;
int temp, decimal;
int main()
{
lcd_init();
check(people,temp,l,f,a1,a2);
ReadTemp_DS1820(&temp, &decimal);
l=0;f=0;a1=0;a2=0;
delay(500);
lcd_clrscr();
while(1)
{
ReadTemp_DS1820(&temp, &decimal);
s1,s2;
if(s1==1&& s2==0)
{
while(s1)
{
check(people,temp,l,f,a1,a2);
if(s1==1&&s2==1){
-
5/26/2018 Ee 20070303051616
58/66
- 9 -
while((s1&&s2))
{
check(people,temp,l,f,a1,a2);
if(s1==0&&s2==1)
{
while(s2)
{
check(people,temp,l,f,a1,a2);
if(s1==0&&s2==0)
{
people+=1;
delay(10);
check(people,temp,l,f,a1,a2);
}
}
}
}
}
}
}else if(s1==0&& s2==1)
{
while(s2)
{
check(people,temp,l,f,a1,a2);
if(s1==1&&s2==1)
{
while((s1&&s2))
{
check(people,temp,l,f,a1,a2);
if(s1==1&&s2==0)
{
while(s1)
{
check(people,temp,l,f,a1,a2);
if(s1==0&&s2==0)
{
if(people>0)
-
5/26/2018 Ee 20070303051616
59/66
- 10 -
{
people-=1;
delay(10);
check(people,temp,l,f,a1,a2);
}
}
}
}
}
}
}
}
if(people0&&people
-
5/26/2018 Ee 20070303051616
60/66
- 11 -
{
lcd_gotoxy(1,1);
printf_fast("Temp=%3d C", temp);
lcd_gotoxy(9,1);
lcd_putchar(0xb2); // write degree symbol
lcd_gotoxy(12,1);
printf_fast("P=%3d",people);
lcd_gotoxy(1,2);
printf_fast("L%d F%d a%d A%d",l,f,a1,a2);
}
void delay(int t)
{
int k,l;
for (k=0;k
-
5/26/2018 Ee 20070303051616
61/66
- 12 -
,
-
5/26/2018 Ee 20070303051616
62/66
- 13 -
-
5/26/2018 Ee 20070303051616
63/66
- 14 -
-
5/26/2018 Ee 20070303051616
64/66
- 15 -
-
5/26/2018 Ee 20070303051616
65/66
- 16 -
-
5/26/2018 Ee 20070303051616
66/66
- 17 -
DATASHEET