Oem Compass

Hello Gunther,

The first step would be to find out the correct datasheet...
I think your module is a A405x as it also has a 6 pin header: http://www.autonnic.com/two-axis-magnetometer.html
The reference input voltage (VRef) need to be connected to a precise 2.5 Volt reference. I think the 5V pin can be used to operate the module. X and Y will output the sinus/cosinus values for the yaw/course angle. Those will be connected to the Arduino Analog inputs.


Code:
A405x
1-VRef (2.5 Volt reference input)
2-X    (0..5 Volt output)
3-Y    (0..5 Volt output)
4-GND 
5-5V   (5 Volt input/output)
6-VSS  (7..15 Volt input)




Code:
A407x
1-VRef (2.5 Volt reference input)
2-X    (0..5 Volt output)
3-Y    (0..5 Volt output)
4-GND 
5-VSS  (7..15 Volt input)



The Arduino code would look like this:


Code:
// read analog x,y values, rescale them to -PI..+PI
double x = ( ((double)analogRead(A1)) -511) / 511  * PI;
double y = ( ((double)analogRead(A2)) -511) / 511  * PI;
// calculate yaw/course angle (-180..+180 degree)
double angle = atan2(y, x) / PI * 180.0;
Serial.print("course is: ");
Serial.println(angle);


I hope this will give you some ideas for testing :)

Regards,
Alexander
 
Oben