I2C: problem getting response from compass

Hi all,

I’m attempting to communicate with a compass (heading, pitch roll) via I2C with my Arduino, however I’m having issues getting a response. I’m not sure if there is an issue with my programming or the device itself.

The compass doesn’t have much documentation other than then what is found on this page: http://www.techdesign.be/projects/023/023.htm which indicates the address is 0xa0 and the registers that contain relevant data are 0x00, 0x01, 0x04, 0x05. It doesn’t really mention how to initiate conversation with a particular register such that it sends the data to the Arduino.

Well here is what I’ve come up with so far…

#include <Wire.h>

void setup() {

void loop() {
  Serial.print("data: ");
  int data;

  //start the transmission
  Wire.requestFrom(0xa0, 1); 
  if (Wire.available()) {
    data = Wire.receive();
  else {

I also tried using the conversion from an 8-bit address (0xa0) to a 7-bit (0x50 in my case), but to no avail.

Any suggestion would be greatly appreciated. Thanks!

Any help would be much appreciated folks.

(sorry if there is a thread bump time rule)

The 0xA0 I2C address is not valid for the Arduino TWI library so no need to even try this. I would keep it at 0x50 when testing. Also make sure you connect SCL to Arduino analog input 5, SDA to Arduino analog input 4 and connect +5V and GND respectively.

The board apparently has 10k pullup's for SDA/SCL so should be no need for additional pullup. TWI clock speed for Arduino is 100kHz by default. You may want to check if this is compatible with the board you have (I found no reference to clock speed in the docs you linked to).

The "documentation" suggests it is accessed as an EEPROM which typically use 16-bit addresses. If you still have issues, I would try sending two bytes for the address. High byte first (0x00) and then the low byte (one of 0x00 thru to 0x05).

Your test program looks ok.

Thanks very much for the reply BenF. All the connections appear to be correct. I've been playing around with an I2C blinkm device and I am able to communicate just fine. I also tried sending the two bytes for the address as suggested, but no luck. I also added in an small delay between Wire.endTransmission and Wire.requestFrom statements.

I'm beginning to speculate that there is some fault with the compass, perhaps there's some incompatibility somewhere. I might think about looking for an alternate device if I can't get this working.

Still looking forward to any additional suggestions!

How many times have you stepped out from Louis Vuitton or Abercrombie Fitch,Gucc