Home Code KY-010 Photo Interrupter Module and Raspberry Pi

KY-010 Photo Interrupter Module and Raspberry Pi

by shedboy71

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

Amazon. com link

Ebay search

37 sensor kit AliExpress Product link

Amazon link

ebay link

connecting wire Aliexpress product link

Amazon.com link

Ebay 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
pi and ky-010 layout

pi and ky-010 layout

 

pi and ky-010 schematic

pi and ky-010 schematic

 

Code Examples

https://gist.github.com/getelectronics/757a044caeffe167e75037f4e42e884d

Download

code on github

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More