Use the Adafruit BMP183 with a Raspberry PI, in Java
Temperature and Pressure
The board we are talking about here is the SPI Barometric Pressure/Temperature/Altitude Sensor.
Important: Unlike the BMP180 that has an I2C interface, this one has an SPI interface!
This makes the code and the wiring substancially different.
Note: There are on the Raspberry PI header pins labeled MISO, MOSI, SCLK, CE0. These are the ones we use in this example.
But this is absolutely not mandatory. You can very well use any GPIO pins you like, as long as they are used in the right direction (input or output).
|Vin||# 2. 5.0 VDC Power|
|GND||# 6. 0V (Ground)|
In your code, nmake sure you read the Temperature before the Pressure. Pressure depends on Temperature.
The class to run is
spi.sensor.main.SampleBMP183Main. Run it from a script like this:
sudo java -cp $CP spi.sensor.main.SampleBMP183Main
The output would look like this:
Pressure : 1019.32 hPa
Oliv did it