----------- [Ag_xtr_29] - SU-202 sensor reading --------------------
Explanation: Basic example that turns on, reads and turn off the
sensor. Measured parameters are stored in the corresponding class
variables and printed by the serial monitor.
Copyright (C) 2020 Libelium Comunicaciones Distribuidas S.L.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Implementation: J.Siscart, V.Boria
#include <WaspSensorXtr.h>
SELECT THE RIGHT SOCKET FOR EACH SENSOR.
Possible sockets for this sensor are:
- XTR_SOCKET_C |---------|
- XTR_SOCKET_F |_D__E__F_|
Example: a 5TM sensor on socket A will be
[Sensor Class] [Sensor Name] [Selected socket]
Decagon_5TM mySensor (XTR_SOCKET_A);
Refer to the technical guide for information about possible combinations.
www.libelium.com/downloads/documentation/smart_agriculture_xtreme_sensor_board.pdf
// [Sensor Class] [Sensor Name] [Selected socket]
Apogee_SU202 mySensor = Apogee_SU202(XTR_SOCKET_B);
USB.println(F("SU-202 example"));
Note: read() function does not directly return sensor values.
They are stored in the class vector variables defined for that purpose.
Values are available as a float value
// 3. Turn off the sensor
USB.println(F("---------------------------"));
USB.println(F("SU-202"));
USB.print(F("Ultraviolet Radiation: "));
USB.printFloat(mySensor.radiation, 2);
USB.println(F(" umol*m-2*s-1"));
USB.print(F("Sensor voltage: "));
USB.printFloat(mySensor.radiationVoltage, 4);
USB.println(F("---------------------------\n"));
Note: the sensor is factory calibrated without
25 mV per W m -2 --> 1mv = 0.04 W m -2
8.33 mV per μmol m−2 s−1 --> 1mV = 0.12 μmol m−2 s−1
if the user wants W m -2, the conversion factor should be adjusted
manually. Besides, If the light source is not the sun,
the calibration factor may vary...