In this project we will control multiple cooling devices using temperature sensor. We will control Fan,AC, room light and other rdevice. We will make real time project. It can be use anywhere for long time. We will show room temperature on LCD.Temperature control is a very useful device for the public palace. BY using this technique it is possible to control the speed of the fan automatically. It is possible to convert normal fan into temperature sensitive fan by adding a temperature sensitive logic. By using this technique we not only save the valuable energy but provide a smart automation logic in electrical systems.
IN normal temperature controller we get a output for on and off purpose only but in this project we control the speed of the fan automatically. In brief firstly we convert the temperature into small voltage with the help of lm 35 sensor. LM 35 is temerature sensor convert the temperature in to small voltage at very accurately. Output of the temperature sensor is further converted into digital signal with the help of the ADC. IN this project we use ADC0804 . ADC 0804 is a 8 bit ADC and convert the any analogue signal into digital signal in 100 microsecond. To control the ADC we required a clock pulse, and 4 different signal . All this signal is provided by the controller. IN this project we use ic 89s51 as a main controller. IC 89s51 sense the output from the ADC in hex code. This HEX code is further converted into binary code with the help of program code inside the controller. IN the output device we use LCD display . LCD display display the contents of the display with the help of the ASCII code. ASCII CODE is a special code for displaying the character in the LCD. In the controller we convert the binary code in to ASCII codes with the help of the code conversion program. Temperature sensor by the lm 35 is now display in the ASCII code on the LCD display.
In the controller. We take four different output from the controller. These different output display the different temperature zone step by step.
If the temperature is in between 25 to 30 then zone one is on and if the temperature is in between 30 to 35 then second zone is on. As the temperature increases different zones are on step by one. As the temperature zone increase. LCD display a speed 1 or 2,or3 on the second line of the display.
All the four zone are connected to the one variable resistor logic or connected to the fan regulator circuit.
We use main resistance of the fan regulator . In the normal fan regulator there is total 5 point for 5 different speed. We use the same resistance for control the speed of the fan or control the intensisty of the light.
WELCOME TO THE WORLD OF THE MICROCONTROLLERS.
code
RS BIT P2.5
RW BIT P2.4
E BIT P2.3
FL BIT P0.7
buzz equ p2.7
LCD EQU P0
RD1 equ p2.0
WR1 equ p2.1
mydata equ p1
INTR equ p2.2
ORG 00H
AJMP START
ORG 30H
START:
MOV LCD,#00H
mov p1,#0ffh
setb INTR
MOV C1,#0
MOV C2,#0
MOV C3,#0
ACALL COMMAND
MOV A,#38H
ACALL COMMAND
MOV A,#02
ACALL COMMAND
MOV A,#01
ACALL COMMAND
MOV A,#0CH
ACALL COMMAND
MOV A,#80H
ACALL COMMAND
MOV DPTR,#TABLE1
ACALL DISPLAY
METER:
j11:
clr WR1
setb WR1
h121:
jb INTR,h121
mov R1,P1
acall READING1
s12: ACALL CHECKC2
S11: setb RD1
sjmp START
READING1:
MOV A,#0C0H
ACALL COMMAND
MOV DPTR,#TABLE4
ACALL DISPLAY
MOV A,R1
SUBB A,#150
SUBB A,#80
ACALL HTD
ACALL WRITE
sjmp S12
CHECKC2:
CLR A
MOV A,P1
J2411:CJNE A,#20,J251
ACALL TEMP0
J251: CJNE A,#21,J242
ACALL TEMP0
J242:CJNE A,#22,J232
ACALL TEMP0
J232:CJNE A,#23,J233
ACALL TEMP0
J233:CJNE A,#24,J241
ACALL TEMP0
J241:CJNE A,#25,J25
ACALL TEMP1
J25:CJNE A,#26,J26
ACALL TEMP1
J26:CJNE A,#27,J27
ACALL TEMP1
J27:CJNE A,#28,J28
ACALL TEMP1
J28:CJNE A,#29,J29
ACALL TEMP1
J29:CJNE A,#30,J30
ACALL TEMP1
J30:CJNE A,#31,J31
ACALL TEMP1
J31:CJNE A,#32,J32
ACALL TEMP1
J32:CJNE A,#33,J33
ACALL TEMP1
J33:CJNE A,#34,J34
ACALL TEMP1
J34:CJNE A,#35,J35
ACALL TEMP2
J35:CJNE A,#36,J36
ACALL TEMP2
J36: CJNE A,#37,n33
ACALL TEMP2
n33:CJNE A,#38,n34
ACALL TEMP2
n34:CJNE A,#39,n35
ACALL TEMP2
n35:CJNE A,#40,n36
ACALL TEMP2
n36: ACALL TEMP3
AJMP S11
TEMP0:
mov p3,#0efh
AJMP START
TEMP1:
mov p3,#0dfh
AJMP START
TEMP2:
mov p3,#0bfh
AJMP START
TEMP3:
clr p2.2
acall delay
setb p2.2
ret
LCDCLR:
MOV A,#01H ;CLEAR DISPLAY SCREEN
ACALL COMMAND
RET ; DISPLAY DATA ON LCD
DISPLAY:
CLR A
MOVC A,@A+DPTR
JZ NEXT
ACALL WRITE
INC DPTR
JMP DISPLAY
NEXT:
RET
WRITE:
MOV LCD,A
SETB RS
CLR RW
SETB E
acall delay1
CLR E
RET
COMMAND:
ACALL CHKBUSY
MOV LCD,A
CLR RS
CLR RW
SETB E
acall delay1
CLR E
RET
delay1:
MOV R4,#255
AGAIN22: MOV R5,#150
BACK22: DJNZ R5,BACK22
DJNZ R4,AGAIN22
RET
DELAY:
MOV R6,#255
AGAIN: MOV R7,#255
BACK: DJNZ R7,BACK
DJNZ R6,AGAIN
RET
TABLE1: DB ‘DIGI.TEMPERATURE’,0
TABLE2: DB ‘CURR. READING.’,0
TABLE3: DB ”,0
TABLE4: DB ‘DEG.’,0
end