Gyroscope: I'd have thought that it was worth working on the gyroscope data to see if you can us its known location in the car + car known geometrical performance when turning + what the accelerometers say to interpret the gyro result more appropriately. A "perfect" gyro should give you better results than "perfect" accelerometers. Reality and Murphy will make this less so, but it's still a shame to abandon the gyros.
Magnetometers - aka compass: You'll have problems if you install a compass where it is affected by large items of ferromagnetic material.
Under a car dashboard certainly qualifies as a really bad location.
You can carry out a very low cost test by taking any compass and holding it in various positions under the dashboard (still in sight) and seeing how it changes, Then turn the car 90 degrees and repeat.
Where it matters "real people" perform "compass swinging" to either produce a deviation chart or to make adjustments by the use of either small magnets or pieces of ferromagnetic (usually) metal. (eg Brass is very slightly diamagnetic (~= "anti ferromagnetic") and will also affect the field but much less and oppositely in sense.
If you make a deviation table then it could be adjusted for in software.
Useful compass deviation page.
They say:
In most cases, these difficulties can be overcome by 'adjusting' the compass. This is the process of placing small magnets around the compass site or of altering the positions of adjustment magnets within the compass body. Traditionally, it has always been considered a task for specialist compass adjusters and beyond the means of the average boat owner.
This is no longer true. With C-Swing, preparing a deviation chart is now simply a question of selecting a suitable shoreside object, entering its true bearing from the chart, then entering its compass bearing as the boat is sailed on a range of headings. With the built-in maths package, headings do not need to be exactly on compass points and, if suitably spaced, as few as 5 are sufficient to prepare a full chart showing deviations at 10� intervals. Furthermore, C-Swing also computes a set of magnetic coefficients and gives guidance on placing corrector magnets and making adjustments.
That sounds hard, and it's not utterly trivial, but a bit of thought about what you are trying to correct for and how external magnets help will show that it's a fairly straight forward process. And, it's likely that intelligence-informed trial and error will allow you to do an OK job.
Here are people who do it do it for a living
According to the above page, here are people who didn't do it properly - USS Port Royal grounding in 2009. However, according to Wikipdia report it was not a compass error but a more high tech navigation system error followed by lots of human error that lead to the grounding. I'll leave the picture as it does make the point of what can happen if your navigation system is faulty. Just stay away from coral reefs with your car! :-). (Reef cost them $15M to repair. Ship between $25M & $40M)
Useful page here
Wikipedia - historical - interesting
They say:
- Diagram of a 19th century binnacle housing a compass. It has two soft iron spheres (Q) to correct for induced magnetization.
The TinkerKit hall sensor is essentially a standard 3-pin ratiometric Hall sensor, on a cutesy PCB.
Of the 3 pins on it, the -
pin goes to the GND
pin of your Arduino, the +
pin goes to the 5V
pin, and the pin in the middle can be connected to any of the analog input pins of the Arduino, say A0
. Jumper wires can be used to connect these up.
As long as there are no magnets near the hall sensor, the PCB can be held upright, and rotated, to receive the sensed value from the Hall sensor. The Arduino code provided on the TinkerKit site will work for this.
As the Hall Sensor module is rotated, the analog input value will change from approximately 512 (or some bias value around that) to a higher value for one polarity and a lower value for the opposite. The value received will provide an approximate magnetic compass reading.
Note that this is not going to be very precise, but for an experiment it should serve the purpose. Also, the variation from the middle value will probably be very small, as the hall sensor IC used is not a very sensitive one: 1.3 mV/Gauss
.
Best Answer
Likely not, my advice would be to try what shipbuilders do for centuries: mount the compass on the frame and calibrate it so you know what true heading corresponds to each indicated.