Page 1 of 1

Arduino Magnetometer Testing

Posted: Sun Feb 11, 2018 11:45 am
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 8917 times
Carl

Re: Arduino Magnetometer Testing

Posted: Sun Feb 11, 2018 11:54 am
by Montana
Very interesting! keep us posted with how you get on :hamster:
Alexandra

Re: Arduino Magnetometer Testing

Posted: Sun Feb 11, 2018 1:30 pm
by carlosjackal
Will do Alexandra.

Re: Arduino Magnetometer Testing

Posted: Sun Feb 11, 2018 2:34 pm
by marktownley
Sounds cool!

Re: Arduino Magnetometer Testing

Posted: Sun Feb 11, 2018 3:23 pm
by highfnum
Real small
Keep us posted

Re: Arduino Magnetometer Testing

Posted: Mon Feb 12, 2018 7:02 am
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.

Re: Arduino Magnetometer Testing

Posted: Mon Feb 12, 2018 5:24 pm
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

Re: Arduino Magnetometer Testing

Posted: Mon Feb 12, 2018 8:58 pm
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

Re: Arduino Magnetometer Testing

Posted: Mon Feb 12, 2018 9:36 pm
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

Re: Arduino Magnetometer Testing

Posted: Tue Feb 13, 2018 9:01 pm
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 8844 times
Este-Oeste-03.jpg
Este-Oeste-03.jpg (173.29 KiB) Viewed 8844 times

Re: Arduino Magnetometer Testing

Posted: Tue Feb 13, 2018 9:26 pm
by marktownley
That's a hefty pier Rainer! :D

Re: Arduino Magnetometer Testing

Posted: Wed Feb 14, 2018 1:19 am
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 8829 times

Re: Arduino Magnetometer Testing

Posted: Wed Feb 14, 2018 6:34 am
by marktownley
Nice!

Re: Arduino Magnetometer Testing

Posted: Wed Feb 14, 2018 6:45 am
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.

Re: Arduino Magnetometer Testing

Posted: Wed Feb 14, 2018 3:22 pm
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

Re: Arduino Magnetometer Testing

Posted: Thu Feb 15, 2018 6:10 pm
by carlosjackal
IMG_20180215_175322.jpg
IMG_20180215_175322.jpg (2.88 MiB) Viewed 8753 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

Re: Arduino Magnetometer Testing

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

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

Stu

Re: Arduino Magnetometer Testing

Posted: Fri Feb 16, 2018 7:48 am
by Montana
Wow! that is impressive :hamster:
Alexandra

Re: Arduino Magnetometer Testing

Posted: Fri Feb 16, 2018 2:18 pm
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

Re: Arduino Magnetometer Testing

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

Re: Arduino Magnetometer Testing

Posted: Fri Feb 16, 2018 2:26 pm
by carlosjackal
IMG_20180216_142318.jpg
IMG_20180216_142318.jpg (2.89 MiB) Viewed 8724 times
The massive WiFi Board has arrived now just need to get these two talking.
Carl

Re: Arduino Magnetometer Testing

Posted: Sat Feb 17, 2018 8:53 pm
by marktownley
Hope the thermals all work out with you for this...

Re: Arduino Magnetometer Testing

Posted: Sun Feb 18, 2018 6:53 am
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.

Re: Arduino Magnetometer Testing

Posted: Sun Feb 18, 2018 11:49 am
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.

Re: Arduino Magnetometer Testing

Posted: Sun Feb 18, 2018 6:51 pm
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.

Re: Arduino Magnetometer Testing

Posted: Mon Feb 19, 2018 10:54 am
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

Re: Arduino Magnetometer Testing

Posted: Thu Mar 01, 2018 1:27 pm
by carlosjackal
IMG_20180301_131210.jpg
IMG_20180301_131210.jpg (2.84 MiB) Viewed 4305 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

Re: Arduino Magnetometer Testing

Posted: Mon Mar 19, 2018 9:59 am
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

Re: Arduino Magnetometer Testing

Posted: Mon Mar 19, 2018 6:08 pm
by Montana
That's really good!! :hamster:
Alexandra

Re: Arduino Magnetometer Testing

Posted: Mon Mar 19, 2018 9:23 pm
by marktownley
Good record!

Re: Arduino Magnetometer Testing

Posted: Tue Mar 20, 2018 4:54 pm
by carlosjackal
Thanks folks it's working great outputting 24/7 just need to get a decent graph on web page.

Carl

Re: Arduino Magnetometer Testing

Posted: Tue Mar 20, 2018 9:12 pm
by Carbon60
Great work, Carl.

Stu.

Re: Arduino Magnetometer Testing

Posted: Wed Mar 21, 2018 9:21 am
by carlosjackal
Cheers Stu