NOTE: Only one environment module can be used at a time
Properties
Name
Data Type
Range
Temperature
float
-40ºC to 85º
Humidity
float
0% to 90%
IAQ (Air Quality Index)
float
0 to 500
Pressure
float
300 hPA to 1100 hPA
Altitude
float
0 to 10km
SIAQ
float
0 to 500
SIAQ Accuracy
int
0 to 3
CO2
int
0 to 5000 ppm
VOC
int
0 to 5000 ppm
Stable
int
0 or 1
Start
int
0 or 1
What does the data mean?
Air quality measurements take about 30 minutes to calibrate. On first use it is suggested to allow the module to burn in for 48 hours.
SIAQ is better to use when the module is in one position while IAQ is better to use when moving.
CO2 is an estimation of the CO2 level and is a derivation from the average correlation between VOCs and CO2 in human's exhaled breath. VOC is a conversion into breath-VOC equivalents.
Right after the sensor is turned on it will go through a run in process. The values stay fixed for the first minute or two. This is the “.start” property. When it switches from 0 to 1 it is out of its power on run-in. There is an accuracy parameter “.siaq_accuracy” which ranges from 0-3. It will be 0 when it is running in for the first few minutes. The other parameter of .stable (0 or 1) is if it is undergoing initial stabilization during its first use. Accuracy increases the longer it is run as it has more values to compare against for internal calibration.
Altitude is calculated using a sea level pressure of 1013 hPA.
What ports can I use it on?
3-6
Code
var celsius = Magic.modules.environment.temperature;
var stationaryIAQ = Magic.modules.environment.siaq;
var accuracy = Magic.modules.environment.siaq_accuracy;
var start = Magic.modules.environment.start;
using Magic;
public class Demo : MonoBehaviour
{
// create a reference to the module
public Magic.Modules.EnvironmentModule environment;
void Start()
{
}
void Update()
{
// access the property of the module
float celsius = environment.temperatureC;
}
}