PDA

View Full Version : PIC16F876A and KMZ52 Magnetic Sensor



Stephen
- 21st December 2007, 20:28
Hi everyone, I am trying to build a simple electronic compass using the PIC16F876A and the KMZ52 magnetic sensor (produced by Phillips). Does anyone have any experience using the KMZ52 or the KMZ51? I have referenced the datasheet and Phillip's application notes about these sensors but am still confused. If someone could help me out by explaining what the flip coil and compensation coil do, I would really appreciate it.

Thanks for your time!

-Steve

mackrackit
- 22nd December 2007, 00:21
It may not help, but http://www.parallax.com/ has a compass module. The documentation is normally pretty good.

Ingvar
- 3rd January 2008, 09:59
Well, i've never used theese modern ones with integrated coils. I've only used the KMZ10 without the coils. Had to wind them myself which was a major pain in the ......

It all goes like this. The Set/Reset(aka flip) coil is used to invert(flip) the output of the sensor. This is very handy when doing measurements since you can use this to measure the offset of your analog system(sensor + amplifier). If you get a signal of 3.5 volts in one measurement and you get 1.5 volt when flipped, you can calculate the zeropint as (3.5+1.5)/2=2.5volts. The signal itself is ofcourse 3.5-2.5=1, or 1.5-2.5=-1 if you're in the flipped state. This coil is also used to "reset" the sensor if it has been exposed to a VERY powerful magnetic field which would otherwise mess up the output.

The compensationcoil is used to move the offset point. It adds(or subtracts) to the measured field.

If my memory serves me right Philips had an appnote on how to build a compass with theese sensors. Go look.

/Ingvar