FoxyPI - Arduino Nano metal detector

Homebrew pulse metal detector on Arduino Nano

Similar projects worth following
FoxyPI - motion/non-motion pulse induction metal detector, built on the Arduino Nano 3.0, with audiovisual indication, setting parameters via the menu and ground balancing.

Principle of pulse induction

With a sharp decrease in the current in the search coil, its magnetic flux also decreases sharply. This phenomenon causes the occurrence of eddy currents in the target, penetrated by this magnetic flux. The resulting eddy currents counteract the reduction of the magnetic flux, which is manifested in a change in the voltage curve on the coil and is noticed by the device.

Assembled metal detector


The appearance of the electronic unit:

1 - LCD screen
2 - LED
3 - piezodynamic
4 - control button
5 - LCD backlight switch
6 - power switch
7 - signal strength indication LEDs
8 - voltmeter switch
9 - voltmeter display

Working principle of metal detector

The signal from the search coil connected to the J2 connector, through the current-limiting resistor R2, is supplied to the diodes D1 and D2 connected in parallel, limiting the signal to ~ 1 V.
Such a weak signal for reliable detection needs to be amplified, for which I used the operational amplifier U1 LM358N, included in the traditional non-inverting amplifier circuit.

To process the signal from the search coil, I use the analog-to-digital converter built into the ATmega microcontroller.
To determine the presence of a target, the sum of a given number of sampled signal levels located at equal intervals from each other is calculated in a time window (evaluation window).
Then the integration of the sequence of obtained total values is performed (the integrator is emulated by software). The signal level at the output of the integrator is analyzed in the static mode of the metal detector.
When the metal detector is in dynamic mode, the integration results additionally pass through a high-pass filter, which is emulated by software.
At the filter output, a signal is obtained that characterizes the dynamics of the received signal.
When the output signal exceeds the threshold (the "zero" level set during balancing), the target is considered detected and an audiovisual indication is realized.

In the metal detector circuit, two "earths" isolated from each other:
analog  - grounding icon

digital  - case icon

ASC file for simulation in LTspice XVII - in Files section.

You can play with the parameters and watch, for example, the voltage on the search coil (1), on the opamp input (2), the current in the coil (3):


HEX and ELF files of current version - in Files section

Metal detector operation
The metal detector works in two modes:    

  • static mode (non-motion mode) (default) - the signal level is taken into account, does not require constant coil movement (can be used both for pinpointing the target location and the main search mode);
  • dynamic mode (motion mode) - the dynamics of the signal changes is taken into account, during the search the coil must be moved above the ground surface

When a metal target object is detected, a sound signal of varying tonality sounds and LEDs light up. The signal changes in accordance with the dynamics (in dynamic mode) or the level (in static mode) of the received pulse.

When the detector is turned on, auto-balancing is performed.
In the process of auto-balancing, the optimal initial delay and duration of the analyzed signal are estimated, and the dynamics of the signal (in dynamic mode) or signal level (in static mode) is evaluated. Also, balancing can be started/stopped during operation by pressing the control button. After the end of the auto-balancing, a short beep sounds and the “zero” value is displayed:

Using the button-controlled menu, you can configure the device parameters:

L - pulse duration (μs)
R - pulse repetition rate (pps)
I - integrator coefficient
F - filter coefficient
S - sound (on / off, ON / OFF)
C - display contrast value

Strong interference to the operation of the metal detector is caused by electronic devices operating in the vicinity!
LCD TV interference:

I will expand the description....

Read more »

hex - 50.61 kB - 10/12/2020 at 07:15



ELF file (v3.8)

elf - 133.81 kB - 10/12/2020 at 07:14



Adafruit license

plain - 1.42 kB - 09/20/2019 at 14:30



LTspice model

asc - 3.60 kB - 09/20/2019 at 08:16




Portable Network Graphics (PNG) - 108.11 kB - 09/20/2019 at 07:55


  • 1 × Arduino Nano R3
  • 1 × LM358N Amplifier and Linear ICs / Operational Amplifiers
  • 1 × UF5408 Discrete Semiconductors / Diodes and Rectifiers
  • 1 × Nokia 5110 LCD display
  • 1 × 1N4148 Discrete Semiconductors / Diodes and Rectifiers

View all 12 components

  • Coil from demagnetization loop

    Alexey Voronin07/11/2021 at 07:39 0 comments

    Check "omnivities" MD to coils - a coil from the demagnetization loop (from old TV) (it works well, although the sensitivity is reduced):

  • Metal detector vs VLF radio receiver

    Alexey Voronin01/18/2021 at 10:14 0 comments

    A working metal detector, even at a distance of 6 meters, completely suppresses my VLF radio receiver:

  • Noise

    Alexey Voronin11/07/2020 at 13:49 0 comments

    The noise from an CFL located near the coil looks in test mode:

  • Noise

    Alexey Voronin11/03/2020 at 18:16 0 comments

    This is how the noise from an LCD TV located near the coil looks in test mode:

  • ?

    Alexey Voronin10/28/2020 at 06:10 0 comments

    One of the new finds with FoxyPI MD (before and after electrolytic cleaning):

    Metal with magnetic properties, the shape is close to a hexagon with a side length of about 8 mm, the edges are uneven, and there is an asymmetrical hole in the middle.

    Old handmade "iron" button?

  • Signal curves

    Alexey Voronin10/19/2020 at 05:55 0 comments

    Examples of signal curves in test mode:

    1 - without a target, 2, 3, 4 - when approaching a massive target:

  • FoxyPI v3.8

    Alexey Voronin10/12/2020 at 07:14 0 comments

    Minor update ( version 3.8 ) is ready (FoxyPIv3_8.ino.eightanaloginputs.hex):

    improved display of signal curves in test mode (through earlier reading of preset settings, including contrast).

  • Echo of war

    Alexey Voronin09/15/2020 at 06:31 0 comments

    One of the new finds in the garden with a metal detector FoxyPI (after electrolytic cleaning):

    The thickness of the metal (5.5 mm) and the characteristic shape are an echo of WWII. I calculated the inner diameter, which turned out to be approximately 4.3 cm.

  • GUARD parameter

    Alexey Voronin08/03/2020 at 14:42 0 comments

    Influence of the value of the GUARD parameter on the detection range of the golden ring (L):

    GUARD L, cm

    500 ---> 12

    750 ---> 10

    1000 ---> 8

    1500 ---> 7

    It is possible to decrease it even below 500, but in this case false positives may appear.

  • Find

    Alexey Voronin07/15/2020 at 05:09 0 comments

    An interesting find in the garden with FoxyPI - an unusual chrome detail (photo after electrolytic cleaning):

View all 23 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates