Introduction: Simple Arduino Metal Detector

Metal detection is a great past-time that gets you outdoors, discover new places and maybe find something interesting. Check your local regulations on how to act in case of an eventual find, in particular in case of hazardous objects, archeological relics or objects of significant economic or emotional value.

Instructions for DIY metal detectors are plenty, but this recipe is particular in the sense that it requires very few components in addition to an Arduino microcontroller: a common capacitor, resistor and diode form the core, together with a search coil that consist of circa 20 windings of electrically conducting cable. LED’s, a speaker and/or headphone are then added for signalling the presence of metal near the search coil. An additional advantage is that all can be powered from a single 5V power, for which a common 2000mAh USB power is sufficient and will last many hours.

To interpret the signals and to understand what materials and shapes the detector is sensitive to, it really helps to understand the physics. As a rule of thumb, the detector is sensitive to objects at a distance or depth up to the radius of the coil. It is most sensitive to objects in which a current can flow in the plane of the coil, and the response will correspond to the area of the current loop in that object. Thus a metal disc in the plane of the coil will give a much stronger response than the same metal disc perpendicular to the coil. The weight of the object does not matter much. A thin piece of aluminium foil oriented in the plane of a coil will give a much stronger response than a heavy metal bolt.

Step 1: Working Principle

Picture of Working Principle

When electricity starts flowing through a coil, it builds up a magnetic field. According to Faraday’s law of induction, a changing magnetic field will result in an electric field that opposes the change in magnetic field. Thus, a voltage will develop across the coil that opposes the increase in current. This effect is called self-inductance, and the unit of inductance is Henry, where a coil of 1 Henry develops a potential difference of 1V when the current changes by 1 Ampere per second. The inductance of a coil with N windings and a radius R is approximately 5muH x N^2 x R, with R in meters.

The presence of a metallic object near a coil will change its inductance. Depending on the type of metal, the inductance can either increase or decrease. Non-magnetic metals such as copper and aluminium near a coil reduce the inductance, because a changing magnetic field will induce eddy currents in the object that reduce the intensity of the local magnetic field. Ferromagnetic materials, such as iron, near a coil increase its inductance because the induced magnetic fields align with the external magnetic field.

The measurement of the inductance of a coil can thus reveal the presence of metals nearby. With an Arduino, a capacitor, a diode and a resistor it is possible to measure the inductance of a coil: making the coil part of a high-pass LR filter and feeding this with a block-wave, short spikes will be created at every transition. The pulse length of these spikes is proportional to the inductance of the coil. In fact, the characteristic time of an LR filter is tau=L/R. For a coil of 20 windings and a diameter of 10 cm, L ~ 5muH x 20^2 x 0.05 = 100muH. To protect the Arduino from overcurrent, the minimum resistance is 200Ohm. We thus expect pulses with a length of about 0.5 microsecond. These are difficult to measure directly with high precision, given that the clock frequency of the Arduino is 16MHz.

Instead, the rising pulse can be used to charge a capacitor, which can then be read out with the Arduino analog to digital converted (ADC). The expected charge from a 0.5 microsecond pulse of 25mA is 12.5nC, which will give 1.25V on a 10nF capacitor. The voltage drop over the diode will reduce this. If the pulse is repeated a few times, the charge on the capacitor rises to ~2V. This can be read out with the Arduino ADC using analogRead(). The capacitor can then be quickly discharged by changing the readout pin to output and setting it to 0V for a few microseconds.The whole measurement takes about 200 microseconds, 100 for the charging and resetting of the capacitor and 100 for the ADC conversion. The precision can be greatly enhanced by repeating the measurement and averaging the result: taking the average of 256 measurements takes 50ms and improves the precision by a factor 16. The 10-bit ADC achieves the precision of a 14-bit ADC this way.

This measurement obtained is highly nonlinear with the inductance of the coil and therefore not suitable to measure the absolute value of the inductance. However, for metal detection we are only interested in tiny relative changes of the coil inductance due to the presence of nearby metals, and for that this method is perfectly suitable.

The calibration of the measurement can be done automatically in software. If one can assume that most of the time there is no metal near the coil, a deviation from the average is a signal that metal has come close to the coil. Using different colours or different tones allows to discriminate between a sudden increase or a sudden decrease in the inductance.

Step 2: Required Components

Electronic core:

Arduino UNO R3 + prototype shield OR Arduino Nano with 5x7cm prototype board

10nF capacitor

Small signal diode, e.g. 1N4148

220-ohm resistor

For power:

USB power bank with cable

For visual output:

2 LEDs of different colour e.g. blue and green

2 220Ohm resistors to limit the currents

For sound output:

Passive buzzer

Microswitch to disable sound

For earphone output:

Earphone connector

1kOhm resistor


To easily connect/disconnect the search coil:

2-pin screw terminal

For the search coil:

~5 meters of thin electric cable

Structure to hold the coil. Must be stiff but does not need to be circular.

For the structure:

1meter stick, e.g wood, plastic or selfie stick.

Step 3: The Search Coil

Picture of The Search Coil

For the search coil, I wound ~4m of stranded wire around a cardboard cylinder with 9 cm diameter, resulting in about 18 windings. The type of cable is irrelevant, as long as the ohmic resistance is at least ten times smaller than the value of R in the RL filter, so make sure to stay below 20 Ohms. I measured 1 Ohm, so that is safe. Just taking a half-finished 10m roll of hookup wire also works!

Step 4: A Prototype Version

Picture of A Prototype Version

Given the small number of external components, it is perfectly possible to fit the circuitry on the small breadboard of a prototype shield. However, the final result is rather bulky and not very robust. Better is to use an Arduino nano and solder it with the extra components on a 5x7cm prototype board, (see next step)

Only 2 Arduino pins are used for the actual metal detection, one for providing the pulses to the LR filter and one for reading out the voltage on the capacitor. Pulsing can be done from any output pin but the readout must be done with one of the analog pins A0-A5. 3 more pins are used for 2 LEDs and for the sound output.

Here's the recipe:

  1. On the breadboard, connect the 220Ohm resistor, the diode and the 10nF capacitor in series, with the negative terminal of the diode (the black line) towards the capacitor.
  2. Connect A0 to resistor (the end not connected to the diode)
  3. Connect A1 to where the cross-point of the diode and the capacitor
  4. Connect the non-connected terminal of the capacitor to ground
  5. Connect one end of the coil to the resistor-diode cross-point
  6. Connect the other end of the coil to ground
  7. Connect one LED with its positive terminal to pin D12 and its negative terminal through a 220Ohm resistor to ground
  8. Connect the other LED with its positive terminal to pin D11 and its negative terminal through a 220Ohm resistor to ground
  9. Optionally, connect a passive buzzer headphone or speaker between pin 10 and ground. A capacitor or resistor can be added in series to reduce the volume

That's all!

Step 5: A Soldered Version

Picture of A Soldered Version

To take the metal detector outside, it will be necessary to solder it. A common 7x5 cm prototype board comfortable fits an Arduino nano and all the required components. Use the same schematics as in the previous step. I found it useful to add a switch in series with the buzzer to turn off the sound when not needed. A screw terminal allows to try out different coils without having to solder. Everything is powered through the 5V supplied to the (mini- or micro-USB) port of the Arduino Nano.

Step 6: ​The Software

The Arduino sketch used is attached here. Upload and run it. I used Arduino 1.6.12 IDE. It is recommended to run it with debug=true in the beginning, in order to tune the number of pulses per measurement. Best is to have an ADC reading between 200 and 300. Increase or decrease the number of pulses in case your coil gives drastically different readings.

The sketch does some sort of self-calibration. It is sufficient to leave the coil quiet away from metals to make it go quiet. Slow drifts in the inductance will be followed, but sudden large changes will not affect the long-term average.

Step 7: Mounting It on a Stick

Picture of Mounting It on a Stick

Since you wouldn't want to do your treasure hunts crawling over the floor, the three board, coil and battery should be mounted on the end of a stick. A selfie-stick is ideal for this, since it is light, collapsible and adjustable. My 5000mAh powerbank happened to fit on the selfie stick. The board can then be attached with cable ties or elastics and the coil can similarly be to either the battery or the stick.

Step 8: How to Use It

To establish the reference, it is sufficient to leave the coil ~5s away from metals. Then, when the coil gets close to a metal, the green or blue LED will start flashing and beeps will be produced in the buzzer and/or headphones. Blue flashes and low-pitch beeps indicate the presence of non-ferromagnetic metals. Green flashes and high-pitch beeps indicate the presence of ferromagnetic metals. Beware that when the coil is kept for more than 5 seconds near the metal, it will take that reading as a reference, and start beeping when the detector is taken away from the metal. After a few seconds of beeping in the air, it will turn quiet again. The frequency of the flashes and the beeps indicate the strength of the signal. Happy hunting!


JoeK178 (author)2017-11-11

I am trying to detect ferrous versus non-ferrous metals. I would have thought depending on the type of metal the measured voltage would either go up or down compared to the steady state without any foreign metal near the coil. But I am finding the measured voltage is always just decreasing no matter if I put steel, aluminum or copper near the coil. What am I missing?

arduino_bot (author)JoeK1782017-11-24

I'm having this same issue. Did you ever figure out what was wrong?

rgco (author)JoeK1782017-11-12


I saw clear opposite-sign response when putting a iron wrench and also when putting a box of staplers.

It doesn't come out so well in the video, but you see it starts flashing blue (lower inductance) for some metals and green (higher inductance) for others.

I would suggest to try a few more iron-based object. There is a large variety of the magnetic susceptibility depending on the precise type of alloy and how it's been forged or melted.

jim.buchanan.165 (author)rgco2017-11-17

I could see the differnce between ferous and non-ferous metals when I built it.

TawfeekH (author)2017-10-20

sorry bro>> how can i used it for detect metal for longer distance than this

Elsewhere in the comments, I posted some work I'd done to increase the range. I increased the sensitivity massively but made the circuit far more complex. rcgo suggested a way to reduce the complexity, I'm going to try that in the future. I'll post about that here in the comments.

TravisG37 (author)2017-11-16

This is a great project! I am trying to apply this to my project, but I need to boost the sensitivity of the metal detector by increasing the current running through the inductor coil. I figured a relay switch would be a good approach so I could use a higher power source (~9-12V) that the Arduino can trigger on and off. The problem is that the relay I have is pretty slow (~0.5 millis to switch) where as the code is running in micros. I think to overcome that I need to slow down the pulses (1-3 millis), but that would mean that I have to figure out new values for the resistor and capacitor. Could you walk me through your calculations in finding out that you would get 1.25V from a 0.5 micros pulse? I an trying to use the RL transient equation but I'm not getting anywhere close. Thanks!

rgco (author)TravisG372017-11-16


I'm afraid the sensitivity won't increase by pushing more current through. For measuring inductance no large currents are required, just like for a precision measurement of a resistor your multimeter uses just microamps.

I can see several ways to improve the sensitivity, most have come up in the other comments:
* use the 1.1V reference to use the 10-bit ADC scale more effectively
* make the coil part of an oscillating LC circuit and measure its frequency.
* make a pulse-induction metal detector.

You are probably thinking of the latter. But a pulse-induction metal detector is a very different thing. It takes big current, fast switching (MOSFETs, not relays), precise timing, careful coil design etc, and probably a good oscilloscope to do the development. Cheers!

TravisG37 (author)rgco2017-11-16

Lol oh wow. My original idea was all kinds of wrong. This area is fairly new to me, but those are some great ideas! I'll look through the comments for more info. My end goal is to be able to detect the presence of very small objects at close distance like iron filings or something like that. Hopefully it works out. Thanks again!

Great time on your several comments, Just yesterday I posted more of what I'm doing on I was going to come here and post a link to it today. So there it is, with schematics and screenshots from a 'scope.

I wound up redesigning the oscillator, I just wasn't pleased with the one from the other article. rgco's idea was great, this circuit is much more sensitive. A lot more complex though. I guess I forgot about the possible internal comparator and used an LM339. I just looked it up, it is a thing, I might try that before I finalize my design.

I'm planning another article after I build an actual practical unit. Maybe an Instructable too, I've never written one, it looks like fun.It'll probably be a while, I just ordered a 3D printer that will take up a lot of my hobby time, plus I intend to use it to make some of the physical parts for the unit.

jim.buchanan.165 (author)2017-09-06

I built a breadboarded version on the bench. It worked the first try. I adjusted the count up and down from the 3 counts in the original sketch. It did change the capacitor reading, I left it at 3, which gave a value of 273. Changes in the count didn't seem to affect the sensitivity. One problem I have is that I used an unknown generic .001uF (10 nF) capacitor from my junk box. I suspect it's a Y7R. It is *very* sensitive to temperature changes! air currents in the room change the value enough that the detector goes off with no metal around it. Putting an upside down cardboard box over the circuit pretty much stops that, but is impractical. I've ordered some better caps to solve that problem. With a 5 1/2 inch (14 cm) coil, it will detect a medium size piece of metal at about 3 inches. (7.6 cm) A US quarter gas to be about an inch (2.54 cm) from the coil for detection. That's not good enough for my purposes, I'm going to try some modifications. The first will be using the internal voltage ref of 1.1V [ analogReference(INTERNAL); ] To do this I'll have to make some circuit changes as the capacitor voltage hits 1.3V which is above the 1.1V internal reference. If I can get the sensitivity up, I'm going to 3D print some mechanical parts and build a permanent version. Thanks for a great instructable!

I just tried the 1.1V internal reference. I had to raise the resistor to 330 ohms to drop the capacitor voltage to about 0.9V, under the new reference voltage. The sensitivity was definitly improved, but not as much as I had hoped. About 25% better on a US quarter. The increased sensitivity caused some problems though. It's even *more* sensitive to capacitor temperature, and it seems to be triggerd by electrical noise, causing random clicks and blinks. I'm going to have to think about this more...

No real improvement on sensitivity yet. I'm going to try different coil sizes soon, I was having trouble with instability, the detector going off for no reason. It turned out to be my fault, I made two mistakes. The first was the capacitor, as I noted above, it was an unknown ceramic. I replaced it with a polystyrene capacitor, no more sensitivity to air currents. I can blow on it, or even hold it between my fingers without the detector going off. There was still some random chirping going on though, both with a 5V reference and the 1.1V reference, I realized that it might be an unstable supply voltage, I was running it off of the USB port of the computer that I was programming with. I substituted a bench supply set to 9V and connected through the Arduino's barrel jack. The chirping totally went away with the 5V reference, it was still there with the 1.1V reference. The 1.1V reference is regulated on the chip, not provided by the power source, so it should have been stable even with the so-so supply voltage. I'll try that smaller coil next, and see if I can find any other ways to improve the circuit.

Thanks so much Jim for your great add on and follow thru comments. I am just beginning my own quest to immerse myself and try my hand at DIY a PI detector which when using with a large coil, and greater power, will be able to search at depth range of 3-15 feet. Was thinking of using landscape semi-rigid tubing for a larger coil frame of either 4' to 8' diameter and using a table saw to notch out either top or outer perimeter for inserting coil wire/s. Will add non-metallic wheels directly to frame and dragging behind an ATV | UTV | SUV.

I look forward to your continued efforts and posts. Thanks again.

That sounds like a cool project. If you want, you can let me know how it goes at Anyone else who wants to discuss this circuit may contact me as well.

Even with the smaller coil, I didn't get the sensitivity that I wanted on smaller objects, and the distance at which I could detect larger objects was reduced. I tried a 40 turn coil instead of the 18 I was using for the 4 inch coil, but other than being able to raise npulse from 3 to 7 (for what that is worth), there was no appreciable difference.

I had the idea to measure the pulse width from the 40 turn coil with pulseIn() directly instead of looking at the voltage on a capacitor. A little research showed that this would not work, the pulse was too narrow for pulseIn() I then had the idea to "ring" an LC circuit and measure the width of the first half cycle with pulseIn().

I Googled this idea and found:

He's using a very similar method to measure the inductance of assorted coils but does mention that it might be used as a metal detector.

I built part of his circuit up and am measuring the pulse width of the first half of the first cycle of the damped sine wave using a 'scope. Big objects make a huge timing change, smaller objects almost immeasurably so with the 'scope. I'll build the full circuit (probably without the diode, it seems to serve no purpose and the results I get are the same without it) and see whether there is enough time to do the job. I am getting what will be pulse widths of about 25uS with 2 0.47uF caps, well within pulseIn() capabilities. The amplitude of the first ring is about 250mV using a 150 ohm resistor, not enough to read directly with the Arduino. The comparator will be needed to get it up to logic levels. There is so much noise and 5V random spikes that I fear that the pulse output will not be clean. I'll have to look into a Schmitt trigger.

rgco (author)jim.buchanan.1652017-09-19

Thanks for all your feedback Jim and please keep up updated!

The method in your link does not look very promising to me.

Metal detection by inductance change has severe limitations regarding depth and size of the object. As a rule of thumb, the change in inductance at zero depth corresponds to the area of the object divided by the area of the coil. At nonzero depth, divide that fraction by the 3rd power of the ratio of the distance to the radius.

So for a 10cm coil, a 2cm coin at 10cm distance, gives an inductance change of (2/10)**2 / (10/5)**3 = 0.04 / 8 =0.5%.

So staying with this technique, the most important is to get good sensitivity to very small changes.

The Arduino ADC can easily get to 10^-3, especially with a well-chosen reference and averaging multiple measurements. But 10^-4 would be hard if not impossible.

In fact, the classical BFO metal detector (see e.g. )

can be sensitive to 1Hz on a base of 10^5Hz, so 10^-5 sensitivity.

I think the following might work: if the coil is made part of an LC circuit (with a good stable capacitor), the Arduino could measure the frequency with very good precision, e.g. by recording time-stamps of the internal timers whenever the oscillating signal goes over threshold (and fires an interrupt). This way the super-high sensitivity of a BFO is achieved, but with much fewer components, and all the flexibility of the Arduino, such as autocalibration, noise filters, and a wide range of output modes.

jim.buchanan.165 (author)rgco2017-09-19

Thanks for the idea, I'll try that maybe after the pulsIn() idea. I don't think it will work either, I can hardly see a change on the 'scope when I move a smaller object close.

rgco (author)jim.buchanan.1652017-09-20

Time is something that the Arduino can measure with very high precision: it has a pretty stable crystal and the timers can be set up to measure with a resolution of a single clock cycle (1/16th of a microsecond). The length of a single LC pulse won't be very accurate (10^-3 for a single pulse of a 16kHz signal). But keeping track of multiple transitions for even 10ms should give 10^-5 precision.

An LC oscillator like the one in (left side of the schematic) uses just 1 transistor, 2 capacitors and 1 resistor (plus the coil). There may not even be a need for an external comparator since the Arduino has a built-in comparator, which can be used for interrupts (if I recall well...)

OK sorry, just thinking aloud. Could be a project for the christmas holidays! Cheers

jim.buchanan.165 (author)rgco2017-10-10

I just built the oscillator on the left side of that schematic. It works well, and did on the first try. Just looking at the frequency measurment on my 'scope, it seems a lot more sensative than either of the inductance measurement methods

Sorry I'm taking so long to reply, I have a lot of other stuff going on...

This seems promising! I would like to try this out and experiment with the coil size on sensitivity, but quick question. Which node from the left side of that circuit would feed into the Arduino to read the frequency? Would it be the node leaving the 10k resistor at the bottom that would go to the 3rd transistor if it was being used? Also, did you make any modifications to the circuit to make it readable?

jim.buchanan.165 (author)rgco2017-09-20

I just looked at my comment and it looks like I said that I thought the frequency method wouldn't work. Sorry, I didn't proofread, it actually sounds like a very good idea...

rgco (author)FortuneFinder2017-09-19

Hi, I don't think it's possible to go very deep with induction measurement: the magnetic field of a coil diminishes with the 3rd power of the distance/radius. So doubling the depth results in an inductance chance that is 8 times smaller, and very quickly below the detection threshold

jim.buchanan.165 (author)rgco2017-09-19

Pretty much what I've been seeing. After I try with pulseIn() I think I'm going to try a PI detector too. I'm having a lot of fun here, thanks for publishing this!

I just tried the full circuit using pulseIn() and an LM339 comparator. It's somewhat less sensative then your original circuit, as you predicted. I think I'll try the oscillator idea next.

PabloT56 (author)2017-09-18

Hi, I'm doing this project for a school job, unfortunately I'm new to the Arduinos and I can not upload the sketch that you attached in the link

I would appreciate if someone could copy and paste the sketch to the forum


rgco (author)PabloT562017-09-19

// Metal detector

// Runs a pulse over the search loop in series with resistor

// Voltage over search loop spikes

// Through a diode this charges a capacitor

// Value of capacitor after series of pulses is read by ADC

// Metal objects near search loop change inductance.

// ADC reading depends on inductance.

// changes wrt long-running mean are indicated by LEDs

// LED1 indicates rise in inductance

// LED2 indicates fall in inductance

// the flash rate indicates how large the difference is

// wiring:

// 220Ohm resistor on D2

// 10-loop D=10cm seach loop between ground and resistor

// diode (-) on pin A0 and (+) on loop-resistor connection

// 10nF capacitor between A0 and ground

// LED1 in series with 220Ohm resistor on pin 8

// LED2 in series with 220Ohm resistor on pin 9

// First time, run with with serial print on and tune value of npulse

// to get capacitor reading between 200 and 300

byte npulse;

const byte pin_pulse=A2;

const byte pin_cap =A3;

const byte pin_LED1 =PB1;

const byte pin_LED2 =PB2;

const byte pin_tone =PB0;

void setup() {

pinMode(pin_pulse, OUTPUT);

digitalWrite(pin_pulse, LOW);

pinMode(pin_cap, INPUT);

pinMode(pin_LED1, OUTPUT);

digitalWrite(pin_LED1, LOW);

pinMode(pin_LED2, OUTPUT);

digitalWrite(pin_LED2, LOW);

pinMode(pin_tone, OUTPUT);

digitalWrite(pin_tone, LOW);

//calibrate the number of pulses to apply

for (npulse=0; npulse<100; npulse++){




// perform measurement using n pulses

int meas(byte n){

//reset the capacitor





//apply the pulses

for (byte i=0; i<n; i++){

digitalWrite(pin_pulse,HIGH); //takes 3.5 microseconds


digitalWrite(pin_pulse,LOW); //takes 3.5 microseconds



//read the charge on the capacitor

return analogRead(pin_cap);


const byte shortexp=6;

const byte longexp=10;

long int shortsum=(300<<shortexp);

long int longsum=(300<<longexp);

long int difsum=0;

const int clickval=100;

byte ledcnt1=0;

byte ledcnt2=0;

bool click=false;

void loop() {

int val=meas(npulse);





int dif=shortsum-(longsum>>(longexp-shortexp));




















} else {






} else {




WitoldM1 (author)2017-06-29

I have built this device and it works.

I have a question
related to the analog readings by Arduino. With my coil and the npulse
variable set to 1, the min/max analog readings were in the range between
163 and 166 (a voltage around 0.78V). When I put some metal near to the
coil, then the reading were just a little bit different, which leads to
the conclusion that the voltage changes not so drastically. For my
case, the delta in analog readings is 3 (166-163) but the maximal
possible reading is 1023 (and the reference voltage is 5V by default).
The smallest possible voltage delta that could be meassured by Arduino
is then 5V * 1 / 1023 = 0.0048V. I'm using Arduino Nano, which offers to
use lower ADC reference voltage: 1.1V. If using 1.1V I think we can
detect smaller voltage changes: 1.1V * 1 / 1023 = 0.0010V. So I set up a
lower ADC voltage reference to 1.1V (in the sketch you need to call
analogReference(INTERNAL); in your setup() method). After that change the min/max readings were between 693 and 700 (so the delta is 7, which is bigger than in previous case). I had the feeling
that the device worked better (but it could be just a feeling :) ). What
do you say @rgco?

Second thing: because the voltage doesn't change so much (the delta in readings is less than 10 which is very small comparing to the maximal 1023 that can be read) I'm wondering if I could put some OpAmp between the capacitor and Arduino analog input. The OpAmp would do some additional formula on the analog signal: like 10 * (Ucap - 0.5V). This could gain the device sensitivity (but the device will be more complex). Is that a good idea?

rgco (author)WitoldM12017-06-29


Using the 1.1V reference is a great idea! The sensitivity could increase by up to a factor 5! For the capacitor voltage I had to make a trade-off between large digitisation error at low voltage and low sensitivity to inductance changes at high voltage and so ended up recommending a value of 200-300 (1.0-1.5V). But going in the range 0.8-1.0 V and using the 1.1V reference should solve both problems. Thanks a lot for the idea! I'll definitely try this out for the next version: I'm working on a super-compact version based on the ATTINY13A and using a coincell.

Amplifying the difference with an opamp seems a bit of an overkill to me, the component count starts to go up, but in theory what you say should work. A diode with O(1mA) current draw might give a decent reference voltage after which the difference could be multiplied by a factor 10 or so...

Thanks for the feedback and the great idea to use the 1.1V reference!

GrzegorzK1 (author)rgco2017-07-25

Would voltage dropping from 5V to 1V from any arduino achieve the same result in increasing precision? Using step-down regulator for example.

I am an electronic newbie and understand may have suggested sth stupid here :)

rgco (author)GrzegorzK12017-07-25

An external reference can indeed also be applied, and would have a similar effect. I would think a resistor-divider would do the job as well. The difference with the internal 1.1V is that Vref from a divider would follow variations in the supply voltage and thus might give better stability...

Brassn (author)2017-07-02

First I'd like to thank you for sharing such a great project.

I'm builing my own version of this and now I'm wondering how one could improve the results. Based on my limited knowledge of this topic I have some questions how my changes would change the depth and sensitivity of the detection.

What if I used a N-MOSFET to send a higher voltage (e.g. 9V) through the coil and read the charge of the capacitor using a voltage-divider to protect the Arduino?

Does a longer wire / more windings on the coil make any difference? (staying under the ohm limit)

Could we use a second coil above the primary one to stretch the magnetic field and improve the penetration?

Does it matter if I use a electrolytic or a ceramic capacitor? I'm having the latter in place.

Also I don't know what happens in your video, most things (including the iron wrench) light the blue led, which should only happen on non-ferromagnetic metal.

Brassn (author)Brassn2017-07-02

Okay the voltage divider is probably a bad idea as it would drain the charge before it could be read, but with npluse = 1 it should stay beneath 5V whatsoever. Also the speed of the MOSFET could be a problem.

rgco (author)Brassn2017-07-03

Hi, glad you like it!

I did read a little about the various types of metal detectors, and I'm afraid that it's hard to improve on this type without fundamental changes. The reason is that this type of metal detection (measuring the inductance) is sensitive to the total inductance of the coil, and it only changes a tiny bit in the vicinity of metals. So you're always looking for a small change on a big number.

To overcome that, you need a pulse-induction: send a pulse, then record the response. So you get zero for no metal and something non-zero if there is metal.

I think it's possible to make that type with and Arduino as well, but it requires higher voltages, faster switching and better gating. I gave it a quick try but it didn't immediately work and I don't have a fast scope to debug or study it...

cshah5 (author)2017-06-24

I want to detect a 3 cm diameter metal sphere at multiple points inside a long tube of 4 cm diameter , the tube might be filled with water or other substances. Will it detect metal if the coil is around the tube ? and if possible to what accuracy i.e will it detect always at the same point?

rgco (author)cshah52017-06-25


If the tube is metal it won't work: it will effectively shield any EM effect inside.

If the tube is an isolator it should work easily: a 3cm metal sphere gives a big change in inductance of a 4- or 5 cm coil.

Make the diameter of the coils as small as possible and still fit around the tube. That way the change in inductance will be biggest.

With some changes to the code, one Arduino should be able to handle 6 coils.

Good luck!

ClémentG16 (author)2017-06-07

Works ! Thanks man. Can see my keys and PC at about 4 cm.

lamaleon (author)2017-05-02

Hi, how deep is the detection in the soil?


rgco (author)lamaleon2017-05-02

Hi, not very deep. For this type of metal detector (based on induction measurement), its range is about half the diameter of the coil. So a larger coil will probe deeper, but be less sensitive to small objects.

cesar.riojas1 (author)2017-04-21

Hi, does it need the coil cable to be 2 colors? I saw in the image a white and a red one! And if so can I join them just by sticking them?

rgco (author)cesar.riojas12017-04-21

Hi, well noted! No, it's actually better to have a single wire. It's just that at the the time I didn't have an 8m piece of wire, so I soldered together two pieces which happened to have two different colours, nothing more than that. Good luck!

cesar.riojas1 (author)rgco2017-04-21

Thank you for your quick answer. I'll get down to work right now.

RamU1 (author)2017-03-10

what was the value of inductance

rgco (author)RamU12017-03-10

In my case the search coil has R=4.5cm, N=18 gives L~40muH. But contrary to beat-frequency-oscillation (BFO) detectors, that need a very precise matching, the value of the inductance does not matter much here, and variations of a factor 2 or 3 are fine. The main thing is to have the ADC reading somewhere around 30% of the maximum, where it is most precise. In the inductance of the search coil is too low, the number of pulses per reading can be increased in the code. If the inductance is too high, the number of pulses can be decreased. Also the value of the capacitor can be adjusted.

R DevaD (author)2017-03-06

I have doubt pls clear it.
Difference between soldered version and prototype version
Both do same job or is there is difference between them .
Pls reply

rgco (author)R DevaD2017-03-06


They do the same, only I did not put the sound on the prototype version, since I didn't intent to take it outside. Using a prototype shield is great to set things up quickly, test the idea and the software, but it's too fragile to take outside. Also, outside the sunlight is too strong to see the LEDs well, so having sound really helps. Ah also I didn't make a real search coil for the prototype, just a 6m roll of hookup wire

magnatron (author)2017-02-28

Please indicate where the correct source code can be found?

rgco (author)magnatron2017-02-28

Hi, it is attached at step 6

actuonix (author)2017-02-24

Wow, incredibly thorough and interesting instructable. Thanks for this!

rgco (author)2017-02-23

The range is similar to the radius of the coil, so 4.5cm for the 9cm diameter coil that I used. A larger coil would have a larger range, but be less sensitive to small objects, since what is measured is the relative change in inductance.

The detector 'sees' through other objects: I got clear signals through a 3cm thick wooden table when placing a metal object on top and sweeping the detector from below.

Note that a nail won't give a strong signal since it's cross-section area is small

rafununu (author)2017-02-20

Regulations are quite simple in France : all that is buried, even at 1 mm, even on your property, belongs to the state ! Because ground is not yours.

About This Instructable




More by rgco:Fix and Upgrade a Cappuccino MixerThermometer MoodlightDIY Bedwetting Alarm
Add instructable to: