The LJC18A3-B-Z/BY is a capacitive proximity sensor designed to detect the presence or absence of objects without physical contact. It operates by sensing changes in capacitance caused by the proximity of a target object. This type of sensor is commonly used in industrial automation, robotics, and other applications where non-contact object detection is required.
Pin Number | Description | Notes |
---|---|---|
1 | Brown Wire (Vcc) | Supply voltage (6-36V DC) |
2 | Blue Wire (GND) | Ground connection |
3 | Black Wire (Output) | Output signal (PNP NO) |
Q: Can the sensor detect non-metallic objects? A: Yes, capacitive sensors can detect both metallic and non-metallic objects.
Q: Is the sensor waterproof? A: The sensor has an IP67 rating, making it dust and water-resistant, but it should not be submerged.
Q: How do I connect this sensor to an Arduino UNO? A: Connect the brown wire to the 5V pin, the blue wire to GND, and the black wire to a digital input pin on the Arduino UNO.
// Define the connection pin
const int sensorPin = 2; // Black wire connected to digital pin 2
void setup() {
pinMode(sensorPin, INPUT); // Set the sensor pin as an input
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
int sensorValue = digitalRead(sensorPin); // Read the sensor output
Serial.println(sensorValue); // Print the sensor value to the serial monitor
delay(100); // Wait for 100 milliseconds
}
This example code sets up an Arduino UNO to read the output from the LJC18A3-B-Z/BY capacitive proximity sensor and print the results to the serial monitor. The sensor's black wire is connected to digital pin 2, the brown wire to the 5V pin, and the blue wire to GND. The code continuously reads the sensor output and prints the value, which will be HIGH when an object is detected and LOW when no object is present.