help on my project on Temperature monitoring and control system of the refrigerator

A

Thread Starter

akulet joseph

friends help me to resolve this problem on project.
the component am using are.

(a). hard ware tools:
1. micro controller AT89C51
2. LCD LM016L
3. FAN-DC motor
4.COMPIM serial connector
5. Temperature sensor DS18B20

(b) software tool
1. proteus simulator
2.keil compiler.
3. C language

THE CONNECTION OF THE CIRCUIT DESIGN<pre>
(a)micro controller pins LCD pis
p0^0 D0
p0^1 D1
. .
. .
. .
p0^7 D7
p2^0 RS
p2^1 RW
p2^3 E</pre>
(b)temperature sensor is connected to p17 of micro controller
(c). motor is connected to p16 of the micro controller
COMPIM serial connector is connected to p3^0(RXD) and p3^1(TXD)of the micro controller and COMPIM.

THE COMMUNICATION OF THE CIRCUIT DIAGRAM
when powered
The user enters the value of temperature he/she assumes is correct to keep the items properly from the computer with an interface developed in V.B.

The COMPIM sends signals to the micro controller and micro controller these signals to LCD for display and it should maintained constant.
Then as the motor rotates, the temperature sensor should sense the condition caused by the rotation of the motor. these sensed temperature is to be measured by the sensor. the second value of temperatures is displayed on the LCD.

These two values are to be compared.if the second value is equal to first value, the is switched off.

So tried code for the project as follows:<pre>
#include<studio.h>
#include<math.h>
#include<LCD.h>
#include<AT89C51.h>
#include<motor.h>
Ds18B20=p17;
void temperatureread()
{
sint16 temperature_raw; /* temperature raw value (resolution 1/256?C) */
float temperature_float;
char temperature[8]; /* temperature as string */
uint8 sensor_count; /* sensor counter */
initialize();
while (1)
{
LED1_On();
sensor_count = 0;
if ( Ds18B20==1 )
{
do
{
temperature_raw = DS18B20_GetTempRaw();
DS18B20_GetTempString(temperature_raw, temperature);
temperature_float = DS18B20_GetTempFloat();
printf("Sensor %d: %s?C (temperature_float = %f), temperature_raw = %ld)\n\r",
sensor_count,
temperature,
temperature_float,
temperature_raw);
sensor_count ++;
}
while ( Ds18B20==0 );
sensor_count = 0;
}
LED1_Off();

delay_ms(2000);
}
#define DATA_BUS (P0)
#define RS (P2_bit.P2_0)
#define RW (P2_bit.P2_1)
#define E (P2_bit.P2_2)
void LCDdisplay(){
void LCD_command(unsigned char var)
{
LCD_data = var; //Function set: 2 Line, 8-bit, 5x7 dots
LCD_rs = 0; //Selected command register
LCD_rw = 0; //We are writing in instruction register
LCD_en = 1; //Enable H->L
LCD_en = 0;
LCD_busy(); //Wait for LCD to process the command
}
.write("the temperature of the device is:%d",value);
}
motor m=p16;
void DriveReverse() {
for (float s= 0.0; s <-1.0 ; s -= 0.01) {
m.speed(s);
}
int main() {
while (1) {
lcd.cls();
lcd.write("Range: %2.f cm\n",value);
wait(0.2);

}

}
}</pre>
please friends help me edit this code to fit in my ideas of the project.
my email : [email protected]
 
Top