Konubinix' opinionated web of thoughts

Temperature Sensor Using a Rpi, With Dht22 and Bmp180

Fleeting

rpi, temperature sensor dht22 am2302

with the bmp180

See https://learn.adafruit.com/using-the-bmp085-with-raspberry-pi/using-the-adafruit-bmp-python-library

You need to enable i2c, either use sudo raspi-config~ / 3 Interface Options / I5 I2C / Would you like the ARM I2C interface to be enabled?

Or, enabling I2C module automatically.

import Adafruit_BMP.BMP085 as BMP085
sensor = BMP085.BMP085()
print(f'Temp = {sensor.read_temperature():0.2f} *C')
print(f'Pressure = {sensor.read_pressure():0.2f} Pa')
print(f'Altitude = {sensor.read_altitude():0.2f} m')
print(f'Sealevel Pressure = {sensor.read_sealevel_pressure():0.2f} Pa')