• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


BMP085 i2c
#1
Hi,

is it possible to integrate the Values from a bmp085 over the i2c-bus?

like this:
https://learn.adafruit.com/using-the-bmp...pi-for-i2c
 
Reply
#2
Of course, would be great if you can do it yourself. If you want me to do it, i need a good C example.
 
Reply
#3
The C-Code i use and it works fine:

The Tutorial:
http://www.john.geek.nz/2012/08/reading-...pberry-pi/

The Codes to compile:
http://www.john.geek.nz/wp-content/uploa...stBMP085.c
http://www.john.geek.nz/wp-content/uploa...12/smbus.h
http://www.john.geek.nz/wp-content/uploa...12/smbus.c

i only need to change
char *fileName = "/dev/i2c-0;
to
char *fileName = "/dev/i2c-1";
in the testBMP085.c for the RaspberryPi B Vers2

i hope the code ist good für your work :-)
 
Reply
#4
I´m a Little bit new on pilight and Linux and C also.

I´m trying to get a BMP180 up and running.

Could somebody give me a hint?
 
Reply
#5
OK, got the i2c up and running:


root@raspberrypi:/etc/pilight# i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

If i use the i2c lm75 protocol, i get a reading at adress 0x77.

how do i modify (or write a new one) the protocol for the BMP180?
The BMP180 is quite good documented at: http://www.adafruit.com/datasheets/BST-B...000-09.pdf

Can somebody help please?
 
Reply
#6
Pick one of these protocols and just adapt them with the new logic:
- ds18b20 / ds18s20
- dh11 / dht22

It is mostly a copy / paste of existing code.
 
Reply
#7
Gosh... not possible for me.

I want to get pressure- readings of the BMP180

It is working:

root@raspberrypi:/home/Adafruit_Python_BMP/examples# python simpletest.py
Temp = 29.70 *C
Pressure = 101216.00 Pa
Altitude = 9.41 m
Sealevel Pressure = 101215.00 Pa

But i have no idea how to integrate the code...
 
Reply
#8
Hi there,

I have the same requirement as you, Alex. I've implemented a solution based on the 'lm76' protocol because BMP180 and it predecessor BMP085 also use the i2c interface. Reading calibration data, reading raw temperature value and also calculating and showing true temperature is already working. I will now go on with implementing the reading of the raw pressure value and the calculation of true pressure. Afterwards I will commit (or provide) it! I think this will happen between Christmas and New Year at the latest.

Cheers,
Hendrik
 
Reply
#9
Nice! Smile
 
Reply
#10
I've completed implementing the reading of the raw pressure value, the calculation of true pressure (in hPa) and the calculation of altitude (in m, given an absolute sea-level pressure value). Anything works fine and has been tested using sample values from the data sheet. I've added pressure and altitude display to the web presentation layer (pilight.js + pilight.css) as well. Currently fitting icons are missing. I will continue my work as soon as possible. There are still features (like calculation of sea-level pressure given an absolute altitude value) to be implemented. Afterwards I will commit. Are there any documented guidelines (code style etc.) to follow?

Merry Christmas,
Hendrik
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)