===== Barometer =====
{{ ::ms5637-30ba_600.jpg?200 |}}
The Sparrow nodes are using the [[http://www.meas-spec.com/product/pressure/MS5637-02BA03.aspx|MS5637]] pressure sensor for barometric and altimeter measurements. We will use the [[https://github.com/freetronics/BaroSensor|Freetronics]] library to interface with it.
#include
#include
int controlPin = 7;
void setup()
{
pinMode(controlPin, OUTPUT); //sensor on/off control
delay(100);
digitalWrite(controlPin, LOW);
Serial.begin(9600);
BaroSensor.begin();
}
void loop()
{
if(!BaroSensor.isOK()) {
Serial.print("Sensor not Found/OK. Error: ");
Serial.println(BaroSensor.getError());
BaroSensor.begin(); // Try to reinitialise the sensor if we can
}
else {
Serial.print("Temperature: ");
Serial.println(BaroSensor.getTemperature());
Serial.print("Pressure: ");
Serial.println(BaroSensor.getPressure());
}
delay(1000);
}
The light sensor on the Sparrow node is very versatile, it can measure visibile, infrared and UV radiation. Check it [[tutorials_light|out]]!