Cannot detect HMC5883L on the I2C bus

Hello everyone,

I bought a HMC5883L board from drotek ( After connecting the board to the i2c bus of my nanowii (ATmega32U4) the sensor board is not detected.

I tried the code from this site ( to scan the i2c bus without success. Nothing found... The same happend if I connect the board to my raspberrypi and scan the bus with i2cscanner.

Any suggestions? Is the sensor board broken?

Thanks. need pullup resistors on the i2c bus..

I think there are already pull-up resistors on that sensor breakout-board.

The i2c scanner you mentioned is rather old. Do you use the newest Arduino 1.0.3 ? This is this i2c_scanner:

Check your wiring careful. If it still doesn't work, You could try to measure the 3.3V or 5V on the board. Are you sure you are using the i2c from the ATmega32U4 ? They are on different pins. Do you have any other i2c device to test ?

Thank you for your replies. On the board are two 4,7k pullup resistors. I tested the I2C bus with a BMP085 pressure sensor and an GPS module. Both are working like a charm.

The 3,3v and 5v lines seem ok.

I'm using Arduino 1.0.1.

It might be broken.

Buying a new sensor board with a broken HMC5883L on it, is something I never heard of. It is always some kind of other problem.

I can think of two things:

(1) In some cases the I2C-bus needs a level shifter : Using a 3.3V I2C-bus with a 5V Arduino is living on the edge as you can read in that link.

(2) It could be bad soldering. Carefully check each soldering with a magnifier (or make a photo of it). You must see that at each connection the solder has flown. If you spot a problem, soldering might be too tiny, but you could use a heat gun to try to make the solder flow.

If this doesn't help, buy a new one. Preferably at Sparkfun or Adafruit, or a cheap one on Ebay.

Ok, I will resolder all pins and try to connect the 5V line of the sensor board (board has a 5V and 3.3V connector). Hope this helps.

Today I tried the following things without success:

  • Resoldered all pins
  • Connected the sensor board to 5V and 3,3V of my nanowii board
  • Connected the sensor board to 5V and 3,3V of my raspberry pi
  • Enabled / Disabled internal pullups of the nanowii board
  • Measured the voltages on the sensor board (3,3V connection => 3,31V VCC, 3V on SCL and SDA)
  • Measured the capacitors on the sensor board => 3,06uF and 0,20uF (Datasheet says 4,7uF and 0,22uF could this be a problem?)

If no one has another idea what I'm missing, I think I will have to buy a new one...

No ideas. Buy a new one. Let's hope the new one doesn't have the same problems.

I want to report back.

I ordered a new saintsmart hmc5883l from ebay and it's working out of the box...