Project tutorial
Pocket Metal Locator

Pocket Metal Locator © CC BY

Cool little Pocket Metal Locator sensitive enough to identify small nails and tacks in wood with four independent search coils and LEDs.

  • 3,129 views
  • 5 comments
  • 23 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

About this project

Intro: 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 tutorial 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

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.

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 22x11 the result being a piece of Vero Board with 20x9 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 36x11 the result being a piece of Vero Board with 34x9 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.

Step 6: Assembling and Testing the Unit

1. Preparing for Assembly

Before assembling we will test each board progressively to make it easier to troubleshoot issues.

The Arduino Pro Mini requires a USB serial board in order to be programmed by your PC. This enables the board to be smaller in size as it doesn't have a serial interface on it. To programme these boards you will need to invest in getting one as outlined in the part list.

Before loading the Arduino code you will need to add the Library "FastLED.h" as a library to drive the WS2182 LEDs.A series of Oscilloscope Traces have been provided for troubleshooting if there are issues.

There is also a screenshot of the IDE serial data output using the Graph Plot function which shows the pulse width output of each of the channels as well as the threshold value. This is useful during testing as you can see if each channel is performing to similar levels of sensitivity.

I have included two copies of the code. One has test serial data streaming for troubleshooting purposes.

NOTE: Do not connect the LiPo Battery unit until the very last step as accidentally shorting this out during assembly can cause the unit to overheat or even catch fire.

2. Test the Main Board

Before connecting the main board to anything it is advisable to attach the Arduino Serial Cable and verify that the code loads.

This will simply test that you have the Arduino is physically wired correctly and that the IDE and libraries are loaded. Load the code through the IDE which should load with no errors and no smoke should come out of any components!!

3. Connect the Driver Board

Follow the circuit diagram to connect the Driver Board to the Main Board and physically position the unit in the case to ensure items fit within the enclosure. This is a case of trial and error and requires persistence.

Load the code through the IDE which should load with no errors and no smoke should come out of any components!!

4. Connect the Coils Follow the circuit diagram to connect the Coils to the Main Board and physically position the unit in the case to ensure items fit appropriately. Carefully ensure the coils are aligned with the Driver Board and Main Board inputs as per the circuit diagram.

With the test code loaded the serial port will display the pulse width on the receive coil somewhere between 5000 - 7000uS. This can also be viewed using the IDE Graph Plotter.

This will enable you to troubleshoot each of the channels and also see the effect of moving a coin near the search coil which should reduce the pulse width as the target gets closer to the search coil.

If you have an oscilloscope you can also check the waveforms at various stages of the circuit to diagnose issues.

Once all channels are performing as per expected position the wires so that the case enclosure will assemble and close correctly.

5. Connect the LEDs

Carefully take the three wires from the Coil Enclosure LEDs and connect them to the main board. Load the code and verify the LEDs are operating correctly. Use glue to fasten the coil enclosure lid into place.

Step 7: Connecting the Rechargeable Battery

NOTE:

1. Do not connect the LiPo Battery unit until the very last step as accidentally shorting this out during assembly can cause the unit to overheat or even catch fire.

2. When handling the battery and charger ensure you are careful not to short out the battery connections.

3. LiPo batteries are unlike other rechargeables and overcurrent charging can be dangerous so ensure you configure the charge circuit correctly.

4. Do not connect the Arduino Serial Cable to the unit when the power button is depressed otherwise the battery could be damaged.

1. Modify The Charger Current Limit

The Pocket Metal Locator uses a LiPo Battery which can be charged using a Micro USB phone charger. The TP4056 USB LiPo Batt Charger Board is first modified with 4.7K resistor to limit charge current to under 300mA. Direction on how this can be done can be found here.

This requires you to remove the existing surface mounted resistor and replace with a resistor as shown in the photo. Once in place protect any unplanned movement of the resistor with some hot glue gun.

Before connecting to the main board, test the charger is working correctly by connecting a cell phone charger with a Micro USB port. The red charging light should come on when working correctly.

2. Install The Push Button Power Switch

Ensure the Push Button is mounted in the correct position so that it protrudes through the center of the enclosure lid then solder the Push Button in place. Install wires between the Push button switch and Charger Output and the VCC line on the Arduino as per the circuit diagram.

When installed correctly pushing the switch will activate the unit.

Fix the Battery in position using hot glue and ensure that the Micro USB socket is aligned to the hole in the case lid so that it can be charged.

Step 8: Final Testing and Operation

1. Physical Assembly

The final step is to rearrange the wires carefully so that the case will close correctly. Use hot glue to fasten the mainboard into the lid and then close the lid into position.

2. Operating the Unit

The unit operates by calibrating after pushing and holding the power button. All of the LEDs will flash when the unit is ready to be used. Keep the push button down while searching. The LEDs change from Blue-Green, Red, Purple based on strength of target object. The haptic feedback occurs when the LEDs turn purple.

You are no ready to go and use for practical applications!!

Code

Pocket_Metal_Locator_V11.inoC/C++
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!!
/* Pocket Metal Locator - Arduino Pro Mini April 2018 TechKiwiGradgets
Version 11 - First Instructable Release

*/

// WS2182 LED Driver Library Setup
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 4 // Note: First LED is address 0
#define DATA_PIN 11 // Note: D11 used to control LED chain

// Define the array of leds
CRGB leds[NUM_LEDS];

// Smoothing Variables for LPF
const float alpha = 0.85; 
float smoothedvalue1 = 1000;
float smoothedvalue2 = 1000;
float smoothedvalue3 = 1000;
float smoothedvalue4 = 1000;

int sthreshold = 100; // Minimum reading from pulseIn function ensure sampling above noise

float ledthreshold1 = 0.93; // Percentage below baseline before setting LEDs Purple
float ledthreshold2 = 0.96; // Percentage below baseline before setting LEDs Red
float ledthreshold3 = 0.99; // Percentage below baseline before setting LEDs Green
float ledthreshold4 = 0.998; // Percentage below baseline before setting LEDs Blue



// Callibration Variables

boolean sample = false; // if true then do not recallibrate thresholds
int calcounter = 0; // Used to count the number of times a sample has been taken
int scount = 200; // Number of reads before calibrating once only after power up
int numsamples = 20; // Number of samples taken before averaging them
int t1 = 100; // Duration in microseconds that LEDs on during callibration



long calav1 = 0; // Used to calcuate average of ten samples
long calav2 = 0; // Used to calcuate average of ten samples
long calav3 = 0; // Used to calcuate average of ten samples
long calav4 = 0; // Used to calcuate average of ten samples

int div1 = 0;// Divisor counter for number of samples taken
int div2 = 0;
int div3 = 0;
int div4 = 0;

// Four Channels denoted by A,B,C,D

int divA = 0;
long tempA = 0;
long pcounterA = 0; // Unfiltered Pulse Width of Channel 1

int divB = 0;
long tempB = 0;
long pcounterB = 0; // Unfiltered Pulse Width of Channel 2

int divC = 0;
long tempC = 0;
long pcounterC = 0; // Unfiltered Pulse Width of Channel 1

int divD = 0;
long tempD = 0;
long pcounterD = 0; // Unfiltered Pulse Width of Channel 1

int pwindow = 7500; // Maximum timeout value for pulsewidth

// ****************************************************
int dly1 = 4; // Period of time that TXR pin stays high (typicLLY 4uS)
int dly2 = 1; // Delay after TXR pin goes LOW before reading starting to read the pulse duration - typically 1 uS 
int dly3 = 500; // Delay in Microseconds after sampling pulsewidth  before starting next cycle

// ****************************************************


int threshdiff = 15; // Add to average to become specific threshold where LED will light (Changed V21 from 25 to 20)

long pulseav = 0; // Stores value of output for calibration

// Vibration Motor 
  boolean haptic = false; // Flag used to turn on vibration motor for a period of time
  int vduration = 1; // Number of program cycles that vibration motor enabled 
  int vcounter = vduration; // v cycle counter  


void setup() {
// Vibration Motor/Haptic Feedback
  pinMode(12,OUTPUT); // Vibration Motor driver from Arduino           - D10
  digitalWrite(12,LOW); // Turn off motor

  
  
  Serial.begin(115200); // Setupserial interface for test data outputs


// WS2182 LED Driver Setup
  LEDS.addLeds<WS2812,DATA_PIN,GRB>(leds,NUM_LEDS); // Default if RGB for this however may vary dependent on LED manufacturer
  LEDS.setBrightness(5); //Set brightness of LEDs here
  // limit my draw to 1A at 5v of power draw
  FastLED.setMaxPowerInVoltsAndMilliamps(5,100);

  FastLED.setDither(0); // Turns off Auto Dithering function to remove flicker


// Arduino Mini Pro logical pin assignements
//  Logical Pin Name 2,3,4,5,6,7,8,9 Equates to D2-D9 Pin Name Printed On Board 
//  Logical Pin Name 10,11,12,13,14,15,16,17 Equates to D10-D13, A0-A3 Pin Name Printed On Board

// Piezo Buzzer
  pinMode(10,OUTPUT); // Piezo Buzzer driver from Arduino           - D10




// Transmit
  pinMode(2,OUTPUT); // Pulse output from Arduino                   - D2
  pinMode(4,OUTPUT); // Pulse output from Arduino                   - D4
  pinMode(6,OUTPUT); // Pulse output from Arduino                   - D6
  pinMode(8,OUTPUT); // Pulse output from Arduino                   - D8
 
// Channel A
  pinMode(3,INPUT); // Signal input to Arduino from pin 2 on LM339  - D3

// Channel B
  pinMode(5,INPUT); // Signal input to Arduino from pin 1 on LM339  - D5

// Channel C
  pinMode(7,INPUT); // Signal input to Arduino from pin 14 on LM339 - D7

// Channel D
  pinMode(9,INPUT); // Signal input to Arduino from pin 13 on LM339 - D9
    
  }

void loop(){

// Pulse and read Coil  ---------------------------------------------


// Channel 1 (point of Wand)

digitalWrite(2,HIGH); // Set the TX pin to high
delayMicroseconds(dly1); // Delay before setting low on output pin
digitalWrite(2,LOW); // Set TX pin to low
delayMicroseconds(dly2); // Delay before sampling pulse width
pcounterA = pulseIn(3,LOW,pwindow);
digitalWrite(2,LOW); // Set the TX pin to LOW
delayMicroseconds(dly3); // Delay before sampling pulse width


// Apply Low Pass Filter to signal to smooth Channel 1
  if (pcounterA >= sthreshold) {
    smoothedvalue1 = (alpha * smoothedvalue1) + ( (1 - alpha) * pcounterA);
    }
  pcounterA = smoothedvalue1;


// Channel 2

digitalWrite(4,HIGH); // Set the TX pin to high
delayMicroseconds(dly1); // Delay before setting low on output pin
digitalWrite(4,LOW); // Set TX pin to low
delayMicroseconds(dly2); // Delay before sampling pulse width
pcounterB = pulseIn(5,LOW,pwindow);
digitalWrite(4,LOW); // Set the TX pin to LOW
delayMicroseconds(dly3); // Delay before sampling pulse width

// Apply Low Pass Filter to signal to smooth Channel 2
  if (pcounterB >= sthreshold) {
    smoothedvalue2 = (alpha * smoothedvalue2) + ( (1 - alpha) * pcounterB);
    }
  pcounterB = smoothedvalue2;

// Channel 3

digitalWrite(6,HIGH); // Set the TX pin to high
delayMicroseconds(dly1); // Delay before setting low on output pin
digitalWrite(6,LOW); // Set TX pin to low
delayMicroseconds(dly2); // Delay before sampling pulse width
pcounterC = pulseIn(7,LOW,pwindow);
digitalWrite(6,LOW); // Set the TX pin to LOW
//delayMicroseconds(dly3); // Delay before sampling pulse width

// Apply Low Pass Filter to signal to smooth Channel 3
  if (pcounterC >= sthreshold) {
    smoothedvalue3 = (alpha * smoothedvalue3) + ( (1 - alpha) * pcounterC);
    }
  pcounterC = smoothedvalue3;

// Channel 4 

digitalWrite(8,HIGH); // Set the TX pin to high
delayMicroseconds(dly1); // Delay before setting low on output pin
digitalWrite(8,LOW); // Set TX pin to low
delayMicroseconds(dly2); // Delay before sampling pulse width
pcounterD = pulseIn(9,LOW,pwindow);
digitalWrite(8,LOW); // Set the TX pin to LOW
delayMicroseconds(dly3); // Delay before sampling pulse width

// Apply Low Pass Filter to signal to smooth Channel 4
  if (pcounterD >= sthreshold) {
    smoothedvalue4 = (alpha * smoothedvalue4) + ( (1 - alpha) * pcounterD);
    }
  pcounterD = smoothedvalue4;



// Print value then Reset the counter

/*

  Serial.print(pcounterA);
  Serial.print("  ");  
  Serial.print(calav1);
  Serial.print(" ");
  Serial.print(pcounterB);
  Serial.print("  ");  
  Serial.print(calav2);
  Serial.print(" ");
  Serial.print(pcounterC);
  Serial.print("  ");  
  Serial.print(calav3);
  Serial.print(" ");
  Serial.print(pcounterD);
  Serial.print("  ");  
  Serial.println(calav4);

*/


// Callibation of Thresholds on Powerup
  // Wait for a period of time to set baseline for each coil
      
   if (sample == false){
         calcounter++;
         }

     if ( calcounter > (scount-numsamples) ) { // Wait for 90 then add up the samples to prepare to calculate the average

       if (pcounterA > sthreshold) {
         calav1 = calav1 + pcounterA;
         div1++;
       }
  
       if (pcounterB > sthreshold) {
         calav2 = calav2 + pcounterB;
         div2++;
       }
    
       if (pcounterC > sthreshold) {
         calav3 = calav3 + pcounterC;
         div3++;
       }
    
       if (pcounterD > sthreshold) {
         calav4 = calav4 + pcounterD;
         div4++;
       }
  
    }

  if ((calcounter > scount)&&(sample == false)){

    // Set the thresholds

    calav1 = calav1/div1;
    calav2 = calav2/div2;
    calav3 = calav3/div3;
    calav4 = calav4/div4;      
    
  // Flash LED to show calibrate done

  // 0-3 Blue
    leds[3] = CRGB::Blue;
    FastLED.show();
    delay(t1);  
    leds[3] = CRGB::Black;
 
    leds[2] = CRGB::Blue;
    FastLED.show();
    delay(t1);  
    leds[2] = CRGB::Black;

     leds[1] = CRGB::Blue;
    FastLED.show();
    delay(t1);  
    leds[1] = CRGB::Black;           

     leds[0] = CRGB::Blue;
    FastLED.show();
    delay(t1);  
    leds[0] = CRGB::Black;

  // 3-0 Green
    leds[3] = CRGB::Green;
    FastLED.show();
    delay(t1);  
    leds[3] = CRGB::Black;
 
    leds[2] = CRGB::Green;
    FastLED.show();
    delay(t1);  
    leds[2] = CRGB::Black;

     leds[1] = CRGB::Green;
    FastLED.show();
    delay(t1);  
    leds[1] = CRGB::Black;           

     leds[0] = CRGB::Green;
    FastLED.show();
    delay(t1);  
    leds[0] = CRGB::Black;

    FastLED.show();

// Sound Buzzer

      // digitalWrite(10,HIGH); // Set the output pin to high to activate the LED
//      delay(t1*2);
      digitalWrite(10,LOW); // Set the output pin to high to activate the LED   
    
    // Reset the sample flag
    sample = true;
    calcounter = 0;
  }

  if (sample == true) {
   updateLEDs();  
  }


// Haptic Feedback - If threshold exceeded turn on vibration motor for "vduration" cycels

  if(haptic == true) { // If flag set then turn on motor
    digitalWrite(12,HIGH); // Set the output pin to high to activate the Vibrate Motor
  
    if (vcounter >= 1){ 
    vcounter--; // decrement counter
    }else{
        digitalWrite(12,LOW); // Set the output pin to LOW to deactivate the Vibrate Motor
        haptic = false; // Reset vibration flag after number of cycles 
        vcounter = vduration; // Reset vibration counter
    }
  
  }
  
}


// Subroutines

void updateLEDs() {

// Display results
// Purple - Strongest target signal + (Beep Piezo and Haptic Feedback)
// Red - High +(Haptic Feedback)
// Green - Moderate +(Haptic Feedback)
// Blue - Weakest target signal



// Turn off all LEDs
leds[0] = CRGB::Black;
leds[1] = CRGB::Black;
leds[2] = CRGB::Black;
leds[3] = CRGB::Black;

digitalWrite(10,LOW); // Set the output pin to LOW to deactivate the Piezo Speaker
digitalWrite(12,LOW); // Set the output pin to LOW to deactivate Vibrating Motor


// *************** Channel 1  


if (pcounterA < (calav1*(ledthreshold1))) { // Display Purple if strong target

    leds[3] = CRGB::Purple;
     digitalWrite(10,HIGH); // Set the output pin to high to activate the Piezo Speaker
     haptic = true;
  } else

if (pcounterA < (calav1*(ledthreshold2))) { // Display Blue for moderate strength target

    leds[3] = CRGB::Red;
     haptic = true;
  } else

if (pcounterA < (calav1*(ledthreshold3))) { // Display Blue for moderate strength target

    leds[3] = CRGB::Green;
     haptic = true;
  } else

if (pcounterA < (calav1*(ledthreshold4))) { // Add additional percentage point to threshold due to sensitivity of channel 1

    leds[3] = CRGB::Blue;

  }  

// Channel 2 Display  


if ((pcounterB < calav2*ledthreshold1 )) { // Display Green if strong target

    leds[2] = CRGB::Purple;
     digitalWrite(10,HIGH); // Set the output pin to high to activate the Piezo Speaker
     haptic = true;
    
  } else

if ((pcounterB < calav2*ledthreshold2 )) { // Display Blue for moderate strength target

    leds[2] = CRGB::Red;
     haptic = true;
  }  else

if ((pcounterB < calav2*ledthreshold3 )) { // Display Blue for moderate strength target

    leds[2] = CRGB::Green;
     haptic = true;
  } else

if ((pcounterB < calav2*ledthreshold4 )) { // Display Blue for moderate strength target

    leds[2] = CRGB::Blue;

  } 

// Channel 3 Display  


if ((pcounterC < calav3*ledthreshold1 )) { // Display Green if strong target

    leds[1] = CRGB::Purple;
     digitalWrite(10,HIGH); // Set the output pin to high to activate the Piezo Speaker
     haptic = true;
    
  } else

if ((pcounterC < calav3*ledthreshold2 )) { // Display Blue for moderate strength target

    leds[1] = CRGB::Red;
     haptic = true;
  }  else

if ((pcounterC < calav3*ledthreshold3 )) { // Display Blue for moderate strength target

    leds[1] = CRGB::Green;
     haptic = true;
  } else

if ((pcounterC < calav3*ledthreshold4 )) { // Display Blue for moderate strength target

    leds[1] = CRGB::Blue;

  }

// Channel 4 Display 


if ((pcounterD < calav4*ledthreshold1 )) { // Display Green if strong target

    leds[0] = CRGB::Purple;
     digitalWrite(10,HIGH); // Set the output pin to high to activate the Piezo Speaker
     haptic = true;
    
  } else

if ((pcounterD < calav4*ledthreshold2 )) { // Display Blue for moderate strength target

    leds[0] = CRGB::Red;
    haptic = true;
  } else

if ((pcounterD < calav4*ledthreshold3 )) { // Display Blue for moderate strength target

    leds[0] = CRGB::Green;
    haptic = true;
  } else

if ((pcounterD < calav4*ledthreshold4 )) { // Display Blue for moderate strength target

    leds[0] = CRGB::Blue;

  } 



    FastLED.show();
}

Custom parts and enclosures

Thingiverse
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!!

Schematics

Pocket Metal Locator
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.
Fcect0wjggtlep4 xt7a8p3iuv

Comments

Similar projects you might like

Arduino Pocket Game Console + A-Maze - Maze Game

Project tutorial by Alojz Jakob

  • 5,316 views
  • 7 comments
  • 18 respects

Programmable Pocket Power Supply with OLED Display

Project tutorial by Shahariar

  • 6,324 views
  • 6 comments
  • 28 respects

KITtyBot

Project tutorial by StaffanEk

  • 17,635 views
  • 7 comments
  • 85 respects

Pocket Synthesizer

Project showcase by Etienne Desportes

  • 4,526 views
  • 1 comment
  • 21 respects

Art Deco FM Radio Project Using Arduino

Project tutorial by Nick Koumaris

  • 4,123 views
  • 1 comment
  • 18 respects

Arduino Soliton Radar | Metal Gear Solid

Project tutorial by Michael Darby - 314Reactor

  • 3,396 views
  • 2 comments
  • 8 respects
Add projectSign up / Login