Stufin
Home Quick Cart Profile

Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch for 3D Printer

Buy Now

Sensing Range

0-5mm

Response Time

<1ms

Operating Voltage

5V DC

Current Consumption

<10mA

Cable Length

50cm

Operating Temperature

0C to 50C

Storage Temperature

-20C to 70C

Applications

The Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch is designed specifically for 3D printing applications, including

Endstop detection for X, Y, and Z axes

Object detection and monitoring

Automation and robotics applications

Conclusion

The Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch is a reliable and accurate sensing component ideal for 3D printing applications. Its compact design, easy installation, and robust construction make it an excellent choice for both professional and hobbyist 3D printing enthusiasts.

Pin Configuration

  • Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch for 3D Printer
  • Pinout Description:
  • The Optical Endstop module has a total of 4 pins, which are:
  • Pin 1: VCC
  • Function: Power supply pin
  • Description: This pin provides the power supply to the Optical Endstop module. Typically, a voltage of 5V is recommended.
  • Connection: Connect to the 5V power supply of your 3D printer's mainboard or a 5V regulator.
  • Pin 2: GND
  • Function: Ground pin
  • Description: This pin provides the ground connection for the Optical Endstop module.
  • Connection: Connect to the ground pin of your 3D printer's mainboard or a common ground point.
  • Pin 3: OUT
  • Function: Output pin
  • Description: This pin provides the output signal from the Optical Endstop module. The output is a digital signal (0V or 5V) that indicates the state of the optical sensor.
  • Connection: Connect to a digital input pin on your 3D printer's mainboard, such as an endstop input or a limit switch input.
  • Pin 4: None ( reserved for future use)
  • Function: Not used
  • Description: This pin is currently not used and is reserved for future updates or functionality.
  • Connection Structure:
  • To connect the Optical Endstop module to your 3D printer's mainboard:
  • 1. VCC Pin: Connect the VCC pin of the Optical Endstop module to the 5V power supply pin of your 3D printer's mainboard.
  • 2. GND Pin: Connect the GND pin of the Optical Endstop module to the ground pin of your 3D printer's mainboard.
  • 3. OUT Pin: Connect the OUT pin of the Optical Endstop module to a digital input pin on your 3D printer's mainboard, such as an endstop input or a limit switch input.
  • Note:
  • Ensure that the Optical Endstop module is properly connected to the 3D printer's mainboard and that the power supply voltage is within the recommended range (5V).
  • Consult your 3D printer's documentation and mainboard specifications to determine the correct digital input pin for the OUT signal.
  • The Optical Endstop module is typically used as an endstop or limit switch for 3D printing applications, and its output signal is used to trigger specific actions or events in the printing process.

Code Examples

Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch for 3D Printer
Overview
The Optical Endstop with 50cm Cable Photoelectric Light Control Optical Limit Switch is a sensor designed for 3D printers to detect the position of the print head or other moving parts. It uses a photoelectric principle to detect obstacles or limits, providing a reliable and accurate way to control the printer's movement.
Technical Specifications
Supply Voltage: 5V - 24V
 Output Signal: Digital TTL level (0V or 5V)
 Detection Distance: 0-10mm
 Response Time: 10ms
 Cable Length: 50cm
 Operating Temperature: -20C to 80C
Pinout
The sensor has a 3-pin connector:
VCC (Red wire): Power supply (5V - 24V)
 GND (Black wire): Ground
 OUT (Yellow wire): Digital output signal (0V or 5V)
Example 1: Using the Optical Endstop with an Arduino Board
In this example, we will use the Optical Endstop with an Arduino board to control a 3D printer's X-axis movement.
Hardware Connection
Connect the VCC pin of the Optical Endstop to the 5V pin of the Arduino board.
 Connect the GND pin of the Optical Endstop to the GND pin of the Arduino board.
 Connect the OUT pin of the Optical Endstop to a digital input pin (e.g. D2) of the Arduino board.
Code
```c
const int endstopPin = 2;  // Digital input pin connected to the OUT pin of the Optical Endstop
void setup() {
  pinMode(endstopPin, INPUT);
  Serial.begin(9600);
}
void loop() {
  int endstopState = digitalRead(endstopPin);
  if (endstopState == HIGH) {
    Serial.println("Endstop triggered!");
    // Stop the 3D printer's X-axis movement
  } else {
    Serial.println("Endstop not triggered.");
    // Continue moving the X-axis
  }
  delay(10);
}
```
Example 2: Using the Optical Endstop with a Raspberry Pi
In this example, we will use the Optical Endstop with a Raspberry Pi to control a 3D printer's Y-axis movement.
Hardware Connection
Connect the VCC pin of the Optical Endstop to a 5V pin of the Raspberry Pi.
 Connect the GND pin of the Optical Endstop to a GND pin of the Raspberry Pi.
 Connect the OUT pin of the Optical Endstop to a GPIO pin (e.g. GPIO 17) of the Raspberry Pi.
Code
```python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
endstop_pin = 17  # GPIO pin connected to the OUT pin of the Optical Endstop
GPIO.setup(endstop_pin, GPIO.IN)
while True:
    endstop_state = GPIO.input(endstop_pin)
    if endstop_state:
        print("Endstop triggered!")
        # Stop the 3D printer's Y-axis movement
    else:
        print("Endstop not triggered.")
        # Continue moving the Y-axis
    time.sleep(0.01)
```
Additional Notes
The Optical Endstop should be mounted in a way that ensures the light beam is not obstructed by any objects or shadows.
 The sensor's detection distance can be adjusted by moving the sensor closer or farther away from the object being detected.
 It is recommended to add a debouncing mechanism to the code to prevent false triggers due to mechanical vibrations or electrical noise.