Metal Detector

by Aleator777 in Circuits > Sensors

77224 Views, 674 Favorites, 0 Comments

Metal Detector

Intel MD main 1.jpg
INTEL MD 3D B1.png

Why not uncover the lost of treasures of bygone civilizations, (or perhaps forgotten goods from a beachside party) with your very own metal detector? In this Instructable, I'll show you how to build a metal detector that not only sounds when you've discovered something, but lights up as well! Using a handful of basic components and the Intel Edison, we'll build a basic detector capable of sensing metals of many sorts. You never know what valuables might be beneath your own feet...

Parts and Materials

IMG_0017.jpg

Intel Edison with Mini Breakout

Dotstar strip

5V 3A UBEC

logic converter

protoboard

mini toggle switch

panel-mount LED holder

(3x) 2N3904 (NPN)

(1x) 2N3906 (PNP)

(3x) 1K resistor

(2x) 10K resistor

56K resistor

220K resistor

1K8 resistor

330 ohm resistor

270K resistor

380 ohm resistor

1k potentiometer

1N4148 diode

100uF capacitor

(2x) 0.1uF capacitor

0.01uf capacitor

0.047uF capacitor

5V6 zener diode

5mm LED

6x AA battery holder (9V)

(6x) AA battery

30 AWG magnet wire

(Optional)

18 ohm resistor

8 ohm speaker

Electrical Design

INTEL MD Circuit.png

Power

The entire system is powered from a 9V source provided by six AA batteries. Power for the whole unit is switched on via a mini toggle switch and indicated with a single green LED that is powered via a 1K current limiting resistor. An additional 5V rail is created by a Universal Battery Eliminator Circuit (AKA a switching regulator), which provides power for the DotStar LEDs and the Edison board (via USB). The 1V8 source is from the Edison's mini breakout pin.

Main Circuit (Blue)

The actual metal detecting circuit is a slightly modified version of this circuit. I've swapped out the transistors and tweaked a few of the resistor values. If you'd like to just build a non-illuminated detector, you can ignore the yellow elements of the schematic, but be sure to add back in the speaker and its resistor (highlighted in red).

Secondary Circuit (Yellow)

Normally, the metal detecting circuit would modulate the base of the transistor to drive a small speaker. In lieu of the audio output, I decided to add visual feedback by sensing when the transistor is pulled low. The output of the main circuit is detected by one of the Edison's digital pins as a falling interrupt (all Edison pins are interrupt capable). So, whenever the circuit is reacting to the presence of a conductive object below the coils, then Edison can properly interpret those signals. For visual feedback, I chose to use a strip of DotStar RGB LEDs, which can be quickly configured and controlled via two pins in an SPI-like fashion. The DotStars need 5V logic on the clock and data pins, so I used a simply logic level converter between the Edison (using 1V8 logic) and the LEDs.

Electrical Assembly: Main Circuit

IMG_9373.JPG
IMG_9375.JPG
IMG_9378.JPG
IMG_9379.JPG
IMG_9383.JPG
IMG_9382.JPG
IMG_9385.JPG

The bulk of the circuitry can fit onto a single "half-size" protoboard. I prefer using Adafruit's protoboards as they are reasonably priced and resemble breadboards. I began by soldering female headers for the logic converter as it is the single largest individual component and I needed to ensure I had enough space for other components. I put female header blocks on both power rails, as well as a mini screw terminal block for both the 9V rail and 5V rail. I used male headers as jumpers for later addition of the coils, potentiometer, and the Edison's digital pin. I soldered the UBEC last as it is the only large, loose component.

Electrical Assembly: Coils

IMG_0018.jpg
IMG_9384.JPG
IMG_9391.JPG

Included in the .SVG files are paths for cutting out disks for winding the coils. The disks are aligned with matching wooden pegs that fit into slots in the center. The coils themselves are wound from 30 gauge enamel wire and are 70mm in diameter. One coils is 50 turns and the other is 70. After winding the coils, I soldered female header wires that I extended by a couple feet for attaching to the headers on the protoboard. The coils are then taped on top of one another.

Mechanical Design

INTEL MD Mech.png
INTEL MD A1.png
IMG_9387.JPG
INTEL MD Vectors.png

Main Body

The main body consists of interlocking pieces of 3/4" plywood with an armrest, handgrip, mount for a control box, and a frame for the coil. Although I used plywood, you could easily build a body out of PVC as well. Just be sure that the coil frame doesn't contain any conductive material!

Control Box

I designed the control to be laser-cut out of 1/4" plywood. The control box houses the battery pack, Edison, protoboard circuit. It also serves as a sturdy mounting point for the power switch, potentiometer, and LED. I've attached the vector paths as a .SVG above. A simple plastic "project box" would also make for a great control box enclosure!

Frame Assembly: Base

INTEL MD A2.png
INTEL MD A3.png
IMG_9392.JPG
IMG_9396.JPG
Intel MD main 2.jpg

The base can either be nailed or glued together. The top plate has a small hole for the coil wires. The DotStar LEDs have four wires that need to be soldered: VCC, DIN, CLK, and GND. I extended these connections with wires by a couple feet and added male header for VCC and GND and used female headers for DIN and CLK. The LEDs attached to the top plate with double stick tape.

Frame Assembly: Control Box

INTEL MD A5.png
INTEL MD A4.png
IMG_9388.JPG
IMG_9389.JPG
IMG_9390.JPG
IMG_9386.JPG
IMG_9393.JPG
IMG_9395.JPG
IMG_9397.JPG

The control box houses the electronics and provides a solid mounting plate for the external controls.

Baseplate - attaches via four 4-40 screws to the rear

Midplate - provides a mounting point for the Edison, battery pack, and protoboard. The Edison attaches via four 1" standoffs and is fastened with eight 4-40 screws. The battery pack attaches to the underside of the midplate and is held in place with two 4-40 screws and matching nuts. The protoboard mounts two 4-40 screws and four matching nuts (two on the underside and two below the midplate).

Faceplate - provides mounting holes for the potentiometer, LED, and powerswitch; these components pop into place and are secured with their matching nuts. The wires for the coils and DotStar strip must be fed through the hole in the faceplate prior to assembly.

Software

arduino_logo-wallpaper-1280x768 (1).jpg

The software is an Arduino-style sketch running on the Edison. The program itself is fairly simple and consists of counting the interrupt state changes on the digital pin connected to the circuit. This count is mapped to the length of the strip every 30 milliseconds and the LEDs are "redrawn.

For compatibility with the Edison, I removed line 111 of Adafruit_DotStar.cpp:

"SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due"

Operation

Intel MD main 3.jpg
INTEL MD 3D B2.png

Operating the detector is fairly simple. After turning on the power switch and verifying that it is powered on, you can begin detecting! Adjust the sensitivity with the knob as you sweep along the ground. The lights should bounce as you encounter hidden conductive objects. Happy hunting!