Tap Module The HY810H optical slotted switch is a versatile component that can be easily integrated into Arduino projects for a variety of applications, primarily involving object detection and automatic countinguxcell 10 Pcs 2564 Fente PCB Photo Interrupteur Benin. This guide provides a detailed example of how to connect and utilize this switch with an Arduino, focusing on its functionality as a slotted optical switch. By understanding the principles behind optical switches and their interaction with an Arduino, makers can unlock advanced capabilities in their projects.
Understanding the HY810H Optical Slotted Switch
The HY810H is a type of photo interrupter, also known as a slotted optical switch. It consists of an infrared (IR) emitting diode and a phototransistor housed within a U-shaped casing, creating a slot.Optical Switch arduino code - General Guidance When an opaque object passes through this slot, it interrupts the IR beam, causing the phototransistor’s output to change. This change can then be read by a microcontroller like the Arduino.OutputType:HY810H · Detection Distance:10mm · Package Content:10pcs x Optical Sensor Switch · Pin Length: 10.45mm/0.41"; Total Size:26.5 x 6.1 x 22mm/1.04" x 0.24 ... The HY810H optical slotted switch commonly features a slot width of 25/64 inches (approximately 9.92mm) and a detection distance of 10mm.TheHY810H optical slotted switchis incredibly versatileuxcell 10 Pcs 25/64"SlotPCB Photo Interrupter When used with anArduino, it can be the core component ... Its Output type is typically a phototransistor.
This switch HY810H is ideal for applications requiring non-contact sensing, as highlighted in its use for printing, scanning, and copy machines. The ability to detect the presence or absence of an object passing through its slot without physical contact makes it a robust solution for automation.How to Use Photo Interrupters With Your ARDUINO
Connecting the HY810H to Arduino
To implement an example showcasing the HY810H optical slotted switch, careful wiring to the Arduino is essential. The typical configuration involves connecting the IR LED's anode and cathode to power and ground, respectively, often through a current-limiting resistorIn this instructable I will show you how to use one to trigger a tone alarm to go off when something is placed in the photo interrupters gap.. The datasheet for the HY810H or similar photo interrupters often suggests a specific resistor value, such as a 560Ω resistor to limit the voltage to approximately 1V for the IR LED, ensuring it stays within its maximum input voltage (around 110 Pcs 25/64"SlotPCB Photo InterrupterSlotted OpticalSensorSwitch HY810H10 Pcs 25/64"SlotPCB Photo InterrupterSlotted OpticalSensorSwitch HY810H14.67 21d 19h. Lion Cable 064193-02. Lion Cable 064193-02 75.00 29d 11h. Lion Cable 064193-01. Lion Cable 064193-01 75.00 29d 11h. Inductive ProximitySwitchSensor ....6V for the IR LED, though this can vary).uxcell 10 Pcs 2564 Fente PCB Photo Interrupteur Benin The phototransistor’s collector and emitter are then connected to Arduino digital input pins, usually with a pull-up resistor.
For instance, if you are using an Arduino Nano or Uno:
* HY810H IR LED Anode: Connect to a digital pin (e.The 560Ω resistor connected to the IR led is to cut the arduinos voltage from 5V to about 1V, TheHY810HIR led input max voltage is 1.6V and the 560Ω resistor ...g.In this instructable I will show you how to use one to trigger a tone alarm to go off when something is placed in the photo interrupters gap., D2) through a 560Ω resistor...SlotPhotoSwitchForexample, modules like theHY810Hand HY860H-A are common choices for PCB mounting, offering variousslotwidths such as 5/32" or 25/64" ....
* HY810H IR LED Cathode: Connect to GND10 Pcs 25/64"SlotPCB Photo InterrupterSlotted OpticalSensorSwitch HY810H10 Pcs 25/64"SlotPCB Photo InterrupterSlotted OpticalSensorSwitch HY810H14.67 21d 19h. Lion Cable 064193-02. Lion Cable 064193-02 75.00 29d 11h. Lion Cable 064193-01. Lion Cable 064193-01 75.00 29d 11h. Inductive ProximitySwitchSensor ....
* HY810H Phototransistor Collector: Connect to a digital input pin (e.g., D3). This pin will read the state of the switch.
* HY810H Phototransistor Emitter: Connect to GND.ArduinoNano: Connecting Photo Interrupter (SlottedOptocoupler) With Visuino:SlottedOptocouplers (Photo Interrupters) are very useful sensors, often included inArduinoprojects to detect position of moving objects, measure speed of rotation, or linear motion, frequency of events, and many others.
* Pull-up Resistor (Optional but recommended): A 10kΩ resistor can be connected between the digital input pin (D3) and the 5V supply to ensure a clean HIGH signal when the beam is not interrupted.2019年2月5日—산업용품 해외구매,수입대행사 유에스일공일 입니다. 국내에서 구매가 불가능한 산업용품,기계부속 ,전기,전자,금속, 바이오,화학약품 등등 다양한 ... The Arduino’s internal pull-up resistors can also be utilized in softwareArduino 101 meetup prep – day 5 – optical limit switches.
Arduino Code Example
The Arduino code will read the digital state of the pin connected to the phototransistor to determine if the optical switch has been triggered.
```cpp
const int opticalSwitchPin = 3; // Pin connected to the phototransistor collector
const int irLedPin = 2; // Pin connected to the IR LED anode (optional control)
void setup() {
Serial.2013年9月16日—The interrupter/optoisolator below is a Liteon LTH-301-32. This is a 5V, 20mA device. This is good for detecting water drops because it has a 15mm gap size.begin(9600);
pinMode(opticalSwitchPin, INPUT_PULLUP); // Use internal pull-up resistor
pinMode(irLedPin, OUTPUT);
// Optional: You can control the IR LED if needed, or keep it always on
// For simplicity, we'll assume the IR LED is always powered through its resistor산업용품해외구매는 "유에스일공일"로 문의주세요 ....
// digitalWrite(irLedPin, HIGH); // Uncomment if controlling LED with a pin
}
void loop() {
int switchState = digitalRead(opticalSwitchPin);
if (switchState == LOW) { // Assuming LOW when the beam is broken (depends on wiring)
Serial.println("Object detected!");
// You can add further actions here, like incrementing a counter
} else {
Serial.OutputType:HY810H · Detection Distance:10mm · Package Content:10pcs x Optical Sensor Switch · Pin Length: 10.45mm/0.41"; Total Size:26.5 x 6.1 x 22mm/1.04" x 0.24 ...println("Beam is clear.");
}
delay(100); // Short delay to avoid flooding the serial monitor
}
```
In this code, `INPUT_PULLUP` is used, meaning the pin will read HIGH by default.2012年2月5日—When an opaque flap enters the U-shaped black sensor above, it breaks the infrared beam of light and trips theswitch. No touching required. When the beam is interrupted, the phototransistor conducts, pulling the pin LOW산업용품해외구매는 "유에스일공일"로 문의주세요. .... If your wiring results in the opposite behavior, simply adjust the `if` condition to `switchState == HIGH`. This provides a fundamental example for using the HY810H optical slotted switch with Arduino.
Applications and Considerations
The HY810H optical slotted switch’s utility extends to numerous projects, including:
* Object Detection: Monitoring the passage of items on a conveyor belt산업용품해외구매는 "유에스일공일"로 문의주세요. ....
* Automatic Counting: Integrating with a counter to tally objectsConnecting a photo interrupter/optoisolator to an Arduino.
* Speed Measurement: Calculating speed by measuring the time between interruptions.Arduino 101 meetup prep – day 5 – optical limit switches
* Position Sensing: Determining the position of moving parts in a mechanism산업용품해외구매는 "유에스일공일"로 문의주세요 ....
* Limit Switches: Acting as a non-contact limit switch in robotics or automation.
When selecting a slotted optical switch, consider factors like the slot width (e.g산업용품해외구매는 "유에스일공일"로 문의주세요. ...., 25/64" for the HY810H), detection distance, and power requirements.Connecting a photo interrupter/optoisolator to an Arduino For specific technical details, referring to the HY810H datasheet is crucial for understanding its operational parameters, including current ratings and voltage tolerances. While the
Join the newsletter to receive news, updates, new products and freebies in your inbox.