Arduino Magnetometer Testing

I LOVE finding out about different ways to appreciate the Sun and light in general. Use this forum to post your info or questions about various outside the mainstream ways to appreciate our life giving star!
Post Reply
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Arduino Magnetometer Testing

Post by carlosjackal »

Hi I have been playing with Ardruino boards over the last few months. These are very cheap and very versatile. They literally can control or monitor anything.

One project was a weather station which updates to the internet every 5 mins, measuring pressure, temp and humidity and all can fit into a matchbox!

I have purchased an Ardruino Uno R3 which can be bought for as little as £6.00. this board can measure the frequency of a pwm signal from a sensor ie the FGM 3 with a program literally a few lines long called "freqcount".

Loads of other boards can be added to the R3 like an ESP8266 which is a WiFi Board which again are only a few pounds.

The signal can the be sent to a site called Thingspeak which then puts the data in graph form and can be easily accessible by mobile phone app or any device really.

The plan is to put this together and see how it performs. The main thing I need to test is temperature and timing on the board and it's effects.

If this is a problem I think it can be solved by adding a very accurate real time clock board to it. This RTC board has a built in temperature monitor which compensates for temp effects on the quartz crystal and again is the size of a stamp!

Very early stage of this but if it works it's tiny, excellent price range and data can be seen from anywhere.
IMG_20180211_110753.jpg
IMG_20180211_110753.jpg (2.13 MiB) Viewed 8776 times
Carl


User avatar
Montana
Librarian
Librarian
Posts: 34560
Joined: Mon Oct 17, 2011 5:25 pm
Location: Cheshire, UK
Has thanked: 17667 times
Been thanked: 8787 times

Re: Arduino Magnetometer Testing

Post by Montana »

Very interesting! keep us posted with how you get on :hamster:
Alexandra


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Will do Alexandra.


User avatar
marktownley
Librarian
Librarian
Posts: 42270
Joined: Tue Oct 18, 2011 5:27 pm
Location: Brierley Hills, UK
Has thanked: 20424 times
Been thanked: 10243 times
Contact:

Re: Arduino Magnetometer Testing

Post by marktownley »

Sounds cool!


Image
http://brierleyhillsolar.blogspot.co.uk/
Solar images, a collection of all the most up to date live solar data on the web, imaging & processing tutorials - please take a look!
highfnum
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 2031
Joined: Sat Nov 24, 2012 2:33 pm
Has thanked: 57 times
Been thanked: 1189 times

Re: Arduino Magnetometer Testing

Post by highfnum »

Real small
Keep us posted


User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

Cool. Looking forward to seeing more from this little (and cheap) device.

Temperature fluctuations are the main issue I've found with my magnetometer. I've had to go to significant lengths to protect the integrity of the signal data using close temperature control at both the sensor and the receiver. The other issue is the effect of sporadic 'noise'; odd glitches caused by everyday objects or stray electromagnetic signals which I filter out of the data to eliminate spurious spikes. You'll need to address these in order to clean up the output charts.

Cheers.

Stu.


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
User avatar
rsfoto
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 6159
Joined: Mon Jun 18, 2012 8:30 pm
Location: San Luis Potosi, México
Has thanked: 9401 times
Been thanked: 5563 times

Re: Arduino Magnetometer Testing

Post by rsfoto »

Interesting and where can I buy those FGM Magnetometers ?

In order to understand it a bit more
...this board can measure the frequency of a pwm signal from a sensor ie the FGM 3 with a program literally a few lines long called "freqcount".
So you do not read an analog Signal but a frequency and if I understand it correctly the higher the frequency is, the stronger the magnetic field ?

Thanks and regards Rainer


regards Rainer

Observatorio Real de 14
San Luis Potosi Mexico

North 22° West 101°
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Carbon60 wrote: Mon Feb 12, 2018 7:02 am Cool. Looking forward to seeing more from this little (and cheap) device.

Temperature fluctuations are the main issue I've found with my magnetometer. I've had to go to significant lengths to protect the integrity of the signal data using close temperature control at both the sensor and the receiver. The other issue is the effect of sporadic 'noise'; odd glitches caused by everyday objects or stray electromagnetic signals which I filter out of the data to eliminate spurious spikes. You'll need to address these in order to clean up the output charts.

Cheers.

Stu.
Yes Stu I use your design but had to disconnect due to room being redecorated etc. So while down I can play with the fgm3 and the boards. As the sensor is still underground and regulated power I can isolate temperature issues at the processor.

First is to regulate power to the board and start getting some data to look at and see what problems there are.

I still have the cooler box and temperature controller setup to use as well.

Looking at software to eliminate spikes and vehicles.

Plenty to do
Regards Carl


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

rsfoto wrote: Mon Feb 12, 2018 5:24 pm Interesting and where can I buy those FGM Magnetometers ?

In order to understand it a bit more
...this board can measure the frequency of a pwm signal from a sensor ie the FGM 3 with a program literally a few lines long called "freqcount".
So you do not read an analog Signal but a frequency and if I understand it correctly the higher the frequency is, the stronger the magnetic field ?

Thanks and regards Rainer
Hi Rainer the FGM 3 outputs a 5 Volt square wave and the frequency correlates with the magnetic field both higher and lower. They are very sensitive and react to temperature fluctuations and voltage fluctuations as well.

The sensor FGM3 and voltage regulator board are best buried around a meter underground to keep a stable temperature. The reading circuit also needs to be temperature controlled as well wherever it is indoors.

Stu (Carbon60) has a design that works extremely well and has a great writeup on the build using a bat detector to measure the frequency.

I'm trying out this microcontroller which can measure the frequency using a digital input.

The sensors come from https://www.fgsensors.com.

Regards Carl


User avatar
rsfoto
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 6159
Joined: Mon Jun 18, 2012 8:30 pm
Location: San Luis Potosi, México
Has thanked: 9401 times
Been thanked: 5563 times

Re: Arduino Magnetometer Testing

Post by rsfoto »

carlosjackal wrote: Mon Feb 12, 2018 9:36 pm
rsfoto wrote: Mon Feb 12, 2018 5:24 pm Interesting and where can I buy those FGM Magnetometers ?

In order to understand it a bit more
...this board can measure the frequency of a pwm signal from a sensor ie the FGM 3 with a program literally a few lines long called "freqcount".
So you do not read an analog Signal but a frequency and if I understand it correctly the higher the frequency is, the stronger the magnetic field ?

Thanks and regards Rainer
Hi Rainer the FGM 3 outputs a 5 Volt square wave and the frequency correlates with the magnetic field both higher and lower. They are very sensitive and react to temperature fluctuations and voltage fluctuations as well.

The sensor FGM3 and voltage regulator board are best buried around a meter underground to keep a stable temperature. The reading circuit also needs to be temperature controlled as well wherever it is indoors.

Stu (Carbon60) has a design that works extremely well and has a great writeup on the build using a bat detector to measure the frequency.

I'm trying out this microcontroller which can measure the frequency using a digital input.

The sensors come from https://www.fgsensors.com.

Regards Carl
Hi Carl,

Thank you. I found FGM 3 and will order one. They are in Slovenia. I have som contacts in Germany and so I can let it send to them and from there to Mexico.

FGM 3 costs 32 Euro and shipping to Mexico would cost 55 Euro :lol:

One more question. I have a pier which at the base is 1m x 1m and quite high. Could I drill a hole into the pier and bury it there ? The pier year in year out has quite a similar temperature. Look at the pier construction.

I could spare burying in my garden ¿?

regards
Torre-Este-03.jpg
Torre-Este-03.jpg (98.17 KiB) Viewed 8703 times
Este-Oeste-03.jpg
Este-Oeste-03.jpg (173.29 KiB) Viewed 8703 times


regards Rainer

Observatorio Real de 14
San Luis Potosi Mexico

North 22° West 101°
User avatar
marktownley
Librarian
Librarian
Posts: 42270
Joined: Tue Oct 18, 2011 5:27 pm
Location: Brierley Hills, UK
Has thanked: 20424 times
Been thanked: 10243 times
Contact:

Re: Arduino Magnetometer Testing

Post by marktownley »

That's a hefty pier Rainer! :D


Image
http://brierleyhillsolar.blogspot.co.uk/
Solar images, a collection of all the most up to date live solar data on the web, imaging & processing tutorials - please take a look!
User avatar
rsfoto
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 6159
Joined: Mon Jun 18, 2012 8:30 pm
Location: San Luis Potosi, México
Has thanked: 9401 times
Been thanked: 5563 times

Re: Arduino Magnetometer Testing

Post by rsfoto »

marktownley wrote: Tue Feb 13, 2018 9:26 pm That's a hefty pier Rainer! :D
Each pier weighs 7000kg :-) and finished they look like this

Este-Oeste-15.jpg
Este-Oeste-15.jpg (186.7 KiB) Viewed 8688 times


regards Rainer

Observatorio Real de 14
San Luis Potosi Mexico

North 22° West 101°
User avatar
marktownley
Librarian
Librarian
Posts: 42270
Joined: Tue Oct 18, 2011 5:27 pm
Location: Brierley Hills, UK
Has thanked: 20424 times
Been thanked: 10243 times
Contact:

Re: Arduino Magnetometer Testing

Post by marktownley »

Nice!


Image
http://brierleyhillsolar.blogspot.co.uk/
Solar images, a collection of all the most up to date live solar data on the web, imaging & processing tutorials - please take a look!
User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

Hi Rainer,

My concern is the local reinforcing steel which might impact performance. Better to be located away from steelwork and electrical cables if you can do so.

BTW there is a tutorial on this in the library section of this forum.

Regards

Stu.


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
User avatar
rsfoto
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 6159
Joined: Mon Jun 18, 2012 8:30 pm
Location: San Luis Potosi, México
Has thanked: 9401 times
Been thanked: 5563 times

Re: Arduino Magnetometer Testing

Post by rsfoto »

Carbon60 wrote: Wed Feb 14, 2018 6:45 am Hi Rainer,

My concern is the local reinforcing steel which might impact performance. Better to be located away from steelwork and electrical cables if you can do so.

BTW there is a tutorial on this in the library section of this forum.

Regards

Stu.
Thank you Stu. Will analize that.

regards


regards Rainer

Observatorio Real de 14
San Luis Potosi Mexico

North 22° West 101°
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

IMG_20180215_175322.jpg
IMG_20180215_175322.jpg (2.88 MiB) Viewed 8612 times
Hi all here's the first hit of the CME on the Ardruino board. Findings so far are it dosnt appear to react to the house temperature which is good. It concurs with the magnetometer at Crooktree.

The raised section in the middle is the effect of my own vehicle which can be looked at. Worth noting as well the chart is inverted however the can be easily turned around on the online live chart.
Carl


User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

Nice one, Carl.

Are you also able to capture/export the data as a CSV file (frequency and time)?

Stu


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
User avatar
Montana
Librarian
Librarian
Posts: 34560
Joined: Mon Oct 17, 2011 5:25 pm
Location: Cheshire, UK
Has thanked: 17667 times
Been thanked: 8787 times

Re: Arduino Magnetometer Testing

Post by Montana »

Wow! that is impressive :hamster:
Alexandra


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Carbon60 wrote: Fri Feb 16, 2018 6:58 am Nice one, Carl.

Are you also able to capture/export the data as a CSV file (frequency and time)?

Stu
Hi Stuart that can be done. This chart is a basic one provided by the Ardruino software instead of pumping out a list of numbers. There are various ways of doing a CSV file live which I will look at this weekend.

Carl


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Montana wrote: Fri Feb 16, 2018 7:48 am Wow! that is impressive :hamster:
Alexandra
It's working well Alexandra 😁


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

IMG_20180216_142318.jpg
IMG_20180216_142318.jpg (2.89 MiB) Viewed 8583 times
The massive WiFi Board has arrived now just need to get these two talking.
Carl


User avatar
marktownley
Librarian
Librarian
Posts: 42270
Joined: Tue Oct 18, 2011 5:27 pm
Location: Brierley Hills, UK
Has thanked: 20424 times
Been thanked: 10243 times
Contact:

Re: Arduino Magnetometer Testing

Post by marktownley »

Hope the thermals all work out with you for this...


Image
http://brierleyhillsolar.blogspot.co.uk/
Solar images, a collection of all the most up to date live solar data on the web, imaging & processing tutorials - please take a look!
User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

Frequency counting is the way to go. When I started my magnetometer project some years back I was looking for a suitable low cost counter, but I couldn't find anything on the market cheap enough with the resolution needed for sub nT measurements. The Arduino ( or Rasperry Pi) micro systems now available seem more than up to the task.

Data logging appears to be pretty straightforward, as does exporting to Excel. Once you get your data into Excel, Carl, it will then be easy to filter out the noise/spikes in your data, even accounting for passing traffic, or parking on your driveway.

Temperature control at the receiver has been the biggest challenge with my design. I'm confident that the Arduino version will eliminate this issue and that a cleaner presentation of your data can be achieved through the use of Excel.

Stu.


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Hi Stu, all,
Yes Stu it appears to be. Heres the story so far.

The Aurdrino board is located beside a kitchen window which is opened and closed on a regular basis due to a cat! Its also beside a kettle. If this didnt test the temperature nothing would.

I have found how to load data into Excel by doing the following,

A free programe called Coolterm reads the data from the USB serial port. It then places it into a text file with a date/time stamp. All setup for reading once a minute.

I set up Excel to auto read from the file every minute and import the data. This also automatically gets plotted into a graph there as well.

All seems to work great.

The next plan is to add the WIFI board and send live data to Thinkspeak online this will still allow excel to gather data as well.

All in all this is looking like a very cost effective project which can be easily added to with a small screen temperature sensors etc.

The regulated power supply and stable temperature at the FGM 3 location is still and absolute must.

The following graph is from around 11:30 yesterday until this morning with a comparison from Lancaster magnetometer and i think we have a match.

The first low spike is a van which decided to park briefly and the second my fault allowing the pc to power down briefly.

Regards Carl.
Attachments
Magaurdruino.jpg
Magaurdruino.jpg (121.68 KiB) Viewed 8527 times


User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

An excellent match, Carl.

You can now very easily get Excel to remove the transient spikes and you've got yourself a nice stable magnetometer. Given the low cost, maybe you could run three at once for the X,Y & Z components ;).

Stu.


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Carbon60 wrote: Sun Feb 18, 2018 6:51 pm An excellent match, Carl.

You can now very easily get Excel to remove the transient spikes and you've got yourself a nice stable magnetometer. Given the low cost, maybe you could run three at once for the X,Y & Z components ;).

Stu.
Thanks Stu, yes that is certainly doable. Baby steps learning code at the minute :shock:

Carl


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

IMG_20180301_131210.jpg
IMG_20180301_131210.jpg (2.84 MiB) Viewed 4152 times
Hi all just a quick update on the build.
I have now connected the WIFI module to the Arduino Uno board they are now both talking.

It took over a week of putting the codes together to get them to work but I think I have cracked it😁

The live readings are now being send to THINGSPEAK

The channel is just up and running so will take a day or two to get a length of data.

If you go to the Thingspeak site then channels and type "magnetometer" into the Tag search it's there.

Should be noted that the readings are inverted but will be using a MATLAB graph soon to correct. For now it's still a test.

Regards Carl


carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Hi all the magnetometer readings can be seen live on the following link,
https://sites.google.com/site/iotchartsdemo/thingspeak
Just type in the channel box 438056 and change the number of points to 2000.
Last night's big hit can be seen.
Cheers Carl


User avatar
Montana
Librarian
Librarian
Posts: 34560
Joined: Mon Oct 17, 2011 5:25 pm
Location: Cheshire, UK
Has thanked: 17667 times
Been thanked: 8787 times

Re: Arduino Magnetometer Testing

Post by Montana »

That's really good!! :hamster:
Alexandra


User avatar
marktownley
Librarian
Librarian
Posts: 42270
Joined: Tue Oct 18, 2011 5:27 pm
Location: Brierley Hills, UK
Has thanked: 20424 times
Been thanked: 10243 times
Contact:

Re: Arduino Magnetometer Testing

Post by marktownley »

Good record!


Image
http://brierleyhillsolar.blogspot.co.uk/
Solar images, a collection of all the most up to date live solar data on the web, imaging & processing tutorials - please take a look!
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Thanks folks it's working great outputting 24/7 just need to get a decent graph on web page.

Carl


User avatar
Carbon60
Way More Fun to Share It!!
Way More Fun to Share It!!
Posts: 14205
Joined: Wed Mar 07, 2012 12:33 pm
Location: Lancashire, UK
Has thanked: 8415 times
Been thanked: 8161 times

Re: Arduino Magnetometer Testing

Post by Carbon60 »

Great work, Carl.

Stu.


H-alpha, WL and Ca II K imaging kit for various image scales.
Fluxgate Magnetometers (1s and 150s Cadence).
Radio meteor detector.
More images at http://www.flickr.com/photos/solarcarbon60/
carlosjackal
Oh, I get it now!
Oh, I get it now!
Posts: 43
Joined: Sat Oct 29, 2016 6:38 pm
Location: Antrim

Re: Arduino Magnetometer Testing

Post by carlosjackal »

Cheers Stu


Post Reply