Build a cool looking and very unique metal detector with 5 separate search coils that light up when metal is detected. The search coil closest to the metal will light up better helping identify the location of the hidden treasure!

Step 1: Gather Materials


The goal of this project was to have some fun exploring the use of multiple search coils, use light rather than sound to indicate detection and also house everything in the head of the detector.

The heart of the detector is the Arduino Nano Atmega328 which is used to measure the pulse width of a signal which passes through each search coil. The Arduino produces a square wave pulse which is fed into an LC Tank circuit which produces a decaying sine wave signal at a frequency determined by the resonant frequency of L & C. This signal is cleaned up through the LM339 voltage comparator which in effect produces a series of pulses that are presented to a digital input pin in the Arduino. The pulseIn function was used to attempt to measure the length of the pulse width of the pulses. After a lot of messing around and varying results I was able to get stable outcome by averaging multiple samples on each coil. When metal is placed near the coil the inductance of the coil changes which varies the resonant frequency of the LC circuit and therefore the pulse width. If the variation in pulse width compared against a baseline value occurs then a LED is lit directly above the coil.

Key components

  1. Arduino Nano ATmega328
  2. LM339 Quad Voltage Comparator chip x 2
  3. Vero Board 50mm x 80 mm
  4. 1K ohm resistors x 5
  5. 100 ohm resistors x 5
  6. IN4148 Signal Diode x 5
  7. 0.1uf Greencap Capacitor x 5 (Mounted by Coil)
  8. 330pf Ceramic Capacitor x 5 (Mounted on PCB to improve stability)
  9. 10K pullup resister x 1
  10. 3v LED strip with 150 ohm resistor attached (Cut from reel) x 5
  11. Suitable Mop Handle with plastic flexible joint
  12. MDF wood 6mm thick, 2 pieces 22cm x 23 cm
  13. Copper Wire 0.26mm approx 25m length (5 coils with40 turns with 20mm radius)
  14. Ping Pong Balls x 3
  15. Plastic sheet A4 Blue Color (used from document file sourced from a department store)
  16. Two part epoxy resin glue( 5min preferably)
  17. Single core 2-3mm shielded cable approx 30cm length
  18. Vero mounting posts x 20 (Small metal spikes that make it easy to attach wires to Vero Board)

Required tools

  1. Soldering iron
  2. Solder
  3. Jig Saw suitable to cut 6mm MDF wood
  4. Pliers and side cutters
  5. 50mm hole drill
  6. Hot glue gun
  7. Electric Drill
  8. Box cutter knife

Step 2: Build the Search Coil Assembly

    1. Create a Hexagonal cardboard template from cardboard by drawing a 80mm circle and dividing the circle into 8 equal segments.
    2. Use the hexagonal shape to draw the shape of the search coil assembly onto sheet of paper as per the diagram.
    3. Copy the shape onto the MDF board and using an electric Jig Saw and cut out the overall shape twice.
    4. Take one of the MDF shapes and using a 50mm diameter hole saw (door handle hole drill works well) drill 5 holes in the centre of each hexagon .
    5. Using epoxy glue fasten the two sheets together as per the diagram so that you now have 5 holes to mount the search coils.
    6. Wind 5 x copper wire coils made up of 40 turns around a 40mm cylinder (I used an old caulking gun tube)
    7. Use hot glue to stick the windings together and ensure that the start and finish of the winding has at least 20cm of lead so they can be connected to the PCB.
    8. Drill a 3mm hole in each of the Search Coil assembly to enable the copper wire coil leads to pass from bottom to the PCB as per the photo.
    9. Hot Glue the coils into place ensuring the copper wire leads are threaded through the hole and can reach the PCB. Use a lot of glue to ensure the coils are rigid and at least flush with the base of the MDF. You don't want the coils protruding out below the MDF otherwise they will be damaged when dragged across the ground.

    Step 3: Build and Test the Circuit

    The unusual shape of the circuit board was an attempt to keep the circuitry central to the device to avoid interference with the search coils.

    1. Use the stencil created earlier to mark out the Vero Board to the required shape.
    2. Mount the Arduino and LM339 devices first and use them to position the components so you can drill out the vero board as per the attached picture. Solder in the Arduino and LM339 devices.
    3. The resistors and capacitors where the added along with shielded cable to improve stability.
    4. I mounted the 0.1uf Capacitors directly on the MDF as they were quite bulky and needed to be attached to the Copper Wire loops directly. Then the shielded wire was cut to length, earthed at one end (not both!) and then connected to the PCB via a Vero pin. (See closeup of circuit)
    5. There is a calibration button on pin D2 of the Arduino that resets the threshold for each coil to enure any variations in construction can be zeroed out.

    Testing the unit

    1. Enclosed is a picture of the circuit diagram along with the Arduino code for testing the unit.
    2. Upload the code to the Arduino. Remove the USB cable from the Arduino (Important as 9v Battery + USB will overheat unit)
    3. Attach a 9v battery (Vin pin on Arduino) and observe that the unit has started up ok (Arduino flashing lights)
    4. Place the search coil somewhere away from metal. Press the calibrate button. Each LED should light as it calibrates each of the 5 coils.
    5. Move metal close to the search coil and the associated LED should light.
    6. If this does not happen check your circuit to see that everything is built correctly.

    Step 4: Complete the Case

    1. A plastic sheet was used to cover the top and the bottom of the unit and the sides where painted to ensure it was water proof.
    2. Drill holes in the cover on top to enable the LEDs to emit light. Ping Pong balls were halved and used as light diffusers to give quite a cool effect when metal is detected.
    3. A plastic container (In this case half and ear muff) was used to house the circuit board and 9v battery.
    4. In this case I chose a Mop Handle with a flexible joint that enables the Metal Detector head to swivel up and down to suit the height of the user an ensure it is comfortable to use.

    Step 5: Final Testing

    1. When the unit is turned on the sensors need calibrating.
    2. Lift the head away from any metal or objects and press the calibration button.
    3. The LEDs should light from left to right briefly and then the unit should be set to use.
    4. There are variables in the code that I have highlighted that can be played around with to improve or change performance.
    5. However I have tried to make this something you turn on and it just works.


    <p>Hi TechKiwi </p><p>Did you do any improvements to the detector or test the depth?</p><p>Thanks</p>
    <p>Sorry, am picking up on this project again to see how to improve sensitivity. Will come back to you. </p>
    The best advice I can give, is power equals depth and the coil size equals sensitivity. The larger the coil, the lower the sensitivity. What helps is to make a oval search coil. It increases the depth but you have a small point of fokus. It also lengthens the search cone so to speak. Giving you more a tent shape than a funnel shape. <br><br>Hope it helps. <br>Btw. This is a very good detector...
    <p>Thanks will try this out with the next iteration :)</p>
    <p>Hey, can I know where we use pull up resistor in the circuit?</p><p>Also would you please tell us the dimension of wounded copper ring?</p>
    <p>HI the 10k pull up resistor is used with the Calibrate button. See the circuit diagram.</p><p>The copper ring - 40 turns around a 40mm cylinder - see section on building the detector head</p>
    <p>Hello! </p><p>I have the Arduino Due, Need do edit Code?</p><p>How about Ve=3.3 V for Due instead 5V of Nano? Does have a problem?</p>
    <p>Sorry dont have one. There may be different clock speeds so you may need to tweak capacitor values.</p>
    <p>hello .. i've been wondering where to connect the 330pf. . can I see the complete schematic diagram. thank you. </p><p>by the way, nice work.keep it up sir. it well help a lot.</p>
    <p>Hi this is across each coil and seems to improve overall stability.</p>
    <p>Wich kind of batterie is it ?</p>
    <p>9v Battery</p>
    <p>Hi</p><p>I use ATmega2560</p><p>need to edit code?</p>
    <p>should work. Havnt tried though. Let me know how you get on.</p>
    <p>ok </p><p>i wonder, where you add shielded cable</p><p>i can detect only medium metal and must very close to search coil</p>
    <p>can u post the arduino code</p>
    <p>Hi the code is in a text file above in step 3</p>
    <p>what is the range of detection for this circuit ? if i need 30 cm range , is it good for that ?</p>
    <p>Hi depends on the size of the object. If its small probably not. I am working on revised circuit that increases the performance dramatically. My challenge at the moment is getting 5 circuits to work with the new design without interfering with each other. As a singgle coil it works great. Am thinking of publishing a single coil circuit with higher sensitivity including new design if that helps.</p>
    <p>if the object is 10x10x10 cm ?</p>
    <p>Yes for an object that size should be ok</p>
    <p>can this system detects multiple objects(metal) present under each coil simultaneously ? and does light glows brighter when detects larger piece of metal ?</p><p>please help me by answering it as early as possible , it need to use this concept for my robotic project </p>
    Yes the coils are independent so can detect multiple items simultaneously. <br>Currently the code will turn on leds when a threshold is reached. It could be adjusted to have multiple thresholds and then display increasing brightness
    <p>This does not work. </p><p>Followed instructions specifically.</p><p>I have build many Detectors in the past.</p><p>What is with the Caps ? - 0.1uF is specified for the Coils and/or on the Lm339 ?</p><p>I see (5) Ceramic Caps on the Lm339 AND Green Caps on the Coils .... are they both 0.1uF ? - They seem large to match a 100uh Coil - I would have thought 0.01uF cap.</p>
    <p>hi can you message me the symptoms and Ill try to help</p>
    <p>As I said, you have Cap on the Coil 0.1uF Green - and also C eramic Cap next to each Lm339 - what is its value here ?</p>
    <p>hi I added a 330pf capacitor to improve stability by mounting on the pcb. The main cap is 0.1 uf greencap. Try using with just a battery instead of usb supply to improve stability. </p>
    <p>Hi!</p><p>Very nice project. I'll try it myself.</p><p>Any chance to add a buzzer on this project; I'm really newbie in programming Arduino boards, but I wanna learn.</p>
    <p>Hi my friend, very nice instructable..!!<br>But i think there is a mistake on the schematic!<br>The LM339 pin 5 is &quot;+&quot; and the pin 4 is &quot;-&quot; and so on the other pins!<br>And something else, up the calibrate button is this a resistor?? and if so what value...??<br>Have a good day my friend and keep up the good work..!!!</p>
    <p>hi thanks yes good spotting. Will update in next release of diagram.</p><p>TechKiwi</p>
    <p>How &quot;good&quot; does it work, I mean wat is the radius/depth an item can be to be picked up by the detector?</p>
    <p>Im doing some tests over the next few weeks on a beach etc so will report back</p>
    <p>Hi guys!</p><p>Very nice project, do you know more about the efficient depth of your detector?</p><p>Thanks!</p>
    <p>That's very kind, thanks. :)</p>
    Please upload the pic of coil and capacitor connection
    Hi<br>The Capacitor for each coil is mounted above the base unit to the side of the circuit board and held in place using hot glue. Tou can see in pictures provided if you zoom. I can provide a closeup if needed.<br><br>TechKiwi<br>
    Please upload the pic of coil and capacitor connection
    Cant understand the circuit diagram and the connection of capacitors
    <p>Can this project be used to detect steel wiring through a brick wall?</p>
    <p>it depends on the depth and thickness of the wire however it is feasible</p>
    <p>Can I use single pulse output pin from the Arduino?</p>
    <p>yes you can just use one part of the circuit and modify the code</p>
    <p>Thats awesome...^_^</p>
    Can I know if this can detect copper, gold???
    <p>i want to make a metal detector using tda0161, when the detector detects the metal from a specific distance the buzzer sounds but as the metal comes near and near the buzzer sound increases!!</p><p>so anyone guide me for this</p><p>i want to use this with arduino</p>
    <p>the circuit diagram is not clear</p>
    <p>I can load a higher resolution image if that helps.</p>
    <p>yes please :) thnx :)</p>
    I have made a very specific purpose single coil version of this from your instructions, but I found that it kept showing false positives. More debugging found that of the three pulse reads one would occasionally be way too low. This is sitting at rest on my desk. <br> <br>To fix the problem I modified the code to read the three pulses to separate variables (pulse1, pulse2, and pulse3), keep only the highest one, then multiply that by three. <br> <br>No more false positives and all tests give positives when expected. <br> <br>Thank you so much for publishing these instructions!

    About This Instructable




    Bio: Crazy about technology and the possibilities it can bring. I love the challenge of building unique things. My goal is to make technology fun, relevant ... More »
    More by TechKiwiGadgets:Retro Pac-Man Clock Interactive LED Shoes - Arduino Personalised Word Clock With Animated Time Transitions 
    Add instructable to: