Pages: [1]   Go Down
Author Topic: Cannot detect HMC5883L on the I2C bus  (Read 1060 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone,

I bought a HMC5883L board from drotek (http://www.drotek.fr/shop/en/25-hmc5883l-magnetometer-compass-sensor.html). 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 (http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/comment-page-1/) 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.
Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 52
Posts: 1990
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

..you need pullup resistors on the i2c bus..
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1010
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://playground.arduino.cc/Main/I2cScanner

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 ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1010
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 : http://playground.arduino.cc/Main/I2CBi-directionalLevelShifter
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1010
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to report back.

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

Pages: [1]   Go Up
Jump to: