rfbee and I2C (BMP085 sensor)

I am trying to interface RFBEe with BMP085 barometric and temp sensor.

I found in the docs that PC4 and PC5 are I20 SDA and SCL ports.

but when connecting this to BMP085 I am not getting any data (same BMP085 works on regular arduino uno).

ist here anything else that needs to be active in order for I2C to work. I found on XBee carrier wiki that Pin 17 needs to be driven low (is this the case) ?

can anyone post some working I2C sketch

Thanx,
DiNo

actually the I2C Grove’s vcc pin is control by a mosfet. you should tuan on the mosfet first~ :smiley:

pinMode(A2, OUTPUT);
digitalWrite(A2, LOW);

Thanx for feedback
Will try it later.

What in the case that you want to make standalone deployment. Is it the same case ?

Regards,
DiNo

hi DiNo~I am sorry I am a little misunderstand about you question~ standalone deployment ? :frowning:

HI,

If I understood correctly If you are using RFBee on XBeeCarrier board then you need to turn on mosfet (drive A2 low)

But in this case I have xBee on the breadboard (raw deployment) connecting directly to BMP085 sensor.
I cannot get this to work (BMP085 works on Arduino Uno Pin4 and Pin5 connected).
Based on my research RFBee Pins PC4 and PC5 are I20 SDA and SCL ports so It should work.
I initiate the communication but when trying to wake up BMP085 sensor I get garbage on serial port (so it looks like something is definitely wrong).

Could it be that firmware need to be initialized or something ?

Thanx,
DiNo

if you use breadboard, then it wouldn’t had the mosfet problem~

moreover, you mean xBee or Rfbee ? :open_mouth:

one more question, when you test BMP085 sensor, do you add the code to to RFBee firmware or standalone ?

HI,

here is update not that i managed to test it more thoroughly.
When using BMO085 with RFBee as plain arduino all works OK. i can get the data with pretty basic sketch (see below).
But when RFBee firmware is loaded the code gets stuck after bmp.begin()

is it a case that firmware is initiating i2c for some of it own purposes ?

Code for BMP085 as plain arduino sketch

#include <Wire.h>
#include “Adafruit_BMP085.h”

/***************************************************
This is an example for the BMP085 Barometric Pressure & Temp Sensor

Designed specifically to work with the Adafruit BMP085 Breakout
----> adafruit.com/products/391

These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!

Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/

// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here

Adafruit_BMP085 bmp;

void setup() {
Serial.begin(38400);
if (!bmp.begin()) {
Serial.println(“Could not find a valid BMP085 sensor, check wiring!”);
while (1) {}
}
}

void loop() {
Serial.print(“Temperature = “);
Serial.print(bmp.readTemperature());
Serial.println(” *C”);

Serial.print("Pressure = ");
Serial.print(bmp.readPressure());
Serial.println(" Pa");

// Calculate altitude assuming 'standard' barometric
// pressure of 1013.25 millibar = 101325 Pascal
Serial.print("Altitude = ");
Serial.print(bmp.readAltitude());
Serial.println(" meters");

// you can get a more precise measurement of altitude
// if you know the current sea level pressure which will
// vary with weather and such. If it is 1015 millibars
// that is equal to 101500 Pascals.
Serial.print(“Real altitude = “);
Serial.print(bmp.readAltitude(101500));
Serial.println(” meters”);

Serial.println();
delay(10000);

}

as i know, RFbee had not use I2C port, I’ll try your code later~ see if any lucky to find the problem~ :slight_smile: