Meteorology · Technical guides
Programmable data logger at the weather station: how to wire sensors, configure inputs and program averages and totals to research standards
A didactic guide to using a programmable data logger at research stations: the measurement chain from sensor to file, single-ended and differential inputs, ratiometric measurement, the 60 Hz filter, 4–20 mA current, pulses and SDI-12, an uncertainty budget using logger accuracy, scans and data tables, derived quantities computed before averaging (vapour pressure, VPD, dew point), storage-format resolution, diagnostic variables, power, grounding, validation and WMO and Brazilian references.

Almost every thesis that relies on data from its own weather station contains a sentence like this one: "data were collected by a data logger programmed to sample every 1 s and store 10-min averages". The sentence looks sufficient, but it hides decisions that change the result: was the sensor wired single-ended or differential? Which input range was used? Was the 60 Hz filter active? Was humidity converted to vapour pressure before or after averaging? Was pressure stored with one decimal place or rounded to the whole hPa? A data logger is not a USB stick with a clock: it is part of the measuring instrument, and the way it is wired and programmed becomes part of the error in the data.
This guide is for professors, graduate students and technicians in agrometeorology, hydrology, agricultural engineering, ecology and environmental science who are going to build or inherit a station with a programmable data logger and need to wire the sensors, write (or review) the program and describe the method with confidence. We use a compact logger from Campbell Scientific's CR300 line, very common in research stations, as the example, but the concepts apply to any instrument of this kind. If your question is still which logger to choose, start with the guide Data logger: how to choose the right one; here the topic is how to make good use of the one you already have.
From sensor to file: the measurement chain
Between the atmosphere and the spreadsheet there is a chain of steps, and each one can add error:
- The sensor converts the physical quantity into an electrical signal (voltage, resistance, current, pulses or a digital message).
- The cable carries that signal to the logger and, along the way, picks up noise and may suffer voltage drop.
- The logger input converts the signal into a number: range, wiring mode, filter, settling time and converter accuracy all come in here.
- The program applies multiplier and offset (the calibration), computes derived quantities and summarizes readings as averages, totals, maxima and minima.
- The data table stores the result in a numeric format with finite resolution, together with a time stamp.
The World Meteorological Organization (WMO) Guide to Instruments and Methods of Observation, in its chapter on automatic stations (WMO-No. 8, Volume III, Chapter 1), describes exactly this sequence — sampling, conversion, linearization, averaging, quality control and storage — and makes a recommendation we will use several times: linearization should be carried out before averaging, and only linear variables should be averaged.
Input types and what to connect to each
A research logger usually offers several terminal types. In the CR300 line, according to the manufacturer's specifications, there are six analog inputs (six single-ended or three differential), excitation terminals, pulse-counting terminals and control terminals that also work as SDI-12 ports. The table summarizes the reasoning:
| Signal type | Examples at the station | How to read it |
|---|---|---|
| High-level voltage (hundreds of mV to volts) | temperature/humidity transmitters with 0–1 V output, pressure sensors with voltage output | single-ended input, range matching the sensor's full scale |
| Low-level voltage (microvolts to tens of mV) | thermopile pyranometers and albedometers, thermocouples, load cells | differential input, narrower range, with input reversal |
| Resistance (thermistors, Pt100/Pt1000, potentiometers) | soil temperature probes, potentiometer wind vane | ratiometric bridge measurement, with excitation supplied by the logger |
| 4–20 mA current | industrial level, pressure and humidity transmitters | current input with a shunt resistor |
| Switch closure | tipping-bucket rain gauge, contact anemometer | pulse terminal in switch-closure mode |
| Low-amplitude sine wave | cup anemometers with an AC generator | pulse terminal in low-level AC mode |
| Digital (SDI-12, RS-232, Modbus) | "smart" humidity/temperature, pressure, level and soil moisture sensors | SDI-12 or serial port; the sensor already delivers the value in physical units |
Single-ended or differential?
In a single-ended measurement, the logger measures the voltage on one terminal relative to its own ground. In a differential measurement, it measures the difference between two terminals (high and low), independent of ground. Campbell's documentation sums it up: each configuration has its purpose, but differential is usually preferred, because it rejects voltages common to both wires — for example, ground potential differences along a long cable or return currents from other sensors. The cost is using two terminals instead of one. Rule of thumb: large signals, short cables and an isolated sensor return accept single-ended; small signals (thermopiles, thermocouples, bridges) call for differential.
Input range: use the smallest that fits the signal
The manufacturer recommends using the smallest input range that accommodates the sensor's full-scale output, because that gives the best accuracy and resolution. If the signal exceeds the range, the logger stores NAN ("not a number"), not a truncated value — which is good, because the error remains visible.
Ratiometric measurement: why thermistors and wind vanes are read as bridges
Resistive sensors do not generate a voltage: the logger has to apply an excitation voltage and measure the fraction that comes back. In a ratiometric measurement the result is the ratio between the measured voltage and the excitation voltage, so a small error in the excitation cancels out. That is why a potentiometer wind vane or a soil temperature thermistor should be read with bridge instructions (half or full bridge) rather than as a plain voltage. Wire the sensor as its manual describes for your logger; sensor manufacturers' example programs usually include the right instruction.
The 60 Hz filter
The Brazilian power grid runs at 60 Hz, and any sensor cable near an outlet, a pump panel or a motor picks up that noise. Converters such as the one in the CR300 line integrate the signal over a user-selected interval; the first notch frequency parameter (fN1) sets that interval. With fN1 = 60, integration lasts about 16.7 ms and rejects 60 Hz and its multiples; the specifications list normal-mode rejection above 74 dB at 60 Hz. The fast options (400 or 4000 Hz) exist for high-frequency measurements but are noisier: in the manufacturer's table, typical resolution on the −100 to +2500 mV range, single-ended, goes from about 2.3 µV RMS with the 50/60 Hz filter to 33 µV RMS with fN1 = 4000. For weather variables read once per second there is no reason to give up the 60 Hz filter (in countries with a 50 Hz grid, use 50).
4–20 mA current, pulses and SDI-12
- 4–20 mA. In the CR300 line only terminals SE1 and SE2 accept current directly (with an internal shunt resistor), with accuracy of ±0.14% of reading between 0 and 40 °C, according to the manufacturer. If you have three 4–20 mA transmitters, plan an external precision resistor for the third one or another logger. The advantage of the current loop is immunity to noise and to voltage drop on long cables; the 4 mA "live zero" also reveals a broken cable (reading near 0 mA).
- Switch closure. This is the mode for the tipping-bucket rain gauge. The CR300 specifications state a maximum frequency of 150 Hz, minimum closed and open times of 3 ms and automatic bounce filtering: openings of up to 1 ms are not counted. Rain at 200 mm/h on a 0.2 mm bucket produces about 0.3 pulses per second — far below the limit. What matters, therefore, is not counter speed but storing the total at short intervals (1 to 5 min) to preserve intensity.
- Low-level AC. Cup anemometers that generate a sine wave (instead of closing a contact) go on the low-level terminal; on the CR300 it accepts signals from 20 mV RMS between 1 and 20 Hz, with wider ranges for larger signals. The multiplier that converts frequency into m/s comes from the anemometer's calibration — not from the logger.
- SDI-12. SDI-12 sensors share a single data wire, each with its own address. The CR300 has two independent SDI-12 terminals (C1 and C2), compliant with version 1.4 of the standard. Before connecting two sensors to the same terminal, change the address of one of them: two sensors with the same factory address (often "0") on the same wire produce corrupted readings or NAN. The advantage of SDI-12 is that calibration lives in the sensor and the cable does not degrade the value; the drawback is response time (some sensors take more than 1 s to deliver a reading) and power draw during measurement.
How much the logger adds to the error: an uncertainty budget
The manufacturer specifies the accuracy of the CR300 line's analog inputs as ±(0.04% of reading + offset) between 0 and 40 °C and ±(0.1% of reading + offset) between −40 and 70 °C. The offset depends on range and mode: on the −100 to +2500 mV range, ±20 µV differential with input reversal, ±40 µV differential without reversal and ±60 µV single-ended; on the ±34 mV range, ±6, ±14 and ±20 µV respectively. These numbers exclude sensor and measurement noise. Let us use them in two illustrative examples.
Example 1 — air temperature with voltage output. A hypothetical transmitter outputs 0 to 1000 mV for −40 to +60 °C (0.1 °C per mV). Read single-ended on the 2500 mV range, at 1000 mV the logger error would be ±(0.4 mV + 0.06 mV) ≈ ±0.46 mV, that is, ±0.05 °C. Even in the worst enclosure-temperature case (±0.1%), it would be about ±0.11 °C. Since the sensor itself usually has an accuracy of a few tenths of a degree, the logger is a small part of the error, provided it is properly configured.
Example 2 — solar radiation with a thermopile. A hypothetical pyranometer with a sensitivity of 10 µV per W/m² outputs 10 mV at 1000 W/m². On the ±34 mV range, differential with reversal, the error would be about ±(4 µV + 6 µV) = ±10 µV, that is, ±1 W/m². Single-ended on the same range, ±24 µV (±2.4 W/m²). If someone leaves the sensor on the 2500 mV range and single-ended, ±64 µV, or ±6.4 W/m² — and resolution also gets worse. The difference does not show on the sunny-day plot, but it does show in early morning, late afternoon, on cloudy days and in daily totals. The sensor's own requirements are covered in the guide on the pyranometer at the weather station.
Two notes complete the budget. First, the manufacturer recommends recalibrating the logger every three years; record the date in the station log. Second, system accuracy is the combination of sensor, cable, input and storage format — and the last one is the most often forgotten.
Scan, table and processing: keep measuring separate from storing
In a programmable logger, two different rates coexist:
- The scan interval is how often sensors are read — for example, every 1 s. In the CR300 line, the program execution period ranges from 100 ms to 1 day, with a maximum rate of 10 Hz.
- The table interval is how often a summary is stored — for example, every 10 min, every hour and once a day.
WMO gives two useful criteria. First, sample at least once within the instrument's time constant. Second, treat the 1-minute average as the "instantaneous" value of most variables (wind and visibility have their own rules; for wind, see the guide on wind measurement at the weather station, which already covers vector averaging, standard deviation and the 3-s gust). In practice, a 1 to 5 s scan serves temperature, humidity, pressure and radiation; wind needs a faster scan to compute gusts.
Each variable calls for a specific kind of table processing:
| Variable | Processing | Note |
|---|---|---|
| Air temperature and humidity, pressure, radiation | average | also store maximum and minimum, with time |
| Rainfall | total (pulse count × bucket resolution) | 1 to 5 min table for intensity |
| Radiation (energy) | total of W/m² × interval, converted to MJ/m² | or compute energy from the average |
| Wind | scalar mean speed, vector mean direction, standard deviation, gust | dedicated wind-vector instruction |
| Battery voltage and enclosure temperature | minimum (battery) and maximum (enclosure) | diagnostic variables, essential |
| Status of digital sensors | sample or failure count | to separate measurement failure from real phenomena |
Tools such as Short Cut, Campbell's program generator, build this skeleton from menus; it is worth opening the generated program and checking every line, because that is what goes into the methods section of your thesis.
Derived quantities: compute at every reading, then average
Here is the most common mistake in station programs, and it follows directly from WMO's recommendation to average only linear variables. Vapour pressure, vapour pressure deficit (VPD), dew point and evapotranspiration depend exponentially on temperature. Computing them from mean temperature and mean relative humidity is not the same as computing them at each reading and then averaging.
An illustrative example with two consecutive half hours (Tetens formula for saturation vapour pressure):
| Situation | Temperature | RH | Vapour pressure | VPD |
|---|---|---|---|---|
| Half hour 1 | 30 °C | 40% | 1.70 kPa | 2.55 kPa |
| Half hour 2 | 20 °C | 90% | 2.10 kPa | 0.23 kPa |
| Average of quantities computed at each reading | — | — | 1.90 kPa | 1.39 kPa |
| Quantities computed from the averages (25 °C; 65%) | 25 °C | 65% | 2.06 kPa | 1.11 kPa |
Computing from the averages overestimated vapour pressure by about 8%, underestimated VPD by about 20% and raised the dew point from 16.7 to 18.0 °C. On a real day the variation is smoother than in this extreme example, but the bias always has the same sign on days with a large temperature range — precisely the days that matter in water-stress studies. Compute vapour pressure, VPD and dew point inside the scan and store the average of those variables. For VPD in protected cultivation, see the guide on greenhouse microclimate; for hourly and daily ET₀, the one on reference evapotranspiration with FAO-56.
The same principle applies to wind direction (the arithmetic mean of angles is wrong near 0°/360°) and to radiation: daily energy is the sum of irradiance over time, not the mean of hourly means multiplied by 24 without accounting for missing hours.
Storage format: the decimal place that disappears
Loggers usually offer a compact 2-byte format and a 4-byte floating-point format. At Campbell the compact one is called FP2: it uses half the memory but has variable resolution. According to the manufacturer's documentation, values from 0 to 7.999 are stored with three decimal places; from 8 to 79.99, with two; from 80 to 799.9, with one; and from 800 to 7999, with none. The maximum value is 7999.
Practical consequences:
- Atmospheric pressure in hPa (for example, 1013.4 hPa) stored in FP2 becomes 1013 — resolution drops to 1 hPa, useless for barometric tendency or for compensating level transducers. Store it in the 4-byte format (IEEE4) or subtract a constant before storing. For pressure itself, see the guide on atmospheric pressure at the weather station.
- Radiation totals in kJ/m² easily exceed 7999 on a sunny day; use MJ/m² or IEEE4.
- Temperature between 8 and 79.99 °C keeps two decimals, which is enough; below 8 °C, three.
When in doubt, use IEEE4: with 30 MB of data memory (CR310 and CR300 units with serial number 2813 or higher, according to the manufacturer), space is rarely the bottleneck at a weather station. A rough calculation: 25 values in IEEE4 are 100 bytes per record (not counting the time stamp). A 10-min table produces about 14 kB per day and fits for years; a 1-min table with the same 25 values produces about 144 kB per day and alone would fill the 30 MB in some seven months. Remember that tables generally work as ring memory: when full, the oldest records are overwritten. Data collection (or telemetry) must happen before that.
Diagnostic variables: what to store besides the sensors
A well-programmed logger records its own health. Include in a daily table:
- Minimum battery voltage: progressive night-time drops announce a tired battery or a dirty panel before data are lost.
- Maximum enclosure temperature: the specified accuracy changes above 40 °C, and an enclosure in the sun in the Cerrado easily exceeds that.
- Skipped scans: if the program does not fit in the scan interval — for example, because an SDI-12 sensor is slow to respond — readings are skipped and averages end up with fewer samples than you assume.
- NAN count per sensor: separates measurement failure from real phenomena.
- Number of valid samples in each average, when there are rejection conditions.
The clock is also a diagnostic: the CR300 line specification is ±1 min per month. The telemetry guide covers synchronization and time convention (UTC), and the guide on the integrated weather station on campus and at the experimental farm shows how to compare with INMET and control series quality.
Power, grounding and surges
Power. The CR300 line specifications list an average current drain of 1.5 mA idle and 5 mA with a 1 Hz scan and one analog measurement, both at 12 V; Wi-Fi in client mode adds about 7 mA idle and 70 mA while communicating, and the CR310 Ethernet port adds 5 mA when idle and 20 mA when linked. The typical battery mentioned is a 7 Ah lead-acid unit, and the charge input accepts 16 to 32 V from a solar panel or power supply. An illustrative calculation: 5 mA of measurement + 7 mA of idle Wi-Fi ≈ 12 mA, or 0.29 Ah per day; using half of a 7 Ah battery, the station would last about 12 days without sun — before adding the sensors. Heated sensors, SDI-12 probes and modems can be powered from the switched 12 V terminal and turned on only during measurement. Measure the actual current draw with an ammeter before sizing the panel.
Grounding and surges. CR300-line inputs are protected against electrostatic discharge and surges (the manufacturer cites tests per IEC 61000-4-5 at 4 kV on power and I/O), but that protection only works if there is a low-impedance path to earth. Connect the logger's ground lug to a rod at the foot of the tower with a short, heavy wire; connect sensor cable shields to logger ground at one end only; and keep signal cables away from power cables.
Validation: check the logger before trusting it
Comparisons between automatic and conventional stations in Brazil show why this step matters. Sentelhas et al. (1997), with 12 months of data in Piracicaba (São Paulo state), and Souza, Galvani and Assunção (2003), with almost three years in Maringá (Paraná state), found good agreement for temperature and relative humidity; in the Maringá study, however, the automatic station's humidity was about 2% higher, and pressure differed significantly because of the altitude difference between the stations. Small systematic differences like these can only be interpreted when the automatic station's configuration is documented and verified.
- Before going to the field, connect all sensors on the bench, run the program for 24 h and compare with a reference instrument (a calibrated thermometer in the same shield, a manually read rain gauge, a hand-counted bucket tip).
- Simulate known signals: a precision resistor in place of the thermistor, a reference voltage at the pyranometer input, a known number of tips with a syringe. If the stored value does not match, the error is in the program (multiplier, range, unit), not in the sensor.
- Keep the program with version and date, together with the data. If a sensor's multiplier changes after recalibration, the series needs that information.
- Describe it in the methods: logger model, wiring mode and range of each sensor, filter, scan interval, processing and storage interval, numeric format, time zone and time-stamp convention.
The example logger: what the product page says
The compact programmable data logger with Ethernet and Wi-Fi in the catalogue (ref. CR310-WiFi) is Campbell Scientific's CR310 with the integrated Wi-Fi option. According to the product page and the manufacturer's specifications, it has:
- six analog inputs (six single-ended or three differential), −100 to +2500 mV and ±34 mV ranges, 24-bit converter;
- 0–20 or 4–20 mA inputs on terminals SE1 and SE2;
- two pulse terminals (P_SW for switch closure up to 150 Hz and high-frequency counting; P_LL for low-level AC and high frequency);
- two control terminals (C1 and C2) with SDI-12, counting and serial communication, plus an RS-232 port;
- two excitation terminals (VX1 and VX2) and a switched 12 V terminal (1100 mA at 20 °C);
- USB port, 10/100 Ethernet and a solar charge regulator for a 12 V battery;
- 30 MB of data memory, a clock accurate to ±1 min per month and an operating range of −40 to +70 °C (non-condensing), according to the manufacturer.
Points to check before designing the project:
- Radio options. The site's product page lists radio variants RF407, RF412 and RF422 (United States/Canada, Australia/New Zealand and Europe). The manufacturer also offers the RF427 variant for Brazil, with an Anatel certificate. If the plan is a radio network between loggers, confirm with the technical team which variant applies — the Wi-Fi version does not replace a long-range radio.
- RS-485. The product page states that the line does not read RS-485 sensors directly; Modbus sensors on that standard need a converter.
- Expansion. According to the product page, the CR310 is typically not used with measurement and control peripherals because of its limited number of control ports, and it is not compatible with SDM or CDM devices. For more than six analog inputs, plan another logger or digital sensors.
- Charging input. The charge input accepts 16 to 32 V; the battery connects to dedicated 12 V terminals.
For those who want to explore the line or compare it with others, here are some loggers and sensors from the catalogue:
Related products
- Compact programmable data logger with Ethernet and Wi-Fi (ref. CR310-WiFi): the main instrument in this guide.
- Weather station data logger with cellular transmission (ref. HD33MT.4): software-configurable inputs, counters, SDI-12 and 4G transmission, with no programming required.
- Housing with acquisition system for weather stations (ref. HD32.35): logger pre-mounted in an IP66 stainless-steel enclosure with sun shield.
- High-performance multichannel data logger (ref. FieldLogger): eight universal analog inputs and Modbus RS485, useful when the channel count exceeds that of a compact logger.
- Multichannel data logger with 3G cellular (ref. LogBox-3G): few channels, simple setup and the manufacturer's cloud.
- SDI-12 data logger with solar panel (ref. DataSnap): for SDI-12 soil moisture sensor networks without programming.
- Relative humidity and temperature sensor with SDI-12 output (ref. SRH1A): an example of a digital sensor that delivers a ready value to the logger.
- Tipping-bucket rain gauge (ref. HD2013): the most common switch-closure sensor at a station.
Checklist before calling the program finished
- Is each sensor on the right input type (single-ended, differential, bridge, current, pulse, SDI-12) and on the smallest range that fits the signal?
- Is the 60 Hz filter active on slow analog measurements?
- Do multipliers and offsets come from each sensor's calibration certificate, with units checked?
- Are vapour pressure, VPD, dew point and ET₀ computed at each scan rather than from averages?
- Does wind direction use vector averaging, and is rainfall totalized at 1 to 5 min intervals?
- Are pressure, radiation totals and other large variables stored in a 4-byte format (or with an offset)?
- Is there a daily table with minimum battery, maximum enclosure temperature, skipped scans and NAN counts?
- Does memory cover the interval between collections, with margin?
- Is the logger grounded to a rod, with shields connected and signal cables separated from power cables?
- Is the program versioned and described in the methods, with time zone and time-stamp convention?
References
- World Meteorological Organization. Guide to Instruments and Methods of Observation (WMO-No. 8), Volume III, Chapter 1 (Measurements at automatic weather stations), 2023 edition.
- World Meteorological Organization. Guide to Instruments and Methods of Observation (WMO-No. 8), Volume V, Chapter 2 (Sampling meteorological variables), 2023 edition.
- World Meteorological Organization. Guide to Instruments and Methods of Observation (WMO-No. 8), Volume I, Chapter 1, Annex 1.A (uncertainty requirements and averaging times).
- Campbell Scientific. CR300-Series Specifications (revision 05/2026) and CR310 product page.
- Campbell Scientific. CR300 and CRBasic help documentation: voltage measurements, switch closure, current measurement (CurrentSE), wind vector (WindVector) and data types for final storage (FP2 and IEEE4).
- SDI-12 Support Group. SDI-12: A Serial-Digital Interface Standard for Microprocessor-Based Sensors, version 1.4.
- Allen, R. G.; Pereira, L. S.; Raes, D.; Smith, M. Crop evapotranspiration — Guidelines for computing crop water requirements. FAO Irrigation and Drainage Paper 56. Rome: FAO, 1998.
- Sentelhas, P. C.; Moraes, S. O.; Piedade, S. M. S.; Pereira, A. R.; Angelocci, L. R.; Marin, F. R. Análise comparativa de dados meteorológicos obtidos por estações convencional e automática. Revista Brasileira de Agrometeorologia, v. 5, n. 2, p. 215–221, 1997.
- Souza, I. A.; Galvani, E.; Assunção, H. F. Estudo comparativo entre elementos meteorológicos monitorados por estações convencional e automática na região de Maringá, Estado do Paraná. Acta Scientiarum. Technology, v. 25, n. 2, p. 203–207, 2003. DOI: 10.4025/actascitechnol.v25i2.2220.
- Hensistemas product page: compact programmable data logger with Ethernet and Wi-Fi.
Instruments for this application

Campbell ScientificCR310-WiFi
CR310-WiFi Datalogger with Ethernet

DeltaOhm - GHM GroupHD33MT.4
HD33MT.4 Data Logger for Weather Station

DeltaOhm - GHM GroupHD32.35
HD32.35 Housing with Acquisition System for Weather Stations

NovusLogBox-3G
LogBox 3G - 3G/2G Multichannel Data Logger

ACCLIMADataSnap
DataSnap Solar SDI-12 Data Logger with Solar Panel

DeltaOhm - GHM GroupHD2013




