Community
cancel
Showing results for 
Search instead for 
Did you mean: 
FLab_
New Contributor II
2,150 Views

BMP180 on I2C with mini breakout ...

made some progress with I2C sensor connected to the mini breakout board:

root@fablab:~# i2cdetect -y -r 6

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

shows the sensor … on address 77 - great, but when running BMP180 cylon.js example I do get strange values back, any hint?

root@fablab:~# node cylon_bmp180_edison.js

I, [2014-10-28T02:04:48.915Z] INFO -- : Initializing connections.

I, [2014-10-28T02:04:48.930Z] INFO -- : Initializing connection 'edison'.

D, [2014-10-28T02:04:48.933Z] DEBUG -- : Loading adaptor 'intel-iot'.

D, [2014-10-28T02:04:49.172Z] DEBUG -- : Registering intel-iot adaptor for Robot 26309

D, [2014-10-28T02:04:49.172Z] DEBUG -- : Registering upm-hmc5883l Driver for Robot 26309

D, [2014-10-28T02:04:49.173Z] DEBUG -- : Registering upm-lcm1602 Driver for Robot 26309

D, [2014-10-28T02:04:49.174Z] DEBUG -- : Registering upm-jhd1313m1 Driver for Robot 26309

D, [2014-10-28T02:04:49.186Z] DEBUG -- : Registering i2c BlinkM driver for Robot 26309

D, [2014-10-28T02:04:49.197Z] DEBUG -- : Registering i2c HMC6352 driver for Robot 26309

D, [2014-10-28T02:04:49.199Z] DEBUG -- : Registering i2c MPL115A2 driver for Robot 26309

D, [2014-10-28T02:04:49.200Z] DEBUG -- : Registering i2c BMP180 driver for Robot 26309

D, [2014-10-28T02:04:49.201Z] DEBUG -- : Registering i2c MPU6050 driver for Robot 26309

D, [2014-10-28T02:04:49.201Z] DEBUG -- : Registering i2c LCD driver for Robot 26309

D, [2014-10-28T02:04:49.202Z] DEBUG -- : Registering i2c LSM9DS0G driver for Robot 26309

D, [2014-10-28T02:04:49.203Z] DEBUG -- : Registering i2c LSM9DS0XM driver for Robot 26309

I, [2014-10-28T02:04:49.210Z] INFO -- : Initializing devices.

I, [2014-10-28T02:04:49.212Z] INFO -- : Initializing device 'bmp180'.

D, [2014-10-28T02:04:49.216Z] DEBUG -- : Loading driver 'bmp180'.

I, [2014-10-28T02:04:49.226Z] INFO -- : Starting connections.

I, [2014-10-28T02:04:49.231Z] INFO -- : Connecting to 'edison'.

I, [2014-10-28T02:04:49.240Z] INFO -- : Starting devices.

I, [2014-10-28T02:04:49.241Z] INFO -- : Starting device 'bmp180'.

I, [2014-10-28T02:04:49.265Z] INFO -- : Working.

getTemperature call:

Temp: 89.5 C

getPressure call:

Temperature: 89.5 C

Pressure: 461230 Pa

getAltitude call:

Temperature: 89.5 C

Pressure: 461230 Pa

Altitude: -14819.812087235687 m

Tags (1)
0 Kudos
21 Replies
Diego_V_Intel
Employee
208 Views

Hi Fab-Lab.eu,

I'm not familiar with this sensor but I was checking the datasheet of it. The datasheet mention that SCL and SDA signals needs a pull-up resistor from 2.2 kohm to 10 kohm, and also I'm not sure if the value read needs a proper conversion to get the true value, or if the calibration required is correct. I'd suggest you to take a look to the datasheet in order to check these details: http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf BMP180 Datasheet.

Regards,

Diego.

FLab_
New Contributor II
208 Views

Diego, All,

yes and no ;-) I am using th Cylon library for communication with the BMP180 sensor - I guess they have done a good job on this part,

the issue might be the access to I2C, I wired to I2C-6-SCL and I2C-6-SDA as supported by the MRAA library … the i2cdetect showed

the sensor on address $77 - all good … but still strange values ...

o anyone out their made experience with I2C?

o i2cdetect -y -r 6 worked well, but now it shows only strange behavior while sending system message … any experience on this?

BWebb2
New Contributor III
208 Views

I'm afraid I can't be of much help, since you've gotten father than I have. I have yet to detect anything on any Edison I2C bus. I've tried several devices on the Arduino breakout without any success, and now I'm working on a custom board with an ms5611 and an mpu9250 with no success.

In my case, the mpu9250 is connected to i2c1 directly using 1.8V I/O. The ms5611 is connected to i2c6 via a logic level converter. I can't see either device when I do i2c detect.

The mpu9250 is a much more complex device that could easily have soldering issues, etc, so I've been concentrating on the ms5611. I have confirmed that the bus is being pulled up on both sides of the level converter. I also see I2C signals being sent to the ms5611, but no response on i2cdetect. I've checked the solder joints, schematics, and even replaces the ms5611 with no effect.

Could you please provide more details on how you connected your bmp180 to the breakout board (level converters, pullups, etc). Also, what do you do to configure the i2c bus?

FLab_
New Contributor II
208 Views

I am using the Sparkfun BMP180 breakout - all on 1.8V no level shifter needed:

+ >> J19-2 (V_V1P80)

- >> J19-3 (GND)

SCL >> J17-7 (I2C-6-SCL)

SDA >> J17-9 (I2C-6-SDA)

IO >> not connected, default connected to +

As said in my first testing on build 68 I got success with the i2cdetect showing the BMP180 on address 0x77 (see above)

but since the last reboot (even I did install a fresh image) i2cdetect is NOT of success any more … ??

FLab_
New Contributor II
208 Views

just added a pic - using my "breadboard hook" for the mini breakout (check project section for an how-to) -

showing the wiring ...

BWebb2
New Contributor III
208 Views

Ah, so you're running it at 1.8V.

Since you're not seeing it anymore, have you tried running cylon.js again and then trying i2c detect? Maybe cylon.js reconfigures the i2c port.

FLab_
New Contributor II
208 Views

root@fablab:~# i2cdetect -l

i2c-1 i2c i2c-designware-1 I2C adapter

i2c-2 i2c i2c-designware-2 I2C adapter

i2c-3 i2c i2c-designware-3 I2C adapter

i2c-4 i2c i2c-designware-4 I2C adapter

i2c-5 i2c i2c-designware-5 I2C adapter

i2c-6 i2c i2c-designware-6 I2C adapter

i2c-7 i2c i2c-designware-7 I2C adapter

i2c-8 i2c PMIC I2C Adapter I2C adapter

root@fablab:~# i2cdetect -y -r 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: -- -- -- -- -- -- -- --

so far so good - now with scan for I2C-6 I get only this panic response ...

root@fablab:~# i2cdetect -y -r 6

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: --

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.709567] CPU: 0 PID: 296 Comm: i2cdetect Tainted: G W O 3.10.17-poky-edison+ # 1

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.709572] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.709579] task: f51426f0 ti: f64f0000 task.ti: f64f0000

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.709641] Stack:

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.709712] Call Trace:

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.710210] Code: b3 ff ff 89 f8 09 d0 80 ce 04 83 ff 02 0f 44 c2 8b 15 54 8b b0 c1 89 82 00 b3 ff ff f7 c6 00 02 00 00 74 14 e8 67 f7 0a 00 56 9d <83> c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 56 9d e8 51 f3 0a 00 83

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.710235] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W O 3.10.17-poky-edison+ # 1

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.710240] Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 466 2014.06.23:19.20.05

Broadcast message from systemd-journald@fablab (Wed 2014-10-29 19:42:46 UTC):

kernel[187]: [ 340.710249] task: f6c83d30 ti: f6e1c000 task.ti: f6e1c000

...

BWebb2
New Contributor III
208 Views

That one I know... You need to configure i2c6. By default it's configured as just GPIO.

This is working from memory, but I believe the command id:

echo "mode1" > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

echo "mode1" > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

FLab_
New Contributor II
208 Views

faceplant - great hint, it worked - cylon.js is going to configure something … see result! Btw still the measurement is not showing correct data ...

now we do need to understand what cylon.js is doing on the Edison platform to enable i2cdetect in bus 6 ???

root@fablab:~# node bmp.js

I, [2014-10-29T19:51:21.375Z] INFO -- : Initializing connections.

I, [2014-10-29T19:51:21.390Z] INFO -- : Initializing connection 'edison'.

D, [2014-10-29T19:51:21.393Z] DEBUG -- : Loading adaptor 'intel-iot'.

D, [2014-10-29T19:51:21.768Z] DEBUG -- : Registering intel-iot adaptor for Robot 48775

D, [2014-10-29T19:51:21.768Z] DEBUG -- : Registering upm-hmc5883l Driver for Robot 48775

D, [2014-10-29T19:51:21.769Z] DEBUG -- : Registering upm-lcm1602 Driver for Robot 48775

D, [2014-10-29T19:51:21.770Z] DEBUG -- : Registering upm-jhd1313m1 Driver for Robot 48775

D, [2014-10-29T19:51:21.833Z] DEBUG -- : Registering i2c BlinkM driver for Robot 48775

D, [2014-10-29T19:51:21.895Z] DEBUG -- : Registering i2c HMC6352 driver for Robot 48775

D, [2014-10-29T19:51:21.895Z] DEBUG -- : Registering i2c MPL115A2 driver for Robot 48775

D, [2014-10-29T19:51:21.896Z] DEBUG -- : Registering i2c BMP180 driver for Robot 48775

D, [2014-10-29T19:51:21.897Z] DEBUG -- : Registering i2c MPU6050 driver for Robot 48775

D, [2014-10-29T19:51:21.898Z] DEBUG -- : Registering i2c LCD driver for Robot 48775

D, [2014-10-29T19:51:21.898Z] DEBUG -- : Registering i2c LSM9DS0G driver for Robot 48775

D, [2014-10-29T19:51:21.900Z] DEBUG -- : Registering i2c LSM9DS0XM driver for Robot 48775

I, [2014-10-29T19:51:21.906Z] INFO -- : Initializing devices.

I, [2014-10-29T19:51:21.908Z] INFO -- : Initializing device 'bmp180'.

D, [2014-10-29T19:51:21.911Z] DEBUG -- : Loading driver 'bmp180'.

I, [2014-10-29T19:51:21.923Z] INFO -- : Starting connections.

I, [2014-10-29T19:51:21.930Z] INFO -- : Connecting to 'edison'.

I, [2014-10-29T19:51:21.940Z] INFO -- : Starting devices.

I, [2014-10-29T19:51:21.941Z] INFO -- : Starting device 'bmp180'.

I, [2014-10-29T19:51:21.960Z] INFO -- : Working.

getTemperature call:

Temp: 89.5 C

getPressure call:

Temperature: 89.5 C

Pressure: 461230 Pa

getAltitude call:

Temperature: 89.5 C

Pressure: 461230 Pa

Altitude: -14819.812087235687 m

root@fablab:~# i2cdetect -y -r 6

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

BWebb2
New Contributor III
208 Views

It looks like cylon.js uses the MRAA library, which changes the pinmode just as I suggested. From what I can tell, that's all it does, and I am already doing that, so I believe we're both just back to where we started. You are seeing your device but getting garbage back, and I don't have anymore clues on how to get my device working...

FLab_
New Contributor II
208 Views

are you using cylon.js as well?

BWebb2
New Contributor III
208 Views

No. I'm just trying to get the device (any device) detected with i2cdetect. I suppose I could try running it and see if it does anything magic.

FLab_
New Contributor II
208 Views

now moving to command lines … will keep posting results

root@fablab:~# i2cset -y 6 0x77 0xF4 0x2E

root@fablab:~# i2cdump -y 6 0x77

No size specified (using byte-data access)

0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef

00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

80: a5 94 45 18 00 27 55 87 9f 63 1d 1e fb 88 c8 27 ??E?.'U??c?????'

90: 85 48 62 14 3f 22 19 73 00 2c 80 00 d1 f6 0a c2 ?Hb??"?s.,?.????

a0: a5 94 45 18 00 27 55 87 9f 63 1d 1e fb 88 c8 27 ??E?.'U??c?????'

b0: 85 48 62 14 3f 22 19 73 00 2c 80 00 d1 f6 0a c2 ?Hb??"?s.,?.????

c0: 00 00 bc 33 00 00 00 00 00 00 00 10 00 00 00 03 ..?3.......?...?

d0: 55 02 06 00 00 00 00 00 00 00 00 00 00 00 00 00 U??.............

e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

f0: 00 00 00 00 0a 00 61 1c 00 00 00 00 00 00 00 00 ....?.a?........

FLab_
New Contributor II
208 Views

cool got it running! based on C ;-) (there is a thread http://www.forum-cubieboard.de/Thread-howto-bmp180-bmp085-sensor-ueber-i2c-am-cb-ct [HowTo] BMP180/BMP085 Sensor über I2C am CB/CT)

root@fablab:~# ./bmp

Temperatur: 25.7 ?C

Luftdruck: 965.94 hPa

now as we know I2C-6 works, the Bosch BMP180 works - we need to fix cylon' s device driver ;-)

TWeiW
New Contributor I
208 Views

Hi,i have the same problem with the BMP085,a level converter is needed?and would you mind telling me the solution you find?

FLab_
New Contributor II
208 Views

Freshbird, if you are running the BMP085 just as it is - it works in the range of 1.8 to 3.6 V (logic and supply) so no level converter needed,

the problem I was facing in a nutshell was the right init of the I2C bus on the Edison - Hope the follow sample will help you too (sample

 

is based on the BMP180 but it should be mostly compatible with the BMP085) - more on www.fab-lab.eu/edison

Starting with Cylon:

Find installation here – http://cylonjs.com/documentation/platforms/edison/ link (external)

npm install cylon-intel-iot

 

npm install cylon-firmata

 

npm install cylon-gpio

 

npm install cylon-i2c

github – https://github.com/hybridgroup/cylon-intel-iot link (external)

The first "I2C" – using mini breakout board I/Os

copy code into bmp.js file

var Cylon = require('cylon');

Cylon.robot({

 

connection: { name: 'edison', adaptor: 'intel-iot' },

 

device:{name:'bmp180′, driver:'bmp180′},

work: function(my) {

 

my.bmp180.getTemperature(function(err, val) {

 

if(err) console.log(err);

 

else {

 

console.log("getTemperature call:");

 

console.log("\tTemp: " + val.temp + " C");

 

}

 

});

after(1..seconds(), function() {

 

my.bmp180.getPressure(1, function(err, val) {

 

if(err) console.log(err);

 

else {

 

console.log("getPressure call:");

 

console.log("\tTemperature: " + val.temp + " C");

 

console.log("\tPressure: " + val.press + " Pa");

 

}

 

});

 

});

after(2..seconds(), function() {

 

my.bmp180.getAltitude(1, null, function(err, val) {

 

if(err) console.log(err);

 

else {

 

console.log("getAltitude call:");

 

console.log("\tTemperature: " + val.temp + " C");

 

console.log("\tPressure: " + val.press + " Pa");

 

console.log("\tAltitude: " + val.alt + " m");

 

}

 

});

 

});

}

 

}).start();

and run code with node bmp.js you will see your first I2C sensor using Bosch BMP180 showing

 

baromometric data!

 

The BMP180 is on I2C-6 on address 0x77. Wiring J17-7 >> SCL, J17-9 >> SDA, J19-2 >> +,...
TWeiW
New Contributor I
208 Views

unlucky, i test the code you mentioned above.

and run code with node bmp.js (i had installed the cylon package )

it tell me cannot find 'cylon-undefined' module.

the problem might be fixed by installing it with 'npm install cylon-undefined' and trying again.

 

and i run npm install cylon-undefined

it tell my that 'cylon-undefined' is not in npm registery

 

so, how to resolve the problem? 

FLab_
New Contributor II
208 Views

have you in installed the MRAA lib already?

double check the Cylon installation: http://cylonjs.com/documentation/platforms/edison/ Edison with Cylon.js

are you on latest OS?

 

you can check version cat /etc/version or configure_edison –version I started with build 56, Poky 1.6 Edison (factory) upgraded to build 68, so at least 68 or later should be you OS build version

 

...

 

TWeiW
New Contributor I
208 Views

sk23
New Contributor II
34 Views

inivasHi All,

Please share bmp180 source code for edison.

Reply