5V Metal Inductive Proximity Switch Wiki - DFRobot

FIT0658 5V Metal Proximity Switch

Introduction

The proximity switch usually possesses the characteristics of travel switch, micro switch and sensor. This is a small 5V metal proximity switch with 27106mm size, which can be easily mounted in tight space. It features NPN (normally open) output, 4mm detection distance, 1000Hz switching frequency. The response time is less than 1ms, quick and stable. These sensors are IP67 rated, which can withstand a temperature range of -20℃~65℃. So, this sensor can be used indoor and outdoor regardless of the weather.

This proximity switch should be operated at 5V. It can be used not only in machinery automation, security equipment, car anti-theft and other operations, but also in the hands of makers with various controller boards for robot runway conversion, speed detection, etc.

Specification

FIT0658-Dimension

Pinout

FIT0658-Pinout

Color Function Description
Black Signal Line
Brown Power Input(5V)
Blue GND

Tutorial

Requirements

Connection Diagram

FIT0658-Connection Diagram

Sample Code

const int SensorPin = 4;
const int LedPin = 13;

void setup()
{
  Serial.begin(9600);
  Serial.println("Start!");  
  pinMode(SensorPin,INPUT);
  pinMode(LedPin,OUTPUT);
  digitalWrite(LedPin,LOW);
}

void loop()
{  
  if(digitalRead(SensorPin) == LOW)              
  digitalWrite(LedPin,LOW);   
  else
  digitalWrite(LedPin,HIGH);
  Serial.print("Infrared Switch Status:");
  Serial.println(digitalRead(SensorPin),BIN);
  delay(50);
}

Expected Results

In the Arduino serial port monitor, you can see the change of the switch state when the sensor detects the metal object, when the metal object is not detected, the status is 1, and it is 0 when detected; you can also observe whether the metal object is detected by the state of indicator on UNO board or the light on the sensor, and the indicator light is on when the metal object is detected, otherwise, off.

Expected Result

Note:

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum

More Documents