Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use YL-99 Limit switch: Examples, Pinouts, and Specs

Image of YL-99 Limit switch
Cirkit Designer LogoDesign with YL-99 Limit switch in Cirkit Designer

Introduction

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.

Explore Projects Built with YL-99 Limit switch

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
CNC Machine with Limit Switch Integration
Image of CNC: A project utilizing YL-99 Limit switch in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Buzzer Alarm with Limit Switch
Image of Door Alarm : A project utilizing YL-99 Limit switch in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Motor Control System with Toggle and Limit Switches
Image of Simple Lift: A project utilizing YL-99 Limit switch in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO-Based Multi-Button Input System with Limit Switch
Image of Button Switches Diagram: A project utilizing YL-99 Limit switch in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with YL-99 Limit switch

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of CNC: A project utilizing YL-99 Limit switch in a practical application
CNC Machine with Limit Switch Integration
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Door Alarm : A project utilizing YL-99 Limit switch in a practical application
Battery-Powered Buzzer Alarm with Limit Switch
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Simple Lift: A project utilizing YL-99 Limit switch in a practical application
Battery-Powered Motor Control System with Toggle and Limit Switches
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Button Switches Diagram: A project utilizing YL-99 Limit switch in a practical application
Arduino UNO-Based Multi-Button Input System with Limit Switch
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.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Detecting the end position of moving parts in machinery
  • Triggering events in conveyor belt systems
  • Safety interlocks in industrial equipment
  • Position sensing in robotics
  • Home automation systems

Technical Specifications

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

Pin Configuration and Descriptions

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.

Usage Instructions

How to Use the YL-99 Limit Switch in a Circuit

  1. Wiring the Switch:

    • Connect the COM pin to the positive terminal of your power source or signal input.
    • Use the NO pin if you want the circuit to close (activate) when the switch is pressed.
    • Use the NC pin if you want the circuit to open (deactivate) when the switch is pressed.
  2. Integration with Microcontrollers:

    • The YL-99 can be connected to a microcontroller (e.g., Arduino UNO) to detect the switch's state.
    • Use a pull-up or pull-down resistor to ensure stable readings.
  3. Example Circuit:

    • Connect the COM pin to the ground (GND) of the Arduino.
    • Connect the NO pin to a digital input pin on the Arduino (e.g., D2).
    • Use a 10kΩ pull-up resistor between the digital input pin and 5V.

Arduino UNO Example Code

// 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
}

Important Considerations and Best Practices

  • Debouncing: Mechanical switches like the YL-99 can produce noise or "bouncing" when pressed. Use software debouncing (e.g., a small delay) or hardware debouncing (e.g., a capacitor) to ensure stable readings.
  • Voltage Levels: Ensure the operating voltage does not exceed the specified 5V DC to avoid damaging the switch.
  • Mounting: Secure the switch using screws or adhesive to prevent movement during operation.
  • Environmental Conditions: Avoid exposing the switch to extreme temperatures or moisture unless it is specifically rated for such conditions.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Switch Not Responding:

    • Cause: Loose or incorrect wiring.
    • Solution: Double-check the connections, ensuring the COM pin is properly connected and the correct output pin (NO or NC) is used.
  2. Unstable Readings:

    • Cause: Switch bouncing or electrical noise.
    • Solution: Implement debouncing in your code or add a capacitor across the switch terminals.
  3. Switch Stuck in One State:

    • Cause: Mechanical failure or debris inside the switch.
    • Solution: Inspect the switch for physical damage or obstructions. Replace if necessary.
  4. Arduino Not Detecting the Switch:

    • Cause: Missing pull-up or pull-down resistor.
    • Solution: Use the INPUT_PULLUP mode in your Arduino code or add an external resistor.

FAQs

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.