

A limit switch is an electromechanical device designed to detect the presence or absence of an object or the position of a moving part. It is commonly used in industrial and automation applications to control machinery or equipment. The switch operates by making or breaking an electrical connection when a physical actuator is triggered by an object.








Below are the key technical details for the Arduino UNO-compatible limit switch:
| Parameter | Value |
|---|---|
| Manufacturer | Arduino |
| Part ID | UNO |
| Operating Voltage | 5V DC |
| Maximum Current Rating | 5A |
| Contact Type | Normally Open (NO) / Normally Closed (NC) |
| Actuator Type | Lever, Roller, or Plunger |
| Mechanical Durability | 10 million operations |
| Electrical Durability | 500,000 operations |
| Operating Temperature | -25°C to 85°C |
| Pin Name | Description |
|---|---|
| COM | Common terminal for the switch |
| NO | Normally Open terminal (closed when actuated) |
| NC | Normally Closed terminal (open when actuated) |
Wiring the Limit Switch:
COM pin to the ground (GND) of your circuit.NO pin if you want the circuit to close when the switch is actuated.NC pin if you want the circuit to open when the switch is actuated.NO or NC pin to a digital input pin (e.g., D2) and use a pull-up or pull-down resistor as needed.Example Circuit:
COM pin to GND.NO pin to Arduino digital pin D2.Arduino UNO Code Example: Below is an example code snippet to read the state of the limit switch:
// Define the pin connected to the limit switch
const int limitSwitchPin = 2;
void setup() {
pinMode(limitSwitchPin, INPUT_PULLUP); // Set pin as input with internal pull-up
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int switchState = digitalRead(limitSwitchPin); // Read the switch state
if (switchState == LOW) {
// Switch is pressed (NO is connected to COM)
Serial.println("Limit switch activated!");
} else {
// Switch is not pressed
Serial.println("Limit switch not activated.");
}
delay(500); // Delay for stability
}
Switch Not Responding:
False Triggering:
Arduino Not Detecting the Switch:
INPUT_PULLUP in the code or use an external pull-up resistor.Switch Fails to Actuate:
Q: Can I use the limit switch with a 3.3V microcontroller?
A: Yes, but ensure the switch operates reliably at 3.3V and adjust the pull-up resistor value accordingly.
Q: How do I debounce the limit switch in software?
A: Use a delay or a state-checking algorithm in your code to filter out rapid changes in the switch state.
Q: Can I use the limit switch for high-current applications?
A: The switch can handle up to 5A, but for higher currents, use it to control a relay or transistor.
Q: What is the difference between NO and NC terminals?
A: The NO terminal is open by default and closes when actuated, while the NC terminal is closed by default and opens when actuated. Choose based on your circuit requirements.