Compass Interference

I am using an LSM303 Compass/ Accelerometer and it is mounted on a breadboard on my gps shield, arduino, esc, motor, servo, sonar, and battery...Well its having some trouble. It was working fine when I first tested it but now is quite jittery in its readings. I know some people recommend averaging out the readings but that would mean slower input rate. I saw something about using mu metal shielding too. Im not too familiar with this but if anyone knows if it works I would give it a try. Otherwise, I could put the Compass up on a stick above the car I'm building however I don't really want to do that. Also if there is a better Compass I may be open to trying out that. Any suggestions would be great. Thank you so much!!!

You MUST calibrate the compass. Magnetometers are nearly useless out of the box. Shielding will create even more problems.

While there are simpler calibration procedures, this one is the best.

Ok wow glad to hear that. I had read some stuff mentioning calibrating but wasn't sure it was necessary. I'll do that right now thanks!!

I won't respond to personal messages, but if you have problems running MagCal or Magneto, a simpler and less accurate approach is described here: Calibration | LSM303 Accelerometer + Compass Breakout | Adafruit Learning System

Google will find several other approaches.

Anybody know how to solve the problem I'm having with downloading MagCal. I unzip it and 5 files show up. 4 are written in weird characters like some kind of alien writing. And 1 says It's for windows and I can't open it. I have a mac. Any suggestions?

So I used the "simple" calibration method listed above but its not simple. I downloaded the code. Started it and spun my compass around all axis' a bunch and the serial monitor just kept reading numbers like is something supposed to happen after I spin it around a bunch. Is that the whole process?

The program is not at all complicated. Please take a few minutes to study it, and understand what it does. Also, read through the documentation on the Adafruit compass calibration pages, so that you understand how to apply the corrections obtained in the first step.