SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Flippy1320
#59440
I purchases the HMC6352 probably a week or two ago and its been giving me problems since day one. I had a working I2C on an AVR with the accelerometer so when I tried communicating with the compass, it was giving me register data but would output 00 and FF for the A command.

Once I started using Arduino and the Wire command, i was able to get data but the data now is starting to give me problems.

In heading mode, i would get a range of only 150ish to 250ish anytime i turn the device. If i started at 150, it would increase, then once it gets to about 250 it peaks and as I continue to rotate the device, it drops down back to 150. (150 when I take the data and divide by 10).

I have tried any possible fix I can think of. setting the Set/Reset to high. Calibrating in both the lab and outside the lab where I would hope no disturbance would occur if the lab had any RF in it. I've used sample code from both sparkfun and other sites.

I am thinking the chip is defective but it is able to do everything else fine (Read/Write RAM, etc). Has anyone ever experienced this? Any ideas?
By Random
#59444
rather than RF there's probably a strong magnetic field or an actual magnet nearby - try taking just the arduino, some kind of output and the hmc itself outside away from anything and power it off a battery, see if you get the same problem.
User avatar
By bigglez
#59445
Random wrote:rather than RF there's probably a strong magnetic field or an actual magnet nearby.
I thought the same thing. I don't thave any experience
with that particular chip, but magnetic instruments are
notoriously finicky because of invisible local interference.

A little OT but a sober reminder is that CRT TV sets
can be upset by stray magnetic fields, and early sets
required a technician to make a house call with a
deguassing coil to get a clear picture.

Later, when CRT TVs and computer monitors were
imported from Asia it was a problem as the factory
had a different orientation of the earth's magnetic
field to the custoemr's location.

Early colour TV cameras required adjustments to
cancel the local magnetic fields every time the camera
was used or relocated for outside broadcasting.

The only peace of mind solution when experimenting
with sensitive magnetic instruments is to use a
Helmholtz Coil and create a magnetically controlled test zone.
By Flippy1320
#59487
Random wrote:rather than RF there's probably a strong magnetic field or an actual magnet nearby - try taking just the arduino, some kind of output and the hmc itself outside away from anything and power it off a battery, see if you get the same problem.
When I meant I took it outside the lab, I did what you said, battery, laptop, arduino, recalibrate it, and got the exact same results.
By Random
#59499
How close to the laptop was the compass module? I know it seems a remote possibility but this was exactly the problem I was having with my compass module - it returned invalid results within a small range (in my case 150 to 220 degrees) and in the end it turns out it was because of a fixed magnet nearby. Hard drives obviously contain rare earth magnets so this could be the issue - the thing is, after all, sensitive to very small magnetic fields!

I'd suggest using an lcd or something to display the output rather than the laptop, or use a long USB cable to connect to the Arduino.
By Flippy1320
#59632
Random wrote:How close to the laptop was the compass module? I know it seems a remote possibility but this was exactly the problem I was having with my compass module - it returned invalid results within a small range (in my case 150 to 220 degrees) and in the end it turns out it was because of a fixed magnet nearby. Hard drives obviously contain rare earth magnets so this could be the issue - the thing is, after all, sensitive to very small magnetic fields!

I'd suggest using an lcd or something to display the output rather than the laptop, or use a long USB cable to connect to the Arduino.
Well, I'm glad I am not the only one that is getting this similar problem. Our range is roughly the same as yours. I looked at the breadboard, no magnets. The only thing on it is the arduino with the kit, and the compass with breakoutboard connected to the 2wire serial.

I just tried to keep it away from my laptop and powered devices as much as possible. No luck. I have it communicating via RS232 and Hyperterminal. I may change it to an lcd this weekend to make it more modular.
By Flippy1320
#62024
Not to bring up a dead thread, but I thought I post the solution so that other people experiencing this would be able to look it up.

I ended up calling Honeywell, mentioning the situation and their response was to check the offset registers and see what they look like. He mentioned they should be small values and if they are anything high, to set them to zero.

So when we check the registers, my group found that it was very high (value >1024). So we zero both the X and Y and noticed how it fixed the problem. So if anyone is experiencing the same problem. Try calibration and if that doesn't work, zero out those registers.