KY-010 PHOTO INTERRUPTER MODULE
Short description :
KY-010 Photo interrupter is a transmission-type photosensor, which typically consists of light emitting elements and light receiving elements aligned facing each other in a single package, that works by detecting light blockage when a target object comes between both elements..
Working with (Compatible)
Arduino, ESP32, Nodemcu, ESP8266, Raspberry Pi, and ......
ARDUINO IDE CODE
Example description :
Arduino when there’s an object blocking the path between the sensor`s gap.
const int pi= A0; // define pin
int values; //define a numeric variable
void setup()
{
Serial.begin(9600);
}
void loop()
{
values=analogRead(pi);
Serial.println(values);
delay(100);
}