Connecting BMA180 accelerometer to Arduino Mega

Hi,

I would like to confirm or correct my connections from a BMA180 to an Arduino Mega. I am using an I2C sample sketch, however the output x, y and z values are all zero so I think my connections are wrong.

My connections are:-

BMA180 Arduino Mega

VDD to 3.3V
GND to GND
INT not connected
CS to 3.3V
SCK to Analog 5 pin
SDO to GND
SDI to Analog 4 pin
VIO to 3.3V

Thanks in advance.

Steve

Don't forget that I2C needs pull-up resistors on the bus. About 4.7k on each wire is a good starting point with 1.8k to 10k being a good range. Only one pull-up per wire.

Thanks John.

I got it working :slight_smile:

I discovered that the Mega uses pins 20 and 21 for I2C interface and not pins 4 and 5. So I just swaped the SDI and SCK to pins 20 and 21 and it worked. Should I still add the pull up resistors or are there pull up resistors already built into the Arduino I2C pins?

Once again, thankyou for your time.

The ATmega processor does have built-in pull-up resistors that can be enabled but when I looked at the Arduino 1.0 Wire library I didn't see any place where they were enabled. Perhaps your accelerometer module has pull-ups. You'd have to look at the schematic to find out.

Thanks John,

The schematic of my BMA 180 accelerometer board does not show any pull up so I will add them. The x, y and z values don't seem to mean anything, apart from changing when I move the accelerometer. However the temperature reading seems accurate.

Thankyou for your time.