Arduino And Wire Detects Metal

Our old math teacher famously said, “You have to take what you know and use it find what you don’t know.” The same holds true for a lot of microcontroller designs including [rgco’s] clever metal detector that uses very little other than an Arduino. The principle of operation is simple. An Arduino can measure time, a coil and a resistor will create a delay proportional to the circuit values, and metal around the coil will change the coil’s inductance. As the inductance changes, so does the delay and, thus, the Arduino can sense metal, as you can see in the video below.

The simple principle is also simple in practice. Besides the Arduino and the coil, there’s a single resistor. You want a small coil since larger coils won’t detect smaller objects. If you don’t want to wind your own coil, [rgco] suggests using a roll of hookup wire as long as the resistance is under 10 ohms.

You could omit it, but the original design has a buzzer and an electrolytic capacitor connected to generate a buzz in addition to the built-in LED indicator when metal is near. The LED also shows a blink pattern if the coil is open, too short, too long, or has too much resistance.

The biggest problem is that the poor Arduino needs to measure delays down in the nanosecond range. It can’t actually do this directly, so the code takes a ranging measurement to get in the ballpark and then produces appropriately-sized pulses and adds them up to get a better idea of the total delay. There are several videos in the post of a prototype and the final device built in a Tic Tac container, which you can see below.

If you want something a bit fancier, here’s another simple design that has a few more parts. Or you can go for one that is ultrasensitive.

7 thoughts on “Arduino And Wire Detects Metal

  1. If a ram chip was used like it was a digital scope memory to grab the returned pulse signal at the ram’s fast rate, could an Arduino then, at its slower s/w rate, read the ram to get more accurate info about the pulse’s echo timing, phase and shape ?

    1. That’s an interesting idea: so you’re thinking about changing the return pulse into a sequence of 0’s and 1’s and looking for the transition point?
      Like you could have a comparator or schmitt trigger, whose output is getting very rapidly multiplexed to sequential addresses?

      The way our brains does this is through using delay lines of varying length, via nerves. We have an array of what amount to AND gates strung across our brain between our ears, with nerves from each ear going to each AND gate, so when a sound pulse arrives at one ear and then the other ear, only the neural group that gets both pulses arriving at the same time triggers. (Some nerves are set up to depolarize to signal the next nerve, only when they receive two depolarization events within a specific time.) That’s how we localize direction of sounds when the signal is faster than the processing hardware’s transmission speed. This seems to be the same problem.

  2. I mean, it’s a cool project, especially using so few parts. A little inspirational, even.

    I just think the tuned audible oscillation of a traditional metal detector is such a neat design. Seems like a pain to calibrate a two-state classifier when something that reveals all the in-between states in such an intuitively useful form is common.

    It would take me a lot of trial and error to build a good tuned oscillator for this purpose though. :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.