Metal Detection Possible with Magnetometer

Hi,

I am doing a project for my school and we are designing a metal detector. I have the Arduino Uno R3 and connected the Triple-axis Magnetometer (Compass) Board - HMC5883L in the hopes that the sensor can be used to detect metal. I have been able to get the software uploaded to the Uno but don't understand what to do with the coordinate readings I am getting.

I appreciate any guidance you can provide. I am brand new to all of this so I apologize for any redundancy, etc. My brother helped my solder the sensor to the pins which were included with the sensor.

I have attached a picture of what I have connected thus far.

Thank you in advance,
Jessica

I think you may off on a wrong track. Although iron/steel is attracted to a magnet, and can be magnetized, most ferrous materials are at best very slightly magnetic. So the magnetometer can react to the earth's magnetic field because it's everywhere present, but there's no assurance a piece of metal you're trying to detect will trigger it.

The standard metal detector generates a local electromagnetic field, which allows metal detection because it stimulates some magnetism in the target material. I'd do a little research on that.

jrdoner:
I think you may off on a wrong track. Although iron/steel is attracted to a magnet, and can be magnetized, most ferrous materials are at best very slightly magnetic. So the magnetometer can react to the earth's magnetic field because it's everywhere present, but there's no assurance a piece of metal you're trying to detect will trigger it.

The standard metal detector generates a local electromagnetic field, which allows metal detection because it stimulates some magnetism in the target material. I'd do a little research on that.

This thread piqued my interest, so I did some reading earlier, and apparently a magnetometer is a valid method of detecting ferrous metals.
From Wikipedia:-

Magnetometers can be used as metal detectors: they can detect only magnetic (ferrous) metals, but can detect such metals at a much larger depth than conventional metal detectors; they are capable of detecting large objects, such as cars, at tens of metres, while a metal detector's range is rarely more than 2 metres.

Here's a link to the Wiki page:-
Magnetometer

Jessica, here's the datasheet. Just in case you don't already have it, it will help a bit:-
HMC5883L

I didn't post earlier, because I had nothing to contribute, but have been watching with interest, and I'd like to see how this project develops.....

Magnetometers are extremely sensitive to iron (ferrous) and even weakly magnetized materials.

If used as a magnetic compass, they almost always have to be recalibrated after installation, because the direction of North appears to change due to nearby ferrous objects. These are called a "hard iron" errors. A single steel screw can create havoc.

Also, magnetic fields due to electrical currents induce errors that are called "soft iron" errors.

As wikipedia claims, a magnetometer compass can easily detect automobiles several meters away, due to distortions induced in the Earth's magnetic field, so I made a gate announcer using an HMC6352 chip that tells us when someone is arriving.

jremington:
As wikipedia claims, a magnetometer compass can easily detect automobiles several meters away

Even better, it actually claims

such as cars, at tens of metres,

I'm tempted to have a go at this myself, for a screw and nail detector for my woodwork. (I know you can buy cheap units to do it, but it's more fun to make one, and a learning exercise to boot.)

Even better, it actually claims

Not in my experience, using the HMC6352. It reliably can sense a car passing about 2 meters away, but not much more (unless you are willing to live with false alarms). Of course, size matters.

jremington:
Not in my experience, using the HMC6352. It reliably can sense a car passing about 2 meters away, but not much more (unless you are willing to live with false alarms). Of course, size matters.

Fair enough. I'll bow to your superior knowledge. I was only quoting the Wiki page, and didn't even know a magnetometer could be used for metal detection until I spotted this thread earlier. Everything I know about it has been learned since, (and would fit in a thimble). :slight_smile:

I think the now retired Micromag3 had a lot better sensitivity that could detect at greater ranges than the HMC6352.
I was looking for some a year of so ago with a view to building my own solar wind detector but determined I could not place the detector anywhere far enough away from interference like cars going by to make the rig usable.

With a conventional metal detector you use it to swing from side to side looking for metal. You can not use this chip in that mode because you will not be able to separate the change you get from the movement with the change you get from the metal.

Adding an accelerometer to the probe might help in theory to separate the two but I doubt it would be useable.

Riva:
I think the now retired Micromag3 had a lot better sensitivity that could detect at greater ranges than the HMC6352.
I was looking for some a year of so ago with a view to building my own solar wind detector but determined I could not place the detector anywhere far enough away from interference like cars going by to make the rig usable.

I imagine so. The HMC6352 is an older device. To clarify, I use the device in "orientation mode" which reports the direction it is pointing, relative to the horizontal component of the Earth's magnetic field. It returns degrees in tenths, between 0 and 3599.

The noise is really the issue. The HMC6352 orientation output shows about 5 tenths standard deviation with very occasional spikes greater than 10 tenths. I set the "vehicle alarm" to 10.

In practice, a small car moving by about 2 meters away will give at least 10, but will occasionally fail to trigger the alarm and once every few days, there is a false alarm. Larger vehicles will give several degrees variation.

I recently saw some little HCM5883L PCBs being sold for a dollar on ebay (free shipping). I've wondered about getting a bunch of these to make some sort of array of sensors. I'd think a 1 meter by 1 meter square of these sensors placed every 10cm would make a very interesting metal detector.

With a bit of extra averaging to smooth the feedback from the HMC5883L, it can be very precise.

DuaneDegn:
I recently saw some little HCM5883L PCBs being sold for a dollar on ebay (free shipping). I've wondered about getting a bunch of these to make some sort of array of sensors. I'd think a 1 meter by 1 meter square of these sensors placed every 10cm would make a very interesting metal detector.

With a bit of extra averaging to smooth the feedback from the HMC5883L, it can be very precise.

How would you correct for the variations caused by moving the sensors in the earth's magnetic field?
How would you correct for the variations caused by moving the sensors in the magnetic fields caused by electrical activity? Eg. Power lines, radio transmitters or even the Arduino itself.
NB. The earth's magnetic field varies greatly from place to place. Eg. The Equator and the North and South magnetic poles.

Henry_Best:
How would you correct for the variations caused by moving the sensors in the earth's magnetic field?

The Earth's field should be pretty consistent across an area of one square meter. Once the sensor array were calibrated all the sensors should have almost identical readings in Earth's undisturbed field. I'd want to look to the array to look for disturbances in the force. These differences would likely be caused from a distortions in the magnetic field (possibly by metal items).

Henry_Best:
How would you correct for the variations caused by moving the sensors in the magnetic fields caused by electrical activity? Eg. Power lines, radio transmitters or even the Arduino itself.

If the electrical activity is far enough away, it should affect all the sensors by the same amount. The microcontroller should be located in a fixed position with respect to the array or far enough away to keep from interfering. Though really, the fields for these sorts of sources would be something I'd want to use an array to investigate.

Henry_Best:
NB. The earth's magnetic field varies greatly from place to place. Eg. The Equator and the North and South magnetic poles.

Yes it does. Here in Idaho it's more vertical than horizontal.

I've played around with some HMC5883L sensors a lot. Fields from microcontroller boards aren't much of a problem but motors sure can be. Even still, if you move the sensor a few feet away from small motors and you can pick up the Earth's field again.

Note, I did say "an interesting metal detector". I didn't say an effective or practical metal detector. I'm not even sure it would detect non-ferrous metals.

I just think it would be interesting to be able to get a quick "picture" of what the magnetic fields in an area looked like. Kind of like being able to toss iron filings into the air to map out the field lines.

DuaneDegn:

Quote from: Henry_Best on Today at 03:48:05

NB. The earth's magnetic field varies greatly from place to place. Eg. The Equator and the North and South magnetic poles.

Yes it does. Here in Idaho it's more vertical than horizontal.

Here, in London, it's much the same.

I am looking to use either a MAG3110 Magnetic Sensor or HMC5883L to detect small metal objects (keys, nails, cell phones, etc) out to 7 meters or so... not sure if it will work. Using an Arduino Uno R3.

SamBrownADK:
I am looking to use either a MAG3110 Magnetic Sensor or HMC5883L to detect small metal objects (keys, nails, cell phones, etc) out to 7 meters or so... not sure if it will work. Using an Arduino Uno R3.

Have you read the replies in this thread?

Hi
It would be worth starting your own thread for your request.

Tom.... :slight_smile:
Send a message to the moderator.

detect small metal objects (keys, nails, cell phones, etc) out to 7 meters or so

No chance at all of detecting "small metal objects" at 7 meters. 7 centimeters, possibly.

1 Like

Metal detectors I know send a changing magnetic field out that induces a field in metal objects strong enough to interact back, all using analog circuitry in a hobby kit. The target metal didn't have to be ferrous, just have eddy currents in a changing field.

The words to look up are magnetic induction.

If you put your sensor in front of a strong magnet and wave a soda can in front of it, the sensor should pick up the field changing because of the moving metal. Gear tooth counters use that.

It will not work, see reply #8.