Other Projects

Pocket Metal Locator – Arduino

This cool little Pocket Metal Locator is sensitive enough to identify small nails and tacks in wood and compact enough to fit into awkward spaces making it convenient to carry and use for metal locating.

The unit has four independent search coils and color LED indicators making it easy to cover a larger search area quickly while being able to accurately identify the target.

This neat little device is self-calibrating with one button operation, rechargeable through a USB port and uses color LEDs, sound and vibration to indicate target strength.

Included in the instructable is all of the designs, testing, code and 3D files required to build on your own. I hope you enjoy building and using this as much as I have!!

Step 1: Materials List and How It Works

1. How it works

The Pocket Metal Locator uses four independent Pulse Induction Search Coils powered by an Arduino Pro Mini. Each Search Coil is made up of a separate TX and RX coil where a pulse is induced into the TX coil which creates an electromagnetic field around the RX coil. The changing field induces a voltage into the RX coil which is detected and amplified before the pulse width of the signal is read by the Arduino.

A smoothing algorithm in the Arduino code is used to remove noise from valid pulses making it very stable.

A calibration algorithm in the code takes an average of readings over a short period of startup and sets a series of thresholds to compare the signal against.

When a metal object comes within range of the electromagnetic field the field is disrupted and some of the energy is diverted from the RX coil into “Eddie currents” that form in the target object. This parasitic effect of the target object results in the pulse width detected in the RX coil reducing. Essentially we are measuring the loss of power into the target object.

When the pulse width detected in the RX coil drops below the threshold then the LEDs are lit, the buzzer is sounded and the Haptic Feedback motor triggered – dependent on a predetermined size of the target signal.

The circuit for this has evolved over the past year into a very stable and reliably performing detector. The coil configuration and orientation have been deliberately designed to maximize stability and depth detection.

2. Materials List

  1. 3.7v 350mAh LiPo Battery Size: 38mm x 20mm x 7.5mm
  2. TP4056 USB LiPo Battery ChargerData Sheet
  3. 4.7K resistor to limit LiPo battery charge current to below 300mA
  4. Arduino Pro Mini
  5. FTDI USB to Serial Module for Programming the Mini Pro
  6. LM339 Quad Differential Comparator Integrated Circuit
  7. Vero Board – 2 pieces cut to 20×9 holes and 34×9 (see photo for correct orientation)
  8. BC548 NPN Transistor x 4
  9. 2N7000 MOSFET Switch x 5
  10. Piezo Buzzer
  11. Coin Vibration Motor for Haptic Feedback
  12. WS2812 RGB LED Module x 4
  13. 1k Resistor x 4
  14. 10k Resistor x 4
  15. 47 Ohm Resistor x 4
  16. 2.2K Resistor x 4
  17. 150pf Ceramic Capacitor x 8
  18. 0.18uF Polyester capacitor x 4
  19. Roll of 0.3mm Enamel Copper Wire (normally come in rolls approx 25g Weight)
  20. PCB Mounted Push Button Switch
  21. Hot Glue Gun
  22. 10mm Drill Bit
  23. Handheld Drill
  24. Label Gun or Sticky Tape suitable to label 16 separate wires Hookup wire
  25. Access to a 3D Printer

3. Comparator Operation

I have had a number of questions about the operation of the LM339 so I thought I would give a more clear explanation.

The LM339 operates solely as a voltage comparator, comparing the differential voltage between the positive and negative pins and outputting a logic low or high impedance (logic high with pullup) based on the input differential polarity.

In this circuit, the positive input of the comparator is connected to the Vcc line and a pull-up resistor to Vcc is applied to the comparator output. In this configuration, in practice, the output voltage of the comparator stays high, until the input voltage on the negative input exceeds 3.5v

The operation can be explained from the LM339 Data Sheet which outlines the “input voltage range” being between 0 V to Vsup-1.5 V

When both IN– and IN+ are both within the common-mode range, if IN– is lower than IN+ and the offset voltage, the output is high impedance and the output transistor is not conducting

When IN– is higher than common mode and IN+ is within common mode, the output is low and the output transistor is sinking current. Link to Data Sheet and explanation below http://www.ti.com/lit/ds/symlink/lm2901.pdf

Step 2: Print the Case

The 3D printed case was done using 5 separate prints. The dimensions and 3D files can be found here on Thingiverse . The design was centered on making the device easy to hold while ensuring the search coils were as close to the area being searched.

Carefully print out the case and remove excess plastic. It is important to do this step now so the electronic components can be aligned in the case before final hookup and testing.

I included a picture of multiple different case designs that I tested before settling on the final design which was more compact and ergonomically pleasing to hold.

Step 3: Build and Mount the Search Coils

Take the printed coil formers and wind 25 turns of copper wire onto each of them. Ensure you leave a good 20cm of extra copper wire for hookup to the main unit.

Use the holes printed in the formers to enable a consistent wind and orientation of coils for each former. As you do this, turn the former upside down and progressively glue the former into the base unit.

Follow the photo assembly as provided, the outcome being 8 coils mounted in the coil assembly with all wires consistently orientated, and long enough to connect to the main board unit in the upper enclosure.

Use the two wire guide blocks which have holes for each coil the printed base to keep track of each specific coil.

I placed the wires for the Inner Coils along the top and the outer coils along the bottom of the wire block so that I could keep track of each specific coil which makes it easier for connecting to the main board.

Step 4: Build the Circuit

The unit has four key circuits to build independently – Driver Board, Main Board, LED assembly and Rechargeable Power Supply. In this step, we will build the Driver Board and Main Board.

1. Driver Board

Use a craft knife to cut a piece of Vero Board along the holes 22×11 the result being a piece of Vero Board with 20×9 holes oriented as per the included picture. It’s best to score across the holes on both sides of the board multiple times then gently snap off the excess board. Check that the board sits in the base of the enclosure with enough clearance on either side.

Using the photos and a 10mm Drill bit by hand carefully break the tacks shown on the bottom of the Vero Board. Follow the circuit Diagram and photo layout of components to assemble the circuit board being careful to ensure there are not shorted tracks.

Set this board aside for testing later.

2. Main Board

Use a craft knife to cut a piece of Vero Board along the holes 36×11 the result being a piece of Vero Board with 34×9 holes oriented as per the included picture. It’s best to score across the holes on both sides of the board multiple times then gently snap off the excess board. Check that the board sits in the base of the enclosure with enough clearance on either side.

Using the photos and a 10mm Drill bit by hand carefully break the tacks shown on the bottom of the Vero Board.

Follow the circuit Diagram and photo layout of the Arduino and LM339 IC and other components to assemble the circuit board being careful to ensure there are not shorted tracks.

Set this board aside for testing later.

Step 5: Add LED Indicators

I have used WS2182 LEDs which have a built-in IC which enables them to be addressed by the Arduino using three separate wires however a broad range of colors and brightnesses color can be created by sending a command to the LED. This is done through a special library loaded into the Arduino IDE covered in the testing section.

1. Mounting the LEDs in the Coil Enclosure Lid

Carefully position the four LEDs so they are oriented correctly so that the VCC and GND connections are aligned and they are sitting in the center of the holes.

Use Hot Glue to fasten the LEDs into position.

2. Wiring the LEDs

Carefully strip and position three 25cm lengths of single core hookup wire across the contacts of the LEDs.

Solder these into place and ensure the center data wire is connected with IN and OUT contacts as per the photo.

3. Case Alignment Check

Check that the lid of the case will sit flush with the Coil Enclosure then use Hot Glue to hold the wires in place at the base end of the lid.

Set this aside for testing later.

Source: Pocket Metal Locator – Arduino

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close
Close