
This circuit connects a limit switch to a CNC machine, allowing the CNC to receive signals from the limit switch. The limit switch is powered by the CNC's 3.3V supply and shares a common ground with the CNC.

The YL-99 Limit Switch is a mechanical device designed to detect the presence or position of an object. It operates by opening or closing an electrical circuit when a predetermined limit is reached. This makes it an essential component in automation, robotics, and industrial control systems. The YL-99 is compact, reliable, and easy to integrate into various projects, making it a popular choice for hobbyists and professionals alike.

This circuit connects a limit switch to a CNC machine, allowing the CNC to receive signals from the limit switch. The limit switch is powered by the CNC's 3.3V supply and shares a common ground with the CNC.

This circuit is designed to activate a buzzer when a limit switch is in its normally closed (NC) position. The 9V battery provides power to the circuit. When the limit switch is open, the circuit is broken, and the buzzer will not sound.

This circuit controls a hobby gear motor using two toggle switches, a rocker switch, and two limit switches. The motor's direction is controlled by the toggle switches, while the limit switches and rocker switch provide additional control and safety features. Power is supplied by a 18650 battery in a holder.

This circuit features an Arduino UNO microcontroller interfaced with multiple pushbuttons and a limit switch, each connected through 10k Ohm pull-down resistors. The pushbuttons and limit switch are used as input devices, likely for user interaction or control, with the Arduino handling the logic and processing.
The YL-99 Limit Switch is a simple yet robust device. Below are its key technical details:
| Parameter | Specification |
|---|---|
| Operating Voltage | 5V DC |
| Maximum Current | 300mA |
| Contact Type | Normally Open (NO) or Normally Closed (NC) |
| Switch Type | Mechanical |
| Dimensions | 27mm x 10mm x 10mm |
| Mounting Hole Diameter | 2mm |
| Operating Temperature | -25°C to 85°C |
The YL-99 Limit Switch typically has three pins:
| Pin | Name | Description |
|---|---|---|
| 1 | Common (COM) | The common terminal for the switch circuit. |
| 2 | Normally Open (NO) | Open circuit by default; closes when the switch is pressed. |
| 3 | Normally Closed (NC) | Closed circuit by default; opens when the switch is pressed. |
Wiring the Switch:
COM pin to the positive terminal of your power source or signal input.NO pin if you want the circuit to close (activate) when the switch is pressed.NC pin if you want the circuit to open (deactivate) when the switch is pressed.Integration with Microcontrollers:
Example Circuit:
COM pin to the ground (GND) of the Arduino.NO pin to a digital input pin on the Arduino (e.g., D2).// YL-99 Limit Switch Example Code
// This code reads the state of the limit switch and prints it to the Serial Monitor.
const int switchPin = 2; // Pin connected to the NO pin of the YL-99
int switchState = 0; // Variable to store the state of the switch
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Set the pin as input with internal pull-up
Serial.begin(9600); // Initialize serial communication
}
void loop() {
switchState = digitalRead(switchPin); // Read the state of the switch
if (switchState == LOW) {
// Switch is pressed (NO pin connected to GND)
Serial.println("Switch Pressed");
} else {
// Switch is not pressed
Serial.println("Switch Released");
}
delay(100); // Small delay to avoid spamming the Serial Monitor
}
Switch Not Responding:
COM pin is properly connected and the correct output pin (NO or NC) is used.Unstable Readings:
Switch Stuck in One State:
Arduino Not Detecting the Switch:
INPUT_PULLUP mode in your Arduino code or add an external resistor.Q: Can the YL-99 Limit Switch handle AC voltage?
A: No, the YL-99 is designed for low-voltage DC applications only. Using it with AC voltage may damage the switch or pose a safety hazard.
Q: How do I choose between the NO and NC pins?
A: Use the NO pin if you want the circuit to activate when the switch is pressed. Use the NC pin if you want the circuit to deactivate when the switch is pressed.
Q: Can I use the YL-99 in outdoor environments?
A: The YL-99 is not weatherproof. If outdoor use is required, consider enclosing it in a waterproof housing.
Q: What is the lifespan of the YL-99 Limit Switch?
A: The lifespan depends on usage conditions but is typically rated for thousands of mechanical operations under normal conditions.