For fast transaction call 0916.457.0748
Metal Scanner with Display

Metal Scanner with Display

This metal sensor are inductive sensors. Which means that it induces current when metal is near to it. This sensor is a non-contact electronic sensor that is used detect positions of a metal objects. The sensing sensing range depend on the type of metal being detected. Ferrous Metal, such as iron and steel, allow for a longer sensing range, while nonferrous metal objects such as aluminum, copper, can reduce the sensing range by 60 percent. Since the output of an induction sensor has two possible states, an inductive sensor sometimes referred to as an inductive proximity switch.

We will be using the Fotek Proximity Sensor Switches PL-05P.


Things you'll need:

  • Arduino UNO R3
  • Proximity Sensor PL-05P
  • 1602 Display with I2C soldered
  • Buzzer
  • Connecting Wire

Schematic Diagram:

Follow the connections above.

Building the code:

Download library here for Liquid Crystal Display and add it in your Arduino IDE.

 #include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2);

float metalDetected;
int monitoring;
int metalDetection = 1;
int buzzer = 13;

void setup(){
Serial.begin(9600);
lcd.init();
delay(10);
lcd.backlight();
pinMode(buzzer, OUTPUT);
digitalWrite(buzzer, LOW);
startUp();
delay(2000);
}

void loop(){
lcd.clear();
lcd.setCursor(2,0);
lcd.print("Scanning...");
monitoring = analogRead(metalDetection);
Serial.println(monitoring);

if (monitoring > 10){
lcd.clear();
lcd.setCursor(0,1);
Serial.println("Metal Detected!");
lcd.print("Metal Value: ");
lcd.setCursor(13,1);
lcd.print(monitoring);
lcd.setCursor(0,0);
lcd.print("Metal Detected!");
while(monitoring > 10){
digitalWrite(buzzer, HIGH);
monitoring = analogRead(metalDetection);
}
digitalWrite(buzzer, LOW);
delay(500);
} else {
lcd.setCursor(0,1);
lcd.print("\"Finding Metal\"");
}
delay(500);
}

void startUp(){
for(int i=0; i <= 16; i++){
lcd.setCursor(i,0);
lcd.print("-");
delay(150);
}
lcd.setCursor(0,1);
lcd.print("Connected Cities");
}

 

Copy the code and Upload.

Test it by pointing the proximity sensor in front of a metal object.

You're done.

 

Happy Coding!

 


0 comments

Leave a comment

Please note, comments must be approved before they are published

Payment Methods

Facebook Rewards Program