Daniel K. Fisher - Irrigation Association...the MPX5010, and 0.76 kPa (0.11 psi) with the MPX5700....

12
MODERN ELECTRONICS FOR AGRICULTURE Daniel K. Fisher USDA Agricultural Research Service Application and Production Technology Research Unit 141 Experiment Station Road Stoneville, Mississippi 38776 USA Written for presentation at the 25th Annual International Irrigation Show Sponsored by the Irrigation Association Tampa Convention Center Tampa, Florida USA 14 - 16 November 2004 ABSTRACT The field of electronics continues to change and evolve rapidly. Electronics are increasingly being used to collect and process all types of data, transfer information, make decisions, and provide automation and control functions. Modern microcontrollers and semiconductor components offer many advantages and ease of use in designing custom measurement and control systems. An array of microcontrollers, sensors, and accessory components are presented and their features, capabilities, and costs are discussed. Several measurement and datalogging circuits were designed for use in irrigation-related research activities. The design, implementation, and performance of these systems are described. Keywords: electronics, automation, microcontrollers, sensors

Transcript of Daniel K. Fisher - Irrigation Association...the MPX5010, and 0.76 kPa (0.11 psi) with the MPX5700....

  • MODERN ELECTRONICS FOR AGRICULTURE

    Daniel K. Fisher

    USDA Agricultural Research ServiceApplication and Production Technology Research Unit

    141 Experiment Station RoadStoneville, Mississippi 38776 USA

    Written for presentation at the25th Annual International Irrigation ShowSponsored by the Irrigation Association

    Tampa Convention CenterTampa, Florida USA

    14 - 16 November 2004

    ABSTRACT

    The field of electronics continues to change and evolve rapidly. Electronics are increasingly beingused to collect and process all types of data, transfer information, make decisions, and provideautomation and control functions. Modern microcontrollers and semiconductor components offermany advantages and ease of use in designing custom measurement and control systems. An arrayof microcontrollers, sensors, and accessory components are presented and their features,capabilities, and costs are discussed. Several measurement and datalogging circuits were designedfor use in irrigation-related research activities. The design, implementation, and performance ofthese systems are described.

    Keywords: electronics, automation, microcontrollers, sensors

  • MODERN ELECTRONICS FOR AGRICULTURE

    The field of electronics continues to change andevolve rapidly. Electronic components andassemblies can be found in a wide variety ofindustrial and commercial products, and with awide variety of functions and capabilities.Modern household appliances, toys, andautomobiles often contain microprocessors,sensors, displays, and data storage and transfersystems.

    Electronics are increasingly being used tocollect and process all types of data, transferinformation, make decisions, and provideautomation and control functions. Electroniccomponents are increasing in their capabilities,while becoming easier to use, smaller in size,and cheaper to buy. Many more specializedcomponents and sensors are available whichinterface easily and simplify circuit design.

    The microcontroller is an important element inmodern electronics, and has brought about achange in the way electronic circuits aredesigned. A microcontroller is a device thatinterfaces with external components, can inputand output information to and from theseexternal components, and can be programmedby the user. It is similar to the centralprocessing unit (CPU) of a personal computer inthat it is very flexible and can be programmed todo a wide variety of things.

    In the past, significant electronics expertise andexperience were required to design a circuit.Now, with a microcontroller, a circuit can bedesigned much more simply because many ofthe desired functions can be accomplished inthe microcontroller’s software. Examples offunctions easily accomplished with amicrocontroller include; timing (doing somethingat regular intervals, or measuring elapsed timebetween events); calibration (converting a rawmeasurement to a quantity in the desired units);accurate signal measurement (measuring avoltage level or frequency from a sensor); dataoutput (transferring measured data orinformation to another device, computer, ordisplay).

    The number and capabilities of semiconductorsensors and auxiliary components that interfaceeasily with microcontrollers have also increased.Many components, such as sensors, clocks,memory chips, and display units are designed toconnect directly to microcontrollers, operateover compatible voltage ranges, andcommunicate easily with one another. Thesecomponents usually require minimal externalcircuitry, have low power requirements, and arecontrolled in software.

    These modern electronic components can beput to use in agriculture as in the many otherapplications in which they already serve. Theavailability, compatibility, and ease of usecombine to offer many advantages to usingmicrocontrollers and semiconductor componentsto create measurement and control systems.

    The objective of this paper is to present anddiscuss some of the current, powerful,inexpensive, and easy-to-use electroniccomponents available to and of potential use inagricultural research. The function, operation,and costs of some of these components will bediscussed, and a number of examples of theiruse will be presented.

    MATERIALS

    Microcontrollers

    The number of manufacturers, number andvariety of products, and capabilities of theproducts continue to grow each year. Cravotta(2004) lists 45 manufacturers of microcontrollerproducts, and gives an overview of the targetapplications, users, and capabilities of eachmanufacturer’s product lines. Rather thandiscussing the many microcontroller options,capabilities, and differences, however,experiences with two microcontrollers from onemanufacturer will be presented.

  • The PIC microcontrollers from Microchip(Microchip Technology Inc. 1, Chandler, ArizonaUSA, www.microchip.com) were chosen due totheir widespread use and availability, ease ofprogramming, low cost, and advanced features.PIC microcontrollers are among the mostpopular in use today, and are used in manydiverse applications. Much information isavailable, especially on the Internet, in the formof application notes, project descriptions anddocumentation, circuit diagrams andschematics, program code, and user forums.

    PIC microcontrollers are available in a range ofsizes and features. Sizes range from 8 pins to84 pins. Available features include digital andanalog input and output, analog-to-digital (A-D)converters, serial ports, USB capability, varyingprocessor speeds, built-in oscillators, timers,and varying amounts of program memory.

    The work presented in this paper wasaccomplished using two different PICmicrocontrollers, the 16F819 and the 16F877.The 16F819 was chosen for its size andfeatures: it has 16 input/output pins, five 10-bitanalog-to-digital converters, a built-in oscillator,an adjustable processor speed, serial-portcapability, and a large program memory area.The 16F877 has similar capabilities, but withadditional input/output pins.

    Programming

    An additional reason for selecting the PICmicrocontrollers was for their ease inprogramming. A number of programmingenvironments are available for PICmicrocontrollers, including assembly language,C compliers, and BASIC compilers.Programming environments are available free ofcharge, including an assembly-languageprogramming environment provided byMicrochip, while others can be purchased.Many code examples and complete programs

    1 The mention of trade or manufacturer names isfor information only and does not imply anendorsement, recommendation or exclusion byUSDA-Agricultural Research Service.

    for these and other programming environmentscan be found on the Internet.

    Among the simplest programming environmentsare PicBasic and PicBasic Pro(MicroEngineering Labs, Inc., Colorado Springs,Colorado USA). These versions of the BASICprogramming language include many functionswhich greatly simplify the programming of themicrocontrollers. Functions are included forusing the PICs’ analog-to-digital converters,communicating with other digital chips viacommon protocols (such as I2C and SPI),outputting information to serial ports and LCDdisplays, measuring frequencies andpulsewidths, outputting analog signals, andenabling interrupts and power-saving features.Once a program has been written, the PicBasiccompiler converts the BASIC program to theproper format for downloading to a PIC. Whilethe PicBasic programming environments are notfree (PicBasic costs about US$100, PicBasicPro about US$240), they are much easier tolearn and use than assembly language.

    A hardware interface is required to download thecompiled program to the microcontroller. Onesuch interface, the EPIC programmer(MicroEngineering Labs, Inc.), connects to acomputer’s parallel port, includes software forediting and downloading a program, iscompatible with most PIC microcontrollers, andcosts about US$60. Other programmers areavailable for purchase, and many plans andschematics can be found on the Internet forbuilding simple programmers.

    Sensors

    Many different sensors are available formeasuring a variety of variables. Theseinexpensive, semiconductor sensors operate inlow voltage ranges and interface easily withmicrocontrollers. Examples of sensors availablefor measuring parameters of interest inagriculture are discussed in Fisher et al. (2003)and presented herein.

    Temperature

    Analog temperature sensors are available whichoutput a voltage that is linearly proportional to

  • temperature. The LM35 (NationalSemiconductor), for example, requires anexcitation voltage of 5 Vdc, and is calibrated tooutput a voltage with a 10 mV / oC scale factor.The output voltage is read with an analog-to-digital converter, and the voltage is converted toa temperature reading in the microcontroller’ssoftware. The LM35 temperature sensor costsabout $2.

    Infrared thermometer

    In some applications, a non-contact or remotetemperature measurement is required. TheMX90601 (Melexis) infrared thermometermodule was designed for automotive andconsumer appliance applications, and providesremote and ambient temperature measurementsin analog voltage and digital signal form. Themodule requires an excitation voltage of 5 Vdc,and the analog output voltage can be read withthe microcontroller’s A-D converter. The voltageis then converted to temperature in themicrocontroller’s software using themanufacturer’s calibration equation. TheMX90601 infrared thermometer module costsabout $53.

    Pressure

    A family of pressure sensors manufactured byMotorola is particularly well-suited for use withmicrocontrollers. The MPX5xxx sensors areavailable in a number of pressure ranges: from0 – 10 kPa (0 - 1.45 psi) with the MPX5010, to 0– 700 kPa (0 - 101.5 psi) with the MPX5700.The sensors require a 5 Vdc excitation signaland return a signal in the range of 0.2 to 4.7Vdc. The PIC microcontroller’s internal 10-bit A-D converters provide pressure measurementswith a resolution of 0.011 kPa (0.0016 psi) withthe MPX5010, and 0.76 kPa (0.11 psi) with theMPX5700. The MPX5xxx series of sensors costabout $20 each.

    Object detection / distance

    Non-contact or remote distance/depthmeasurements can be made using ultrasonicrangefinders similar to those used in autofocuscameras. The Devontech SRF04 rangefinder isa module that contains an ultrasonic transmitterand a detector, and interfaces easily with amicrocontroller. The microcontroller triggers the

    transmitter, which sends a pulse, and measuresthe length of time for the pulse to return. Themicrocontroller then calculates the distancebased on the time interval. The SRF04 canmeasure distances within a range of 3 cm to 3m, and costs about $35.

    Other variables

    Additional semiconductor sensors are availablefor measuring many other variables, andinterface easily with microcontrollers. There aresensors for measuring acceleration, humidity,proximity, illumination, location (GPScoordinates), and rotation, for example. Manyof the sensors return an analog voltage in therange of 0 to 5 Vdc, a digital signal, or afrequency, and require an excitation voltage of 5Vdc. Other sensors, such as soil-moisturesensors, strain-gage loadcells, and conductivitysensors, which are often connected to traditionaldataloggers, may also be suitable for use withinexpensive microcontrollers.

    Auxiliary Components

    Additional components are usually required toprovide other, necessary functions and completethe measurement system. While themicrocontroller provides many of the control andprocess functions, additional components maybe needed for timekeeping, data storage,peripheral equipment control, and datatransmission.

    Timekeeping

    Real-time clocks provide time and date functionsvery simply. Real-time clocks such as theDallas Semiconductor DS1307 and DS1337interface easily to a microcontroller and areaccessed by the microcontroller’s software. Acrystal oscillator connects to the clock chip toprovide an accurate timing signal, and a backupbattery maintains operation when themicrocontroller is in low-power sleep mode or isdisconnected from its power source. TheDS1307 costs $2, the DS1337 costs $3, and anoscillator costs $0.75.

  • Storage memory

    Most microcontrollers do not normally providememory for long-term data storage. Externalmemory chips, such as Maxim’s 24LCxxx series,are available which can store from 1 kbyte to512 kbytes of data. The non-volatile memory isaccessed via the microcontroller’s software, anddata can be written and read randomly. Thechips cost about $2 each.

    Analog-to-digital converters

    While many microcontrollers have internalanalog-to-digital converters, a variety of externalA-D converters are available. External A-Dconverters can provide higher resolutions, fastermeasurements, differential voltagemeasurements, and multiple input channels.The MAX340x series from Maxim, for example,can be programmed to provide variableresolutions ranging from 8- to 16-bits. A lower-resolution setting can be used if less accuracybut a higher sampling rate is needed, while ahigher-resolution setting allows for greateraccuracy but more time required for eachmeasurement. The MAX340x ADCs cost about$5 each.

    LCD displays

    Simple and inexpensive LCD displays can beconnected for displaying text, while moreexpensive displays can be used to displaygraphics. The microcontroller can beprogrammed to read pushbuttons or keypads toallow users to select options, use menus, orinput information to the microcontroller.

    RF transmitters and receivers

    Radio frequency (RF) transmitters and receiversprovide remote sensing, control, and datatransmission capabilities. RF transmitters andreceivers connect directly to the microcontrollerswith no external components, other than anantenna, and operate with simplemicrocontroller programming. Transmissionranges up to about 300 ft are common, andseveral frequencies are available which requireno FCC licenses for use. One example, theTXS-434 (Laipac), costs about $5.

    EXAMPLE APPLICATIONS

    Collecting agricultural field data can be labor-intensive, time-consuming, and costly. Byautomating sensor measurements, data can becollected much more frequently and reliably withmuch less effort. A few examples of data-collection equipment constructed usingmicrocontrollers and semiconductor componentsare presented in the following sections.

    Automated Soil Moisture Monitoring

    Moisture sensors (Irrometer, Model 200SS) hadbeen installed at many locations in a number ofcotton, corn, and soybean fields at the USDAARS research station at Stoneville, Mississippi,for use in scheduling irrigations. There were 4to 18 sensor locations per field, with threesensors installed at different depths in the soilprofile at each location. In previous years,sensor readings had been collected periodicallyby a technician walking to each sensor site,attaching a hand-held electronic meter to eachsensor, taking measurements, and recording thereadings on a data sheet. Given the number ofmeasurements to be made, the time involved,and other factors, such as inclement weather,weekends and holidays, and other fieldwork,measurements from each sensor were normallycollected only once or twice per week.

    A circuit board was designed prior to the 2004growing season to automate the moisture-sensor measurements. Circuit designparameters included the ability to power themoisture sensors, make readings at regularintervals, store the readings, and operate onbattery power.

    An important consideration in powering thesensors was that the moisture sensors requiredan AC (alternating current) excitation rather thanthe DC (direct current) energy supplied by abattery. An AC circuit designed by EMESystems (EME Systems, 2002) was modifiedand used to provide the proper excitation to thesensors.

    The output signal from the sensors was in theform of a frequency which was linearly related tothe resistance of the sensor, and ultimately to

  • the water potential of the sensor/soil. Acalibration equation was developed to convertfrequency to water potential. A series of knownresistances was connected to the circuit, andthe corresponding frequency from the circuitboard was recorded. The known resistanceswere then connected to the moisture-sensormeter, and the corresponding water potentialvalues were recorded. Correlating these datayielded a calibration equation which provided awater potential value based on output signalfrequency.

    The main components of the circuit consist of amicrocontroller, AC-excitation circuit,multiplexer, real-time clock, memory chip, andbatteries. The circuit was etched onto a copper-clad circuit board. Components were thensoldered onto the board. Two temperaturesensors were added to the circuit, one tomeasure the temperature of the circuit board,and a second to measure soil temperature. Thecomponent-side of the completed circuit boardis shown in Figure 1. A list of the maincomponents and their costs is shown in Table 1.

    Figure 1. Component side of moisture-sensorcircuit board.

    Table 1. Parts list and cost of main componentson moisture-sensor circuit board

    Description Cost (US$) Part number, Manufacturer Microcontroller PIC 16F819, Microchip Technologies 3Clock DS1302, Dallas Semiconductor 3Memory 24LC512, Microchip Technologies 3Multiplexer 74HC4051, Phillips Semiconductors 1RF transmitter TX-434, Laipac 5Circuit board 1Batteries 2Miscellaneous (resistors, capacitors, pins, timer, voltage regulator) 2 total $20

    The microcontroller was programmed to makeand store measurements at 2-hour intervals.The microcontroller continuously monitored thereal-time clock, which had a backup battery tomaintain the correct time. At the beginning ofeach measurement interval, the microcontrolleractivated the AC-excitation circuit andmultiplexer chip. The multiplexer selected onesensor at a time, the AC-excitation circuitpowered the sensor, and the microcontrollermeasured the frequency. The microcontrollerprogram applied the calibration routine toconvert the frequency to water potential. Theprogram then looped and continued the sensor-measurement process by instructing themultiplexer to select the next sensor, make ameasurement, and continue until all sensors hadbeen read. The date, time, and sensormeasurements were stored in the memory chip,and the microcontroller then put itself into a low-voltage sleep mode to conserve battery poweruntil the next measurement interval.

    The circuit board was also designed to transmitthe data out of the field automatically via an on-board RF transmitter. An RF receiver circuitlocated on one edge of the field would receivethe data from all circuit boards within that field,making it quicker and easier to access the datawithout having to download the data manuallyfrom each individual circuit board. The receiver

    microcontrollerclock battery

    voltage regulator clock

    memorytemperature sensor

    timermultiplexer

    RF transmitter

    soil temperaturesensor connection

    moisture sensorconnections

  • circuit design was not completed by the time thecircuit boards needed to be deployed, however,and this feature was not enabled.

    Circuit boards were deployed in the 2004growing season to monitor moisture sensorsinstalled in corn, soybean, and cotton fields.Measurements were made at 3 depths at eachsensor location in the field. The threemeasurements were also averaged.

    Sensor readings for two one-month periods areshown in Figures 2 and 3. In Figure 2,measurements collected manually during the2003 growing season are shown. Nine visits to

    Field 3c, Site 2 (cotton): July 2003

    -200

    -180

    -160

    -140

    -120

    -100

    -80

    -60

    -40

    -20

    0

    1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31

    Soil

    Wat

    er P

    oten

    tial

    (kPa

    )

    0.0

    0.4

    0.8

    1.2

    1.6

    2.0

    2.4

    2.8

    3.2

    3.6

    4.0R

    ainf

    all,

    irrig

    atio

    n (i

    n)

    rainfallirrigation6in12in24inaverage

    Figure 2. Moisture-sensor measurementscollected manually, July 2003.

    Field 3c, Site 2 (cotton): August 2004

    -200

    -180

    -160

    -140

    -120

    -100

    -80

    -60

    -40

    -20

    0

    1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31

    Soil

    Wat

    er P

    oten

    tial

    (kPa

    )

    0.0

    0.4

    0.8

    1.2

    1.6

    2.0

    2.4

    2.8

    3.2

    3.6

    4.0

    Rai

    nfal

    l, irr

    igat

    ion

    (in)

    rainfallirrigation 6in12in24inaverage

    Figure 3. Moisture-sensor measurementscollected automatically, August 2004.

    the field were made during this time period tocollect data. Long-term trends are apparent, butconditions immediately after a rainfall orirrigation event are not detected.

    Measurements collected automatically duringthe 2004 growing season are shown in Figure 3.The field was visited normally once per week, tovisually inspect crop conditions, collect otherdata, and download moisture-sensor data.Much less time and labor were required tocollect moisture data, and a much morecomplete picture of the moisture conditions wasobtained by automating the measurements.

    Automated Evaporation Pan andAtmometer Measurements

    Recent efforts to automate evaporation pan andatmometer readings have been described.Bruton et al. (2000) used a float mechanism toautomate evaporation pan readings, butmalfunctions in the mechanism and differencesbetween manual and automated readings werenoted. Dukes et al. (2004) described a low-cost(US$200) float and pulley datalogger systemdesigned to automate atmometer readings.

    An evaporation pan and atmometer wereinstalled at the USDA ARS research station atStoneville, Mississippi, for use in irrigationscheduling of cotton. Previously, pan andatmometer measurements were made manually,requiring frequent site visits, and recorded on adata sheet.

    A circuit board was designed to automate thedata-collection process. The metal evaporationpan was first modified by drilling a hole in theside of the pan. A barbed hose fitting wasinstalled in the hole, and a differential pressuresensor was connected to the hose fitting with ashort length of plastic tubing. The atmometerwas modified in the same way: a hole wasdrilled in the side and a pressure sensor wasattached.

    The pressure sensors were used to measurethe hydrostatic pressure of the water. Thehydrostatic pressure is the pressure caused bythe weight of the water, which is a function of itsdepth. The depth of water, then, could easily be

  • determined by measuring the hydrostaticpressure and calculating the depth based on thepressure vs depth relationship for water.

    The main components of the circuit boardconsist of a microcontroller, connectors for thetwo pressure sensors, real-time clock, memorychip, and batteries. The circuit was built on aprototype board, shown in Figure 4. Themaincomponents of the circuit and their costsare shown in Table 2.

    The microcontroller was programmed to makeand store measurements at 2-hour intervals.The microcontroller continuously monitored thereal-time clock, and when time came to makemeasurements, provided an excitation voltage tothe pressure sensors. The pressure sensorswere factory calibrated to provide a voltagesignal linearly related to pressure. Themicrocontroller measured the signal voltageswith its built-in analog-to-digital converters. Themicrocontroller program contained a calibrationroutine to convert the voltage signals topressures and then to the depths of water. The

    Figure 4. Evaporation-pan and atmometermeasurement prototype circuit board.

    Table 2. Parts list and cost of main componentsfor evaporation pan/atmometer circuit

    Description Cost (US$) Part number, Manufacturer Microcontroller PIC 16F819, Microchip Technologies 3Clock DS1302, Dallas Semiconductor 3Memory 24LC512, Microchip Technologies 3Pressure sensors MPX5010D, Motorola 20 eaCircuit board 1Batteries 2Miscellaneous (resistors, capacitors, connector pins, voltage regulator) 2 total $54

    date, time, and water depth data were thenstored in the memory chip, and themicrocontroller put itself into a low-voltage sleepmode to conserve battery power until the nextmeasurement interval.

    To test the accuracy of the automatedmeasurements, manual depth measurementswere collected periodically and compared tothose made with the circuit board. Manualevaporation-pan measurements were made byreading the metal scale in the evaporation pan.Manual atmometer measurements were madeby reading the height of the water column in theclear plastic standpipe on the side of theatmometer. Data from the circuit board weredownloaded periodically, and the automated andmanual data were input to a spreadsheet foranalysis and graphing.

    Depth measurements from a 10-day period inSeptember 2004 are shown in Figure 5. Manualmeasurements were made three times duringthis period, and compare well with theautomated measurements.

    Between April and September 2004, 55 manualmeasurements were made during visits to thesite. Measurements were not made at anyregular time, rather occurred at various times ofthe day between 0800 and 1600. The manualmeasurements were compared to concurrentautomated measurements, shown in Figure 6.The automated measurements compared well

    memoryclock

    clock batterymicrocontroller

    pressure sensorconnections

  • Atmometer, Evaporation Pan: 21- 30 September 2004

    0

    2

    4

    6

    8

    10

    12

    21 22 23 24 25 26 27 28 29 30

    Dep

    th o

    f wat

    er (

    in)

    Atmometer, automatedmanualEvap pan, automatedmanual

    Figure 5. Automated and manual evaporationpan and atmometer measurements during a 10-day period in September 2004.

    y = 1.0207x - 0.1768r2 = 0.9881

    y = 1.0079x - 0.0969r2 = 0.9966

    2

    4

    6

    8

    10

    12

    2 4 6 8 10 12Depth, automated reading (in)

    Dep

    th, m

    anua

    l rea

    ding

    (in

    )

    Evaporation panAtmometer1 : 1

    Figure 6. Comparison of automated andmanual measurements.

    with the manually collected measurements.Standard errors of the automated readingscompared to the manual readings were 0.13 infor the evaporation pan and 0.12 in for theatmometer.

    Pressure Chamber Controller

    An important hydraulic property of a soil is itssoil-water retention curve. The soil-waterretention curve is the relationship between thesoil’s water content and water potential. Acommon laboratory procedure for developing

    the retention curve is described by Klute (1986),and involves determining the water content of asoil sample over a range of known waterpotentials.

    The equipment used to develop a waterretention curve normally consists of a pressurechamber and porous ceramic plate, a source ofcompressed air, and an air-pressure regulatingsystem. The compressed-air source, usually anelectric air compressor, supplies pressurized airto the pressure chamber. The pressure-regulating system maintains the pressure in thepressure chamber at the desired level.

    One pressure-chamber system is commerciallyavailable (Soilmoisture Equipment Corp., SantaBarbara, California USA). The system consistsof mechanical regulator valves, large pressuregages, metal piping, and an industrial-size aircompressor. The system has a few potentialdrawbacks, however. The industrial, high-pressure compressor is noisy, and theequipment takes up considerable space. It isalso expensive, and its purchase could be hardto justify for a small project or with a limitedbudget.

    A system was designed to provide aninexpensive, well-regulated source ofpressurized air to a pressure chamber fordeveloping water retention curves. The systemconsisted mainly of an electric air compressor,an air storage tank, an electric solenoid valve,pressure sensors, and a PIC microcontrollercircuit board. A sketch of the pressure chambersystem is shown in Figure 7. A list of thecomponents and their costs are shown in Table3.

    The system is controlled by a microcontrollerwhich continuously monitors two pressuresensors. One sensor measures the pressureinside the pressure chamber. If this pressuredecreases below the desired level, themicrocontroller opens the solenoid valve for afraction of a second. Higher-pressure airupstream of the solenoid valve enters thechamber, increasing the pressure inside thechamber. The second sensor measures thepressure inside the air storage tank, which ismaintained at a pressure higher than thatdesired inside the pressure chamber. If the

  • Figure 7. Sketch of components

    Table 3. Parts list and cost of main componentson pressure chamber controller

    Description Cost (US$) Part number, Manufacturer Microcontroller PIC 16F877, Microchip Technologies 7Pressure sensor MPX5010D, Motorola 20LCD display 10Circuit board 1Batteries 2Miscellaneous (resistors, capacitors, pushbuttons, LEDs, voltage regulator) 3Power supply MKS150-12, Astrodyne 73Solenoid valve 6011, Burkert 27Air compressor 12V Ultra, NuTech 20Air storage tank 41712, Central Pneumatics 20Plastic tubing, fittings 5 total $188

    storage-tank pressure decreases below a setlevel, the microcontroller turns on the aircompressor. The compressor remains on untilthe pressure inside the storage tank isrecharged. The microcontroller program loopscontinuously, monitoring the pressure sensorsand adjusting the pressures at 1-secondintervals.

    The control circuitry consists essentially of apower supply, circuit board, and LCD display.The power supply converts the 120 Vac mainelectrical source to a 12 Vdc supply needed torun the air compressor and the solenoid valve.The 12 Vdc supply provides power to themicrocontroller circuit, pressure sensors, andLCD display through a 5-Vdc voltage regulator.

    The circuit board consists of a microcontroller,relays, three pushbuttons, and a few resistors,capacitors, and LED lights. Since thecompressor and solenoid valve draw moreelectrical current than the microcontroller cantolerate, each is controlled by the microcontrollervia a relay. Pushbuttons enable the user toincrease or decrease the desired chamberpressure, and to temporarily pause the systemto allow the pressure chamber to be opened andthe soil samples accessed. LED lights indicatewhen the system is operating and when it ispaused.

    The system has performed well in initial testing.A range of chamber pressures from 10 kPa to150 kPa have been tested, and the pressureinside the pressure chamber has remainedwithin ±1 kPa of its set pressure.

    Non-Contact Water Level Measurements

    While pressure sensors are being used tomeasure water levels (see above), there may beoccasions where non-contact measurementsare desired. The use of a sensor which doesnot come into contact with the substance beingmeasured would then be needed.

    A circuit was designed for making non-contactdepth measurements using an ultrasonicrangefinder. The rangefinder transmits a high-frequency acoustic pulse, which is reflected if itcomes into contact with an object. A receiver is

  • activated to detect the reflected signal. Thedistance of the object from the sensor can becalculated based on the time it takes for thepulse to be reflected and return to the sensorand the speed of sound in air.

    The rangefinder was installed above theevaporation pan described previously, and usedto measure the depth of water in the pan. Depthmeasurements were then compared to thosemade manually and with the pressure-sensorcircuit described above.

    The main components of the circuit boardconsist of a microcontroller, real-time clock,memory chip, transistor, connector for theultrasonic rangefinder, and batteries. The circuitwas built on a prototype board, shown in Figure8. The main components of the circuit and theircosts are shown in Table 4.

    The microcontroller was programmed to makeand store measurements at 2-hour intervals.When time came to make measurements, themicrocontroller first energized the transistor,which acted as a switch to turn on power to theultrasonic rangefinder. The microcontroller

    Figure 8. Ultrasonic rangefinder prototypeboard.

    Table 4. Parts list and cost of main componentson ultrasonic rangefinder circuit board

    Description Cost (US$) Part number, Manufacturer Microcontroller PIC 16F819, Microchip Technologies 3Clock DS1302, Dallas Semiconductor 3Memory 24LC512, Microchip Technologies 3Ultrasonic rangefinder SRF04, Devontech 35Circuit board 1Batteries 2Miscellaneous (resistors, capacitors, connector pins, transistor) 2 total $49

    triggered the sensor, which transmitted anacoustic pulse, and initiated a timer. When thesensor’s receiver detected the reflected pulse,the timer stopped. The microcontroller programcontained a routine to convert the time of travelof the pulse to a distance, and then to a depth ofwater. The date, time, and water depth datawere then stored in the memory chip, and themicrocontroller put itself into a low-voltage sleepmode to conserve battery power.

    A series of water depth measurements mademanually, with the rangefinder, and with thepressure-sensor circuit is shown in Figure 9. Ingeneral, the rangefinder showed more variation

    Evaporation pan: 21 - 30 September 2004

    3.5

    4.0

    4.5

    5.0

    5.5

    6.0

    6.5

    7.0

    21 22 23 24 25 26 27 28 29 30

    Dep

    th o

    f wat

    er (

    in)

    sonic rangefinderpressure sensormanual

    Figure 9. Ultrasonic rangefindermeasurements.

    memory

    clocktransistor

    microcontroller

    clock batteryultrasonicsensorconnection

  • in depth than did the pressure sensor. This mayhave been due in part to the mounting of therangefinder: the rangefinder was attached to thechicken-wire screen covering the evaporationpan which may have flexed throughout the day.On a few occasions, unrealistic depths wererecorded. The cause of these significantrandom errors is unknown and must beinvestigated.

    CONCLUSIONS

    The capabilities, prevalence, and ease of use ofmodern electronic components are increasingrapidly. Electronics are increasingly being usedto collect and process all types of data, transferinformation, and provide automation and controlfunctions. Many more specialized componentsand sensors are available which interface easilyand simplify circuit design.

    These modern electronic components can beput to use in agriculture as in the many otherapplications in which they already serve. Anumber of useful, inexpensive, and easy-to-useelectronic components were described. Severalexamples of circuits used in irrigation researchwere presented and discussed.

    ACKNOWLEDGEMENTS

    The author wishes to thank Barry Collins,Electronics Technician, USDA AgriculturalResearch Service, Application and ProductionTechnology Research Unit, for his electronicsexpertise and assistance in designing andconstructing the circuits and circuit boards.

    REFERENCES

    Bruton, J.M., G. Hoogenboom, and R.W.McClendon. 2000. A comparison ofautomatically and manually collected panevaporation data. Transactions of the ASAE,vol. 43(5):1097-1101.

    Cravotta, R. 2004. Field Guide: 31stMicroprocessor Directory. EDN, 5 August 2004,pp39-58.

    Dukes, M.D., S. Irmak, J.M. Jacobs. 2004. AnAutomatic System for Recording Evaporationfrom ET Gages. Paper Number: 042191, 2004ASAE/CSAE Annual International Meeting,Ottawa, Ontario, Canada, 1-4 August 2004.

    EME Systems. 2002. SMX: Converter forWatermark or gypsum block sensors.http://www.emesystems.com.

    Fisher, D.K., S.J. Thomson, L.A. Smith, and B.L.Brazil. 2003. Automated Data Collection UsingSimple and Inexpensive Microcontrollers andSemiconductor Sensors. Paper Number033146, Presented at the 2003 ASAE AnnualInternational Meeting, Riviera Hotel andConvention Center, Las Vegas, Nevada, USA,27-30 July 2003.

    Klute, A. 1986. Water retention: laboratorymethods. p. 635-662. In: A. Klute (ed.)Methods of Soil Analysis: Part 1. Physical andMineralogical Methods. ASA MonographNumber 9. ASA, Madison, WI.

    MAIN MENUPREVIOUS MENU---------------------------------Search CD-ROMSearch ResultsPrint

    01: 30202: 30303: 30404: 30505: 30606: 30707: 30808: 30909: 31010: 31111: 31212: 313