This is a library for Java Sensors. You can use it as Maven dependency.
This blog post describe who it started and how I used it in my IoT AirQuality Lab project.
To test it, you can use the examples.
Sensor Libraries:
- BMP180 barometric sensor
- BMP280 barometric sensor
- Seed Studio AirQuality Sensor 1.0/1.3 indoor air quality
- SHT15 humidity sensor
- TSL45315 light sensor
Compile and package can be done on a seperate computer or on a Raspberry Pi itself.
cd rpi-java-sensor-lib
mvn package
The package command generates a examples/target/examples-1.0-SNAPSHOT-jar-with-dependencies.jar
.
If you have packaged on the Raspberry Pi you can use it direct, otherwise you need to copy it to the Raspberry Pi. ddd Use this commands to test the Sensors:
sudo java -cp examples-1.0-SNAPSHOT-jar-with-dependencies.jar de.patricksteinert.rpisensorlib.examples.AdafruitBMP180Example
sudo java -cp examples-1.0-SNAPSHOT-jar-with-dependencies.jar de.patricksteinert.rpisensorlib.examples.AdafruitBMP280Example
sudo java -cp examples-1.0-SNAPSHOT-jar-with-dependencies.jar de.patricksteinert.rpisensorlib.examples.Sht15Example
sudo java -cp examples-1.0-SNAPSHOT-jar-with-dependencies.jar de.patricksteinert.rpisensorlib.examples.PollutionSensorADS1015Example
sudo java -cp examples-1.0-SNAPSHOT-jar-with-dependencies.jar de.patricksteinert.rpisensorlib.examples.Tsl45315Example
Parts of the code in this repository are based on work of other peoples:
- People from Adafruit
- People from Seed Studio
- cudacode
- and many other sources