Mirko Pavleski
Published © GPL3+

DIY Sensitive Arduino IB METAL DETECTOR

The construction is really simple thanks to the microcontroller, but also the module for weak signal amplification with LM358 IC.

BeginnerFull instructions provided21,379
DIY Sensitive Arduino IB METAL DETECTOR

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
module for weak signal amplification with LM358
×1
IRF730 mosfet transistor
×1
Rotary Potentiometer, 10 kohm
Rotary Potentiometer, 10 kohm
×2
Buzzer
Buzzer
×1
LED (generic)
LED (generic)
×2
Rechargeable Battery, Lithium Ion
Rechargeable Battery, Lithium Ion
×3
General Purpose Transistor NPN
General Purpose Transistor NPN
second version
×2
Resistors and capacitors (second version)
second version
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Schematics

Schematic with module

Schem. with discrete amp.

Code

Arduino code

Arduino
void setup() {
pinMode(A0, INPUT);
pinMode(A1, INPUT);
pinMode(8, OUTPUT);
pinMode(A4, INPUT);
pinMode(A5, OUTPUT);
}
void loop() {
int val1 = 0;
int val2 = 0;
int val3 = 0;
int val4 = 0;
int val5 = 0;
int val6 = 0;
int val7 = 0;
int val8 = 0;
int val9 = 0;
int val10 = 0;
int sumval = 0;
int impuls = 120;   //select the pulse length depending on the frequency
int Delay = 0;  
int base = 0;
Delay = analogRead(A4);
pinMode(A0, OUTPUT);
digitalWrite(A0, LOW);
pinMode(A0, INPUT);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);      
val1 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);    
val2 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);    
val3 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val4 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val5 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val6 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val7 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val8 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val9 = analogRead(A0);
digitalWrite(8,HIGH);
delayMicroseconds(impuls);   
digitalWrite(8, LOW);
delayMicroseconds(Delay);   
val10 = analogRead(A0);
sumval = val1 + val2 + val3 + val4 + val5 + val6 + val7 + val8 + val9 + val10;
sumval = sumval/5;
base = analogRead(A1);
if (sumval > base)
{tone(A5,1000);
delay(50);
noTone(A5);
} 
else  {delay(50);
}
}

Credits

Mirko Pavleski

Mirko Pavleski

149 projects • 1283 followers

Comments