Neelamegam 2010

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

ISSN 00204412, Instruments and Experimental Techniques, 2010, Vol. 53, No. 4, pp. 591–595. © Pleiades Publishing, Ltd.

, 2010.

PHYSICAL INSTRUMENTS FOR ECOLOGY,


MEDICINE, AND BIOLOGY

ATMEGA32 Microcontroller Based Conductivity Measurement


System for Chloride Estimation of Soil Samples1
P. Neelamegama and R. Vasumathib
a
Department of Electronic and Instrumentation Engineering, SASTRA University, Tanjore, Tamil Nadu, India
email: [email protected]
b PG and Research Department of Physics, AVVM Sri Pushpam College, Poondi, Tanjore, Tamilnadu, 613503 India

Received October 26, 2009

Abstract—This paper presents the development of an inexpensive and portable microcontroller based instru
ment set up to measure the electrical conductivity of the soil samples and hence to determine the Chloride
concentration using empirical relation between the two parameters. A dedicated ATmega32 microcontroller
and its associated peripherals are employed to measure electrical conductivity and temperature. A special fea
ture of the designed instrument is that the conductivity temperature compensation can be achieved by soft
ware or the user can maintain the sample at desired temperatures by using the temperature controller.
An empirical relationship between Chloride concentration and electrical conductivity of soil samples has
been developed using Linear Regression Model, which gave a Correlation Coefficient of R = 0.95 (n = 20),
Slope = 14.95, and Intercept = –563.9. The obtained results are compared with the ELICO CM 180 con
ductivity meter to check the accuracy of the designed instrument, which gives a correlation coefficient of
R = 0.98 (n = 20).
DOI: 10.1134/S0020441210040214

1
1. INTRODUCTION tivity with the Chloride concentration of the soil sam
ples using regression model.
Electrical conductivity is a general indicator of
water quality, especially a function of the amount of
dissolved salt, and can be used to monitor processes in 2. EXPERIMENTAL
the wastewater treatment that causes changes in total 2.1. Design of the Measurement System
salt concentration and thus changes the conductivity.
Recently different circuits have been presented to The block diagram of microcontroller based elec
measure conductivity, from the application point of trical conductivity measurement set up is shown in
view. In [1] a circuit model is presented which Fig. 1. The conductivity cell made up of platinum is
responds to the electric behavior in conductivity fre used to measure the conductivity of the samples is kept
quency. In [2] an analog interface is presented which in block 1. The cell constant is determined conve
provides good accurate results but with a fourelec niently by calibration with pattern solutions [6].
trode cell. In [3] an electronic conditioning circuit, Polarizing the conductance cell by an external DC
based on a variant of Wheatstone bridge is presented potential produces some undesirable effects (double
with the help of a digital processing stage based on a layer capacitance, electrolysis, ohmic resistance and
microcontroller. electrolytic saturation). On the other hand, it is proved
In the present work, option is provided for the con that the electrolytic saturation is reduced considerably
ductivity temperature compensation by software or if the AC polarization frequency is high enough. Prac
the user can measure the conductivity by keeping the tical values are (1–5 kHz) although those values must
sample at a desired temperature for the analysis of not be high in excess because it would appear the effect
conductivity variation with temperature. The conduc of the capacitance in parallel with the electrolytic
tivity of a solution is proportional to its ion concentra solution itself [7]. Hence, a fixed sinusoidal excitation
tion, and if Chloride is the predominant anion in a soil voltage of 1 V is applied to the bridge.
solution, the Chloride concentration in m mole would The conductivity cell is connected to one arm of a
be approximately equal to 10 times the electrical con modified Wheatstone’s bridge network. The block 2
ductivity measured in dS/m [4, 5]. In this experimen consists of precision rectifier to rectify the output of
tal study, we use the ATmega32 microcontroller bridge network. Block 3 represents the temperature
mounted in the system, to correlate electrical conduc sensor LM35D to measure the temperature of the
sample. Output of this sensor calibrated directly to
1 The article is published in the original.
Celsius does not require any external calibration. The

591
592 NEELAMEGAM, VASUMATHI

1 2 4
Conductivity Precision Keypad
cell rectifier
5
Micro
3 controller 7
LM35D LCD

6
8 9
Temperature
MAX232 PC
controller

Fig. 1. Block diagram of microcontroller based electrical conductivity instrumentation set up.

В 3 IС1
R2 R3 R4
6
Z1
I1 2

Z3 3
IС3 3
IС4
D1
I3 6 6
С 2 2 To pin 38 of MC
Rf R1
AC
input Z2 Z4 D2
I2 I4
3 IС2
R5
D 6

Fig. 2. AC modified Wheatstone’s bridge network with precision rectifier. (IC1–IC4) CA3041.

effect of temperature is important when an electric inverting terminal connected to the ground circuit.
conductivity of a liquid or solution must be done. The bridge output nodal points B and D almost at the
Block 4 indicates keypad to give input data to the same potentials with respect to the ground and hence
microcontroller for processing. Block 5 consists of the effect of stray capacitance that will exist between
ATmega32 microcontroller from Atmel company. It is them and also between them and ground is assumed to
a low power, high performance 8bit AVR microcon be minimized. Since, B and D are at virtual ground,
troller with 32 kbyte in System Programmable Flash, the sinusoidal supply voltage, V = Vsinωt, the current
one 16bit timer/counter and two 8bit timer/counter, through the bridge impedances are Z1, Z2, Z3, and Z4
an eight channel 10bit ADC [8], 32 programmable respectively. The output voltage of the circuit is [3]
I/O lines in four I/O ports and 2 kbyte of SRAM. Tem Vo = Rf (Z2Z3 – Z1Z2]V.
perature controller kept in the block 6 is used to keep
the sample at a desired temperature. Block 7 is a four At balance condition of the bridge, Vo = 0 which is
rows twenty characters LCD (Liquid Crystal Display) identical with the conventional bridge network. The
from Hitachi, to display the experimental results. conductivity cell is connected instead of Z3. The con
Block 8 consists of MAX232 (dual RS232 transmit ductivity of a sample is determined by
ter/receiver interface), which is used to communicate
with PC kept in block 9. 1/Z3 = Gc = (Z1Z4/RiVi + VoZ1Z4/Z2)–1,
where Vo —bridge output voltage, Vi —input excita
2.2. AC Modified Wheatstone’s Bridge Network tion voltage, Z1, Z2, Z4 —known resistances, Rf —feed
back resistance, and Gc —conductivity of a sample.
A modified AC Wheatstone bridge network is
shown in Fig. 2. In the developed instrument, two high The output of the amplifier IC2 is given to input of
gain operational amplifiers (CA3041) IC1 and IC2 are the precision rectifier constructed with operational
connected with the bridge network with the non amplifiers IC3 and IC4 as shown in Fig. 2.

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 53 No. 4 2010


ATMEGA32 MICROCONTROLLER BASED CONDUCTIVITY MEASUREMENT SYSTEM 593

+5 V
LM35D ATmega32
8 1
+5 V +VS Vout VCC
GND
4 40
R PA0/ADC0
39
PA1/ADC1
O/P from AC Wheatstone’s bridge 38
PA2/ADC2
37 22

Key pad
+5 V PA3/ADC3 PC0/SCL
36 23
PA4/ADC4 PC1/SDA
+12 V +5 V R 35 24
PA5/ADC5 PC2/TCK
34 25
PA6/ADC6 PC3/TMS
opto transistor

Heater coil 33 26
5 PA7/ADC7 PC4/TD0
R Q
1 1 27
PB0/T0 PC5/TD1
MCT2E 28
2
D 2 PB1/T1 PC6/TOSC1 MAX232
4 3 29 PC
PB2/AIN0 PC7/TOSC2
Q 4 14
PB3/AIN1 PD0/RXD D4
BDX33C Q 15
5
PB4/SS PD1/TXD D5
BC547
6 16
R PB5/MOSI PD2/INT0 D6
+5 V LCD
7
PB6/MISO PD3/INT1 17 D7
8
C PB7/SCK PD4/OC1B 18 RS
9
RESET PD5/OC1A 19 EN
13 R/W
XTAL1 PD6/ICP1 20
X 12
XTAL2 PD7/OC2 21
32
AREF
30
AVCC
31
AGND

GND
11

Fig. 3. Microcontroller and interfacing circuit.

2.3. Microcontroller and Interfacing Circuit 2.4. Software


The circuit diagram of the microcontroller based Software is developed in C and assembly language
instrumentation set up to measure the electrical con to initialize LCD, to compute conductivity tempera
ductivity of the sample is shown in Fig. 3. In this cir
ture compensation by software, to keep the sample at
cuit, the output from the modified Wheatstone’s
bridge network is given to pin 38 (ADC2) of micro desired temperature using temperature controller, to
controller. The temperature sensor LM35D is con start AD conversion, to check End of conversion, to
nected to pin 39 (ADC1) of port A. A crystal oscillator read 10 bit of data from ADC, to measure the temper
of 8 MHz is connected between pin 12 and 13 of ature, to control the temperature, to compute conduc
microcontroller as shown in Fig. 3. Three keys are tivity, to compute Chloride concentration using
connected to PC0, PC1, and PC2 port C. A four rows regression model, to display the results in LCD, and to
twenty characters LCD is connected with port D, to send data to PC for further processing.
display the measured data and the computed results.
The temperature controller built with optocoupler
transistor and heater coil with battery (12 V, 7 A h), 3. SOIL SAMPLING
Exide power safe, ShinKobe Electric machinery Co.
Ltd, Japan, and other associated components is also 3.1. Field Description
shown in Fig. 3. An opto transistor MCT2E is used to
isolate temperature controller section from the micro Soil samples are collected from twenty paddy field
controller circuit. The opto coupler is activated/deac sites originated from ThanjavurThiruvarur Delta dis
tivated through the transistor BC547, which is con tricts, TN, South India, where rice is the main crop of
nected to PA7 of microcontroller. By proper com several agricultural products. The samples are col
mands from the microcontroller, heater is switched
ON/OFF to maintain the temperature of the sample lected at every 3 km from Thanjavur to Thiruvarur over
at desired temperature. MAX232 (dual RS232 trans 60 km, during the major cropping season of spring
mitter/receiver interface) is connected with pin 14 and summer (March–June), which produces about 56%
15 of port D to transmit/receive data from PC. of the National total production.

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 53 No. 4 2010


594 NEELAMEGAM, VASUMATHI

Electrical conductivity, mS/cm (1 kΩ). A fixed sinusoidal excitation voltage of 1 V


30 with frequency 1 kHz is applied to the bridge. For the
calibration of the instrument, the known concentra
25 tions of NaCl are prepared and the conductivity is
measured before using the soil samples. The solution is
20 maintained at 25°C by means of temperature control
ler. Initially, the conductivity cell is immersed into the
15 solution of NaCl having concentration of 0.1N, and
the electrical conductivity is measured. Then the
10 probe is washed with deionised water and the electrical
conductivity for various concentrations 0.2 N, 0.3 N,
5 0.4 N, and 0.5 N are measured. Then, the conductivity
cell is immersed in the prepared soil sample and the
0 measurements are made for electrical conductivity.
0.1 0.2 0.3 0.4 0.5
NaCl concentration, N
The Chloride concentration of the prepared soil sam
ples is determined using the titration method for the
Fig. 4. Electrical conductivity measured for known con
development of regression model.
centration of NaCl solution using developed instrument.
3.5. Development of Regression Model
3.2. Soil Sample Collection The Chloride concentration of the sample is
Sampling areas of paddy fields are selected by strongly related to the electrical conductivity of the
avoiding tracks, drainage lines, sheep camp, or influ sample, a relation between them is evaluated using lin
ences other than effluent irrigation. During collection, ear regression model (using software ULTI
the size of the sample (volume or weight), identifica MACALC).
tion of sample (unique labeling), special packaging The regression line equation y = –563.9 + 14.95x is
and storage are noted. After collection of the samples, obtained and it is used by the microcontroller to com
they are airdried to remove moisture. pute Chloride concentration of the soil. The correla
tion coefficient between the electrical conductivity
and the Chloride concentration is R = 0.95 (n = 20).
3.3. Sampling Procedure
The collected soil samples are dried overnight in a 4. RESULTS AND DISCUSSION
cabinet equipped with a heating element and an
exhaust fan to remove moisture. The temperature in The developed microcontroller based instrument is
the cabinet does not exceed 36°C in order to approxi used to measure the conductivity of the soil samples.
mate airdrying conditions. Samples are crushed with a The empirical relationship between the electrical con
mechanical grinder equipped with porcelain mortar ductivity and the Chloride concentration has been
and stainless steel 10 mm mesh sieve to remove larger developed using linear regression model to determine
clods and unwanted debris. Since the material from the Chloride concentration of the sample. The perfor
the particle sizing 2 mm and smaller are most impor mance of the designed instrument is investigated by
tant in making an inventory of the mineral constitu comparing the results with the standard instrument
ents of the soil and in evaluating EC, the sample is (ELICO CM 180).
crushed again and the particles sizing 2 mm and less The calibration curve is obtained by plotting the
than 2 mm are sieved using 2 mm mesh. The sample is concentration of Chloride against the electrical con
prepared as given below to measure the conductivity. ductivity of prepared NaCl solutions at various con
Three 10 g scoops of soil and 30 ml of deionized water centrations as shown in Fig. 4. From the figure, it is
are taken in a large test tube and shaken well for 30 min observed that the developed instrument shows the lin
to get 1:1 suspension of soil sample. After initial shak earity between the Chloride concentration and the
ing, the suspension is allowed to stand, with intermit electrical conductivity. The regression line between
tent shaking for 30 min [9]. The supernatant solution the electrical conductivity measured for soil samples
is then filtered and it is used for the measurement of using the developed instrument and the commercially
electrical conductivity. available ELICO CM 180 instrument is: y = –1.10 +
1.07x, and the correlation coefficient for this line is
R = 0.98 (n = 20). The reproducibility of the instru
3.4. Measurement ment is tested by taking five replicate readings for soil
To measure the electrical conductivity of the sam sample and it is found to agree well within the limits.
ple, the conductivity cell is connected at one arm of In this study, it is observed that the range of electri
the modified AC Wheatstone bridge and selecting the cal conductivity of soil samples are varied from 45 to
resistance value Z1 (100 Ω or 1 kΩ), Z2 (1 kΩ), and Z4 74 mS/cm and the Chloride concentration is maxi

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 53 No. 4 2010


ATMEGA32 MICROCONTROLLER BASED CONDUCTIVITY MEASUREMENT SYSTEM 595

mum at Ammaiyappan (560 ppm) and minimum at tivity in Aqueous Solutions, Proc. 17th IEEE Instru
Kattuthottam (140 ppm). It is also to be noted that all mentation and Measurement Technology Conference,
the collected paddy field soil samples are having the Baltimore, 2000.
Chloride concentration within the maximum tolera 2. Li, X. and Meijer, G.C.M., A LowCost and Accurate
ble limit (1050 ppm). Interface for Conductivity Sensors, Proc. 19th IEEE
Instrumentation and Measurement Technology Confer
ence, Anchorage, AK, USA, 2002.
5. CONCLUSIONS 3. Rajendran, A. and Neelamegam, P., Measurement,
ATmega32 microcontroller based instrumentation 2004, vol. 35, p. 59.
system has been developed to compute Chloride con 4. Abyaneh, H.Z., Nazemi, A.H., Neyshabori, M.R.,
centration of the soil samples using electrical conduc et al., Tarim Bilimleri Dergisi, 2005, vol. 11, no. 1,
tivity. The design allows an efficient and easy solution p. 110.
to the thermal compensation needed in this type of 5. Hajrasuliha, S., Cassel, D.K., and Rezainejad, Y., Geo
measurements. This system is a portable one and can derma, 1991, vol. 49, p. 117.
be easily handled by irrigators and farm managers. The 6. Braunstein, J. and Robbins, G.D., J. of Chemical Edu
electrical conductivity determination has replaced the cation, 1981, vol. 48, no. 1, p. 52.
tedious chemical methods for the Chloride determi
nation. The results are comparable with the values 7. Sensors. A Comprehensive Survey, Chemical and Bio
reported using the standard method. chemical Sensors, Gopel, W., Hesse, J., and Zemel,
J.N., Eds., part I, vol. 2, Weinheim: VCH, 1991.
8. ATmega32 Microcontroller data sheet [www.atmel.com].
REFERENCES 9. Recommended Chemical Soil Test Procedures for the
1. Ferrara, E., Callegaro, L., and Durbiano, F., Optimal North Central Region. North Central Regional Publi
Frequency Range for the Measurement of AC Conduc cation, no. 221, NDSVBull., 1988, no. 499.

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 53 No. 4 2010

You might also like