Metal detector uses electric field to find metal near it.
Making Metal Detector Circuit using Arduino is fun for electronics lovers and we can make it using Arduino, CS209A chip, LEDs, buzzer and some other parts.
Furthermore, LED and buzzer will show when metal is close, also this project use CS209A chip with Arduino, as this CS209A is good chip for finding metal and nearby things.
Arduino Code:
// 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.
}
Circuit Working:

Parts List:
| Components | Values | Quantity |
|---|---|---|
| Resistors | 10k 1/4 watt | 1 |
| 1k 1/4 watt | 2 | |
| Preset 10k | 1 | |
| Capacitors | Electrolytic 10µF 25V | 1 |
| Ceramic 2.2nF | 2 | |
| Semiconductors | Arduino UNO | 1 |
| IC CS209A Metal Detection | 1 | |
| 5V Buzzer | 1 | |
| LED Red 5mm 20mA | 1 | |
| LED Green 5mm 20mA | 1 | |
| Coil Detector 100µH, 40mm diameter, 50 turns by 0.4 mm insulated copper wire | 1 | |
| 9V Battery | 1 |
Arduino metal detector runs on 9V battery and it makes square wave signal to power the coil; coil makes electromagnetic field and it changes when metal is close.
The coil has an inductance of 100 μH and uses 0.4 mm copper wire with 50 turns and a 40 mm width.
When metal comes coils inductance changes and this changes the square wave signal.
Also, capacitors remove noise and make signal clean and then resistors control current so parts do not break.
Sensitivity can change using presets and also we can adjust signal strength or detection level.
Op-amp makes signal stronger and cleaner and CS209A chip sets voltage level to check signal.
Finally, the green LED turns ON when no metal is detected and the red LED turns ON when metal is nearby.
The buzzer also sounds when metal is detected.
How to Build:
To build a Metal Detector Circuit using Arduino follow the below mentioned steps:
- First, collect all parts shown in circuit diagram.
- Next, connect pin 1 of CS209A to pin 8 using a preset and 10k resistor.
- After that, connect pin 2 of CS209A to one side of 100μH coil and then connect pin 3 of CS209A to other side of coil and to GND.
- Now connect pin 4 of CS209A to Arduino pin 2.
- Also, connect pin 5 of CS209A to Arduino pin 3.
- Then connect pin 6 of CS209A to GND using a 2.2nF capacitor.
- Further, connect pin 7 of CS209A to positive terminal of 9V battery, then connect 9V battery negative to GND and place a 10μF capacitor between pin 7 and GND.
- Also, one leg goes to Arduino pin 6 and other leg goes to GND.
- Then add 1k pull-up resistor between Arduino pin 3 and positive line and then add 1k pull-up resistor between Arduino pin 2 and positive line.
- Now connect anode long leg to Arduino pin and connect cathode short leg to GND.
- Finally, place 2.2nF capacitor between CS209A pin 2 and pin 3.
Conclusion:
Overall, this Metal Detector Circuit using Arduino is easy and accurate project, as it uses coil, CS209A chip and Arduino to find metal.
Furthermore, green light shows no metal and red light and buzzer show metal found, therefore, this circuit is good for learning electronics and sensor projects.