

A limit switch is an electromechanical device that detects the presence or absence of an object, or the position of a moving part. It is commonly used to control machinery or equipment by providing feedback to a system when a specific condition is met, such as the end of travel for a moving component. Limit switches are highly reliable and are widely used in industrial automation, robotics, and safety systems.








Below are the general technical specifications for a standard limit switch. Note that specific models may vary, so always refer to the datasheet of your particular switch.
The limit switch typically has three terminals: Common (COM), Normally Open (NO), and Normally Closed (NC). The table below describes these terminals:
| Pin Name | Description |
|---|---|
| COM | Common terminal, connected to the input voltage or ground. |
| NO | Normally Open terminal, connected to COM when the switch is activated. |
| NC | Normally Closed terminal, connected to COM when the switch is not activated. |
Wiring the Limit Switch:
Integrating with a Microcontroller (e.g., Arduino UNO):
Example Circuit:
Below is an example of how to use a limit switch with an Arduino UNO:
// Define the pin connected to the limit switch
const int limitSwitchPin = 2; // Digital pin 2
const int ledPin = 13; // Built-in LED pin
void setup() {
pinMode(limitSwitchPin, INPUT_PULLUP); // Set pin as input with pull-up resistor
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int switchState = digitalRead(limitSwitchPin); // Read the state of the switch
if (switchState == LOW) {
// Switch is pressed (NO terminal connected to COM)
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Limit switch activated!");
} else {
// Switch is not pressed
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("Limit switch not activated.");
}
delay(100); // Small delay for stability
}
Switch Not Responding:
Unstable or Noisy Signal:
Mechanical Failure:
Incorrect Behavior in Arduino:
INPUT_PULLUP if using the NO terminal.By following these guidelines, you can effectively integrate and troubleshoot a limit switch in your projects.