|
مادام القياس على طرفى الحساس مباشرة و كان الفولت متغير بدون تغير فى الحرارة فهذا يعنى فعلا أن الحساس تالف
|
انا معك اخي بس هل من المعقول ان يكون الحساسان تالفان من نفس النوع وعلى فكرة هذه ليست اول مرة لقد اشتريت خمسة حساسات
اثنان من بائع لايعملان ابدا
واحد يعمل بكفائة
اثنان من بائع اخر فيهم هذه المشكلة
اريد رقم حساس نفس المعيارية من نوع اخر اي شركة اخرى
او تعديل على الكود لاستخدام ntc مقاومة 103
وهذا الكود الذي كتبته
لهذا الغرض
// LCD module connections
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
// End LCD module connections
int x ;
float y;
float temp;
char temp_txt[15];
int counter=0;
void main()
{
trisa=0b11111111;
trisc.f4=0; portc.f4=0;
trisc.f3=0; portc.f3=0;
trisc.f2=0; portc.f2=0;
trisc.f1=0; portc.f1=0;
trisc.f0=0; portc.f0=0;
ADC_Init(); Lcd_Init();
counter = EEPROM_Read(0x02);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,1,"Hatchery eggs");
delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"designd by");
delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"abo hosen");
delay_ms(1000);
Lcd_Cmd(_LCD_CLEAR);
Lcd_Out(1,1,"Temp=");
while(1)
{
x=adc_read(0); // digital value
y=(x*5.0/1023); //analog value
temp=y*100;
floattostr(temp,temp_txt);
temp_txt[5]='\0'; // terminate for array
lcd_out(1,1,"temp= ");
lcd_out_cp(temp_txt);
lcd_chr_cp(223);
lcd_chr_cp('c');
counter++;
EEPROM_Write(0x02, counter);
if(counter > 28800){counter=0;portc.b2=1;}
delay_ms(500);
if(counter > 240)portc.b2=0;
if(counter > 14400)portc.b3=1;
if(counter > 14640)portc.b3=0;
if(temp>37.7)
{
portc.f0=0;
portc.f4=0;
Lcd_out (2,1,"Overheat");
}
else
{
PORTC.f0=1;
portc.f4=1;
Lcd_out (2,1,"Normal " );
delaY_ms(500);
}
if(temp<36)
{
portc.f1=0;
Lcd_out (2,10,"fan off");
}
else
{
PORTC.f1=1;
Lcd_out (2,10,"fan on " );
}
}
}