Ag v30 04: Photosynthetic solar radiation SQ-110
Turn on the Agriculture v30 board and read the Solar Radiation Sensor on it once every second

Required Materials

1 x Waspmote 1 x Agriculture Board v30 1 x Photosynthetic Solar radiation sensor

Notes

- This example is only valid for Waspmote v15

Code

1
/*
2
* --[Ag_v30_04] - Solar radiation sensor reading SQ-110
3
*
4
* Explanation: Turn on the Agriculture v30 board and read the
5
* Solar Radiation Sensor on it once every second
6
*
7
* Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L.
8
* http://www.libelium.com
9
*
10
* This program is free software: you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*
23
* Version: 3.0
24
* Design: David Gascón
25
* Implementation: Carlos Bello
26
*/
27
28
#include <WaspSensorAgr_v30.h>
29
30
// Instance object
31
radiationClass radSensor;
32
// Variable to store the radiation conversion value
33
float radiation,value;
34
35
void setup()
36
{
37
// Turn on the USB and print a start message
38
USB.ON();
39
USB.println(F("SQ-110"));
40
// Turn on the sensor board
41
Agriculture.ON();
42
}
43
44
void loop()
45
{
46
// Part 1: Read the solar radiation sensor
47
value = radSensor.readRadiation();
48
// Conversion from voltage into umol·m-2·s-1
49
radiation = value / 0.0002;
50
51
// Part 2: USB printing
52
// Print the radiation value through the USB
53
USB.print(F("Radiation: "));
54
USB.print(radiation);
55
USB.println(F("umol·m-2·s-1"));
56
delay(1000);
57
}
Copied!

Output

1
H#
2
Start program
3
Radiation: 39.8260498046 umol m-2 s-1
4
Radiation: 32.2728347778 umol m-2 s-1
5
Radiation: 123.5980834960 umol m-2 s-1
6
Radiation: 137.3312072753 umol m-2 s-1
7
Radiation: 140.0778350830 umol m-2 s-1
8
...
Copied!
Last modified 5mo ago