This time I will present you how to build a very simple Metal Detector. Despite its simplicity, it has a relatively good sensitivity and perfect stability during operation, so that there is no need for any calibration even during a long time of operation. Also, the dimensions and inductance of the detecting coil are not critical, and most importantly, it will surely work for you immediately after making it. This makes it an ideal metal detector for beginners.

   Basically, the project was taken over from the Silicon Junction blog, and I just added a sound indication for better control during  metal detection. The detecting part is a simple Colpitts oscillator with the resonant circuit comprised of C2, C3 and SEARCH_COIL. This oscillator will have a frequency of approximately 260khz.

   The complete device consists of several components:
      - Arduino Nano microcontroller
      - BC337 or similar NPN Transistor
      - several resistors
      - five capacitors
      - Zener diode 
      - and search coil

  Zener diode D1 is used to limit the voltage on the Arduino pin to a safe 4.3V.  C5 and R4 ensures the output of the oscillator is referenced to ground.
   Any coil with an inductance around 200-400uH should work, and you should try and keep the resistance fairly low. This will give you a frequency around 200-400 khz, which falls within a range the arduino can handle. I used a coil with a diameter of 20cm and contains 25 turns, but the detector also worked quite correctly with two concentrically placed coils with a diameter of 12 and 23cm, both of which had 25 turns and are connected in series.

   The Arduino code counts every 100 milliseconds how many pulses have occurred and stores this as baseline. In the main loop Count how many pulses occurred in 100 milliseconds, store this as count. If count has changed from the baseline in turn on a LED, and activates the buzzer. This means that the detector is calibrated continuously every 100 milliseconds. The code is relatively simple thanks to the FreqCount library which you can also download from the given links.
   The advantage of this type of code is that in order for the device to work, no adjustments or calibrations need to be made, but the downside is that in order to detect the metal object, there needs to be movement of the object in relation to the coil or vice versa.