• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Metal Detector Circuit using Arduino

Metal Detector Circuit using Arduino

Last updated on 31 July 2025 by Admin-Lavi Leave a Comment

Metal detector uses electric field to find metal near it.

Making Metal Detector Circuit using Arduino is fun for electronics lovers.

We can make it using Arduino, CS209A chip, LEDs, buzzer and some other parts.

LED and buzzer will show when metal is close.

This project use CS209A chip with Arduino.

CS209A is good chip for finding metal and nearby things.

Coding:

// Declare Arduino Pins
const int vinHi = 2; 
const int vinLo = 3;
const int ledG = 4;
const int ledR = 5;
const int Buz = 6;

// Variable to detect state change
int metalState = 0;

// Declare Arduino Pin Mode
void setup() {
  pinMode(vinHi, INPUT);
  pinMode(vinLo, INPUT);
  pinMode(ledG, OUTPUT);
  pinMode(ledR, OUTPUT);
  pinMode(Buz, OUTPUT);
}

void loop() {
  metalState = digitalRead(vinHi); // Read the proximity detector signal

  if (metalState == HIGH) { // No Metal detected
    digitalWrite(ledG, HIGH);
    digitalWrite(ledR, LOW);
    digitalWrite(Buz, LOW); 
  } else { // Metal detected
    digitalWrite(ledG, LOW);
    digitalWrite(ledR, HIGH);
    digitalWrite(Buz, HIGH);
  }

  delay(3000); // Wait for 3 Sec.
}

Code Explanation:

  • Variables vinHi, vinLo, ledG, ledR and Buz are numbers for Arduino pins.
  • Pins 2 and 3 goes to vinHi and vinLo and these read signals.
  • Pins 4, 5 and 6 go to ledG, ledR, and Buz and these control green LED, red LED and buzzer.
  • metalState is a variable and it stores signal from vinHi pin and it tells if metal is found or not.
  • When Arduino turns ON or resets, setup() runs one time.
  • pinMode() sets how each pin works.
  • vinHi and vinLo are for input so it is set to INPUT
  • ledG, ledR and Buz are for output and so it is set to OUTPUT
  • After setup(), loop() keeps running again and again.
  • In loop(), digitalRead(vinHi) checks metal signal and saves it to metalState.
  • If metalState is HIGH then there is no metal.
  • With Green LED will be ON and red LED will be OFF and buzzer will be OFF.
  • If metalState is LOW then metal is found.
  • With Green LED will be OFF and red LED will be ON and buzzer will be ON.
  • delay(3000) stops for 3 seconds before checking again.

Circuit Working:

Metal Detector Circuit Diagram using Arduino

Parts List:

ComponentSpecificationQuantity
Resistors
10k 1/4 watt1
1k 1/4 watt2
Preset 10k1
Capacitors
Electrolytic 10µF 25V1
Ceramic 2.2nF2
Semiconductors
Arduino UNO1
IC CS209A Metal Detection1
5V Buzzer1
LED Red 5mm 20mA1
LED Green 5mm 20mA1
Coil Detector 100µH, 40mm diameter, 50 turns by 0.4 mm insulated copper wire1
9V Battery1

Arduino metal detector runs on 9V battery.

Arduino makes square wave signal to power the coil.

Coil makes electromagnetic field and it changes when metal is close.

Coil is 100μH and is made from 0.4 mm copper wire with 50 turns and 40 mm wide.

When metal comes coils inductance changes.

This changes the square wave signal.

Capacitors remove noise and make signal clean.

Resistors control current so parts do not break.

Sensitivity can change using presets.

We can adjust signal strength or detection level.

Op-amp makes signal stronger and cleaner.

CS209A chip sets voltage level to check signal.

If no metal then green LED is ON.

If metal is close by then red LED is ON and buzzer makes sound.

How to Build:

To build a Metal Detector Circuit using Arduino follow the below mentioned steps:

  • Collect all parts shown in circuit diagram.
  • Connect pin 1 of CS209A to pin 8 using a preset and 10k resistor.
  • Connect pin 2 of CS209A to one side of 100μH coil.
  • Connect pin 3 of CS209A to other side of coil and to GND.
  • Connect pin 4 of CS209A to Arduino pin 2.
  • Connect pin 5 of CS209A to Arduino pin 3.
  • Connect pin 6 of CS209A to GND using a 2.2nF capacitor.
  • Connect pin 7 of CS209A to positive terminal of 9V battery.
  • Connect 9V battery negative to GND and place a 10μF capacitor between pin 7 and GND.
  • One leg goes to Arduino pin 6.
  • Other leg goes to GND.
  • Add 1k pull-up resistor between Arduino pin 3 and positive line.
  • Add 1k pull-up resistor between Arduino pin 2 and positive line.
  • Connect anode long leg to Arduino pin 5
  • Connect cathode short leg to GND.
  • Anode goes to Arduino pin 4
  • Cathode goes to GND.
  • Place 2.2nF capacitor between CS209A pin 2 and pin 3.

Conclusion:

This Metal Detector Circuit using Arduino is easy and accurate project.

It uses coil, CS209A chip and Arduino to find metal.

Green light shows no metal and red light and buzzer show metal found.

This circuit is good for learning electronics and sensor projects.

References:

Metal detector with arduino

Filed Under: Arduino Projects, Sensors and Detectors

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Building a Smart Pet Feeder Circuit using Arduino
Next Post: Simple Micro SD Card Data Logging Circuit with Arduino UNO »

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar




Categories

  • Alarm Circuits (34)
  • Amplifier Circuits (67)
  • Arduino Projects (56)
  • Audio Circuits (97)
  • Automobile Circuits (19)
  • Battery Charger Circuits (49)
  • Free Energy (13)
  • Heater and Temperature Controllers (10)
  • High Voltage (1)
  • Indicator Circuits (40)
  • Inverter Circuits (14)
  • LDR Circuits (16)
  • LED and Lamps (116)
  • Meters and Testers (28)
  • Motor Controllers (18)
  • Oscillator Circuits (34)
  • Power Supply Circuits (92)
  • Remote Control Circuits (7)
  • Security and Protection (26)
  • Sensors and Detectors (97)
  • Solar Circuits (17)
  • Timer Circuits (30)
  • Transistor Circuits (57)
  • Transmitter Circuit (13)
  • Tutorials (5)
  • Water Level Controller (4)

Recent Posts

  • Small UPS Circuit for Router Backup
  • Sound Activated LED Circuit with Arduino
  • Whistle Controlled Light Circuit using Arduino
  • Tilt Switch Interfacing Circuit with Arduino Uno
  • Interfacing Hall Effect Magnetic Sensor Circuit with Arduino

Recent Comments

  1. Admin-Lavi on Constant Voltage, Constant Current Battery Charger Circuit
  2. Bill on Constant Voltage, Constant Current Battery Charger Circuit
  3. Admin-Lavi on Long Range FM Transmitter Circuit (2km)
  4. Sina on Long Range FM Transmitter Circuit (2km)
  5. Admin-Lavi on Long Range FM Transmitter Circuit (2km)

Copyright © 2025 | New Circuit Ideas