SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By eggsy
#183056
Hey all,

at first I would like to mention that this is my first post. So please let me know, if there are any questions or suggestions regarding my problem.
I am working on a project, where I have to measure the magnetic field of an object at specific measurement points with known distance. I use five MAG3110 three-axis magnetometers that are arranged in a vertical array. They are connected to 5 Raspberry Pis that transmit the data via network to my computer, where I pull the data from each sensor with a command in MATLAB. Up to this point everything works well and I receive raw data from each magnetometer in form of values within the MAG3110's output range of +-30000. With some conversion in MATLAB I process the data to get values in the unit of µT and to remove the offset.
Now the problem is, that the y-axis magnetometer of 3 of these sensors (considered as sensor 3 to 5) have raw data that is near the output limit of -30000. In more detail these are -28769, -29712 and -28490. The other two sensors (considered as sensor 1 and 2) have raw data of 845 and -807 and are working fine. When I place a coil next to the magnetometers I expect a change in the y-component, but only the raw data of sensor 1 and 2 are changing. I think this problem results from the high raw data, so that the sensors reach their limit. As I only use MATLAB to remove the offset and conversions, the raw data of sensors 3 to 5 is still high and I can not solve the problem this way. So I think I have to make use of the user offset correction register of each MAG3110, remove these high values to get away from the limit of -30000 and then it should work.
Does anyone have had a similar problem and solved it this way with success? If not, what else could be the reason? Is the user offset correction register used for this purpose?

I would appreciate to get some help.
Thank you.
By Valen
#183074
First check is to identify if the erroneous values are indeed specific to the said sensors (faulty device or high offset), or if that is caused by the location of the specific sensor in it's surroundings. Could the geometry and metallic material in the vicinity influence your data? Can you reposition the sensors 1 and 2 to the location of 3 to 5 and verify the results? Do these values result from magnetic fields created by current carrying conductors in the vicinity? Use the working sensors to verify the magnetic field orientation at the other sensors. Do the sensors 3 to 5 give the same response when they are no longer in their previous locations.

Second, could the erroneous values be due to a bug in the RaspberryPi code? Has someone else looked at this .... Hint: we can't!

Baseline-offsets near the output limit are not good, and signs of faults (somewhere). There is no point in correcting those raw data with subtracting offsets as you won't have any resolution space left near the max value limit. You'll mostly get clipped data values. Even Matlab can't fix that. Go find the real source of the issue until you get minor offsets near 0.
By vrob
#186554
Hello Eggsy,
do you have a solution for your problem with the sensor MAG3110?
We also use this sensor and now we have the same problem as you described. These sensors have datecode "0B0" and "8B0". Older boards with same SW, but sensors with datecode "0YZ" are working well (values between ~ 1600 and 1900).

Best regards