دما سنج 2 بر نا مه ریزی شده توسط آی سی میکرو
این نقشه بلوک دیاگرام مدار
این هم نقشه شماتیک مدار
زمان جاروب کردن هر LED برابر با ۱۰ میلی ثانیه میباشد
این هم بر نامه ی ای سی میکرو پروسسور مدار می باشد
| while(1) { while(!cputick) continue; cputick=0; print_ADC(); } |
The function that reads 12-bit data from ADC is read_ADC(char n). The function has two loops. First loop is to send 4-bit command. And the second loop is 12-bit to shift the data from ADC.
sbit Data = P1^1; for(i=0;i<4;i++)
{
CLK = 0;
if(channel&8) Data = 1;
else Data = 0;
CLK = 1;
channel <<=1;
}
Data = 1;
CLK = 0; for(i=0;i<12;i++)
{
k<<=1;
CLK=1;
CLK=0;
if(Data) k|=1;
else k&=~1;
}
CS = 1;
return k&=0xfff;
}
|
To provide smooth reading, I added the 5-point moving average to the raw data. The function low_pass_filte1( ) is used to filter the high frequency noise. The reading is calibrated to degree Celsius with Platinum 100 standard thermometer. We found the equation y=0.0323x-15.122.
int low_pass_filter1(void) float read_temp1_filter(void)
{
return(0.0323*low_pass_filter1()-15.122);
} |
Download
| Schematic | schematic.pdf |
| C source code | thermistor.c |
| Orcad Schematic File | Uss.dsn |
| Intel-Hex file | thermistor.hex |
| HIH-3160 Humidity Sensor Datasheet |
+ نوشته شده در ساعت ۳:۲۵ ق.ظ توسط دشتی
|
