1.5k
In this example we take a look at the KY-010 Photo Interrupter Module and connect this to a Raspberry Pi.
The sensor uses a beam of light between the emitter and the detector to check if the path between both is being blocked by an object
Parts List
Name | link |
Raspberry Pi 4 | Aliexpress product link |
37 sensor kit | AliExpress Product link |
connecting wire | Aliexpress product link |
Layout
We use pin 40 (GPIO 21) in this example, you can use another GPIO pin.
KY-010 module | Raspberry Pi |
– (left) | GND |
middle | +3v3 |
S (right) | Pin 40 |
Code Examples
https://gist.github.com/getelectronics/757a044caeffe167e75037f4e42e884d