The Talking Boat - Part 4 - A working Barometer

In Part 3, I wrote about a talking barometer but had to mock up a barometer.  The other day, a barometer chip and pi Cobbler arrived so I now have a real talking barometer.

Apart from the RPi, the components are:

Kernel support for I2C is included in the Raspian distro.  Mostly following the Adafruit tutorial, additons from the Quick2Wire site, I only had to:

  • install python-smbus  (which also installed i2c-tools) > sudo apt-get python-smbus
  • edit /etc/modules to include i2c-bcm2708 and i2c-dev
  • edit /etc/modprobe.d/raspi-blacklist.conf  to remove these modules (not sure why this is also required - seemed to work before I did this)
  • wire up the board  - note that the Sparkfun board is different to the Adafruit board
  • check it is there at address 0x77 > sudo i2cdetect 0
  • download the Adafruit code
  • test using the example Adafruit code
  • set public access to /dev/i2c-0 (cos I got tired of sudoing )   > chmod 666 /dev/i2c-0

The BMP085 module worked fine.  However for use in forecasting, the observed barometric pressure has to be corrected for altitude back to sea-level pressure, so I added an additional method using the formula provided in the datasheet:

The original talking barometer code worked except that the generator which read raw barometric pressures was changed to now create the BMP085 object and read the sea level pressure at intervals. 

The only complication is that an altitude is now required and this has to be passed through the filter pipeline, which is messy. Perhaps a configuation file would be better if less functional.

Thanks to Bristol Hackspace for the soldering iron and reassurance, and of course to Google search, although one could wish that it wasn't easier to find information which is out-of-date than  up-to-date.