In this illustration we will going to wire the NPN Inductive Proximity Sensor to detect metal or any metal objects, this device also can be used as a metal detector screening when people walking through the entrance to find metal objects.
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.
This sensor consist an induction loop, electric current generates a magnetic field, which collapses generating a current that falls toward zero from its initial trans when the input electricity stops.
The inductance of the loop changes according to the material inside it and since metals are much more effective conductors that other materials the presence of metal increases the current flowing through the loop. This change can be detected by sensing circuitry which signal pass true to some other device whenever metal is detected.
This device is commonly used in traffic lights, car washes, manufacturing machinery, automated industrial machinery, elevators and building automatons this device is mostly used because can adopt in a rugged and dirt environment.
In this example we will going to used PNP NO 3-WIRE Cylindrical Inductive Proximity Sensor
Detecting Distance: 4mm
Supply Voltage: DC6-36V
Current Output: 300 mA
Response Frequency: 100Hz
Detect Object: Metal
Column Sensor Dia.12mm
Wiring Guide with Arduino MCU
The metal proximity sensor will have three color wire. The blue should be in the ground, brown is on +VCC which should be giving to Arduino + 5v VCC and when you take metal near tot the sensor it induces more current which results in higher voltage. In this case you need to open your serial monitor to see the incoming signal from the analog pin then make a threshold to determine if metal is detected or not.
Generally speaking the Iron/Copper or Metal with good magnetic properties will induce more that 1v when brought nearer to the sensor you need to touch the surface it will start detecting from a distance about 3CM.
14CORE TEST CODE FOR PROXIMITY SENSOR
Metal Detection with 3 wire sensor
int metalDetection = 1;
monitoring = analogRead(metalDetection);
metalDetected = (float) monitoring*100/1024.0;
Serial.print("14CORE METAL DETECTOR TEST");
Serial.print("Initializing Proximity Sensor");
Serial.print("Metal is Proximited = ");
if (monitoring > 250)
Serial.println("Metal is Detected");