HMC6352 compass sensor late wake up(?) problem

I'm using HMC6352 compass sensor with self made arduino 328 board.

It needs 3~4 minutes after power on till HMC6352 sensor works properly. before the time(3~4 minutes after power on) the sensor tells wrong direction.

Anybody experience this? Anyone how knows why?

Have you tried calibrating the sensor? The procedure is documented in the datasheet.

I have the module and found it didn't give meaningful data, it changed when I rotated the compass but not with any consistency.

I didn't try leaving it on for 3-4 minutes though, I'll try it later and let you know what I find.

I have the breakout module from Sparkfun (I don't know of any others) and it works fine immediately after power up. But then I also went through the calibration procedure and stored the calibration data.

I’m using similar board like sparkfun breakout from local company in Korea.
I did calibration but the late wake up problem still exist.

how about you dikkie?

Not sure about the 4 minute warmup time. Here are some things to check --

Is the module tilted?
Any magnetic fields?
Did you run any high-current traces near the compass? The HMC6343 datasheet recommendation is a "few mm's" from the compass. I would also watch the loop
area of current carrying traces.

I am using the HMC6343 without any issues.

(* jcl *)

The HMC6343 is a different product.

As for the HMC6352 my experience was similar to that of the OP. What I found was that an initial 'O' command (update bridge offsets) in my setup routine made a positive difference. It is unclear to me what this comand actually does, but perhaps anothother reader may enlighten us.

It is documented that the module will perform a "periodic set/reset" during operation (this is a switchable option) and this may explain why it would otherwise need a couple minutes before it will give stable sensor readings.

The HM6343 is a different product but all of the items I listed apply to the
HMC6352 (and to 2-axis compass ICs in general) The difference between
the two parts is that the 6343 is 3-axis and the 6352 is two axis.

The offsets are input offsets in the analog bridge circuit that conditions
the signal from magnetometer to the ADC. Unless there is an offset drift
over the first minutes of operation I am not sure how this would make a
difference. The offset values are subtracted from the ADC reading.
Without a drift the error would be constant.

I would look at the application of the sensor – grounding, decoupling, magnetic
fields, tilt, etc.

(* jcl *)

According to the HMC6352 datasheet, the raw magnetometer values are 10 bit two's complement values with its zero point at half of the supply voltage. I assume these values would be conditioned by the amplifier stage following the chips internal MR to ADC.

As the supply voltage can be anywhere from 2.7V to 5.2V my initial thinking (related to the "update bridge offsets" command) was that the chip is pre calibrated to expect a specific voltage (e.g. 3 volts). When powered from a 5 volt source (e.g. a standard Duemillanove regulated 5V power line) then a reconditioning of the amplifier stage will be needed to set the proper range and zero offset.

Another (and possibly more likely) scenario is that the HMC6352 will power up and initialize itself before we a have a stable 5V supply from the Arduino 7805 regulator and then the ADC readings will be amplified out of proportion once the Arduino is up and running at 5V.

I am not sure if the above 'assumptions' are correct, but the initial 'O' command appears to fix the "late wakeup" issue.