Troubles with BMP085 pressure sensor & I2C protocol

Hello to all, this is my first post here...

I'm gently asking if someone could help me trying to discover what's the matter with sensor and protocol stated in the title.

I bought the BMP085 from Drotek (FR) but it's like the one from Sparkfun, with the only difference of smaller delivery time for me living in Italy.

During last week I made several tests, and the sensor initially worked almost good, but after being working for about two hours it doesn't work anymore.

I premit that it has been plugged correctly, correct 3.3V supply, correct A4 & A5 plugging of I2C interface on my Arduino Uno board. When the sensor didn't work I tried to make it send parameters to a LCD screen directly plugged on my own shield and/or to COM port, I tried to supply with USB, 9V battery and both two, but got no answer.

After keeping Arduino unplugged for many hours, the sensor will work for 2-4 seconds and then still no answer, even if pushing reset button on the board

Pease could any of you tell me if this could be caused by I2C protocol (Arduino board failure) or if ti could be imputable to a misfunctioning of the BMP085 sensor? Is there any method to check it, considering that's my only I2C-based sensor?

Many thanks

Luca

Hi Luca,

You can check if the device is visible with the I2C scanner - http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/ - A good tool for detecting addresses too.

It will not solve your problem but might help diagnosing it. The fact that it works once and a while can be caused by several factors: - wiring is it connected well? - wiring length - common 5V and GND

To learn more about I2C check - http://www.gammon.com.au/forum/?id=10896 - Nick Gammons I2C tutorial, very informative.

Succes, Rob

Rob,

thank you a lot!

wiring is OK, sensor is directly mounted on a shield that I’ve built on my own and both ground & common 3v3 are OK… I’m a newbie with Arduino, but in the past I’ve mess around with some pcb kits and others made on myself, I’m almost sure that’s no wiring problem. To check this I also tried temporary flexible wiring, but nothing changed.

in attachment the screenshot of COM18 stream after launching I2Cscanner, this is the only answer I get from Arduino. Today the sensor (or the I2C on board?) doesn’t work neither a second.

IIC.png

The UNO will probably work on 5V signals levels, is the shield 5V tolerant?

output of I2C scanner is strange.... is the baudrate ok? the source is 19200, your window says 9600 ....

Sorry, I didn't pay much attention to the baudrate...

I correct it, now it says:

I2CScanner ready! starting scanning of I2C bus from 1 to 100…

and then nothing else...

for debugging, I've added some "print" lines after each command of http://www.sparkfun.com/tutorial/Barometric/BMP085_Example_Code.pde , and I've discovered thant it hangs after trying to read calibration values. I set this as comment to see if the rest of program works, but no answer, it stops when trying to communicate via I2C. Port A4 & A5 are good, I've done some analog input measures and all seems ok.

Could be that breakout/sensor has been damaged during delivery? how should I check if the breakout board is damaged? soldering is so little, I'm scared to try to resolder it!

For the shield, it's a basic vetronite proto board adapted to Arduino so no problem for 5V

Sorry, I didn't pay much attention to the baudrate

Allways pay attention when programming, errors can be as small as one bit (not smaller) but a lot bigger :)

Could be that breakout/sensor has been damaged during delivery?

Yes, or afterwards

how should I check if the breakout board is damaged?

The I2C scanner does check if it is reachable, if it is not reachable by the Arduino I2C you might test it with another microprocessor.

Furthermore you could check if other I2C devices can talk with the Arduino to exclude that as error source.

Ok, I have only one Arduino and only one I2C sensor... my topic was oriented to discover if there's a method to test the board without any other I2C sensor, but - never mind - I just bought a DS1307 which will become useful in the future, I hope!

It will arrive in the next days, after check I'll tell you how the story is going on...

For now many thanks, your suggestion have been useful and I've learned something new!

Hope that a day I'll be able to give this pleasure back to you! ;) I'm a mechanical engineer, so if you need somethingh in this branch, you're welcome!

Luca

What the hell...

I've solved one problem and then discovered another...

DS1307 arrived this morning, this evening I've soldered the protoboard with crystal, pull-up resistors, and battery as I found here http://lusorobotica.com/index.php?topic=681.0.

Connected and for few seconds worked (1st run of I2DScanner.pde), then I re-checked the BMP085 and as the other day it starts but displays only "I2CScanner ready! - starting scanning of I2C bus from 1 to 100…" and hangs.

I disconnected the sensor, then run I2DScanner.pde; this time worked and obviously no I2C address were found, after the 100 numbers there wasn't any "found"

Re-connected the DS1307 and - surprise - even this doesn't work, or better will make I2CScanner.pde halting as above... Checked and re-checked, tired with both to connect directly to Arduino board bypassing my shield but nothing changed.

I don't understand what's happening...

Now I've bought another ATMega328 with bootloader, trying to check if the microprocessor could have been someway damaged, it looks pretty strange to me, I've been extremely clean- & careful...

It stimulate me to knock my head on a hard edge...

I disconnected the sensor, then run I2DScanner.pde; this time worked and obviously no I2C address were found, after the 100 numbers there wasn’t any “found”

Well that scanner sketch has kind of a dumb setup in that it doesn’t scan for all possible I2C address. You should change the ending address used in the sketch to:

byte end_address = 127;

A 1307 RTC will report back as:

addr: 104 found!

Lefty

retrolefty:

I disconnected the sensor, then run I2DScanner.pde; this time worked and obviously no I2C address were found, after the 100 numbers there wasn’t any “found”

Well that scanner sketch has kind of a dumb setup in that it doesn’t scan for all possible I2C address. You should change the ending address used in the sketch to:

byte end_address = 127;

A 1307 RTC will report back as:

addr: 104 found!

Lefty

I already made this modification, I see this issue in other forum. I even tried by other baudrate, but still nothing changed. My problem is that scanner initialize but halts after displaying “I2CScanner ready! - starting scanning of I2C bus from 1 to 100…”, it seems like the I2C sensors make something busy by a loop

I also triple-checked wiring, voltage supply of devices, connectors, but all seems OK. I made some analogueRead on analogue pin 4 e 5, and they work ok (I made even measurement on analogue pin 0 and 2 to make sure to get same values)

What kind of mess could be happened to the board? it worked well for two hours, nothing have been changed/touched and now it’s in strike…

What value are you using for pull up resistors? Also what are you using for level translation since it's a 3.3V device interfacing to a 5V Arduino?

They're onboard 4k7, the board could be seen here http://www.drotek.fr/shop/en/11-bmp085-pressure-barometric-sensor.html

what do you mean by

"Also what are you using for level translation since it's a 3.3V device interfacing to a 5V Arduino?"

?

I take 3.3 V supply from board and connected it to sensor +VDC, GND to sensor GND, analogPin 5 & 4 to SCL and SDA. Please don't tell me I should place a level converter even between I2C ports... aaaaaargh!

Yes you should use a level translator when interfacing different logic levels in I2C communication.

So I've cooked something... either board or sensor... probably this is because it worked a few and now it doesn't!

well, hope I've damaged only ATMEGA chip, the next week I'll have it in hands.

Still a little question for you... is this the board I have to use to interface http://www.sparkfun.com/products/8745?

Thank you a lot.

Yes those will work fine. Just make sure you use the both Tx channels on the board instead of Tx and Rx. The Tx channels are the bidirectional channels. I'm not sure how sensitive the BMP085 is to pull up resistor values just keep in mind the Sparkfun board uses on board 10K pullup resistors so if you keep your 4.7k resistors in the circuit your total pullup on one side will be closer to 8k ohms.

Can't tell you if you've damaged anything yet but if you did it would typically be the lower voltage devices.

Can't tell you if you've damaged anything yet but if you did it would typically be the lower voltage devices.

I think so, but now even DS1307 RTC refuse to work... its behaviour is the same of the BMP085, while its supply voltage is 5 V

What size pullups are you using for the RTC?

10k for both SCL & SDA (obviously one each)

Last night, in spite of sleeping, I was thinking about 3.3 level conversion of signal. Should something like the attachment works (apart the mistake that the central resistor should be 220R in spite of 330R)? I even thought that it should work fine for digital output, but dunno know if it’s the same for I2C… even thought that a diode should be mounted in parallel to resistor to avoid an extra lowering of 3.3v signal sended from sensor to I2C pins A4 & A5.

I bought a logical level converter, but if the method I thought about works it would be easier for me to integrate it into my own shields…

I’m sorry I tried to read something about I2C protocol but I understand almost nothing when applying it to Arduino.

5-to-3_3.png