P&T Webcam Scripting Magnetometry Lightbox Artificial stars Home


cscript log2excelchart.vbs "u:\documents and settings\administrator\desktop\astronomy\compass\compass2006sep05.log" -->

Magnetometry using a Digital compass.

Why ?

Magnetometry reveals the fluctuations in the earth's magnetic field.these fluctuations are caused by the changing compression on a daily basis of the earths magnetic field due to the changing magnetic field from the sun and any charged particle storms such as those that cause aurora. Hence monitoring the local magnetic field components ( preferably all three of them ) gives an idea what's going on at any one time if measured with sufficient sensitivity. Failing to measure all three, the local field strength in the vertical plane should be sufficient.

How ?

The robotics web sites sell digital compasses such as this one that interface using a serial port or an I2C port. These compasses comprise sensitive fluxgate magnetometers that, when using a pair of them on board a PCB and mounted at right angles, allow the Earth's field strength in particular direction to be measured and thus can be used as a digital compass. Given sufficient readings and a bit of statistics the idea was to see whether I could also use one of these as a real-time aurora-meter on the cheap.
In my defence for not going the whole hog - I have previously built a real fluxgate magnetometer ( the Richard Noble design ) and found it to be very unstable for reliable readings.

Since I was using one of these devices as the dome pointing measurement device - giving pointing readings to half a degree or so, I reckoned sufficient readings averaged over a few seconds ought to show the diurnal background and any magnetic transients. The test was in the data.
So I set up a running measurement to take and average the data every minute between 10 and 60 samples per minute and record it in a simple text file. The script to do this is here: VBS script to read magnetometer

Well ?

The data is here, consisting of a set of Excel files with graphs and the original raw text file logs that have been imported into excel.
The date format is julian date, so midnight lies at DDD.5.
The graphs are should be read in detail - that is to say look at the movement on a section of the graph - the dome was occasionally moved so the 'dc offset' as it were, occasionally shifts. The data of interest is the variation on the static baseline due to changes in the earths magnetic field and not gross changes in the dome orientation.


Todays data from The university of Lancaster

My data from various dates in Spring 2005.

2005 April 4th

2005 April 5th

2005 May 28th

2005 May 29th

2005 May 30th

The dropouts in my data are due to the occasional missed reading causing average over 60 to be short compared with the more normally correct data.
I need to fix this counting error for missing data in the script. If you look at the University of Lancaster data you should see that the diurnal data has a shallow peak in the afternoon due to the regular daily changes in the local magnetic field. These should be echoed as a first test, in the magnetometer data.
Graph 2005 may 29 seems to show this quite well, covering as it does, almost two days worth of data.

In summary I claim that you can see the diurnal variation in the data above - i.e. a change of about 0.4 ° corresponds to the diurnal variation and more than this due to auroral influences will show up clearly.
The final step is to modify the script to read the magnetometer continuously - this is more of a battery problem than a scripting problem - eventually the batteries die because the panel recharging them couldn't cope with the load.


  • "Fluxgate Magnetometry", R Noble, Electronics World and Wireless World, ( Sept 1991 )Vol 97 pp. 726-32 ( ISSN 0266-3244 )

  • "Electronic Fluxgate Compass", R Noble, Electronics World and Wireles World, ( Jan 1992 )Vol 98 pp. 14-18

  • "A review of magnetic sensors", J. E. Lenz, Proc IEEE 78(6) 1990 p973

  • "Recent advances in Fluxgate Magnetometry", D.I Gordon, R.E. Brown, IEEE Trans. Magnetics v.MAG-8,1,1972, pp. 76-82

  • "A simple fluxgate sensor" link

  • "Magnetometer in observing auroras" link

  • University of Lancaster Aurora Alert & Solar weather page link

  • Space Weather link

  • NASA POES auraora monitor link