Difficulty in running BMP180 sketchies eg.

SFE_BMP180 stops at verification
by ChrisPSR » Tue Aug 04, 2015 9:12 am
Hi.

I decided to adopt this program as it will (?) later fit along with my home weather monitor running on a 1.8" tft. I'm not entirely new to the Arduino environment but I’m afraid that I am struggling with the SFE_BMP180_Example.
The program verifies, loads and runs but almost as soon as its started in the Windows/Arduino Consul it stops at what I call the verification point, all at the illustrated example final line:

//Start of illustration

#include <SFE_BMP180.h>
#include <Wire.h>

// You will need to create an SFE_BMP180 object, here called "pressure":

SFE_BMP180 pressure;

#define ALTITUDE 34.6 // Altitude of my road in meters

void setup()
{
Serial.begin(9600);
Serial.println("REBOOT");

// Initialize the sensor (it is important to get calibration values stored on the device).

if (pressure.begin())
Serial.println("BMP180 init success");
else
{
// Oops, something went wrong, this is usually a connection problem,
// see the comments at the top of this sketch for the proper connections.

Serial.println("BMP180 init fail\n\n"); //This is where I believe the program halts.

//End of illustration

I'm not too sure just what the comment "// You will need to create an SFE_BMP180 object, here called "pressure":" actually means; is the answer as the next instruction/line "SFE_BMP180 pressure;" or am I supposed to write something into the program. Whatever it stops here and will not go any further. So: where am I up to:

1] The board is definitely provided with a Vcc of Arduino 3.3V's, and never any other.
2] The four wires hardly require any elucidation (or do they).
3] My project board is a Duemilanove (pin-outs as a UNO[?]).
4] Why O'why is it stopping.

I have loads of stuff to write as soon as I can extract the fundamental numbers so: Any help would be most kindly welcomed, Cheers,
A Braindead ChrisPSR

Are the I2C pullup resistors installed (may be on the BMP module)? Have you run the I2C scanner to verify address and communication with the BMP. Are you sure the module runs on 3V3 as some have a regulator to drop 5V to 3V3.

Nick Gammon's I2C scanner

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

GROUNDFUNGUS,

Pull up resistors: They appear to be present
Nic Gammons Scanner program: Run; (thanks) Consul printed "=0" and stopped there.
Does Module run on 3.3V or 5V: PCB fit with VR., enumerated as "(Moon shape) 662K" Dropped down Data sheet for VR., but of know help as VR., can be set at 1.2V through to 5V in consecutive one tenth of a volt increments. Taken from Data sheet: ETR0305_002 by Torex naming the VR., as XC6206 Series. Now tried VR., with DM., input of 5V provided 3.28V out.

Ran NC's scanner once more on input of 5 Volts: Now provides the consul character: "<" without inverted commas

Hope all that makes sense and I would be grateful if you can elucidate on my findings.

Now provides the consul character: "<" without inverted commas

Did you set the bit rate of the serial monitor to 115200?

Following the above I tried running various programs using the BMP180 Sensor.
The most illuminating was Adafruits "Sensorapi" this provided the following consul printout:

"Pressure Sensor Test

Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!"

Help,
ChrisPSR

AWOL:
Did you set the bit rate of the serial monitor to 115200?

Hi, Thaniks for the input. I chose to leave the Serial data speed at 9600 as set by Adafruit in their "Sensorapi" program.
Changing to 115200 from 9600 provided no result at all in the Consul.

ChrisPSR

You need to be sure that the pull ups are installed. Are you sure of your wiring? Can you post a picture of your module, maybe we can identify the pull ups if they are there. And a picture or drawing of your wiring.

groundfungus:
You need to be sure that the pull ups are installed. Are you sure of your wiring? Can you post a picture of your module, maybe we can identify the pull ups if they are there. And a picture or drawing of your wiring.

Hi images of the BMP180 pcb and my development board and wiring to the duamilinove can be found at:

https://www.flickr.com/photos/chrispsr/shares/UC6G7R7

ChrisPSR

I get 404 bad link.

I am sorry bout the bad link. I am brand new to posting pics on any site. I will try once more tomorrow. Any help or a pointer in the right direction to post pics would be welcome.

Cheers.
Chrispsr

If you use the reply button (not quick reply) at the bottom or the last post on the page you can attach images.

Groundfungus,

Apologies for my ignorance hopefully these pics will be visible ones.

On the project board the Vcc cable is red for some reason it shows pink here.

The BMP180 pcb reads on the reverse. from left to right:
SDA; SCL; GND; VIN. remember to invert these tabs when looking on the front side (Obverse) please read the tabs in the opposite direction ie., they then start at VIN.

The wiring is somehow so simple, I cannot see wheree I can be wrong but hey ho, something is wrong somewhere! Hope you can help.

Cheers,
ChrisPSR

I can hear you "Wish this fellar would pee off".

The pullups are on the BMP board. The 2 resistors marked 472 (4700 ohm). The 3 terminal part is a 3.3V regulator so Vcc is 5V. The wiring looks right, as far as I can see, so I don't see why it won't work. Try running the scanner again. I have used it many times and it will find the board if the board can communicate. Make sure the baud rate in serial monitor is 115200, like Grumpy Mike said.

What Arduino board is that?

Groundfungus,

I believe the board to be the Duamilinove with increased output
and known (I think) as a Funduino. Bought from Bangood.com for £6 I suppose that's about $10. I have always found them to be very good (I have two or three of them) but have never used the alternate pins, made for robot'ors I should think whereas I'm really a model rail man. When programming the chip/Bd it has to be named as the Duamilinove running on the 328P chip and programmed as AVRISP, the setting for a UNO will not work. However its pin-outs are exactly as the UNO including the use of pin 13 in equality.
Do I load the scanner program into the same chip as I have loaded the BMP180 program or do I tie another Arduino somehow to the one I am checking? I'll have a look and try to understand Mr., Gammon's "About I^2C".
Chris.

Try connecting to the 5V pin as the module seems to have a 3.3V regulator according to this eBay sellers schematics.

EDIT: It also has pullup resistors on the SCL/SDA lines.

Hi,

Hi, Thaniks for the input. I chose to leave the Serial data speed at 9600 as set by Adafruit in their "Sensorapi" program.
Changing to 115200 from 9600 provided no result at all in the Consul.

I'm not sure what you mean by this.
The baud rate on the IDE monitor has to match the baud rate in the Serial.Begin(9600) statement.
In this case 9600.
Setting the speed at the IDE monitor does not set the comms speed.
It is set by the Serial.begin statement,
Sorry if you are changing the speed, but the statement you made above was not clear as to whether you changed speed to accommodate the sketch.

Tom.... :slight_smile:

Do I load the scanner program into the same chip as I have loaded the BMP180 program or do I tie another Arduino somehow to the one I am checking?

Load the Scanner program to the Arduino that the BMP is connected to. You can have only one program at a time in the Arduino. You will have to reload your original program once the scanner can see the BMP.

The baud rate set in the I2C scanner by Nick Gammon that I posted is 115200 so the serial monitor baud rate needs to be 115200 to see the output from the scanner.

Riva:
Try connecting to the 5V pin as the module seems to have a 3.3V regulator according to this eBay sellers schematics.

EDIT: It also has pullup resistors on the SCL/SDA lines.

Yes thanks for the nudge Riva. However the schematic shown on the web sales page of this BMP189 pcb., is mereley that of the pcb., itself. and of course once you own the board youthen have to hook it up, 2 wire + ground but this simplistic guy your talking to cant get it to work for one reason or another. Because I houghgt I had ballsed up the first pcb I bought a second however I have now changed the board to the AT ATMEGA 2460 and do you know what "It works, Yipee". Sorry for the elation and thanks for your help.

ChrisPSR

TomGeorge:
Hi,
I'm not sure what you mean by this.
The baud rate on the IDE monitor has to match the baud rate in the Serial.Begin(9600) statement.
In this case 9600.
Setting the speed at the IDE monitor does not set the comms speed.
It is set by the Serial.begin statement,
Sorry if you are changing the speed, but the statement you made above was not clear as to whether you changed speed to accommodate the sketch.

Tom.... :slight_smile:

Sorry if I mislead you. Schema now working using an Atmega 2460 I can only assume that their is an error of some sort in the Duamianove dev Bd., used earlier.

ChrisPSR

groundfungus:
Load the Scanner program to the Arduino that the BMP is connected to. You can have only one program at a time in the Arduino. You will have to reload your original program once the scanner can see the BMP.

The baud rate set in the I2C scanner by Nick Gammon that I posted is 115200 so the serial monitor baud rate needs to be 115200 to see the output from the scanner.

Groundfungus,

Your only going to say "Why on earth didn't you try another dev., board earlier. Well hands on heart I have to say sorry. You've probably read already that the schema is working on an Atmel Atmega 2460 using pins 21 & 20 in that order for the SCL and SDA.

I would still like to gain from your advice on running the scanner and I'll see where I get to with it. Looked at your profile, excuse me, and found it fascinating that your town only has a hadfull of local occupants; are there still the indiginous Navajo people about. It must be a fascinating place full of wonderful history and exploits of the Navajo and the wagon trail European expats.

Thanks very much for all your help, hope we speak again, hey: perhaps I can give you a shout if I need some more advice, cheers, Chris.