- Open Access
- Total Downloads : 98
- Authors : Afolabi O. M. , Agbi J. I. , Ogunniyi E. O. , Tomiwa A. C
- Paper ID : IJERTV8IS070149
- Volume & Issue : Volume 08, Issue 07 (July 2019)
- Published (First Online): 06-08-2019
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License: This work is licensed under a Creative Commons Attribution 4.0 International License
Application of Designed and Constructed PIC18F4520 microcontroller LM34DZ based Temperature Meter to Derivation of Soil Damping Depths near the NECOP station in Adekunle Ajasin University Akungba Akoko
Afolabi O. M, Agbi J. I, Tomiwa A. C, Ogunniyi E. O
Adekunle Ajasin University, Akungba Akoko
Abstract:- A digital temperature logger constructed based on the PIC18F4520 was used to measure the four layers temperature close to the Campbell digital weather station in Akungba Akoko with LM34DZ temperature sensor IC. A damping depth equation was developed from heat equation and used to check the variation of damping depth with layers, temperature variation and the effect of previous rainfalls. The maximum damping depth computed was 558.73 cm for day 2 at layer 4 while the minimum damping depth was 46.39 cm for day 1 at layer 1. It was noticed that the damping depth increased with previous rainfall days and the rainfall duration can increase thermal conduction and damping depth at each layer. It was also noticed that the effect of subsurface temperature acting in opposite upward direction and lithology can affect damping depth. This measurement is eventually suggested for area prone to volcanoes or earthquake for early precautionary studies with more sophisticated microcontroller based system.
Keywords: Damping depth, temperature, layers, equation, measurement, computation
INTRODUCTION AND BACKGROUND THEORY
2 2 2
2 2 2
The heat equation for a non homogeneous non isotropic body in which heat is generated at a rate given by a function q varying in space and time satisfies the equation (Flynn and Gorthala. 1997, Tikhonov and Samarskii, 1963)
= ( + + ) + .1
2
2
2
Heat equation is usefully applied by some authors for investigating soil thermal conductivities, specific heat and thermal diffusivity (Assael et al., 2003; Nicolau et al.,2002; Hust et al., 1985 and Lee et al., 1985).
2 2 2
2 2 2
When the heat generated is not within the body concerned as it is the case for energy at the surface of the earth ( David, 1981), equation 1 becomes
= ( + + )…2
2
2
2
2
2
Then, for an isotropic case that is assumed due to point measurement that is usually done,
= ( )..
2
.3
2
2
let U(t,r)=T(t)R(r)
=()R(r) = = ()() 4
2
() = ()=-
() R(r)
..5
These become
() = () and () = R(r) 6
Then the following solutions exist
() =
..7
R(r) = Br + r 8
If the constant is considered a damping depth proportional to 1 , equation 7 becomes
r r
D
D
R(r) = BD +
9
the first term on the RHS indicates too large motion of heat into the ground without damping and it is not a satisfactory solution. The second term justifies a decaying heat imparted from the outside surface or atmosphere into the ground. The damping depth D is the depth at which the amplitude of the diurnal temperature wave is 1times the amplitude of the diurnal temperature wave at the surface.
Hence the reasonable solution to equation 2 or 6 then becomes R(r) = (0)
r
D 10
In 1 Dimension, equation 10 can be approximated by choosing a simple amplitude R(r) = A(d), R(0) = A(0) . The amplitude of diurnal temperature wave at the depth d is
d
A(d)=A(0) D 11
When temperature data is collected at depth d in cm, The damping depth D is calculated by measuring with constructed digital thermometer based on PIC18F4520 the soil surface temperature A(0) and soil temperature at depth d.
GEOGRAPHICAL LOCATION AND GEOLOGICAL DESCRIPTION OF THE STUDY AREA
The study place is located in Akungba Akoko, Ondo state on longitude N70 28l 196ll, and latitude 0050 44l 120ll, the elevation is 330.2m. The annual rainfall has a mean of 1333.2mm. Geologically, the place is underlain by granite gneiss. 40m away the rock forms inselbergs of isolated residual hills and continuous ridges. The area exhibits varieties of foliation, fold, joints faults and fracture and at the eastern part of study area 30m away there is a spring emanating from the fracture flowing down towards the southern part.
MATERIAL AND METHODS
+5V
0.1µF
POT
+5V
LCD B5
LCD B6
2.2 pF
2.2 pF
XTAL
-
MHz
RC2
RC3 RC4 RC5
12, 31
13
14
17
18
23
32, 11
PIC 18F4520
PIC 18F4520
2
39
40
RAO/ANO
RB6 RB7
1 3
2
LM34DZ
ICSP/ICD
Header
– 5V ICSPCLK ICSPDAT
10K
24
RC6
25
Vpp/MCLR
Gnd
RC7
26
1 15
+5V
RCO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 MCLR
10K
LCD
10K
Read Temp.
Reset
Fig. 1 PIC18F4520 based Temperature circuit
A data of soil and air temperature were collected with a constructed digital thermometer based on microcontroller PIC 18F4520 and LM34DZ temperature sensors (www.mikroe.com, 2010) connected to pin RA2(see Fig. 1 and Appendix 1) The digital temperature meter has a 16 by 2 LCD display. A pit of 1.5 meters consisting of four levels at 20cm, 50cm, 100cm and 150cm depths from the surface were dug and covered with rubber tarpaulin throughout the first day without taking any measurement. The rubber tarpaulin was used such that air temperature interaction with each level of the pit is greatly reduced.
On the second day the air and soil temperature were measured and recorded with the two LM 34DZ sensors on the surface and at each layer successively. After each measurement on the soil for each level the pit was covered. The measurements were done at 1 hour interval between the hours of 8am to 6pm for seven consecutive days from 16th to 22nd February, 2011. There were rainfall on first and fifth day and lower temperature data were recorded compare to the days when there were no rainfalls.
RESULTS AND DISCUSSION
Table 1: Temperature Variations for 7 days from 8:00 am to 6 pm
Time
Layers
Days, Dates and Temperature( 0C)
Wednesday 16th Temp ( 0C)
Thursday 17th Temp (0C)
Friday 18th
Temp (0C)
Saturday 19th
Temp (0C)
Sunday 20th Temp(0C)
Monday 21st Temp(0C)
Tuesday 22nd
Temp (0C)
8.00 am
Air Temp.
23.48
25.34
24.32
25.52
25.24
26.91
26.10
L1
23.04
26.46
23.15
24.75
23.97
24.07
24.87
L2
22.85
25.77
23.00
23.66
23.42
23.49
24.38
L3
21.60
29.80
22.87
23.31
22.55
23.11
23.69
L4
21.33
29.30
22.11
23.00
22.41
22.77
22.91
9.00 am
Air Temp.
27.57
27.54
28.90
29.00
29.04
27.54
25.96
L1
25.44
28.80
28.80
28.43
28.77
27.33
26.13
L2
25.31
29.71
27.96
26.92
27.81
26.49
25.55
L3
24.98
30.50
27.07
26.64
27.00
26.08
25.02
L4
23.76
29.40
26.55
25.00
26.23
25.89
24.83
10.00
am
Air Temp.
33.24
30.00
33.56
29.87
32.81
28.36
28.80
L1
30.75
29.20
30.71
29.01
30.93
28.15
28.26
L2
27.00
29.30
28.07
28.63
29.88
27.90
27.81
L3
27.55
28.90
27.36
28.54
27.59
27.55
27.27
L4
27.17
28.50
27.18
27.44
26.66
26.42
27.09
11.00
am
Air Temp.
30.83
32.30
29.70
31.05
33.11
30.11
30.24
L1
29.70
32.10
28.08
29.97
32.73
30.17
30.33
L2
28.54
31.20
27.54
28.89
29.45
29.12
28.80
L3
27.08
30.60
26.73
28.17
28.07
28.99
27.81
L4
26.73
29.70
26.18
27.63
28.00
28.09
27.09
12.00
noon
Air Temp.
33.48
34.02
30.51
31.86
33.81
31.73
29.88
L1
31.22
30.78
28.53
31.77
32.46
31.06
31.05
L2
29.73
28.89
28.44
29.34
30.67
29.73
30.42
L3
28.48
28.08
27.27
28.89
29.74
29.06
29.34
L4
28.02
27.81
26.91
27.81
29.16
28.82
28.53
1.00 pm
Air Temp.
34.09
34.02
33.51
34.02
35.07
32.67
30.74
L1
33.22
32.22
31.41
32.13
35.44
32.22
31.35
L2
30.65
30.24
30.24
31.14
32.95
30.42
30.33
L3
28.15
29.42
28.98
29.97
31.76
29.88
29.70
L4
27.88
27.72
27.72
29.07
31.23
28.34
28.81
2.00 pm
Air Temp.
35.46
32.13
31.32
31.95
36.00
31.59
34.50
L1
36.45
31.22
30.87
32.67
37.44
33.57
35.37
L2
35.73
29.25
29.88
31.05
35.91
31.77
32.22
L3
34.83
29.88
29.25
30.78
32.91
30.69
31.23
L4
34.02
28.35
28.07
29.25
30.15
29.97
30.15
3.00 pm
Air Temp.
32.11
32.58
34.11
34.02
34.11
36.54
33.66
L1
32.00
32.13
33.30
34.37
35.37
37.26
37.15
L2
30.55
30.51
31.23
32.22
33.03
34.11
32.40
L3
29.27
29.88
30.78
31.77
32.24
33.84
31.86
L4
27.88
27.99
28.35
29.61
31.77
31.05
31.14
4.00 pm
Air Temp.
32.06
33.39
33.30
36.47
33.66
34.48
30.45
L1
31.87
33.66
32.94
36.27
34.11
36.18
32.67
L2
30.67
31.41
30.69
33.39
31.77
33.75
30.06
L3
29.92
30.51
29.97
32.67
31.05
31.44
29.07
L4
28.73
28.62
28.34
30.42
30.51
30.78
28.44
5.00 pm
Air Temp.
30.19
31.41
29.97
32.03
31.75
33.39
28.08
L1
31.17
32.85
31.05
30.68
30.49
34.11
30.06
L2
30.00
30.15
29.88
31.55
29.68
31.59
29.07
L3
29.13
29.34
28.89
29.79
29.29
30.60
28.60
L4
28.54
28.17
28.44
29.21
28.73
29.61
27.63
6.00 pm
Air Temp.
31.32
29.01
28.67
29.67
29.84
31.95
27.43
L1
29.25
29.11
29.01
28.93
28.63
33.39
28.71
L2
27.27
28.43
27.32
28.06
28.04
31.41
27.72
L3
25.47
27.85
27.01
27.11
27.77
29.97
27.05
L4
23.58
26.01
26.84
26.24
27.02
28.89
26.81
Equation 11 can be made applicable by further development with natural logarithm
Ln A(d)=lnA(0)- d
D
D = d
lnA(0)lnA(d)
..12
…….13
The damping depth D is a constant characterizing the decrease in temperature with depth d in the soil
To get A(0) and A(d) another table of minimum and maximum temperatures for the surface and at the four layers are needed.
Table 2: Average Surface and Depth Temperature Variations for 7 days from 8:00 am to 6 pm
Days
Surface
Layer 1
Layer 2
Layer 3
Layer 4
Max
Min
Max
Min
Max
Min
Max
Min
Max
Min
1
35.46
23.48
36.45
23.04
35.73
22.85
34.83
21.60
34.02
21.33
2
34.02
25.34
33.66
26.46
31.41
25.77
30.60
27.85
29.70
26.01
3
34.11
24.32
33.30
23.15
31.23
23.00
29.25
22.87
28.44
22.11
4
36.47
25.52
36.27
24.75
33.39
23.66
31.77
23.31
30.42
23.00
5
36.00
25.24
37.44
23.97
35.91
23.42
32.24
22.55
31.14
22.41
6
36.54
26.91
37.26
24.07
34.11
23.49
33.84
23.11
31.05
22.77
7
34.50
25.96
37.15
24.87
32.40
24.38
31.86
23.69
31.14
22.91
With layers 1, 2, 3, and 4 respectively at depths 20, 50, 100 and 150cm, several damping depths can be calculated to investigate the contributions of the rainfall of the first and fifth days and each layer to the values.
Table 3 Damping Depths for different layers
Days
Surface
Layer 1
Layer 2
Layer 3
Layer 4
Max (0C)
Min (0C)
D1
(cm)
Min (0C)
D2
(cm)
Min (0C)
D3
(cm)
Min (0C)
D4
(cm)
1
35.46
23.04
46.38504
22.85
113.7775
21.60
201.7300
21.33
295.1067
2
34.02
26.46
79.58158
25.77
180.0261
27.85
499.7111
26.01
558.7268
3
34.11
23.15
51.60014
23.00
126.8725
22.87
250.1472
22.11
345.9724
4
36.47
24.75
51.59100
23.66
115.5524
23.31
223.4100
23.00
325.3826
5
36.00
23.97
49.17438
23.42
116.2984
22.55
213.7739
22.41
316.4479
6
36.54
24.07
47.91093
23.49
113.1650
23.11
218.2729
22.77
317.1491
7
34.50
24.87
61.10657
24.38
144.0108
23.69
266.0237
22.91
366.4025
Mean
55.33566
Mean
129.9575
Mean
267.5813
Mean
360.7411
The computation was done with EXCEL spreadsheet. The data was applied to equation 13 with maximum surface temperature being A(0) while minimum temperatures are used for each layer
Graphs of each layers damping depth against days are plotted with table 3 below.
200
180
160
140
120
100
80
60
40
20
0
DD1
0 2 4 6 8
Days
Days
Fig 1. Damping depth of layer 1
200
180
160
140
120
100
80
60
40
20
0
DD2
DD2
200
180
160
140
120
100
80
60
40
20
0
DD2
DD2
0 2 4 6 8
0 2 4 6 8
Days
Days
Fig 2. Damping depth of layer 2
600
500
DD3
600
500
DD3
400
300
200
100
DD3
400
300
200
100
DD3
0
0
0
2
4
6
8
0
2
4
6
8
Fig 3. Damping depth of layer 3
600
500
DD4
400
300
200
100
0
0 2 4 6 8
DD4
Fig 4. Damping depth of layer 4
The maximum damping depths from the surface to each layer are noticed to be very high on the second day compared to those of other days (Table 3, Figs 1-4). This may be due to rainfall of the previous day that increases the thermal conductivity of the soil for temperature to flow deeper into the ground. The same condition also prevail on the seventh day values of damping depth where the rainfall duration and intensity of the previous fifth day may be ower than that of the first day resulting in seco nd realm of high damping depth for which complex property of subsurface delayed.
CONCLUSION AND SUGGESTION ON FURTHER RESEARCH
The damping depth formula derived from heat equation showed that external conditions (like rainfall fluctuations) and layers of soil depth can influence damping depth apart from the type of lithology and subsurface temperature changes. More research should be done to check the effect of several temperature or rainfalls days and rainfall length on different soil damping depth so as to develop a real database with which to check if there is anomalous heat coming from the subsurface that may emanate from volcanic development, tremor or earthquake frictional activity. This instrument apart from being useful for hydrothermal electricity generation geophysical studies will be good for environmental monitoring to serve as precautionary studies or research to reduce hazards. A real time remote sensed logger EEPROM digital controlled microcontroller based thermometer with four pole four throw switches (looped or connected to several temperature sensors and microcontroller ADC ports) is useful to select the layer whose temperature is to be measured with automatic display of several layers and for computation of damping depths should be developed.
REFERENCES
-
Assael, M. J., K. Gialou, K. Kakosimos, and I. Metaxa. 2003. Thermal Conductivity of Reference Solid Materials in Fifteenth Symposium on Thermophysical Properties June 22- 27, 2003, Boulder, Colorado, NIST/ASME.
-
David M. 1981: Energy at the surface of the Earth: An introduction to the Energetic of Ecosystems, Academic press, International Geophysical Series, Vol. 29.
-
Flynn, D. R., and R. Gorthala. 1997. Early-Time Estimation of the Thermal Resistance of Flat Specimens Theoretical Analysis for Pure Conduction in a Homogeneous Material, in: Insulation Materials: Testing and Applications: Third Volume, ASTM STP 1320, R. S.
-
Hulstrom, L. C., R. P. Tye, and S. E. Smith, 1985. Round-Robin Testing of Thermal Conductivity Reference Materials, in Thermal Conductivity 19, Proceeding of the 19th International Thermal Conductivity Conference, 1985, Cookeville, Tennessee. D. W.
-
Hust, J. G., J.E. Callanan, and S. A. Sullivan. 1985. Specific Heat of Insulations in Thermal Conductivity 19, Proceeding of the 19th International Thermal Conductivity Conference, 1985, Cookeville, Tennessee. D. W. Yarbrough, ed. New York: Plenum Press, pp.533-550.
-
Lee, H. L., and D. P. H. Hasselman. 1985. Comparison of Data for Thermal Diffusivity Obtained by Laser-Flash Method Using Thermocouple and Photodetector, J. Amer. Ceramic Society, 68(1): C-12 C-13.
-
Nicolau, V.P., S. Guths, and M. G. Silva. 2002. Thermal Conductivity and Specific Heat of Low Conductivity Materials Using Heat Flux Meters, in The 16th European Conference on Thermophysical Properties, Imperial College, London.
-
Tikhonov, A. N., and A. A. Samarskii. 1963. Equations of Mathematical Physics, Dover Publications, Inc., pp. 515-516.
-
www.mikroe.com, accessed date 12th August 2010
-
APPENDIX 1
//C code for retrieving sensed positive or negative temperature by LM34DZ and computing values of //temperature with PIC18F4520
// the "sbit BackLight at RA1_bit;" line
sbit FAN at RA2_bit;// TO tie fan to pin 2 in the A outputs FAN=0;//means set fan off
//after the "tempinC = temp_whole*10+temp_fraction;" line if( tempinC>27 && FAN==0)FAN=1;
if( tempinC<20 && FAN==1)FAN=0;
getting a temperature from the LM34DZ thermistor
*/
// LCD module connections sbit LCD_RS at RC4_bit; sbit LCD_EN at RC5_bit; sbit LCD_D4 at RC0_bit; sbit LCD_D5 at RC1_bit; sbit LCD_D6 at RC2_bit; sbit LCD_D7 at RC3_bit;
sbit LCD_RS_Direction at TRISC4_bit; sbit LCD_EN_Direction at TRISC5_bit; sbit LCD_D4_Direction at TRISC0_bit; sbit LCD_D5_Direction at TRISC1_bit; sbit LCD_D6_Direction at TRISC2_bit; sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections
// Back Light Switch connected to RA1
sbit BackLight at RA1_bit;
//Messages
char message0[] = "LCD Initialized"; char message1[] = "Room Temperature";
// String array to save values to display char *tempC = "000.0";
char *tempF = "000.0";
// Variables to store temperature register values unsigned int temp_whole, temp_fraction, temp_value; signed int tempinF, tempinC;
unsigned short C_Neg=0, F_Neg=0, TempH, TempL; void Display_Temperature() {
// convert Temp to characters if (!C_Neg) {
if (tempinC/1000)
// 48 is the decimal character code value for displaying 0 on LCD tempC[0] = tempinC/1000 + 48;
else tempC[0] = ' ';
}
tempC[1] = (tempinC/100)%10 + 48; // Extract tens digit tempC[2] = (tempinC/10)%10 + 48; // Extract ones digit
// convert temp_fraction to characters
tempC[4] = tempinC%10 + 48; // Extract tens digit
// print temperature on LCD Lcd_Out(2, 1, tempC);
if (!F_Neg) {
if (tempinF/1000)
tempF[0] = tempinF/1000 + 48; else tempF[0] = ' ';
}
tempF[1] = (tempinF/100)%10 + 48; // Extract tens digit tempF[2] = (tempinF/10)%10 + 48;
tempF[4] = tempinF%10 + 48;
// print temperature on LCD Lcd_Out(2, 10, tempF);
}
// ISR for LCD Backlight void interrupt(void){
if (INTCON.INTF == 1) // Check if INTF flag is set
{
BackLight =~BackLight; // Toggle backlight Delay_ms(300) ;
INTCON.INTF = 0; // Clear interrupt flag before exiting ISR
}
}
void main() { TRISC = 0x00 ;
TRISA = 0b00001100; // RA2, RA3 Inputs, Rest O/P's ANSEL = 0b00000000;
PORTA = 0b00000000; // Start with Everything Low PORTC = 0b00000000; // Start with Everything Low CMCON0 = 0b00000111;
Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // CLEAR display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off BackLight = 1;
Lcd_Out(1,1,message0); Delay_ms(1000);
Lcd_Out(1,1,message1); // Write message1 in 1st row
// Print degree character Lcd_Chr(2,6,223); Lcd_Chr(2,15,223);
// different LCD displays have different char code for degree
// if you see greek alpha letter try typing 178 instead of 223 Lcd_Chr(2,7,'C');
Lcd_Chr(2,16,'F');
// Interrupt Setup
OPTION_REG = 0x00; // Clear INTEDG, External Interrupt on falling edge INTCON.INTF = 0; // Clear interrupt flag prior to enable
INTCON.INTE = 1; // enable INT interrupt INTCON.GIE = 1; // enable Global interrupts
do {
//— perform temperature reading Ow_Reset(&PORTA, 5); // Onewire reset signal
Ow_Write(&PORTA, 5, 0xCC); // Issue command SKIP_ROM Ow_Write(&PORTA, 5, 0x44); // Issue command CONVERT_T INTCON.GIE = 1; // 1-wire library disables interrpts Delay_ms(600);
Ow_Reset(&PORTA, 5);
Ow_Write(&PORTA, 5, 0xCC); // Issue command SKIP_ROM Ow_Write(&PORTA, 5, 0xBE); // Issue command READ_SCRATCHPAD
// Read Byte 0 from Scratchpad TempL = Ow_Read(&PORTA, 5);
// Then read Byte 1 from Scratchpad TempH = Ow_Read(&PORTA, 5); temp_value = (TempH << 8)+ TempL ;
// check if temperature is negative if (temp_value & 0x8000) { C_Neg = 1;
tempC[0] = '-';
// Negative temp values are stored in 2's complement form temp_value = ~temp_value + 1;
}
else C_Neg = 0;
// Get temp_whole by dividing by 2 temp_whole = temp_value >> 1 ;
if (temp_value & 0x0001){ // LSB is 0.5C temp_fraction = 5;
}
else temp_fraction = 0;
tempinC = temp_whole*10+temp_fraction;
if(C_Neg) {
tempinF = 320-9*tempinC/5; if (tempinF < 0) {
F_Neg = 1; tempF[0] = '-';
tempinF = abs(tempinF);
}
else F_Neg = 0;
}
else tempinF = 9*tempinC/5 + 320;
//— Format and display result on Lcd Display_Temperature();