Weather Sensor Read Lib

Weather Sensor Read Lib

WSReadLIB (Weather Sensor Read) is a small (static) library for reading the weather sensor bmp085 (temperature and pressure) and the sensor AM2392 (temperature and humidity) with the Raspberry Pi.

A Webinterface is currently under development

The library requires the bcm2835 library (http://www.airspayce.com/mikem/bcm2835/).

Installation:

The header files will be installed to /usr/local/include and the library will be installed to /usr/local/lib. Also a small test program "wsread" is build which reads out an AM2302 if connected to pin 1 and an bmp085.

Usage:

Sensor AM2302:

To use this sensor you need to include the header file am2302.h

bool readAM2302 (int pin, float *temp, float *hum)

Reads the temperature in celsius and the relative humidity. The sensor must be connected to GPIO pin pin (in wiringPi numbering scheme, see http://wiringpi.com/pins/).

Returns true if the sensor could successfully be read.

Sensor BMP085:

To use this sensor you need to include the header file bmp085.h

Reads the temperature in celsius and pressure in hPa from a BMP085. The parameter oss is the oversampling setting:

Returns true if the sensor could successfully be read.

float convertToSeaLevel (float pressure, float alt)

Converts the local pressure to the pressure at sea level. You have to supply the correct altitude in meters of the current location of the sensor.