11. Octopus Photo Interrupter Sensor(EF04012)

11.1. Introduction

  • Photo Interrupter Sensor is a sensor module based on ITR9608 photoelectric switch that can be used with micro:bit.


11.2. Characteristics

  • The 3-pins ports is easy to plug and play.

  • It can work with micro:bit in 3V.

11.3. Specifications

Item Parameter
SKU EF04012
ITR9608 Optoelectronic switch Built-in infrared transmitter and receiver tube
LED with signal Signal Indicator
Working Voltage DC 3.0V-5.0V
Connector Type Digital
Pins Definition 1-Signal 2-VCC 3-GND
Response Quick to response with high sensitivity
Stability Stable and durable

11.4. Outlook and Dimensions


11.5. Quick to Start

Connection diagram

  • Connect to P1 port as the picture shows.

Take sensor:bit for example


Program as the picture shows

  • Show the value variable.

  • Add 1 on the value variable each time when the Photo Interrupter Sensor detects a value.



Links: https://makecode.microbit.org/_VcJWCh4hw97j

You can also download it directly below:


  • The on start micro:bit shows number 0, the counting system would add one each time when objects are put on the Optoelectronic switch.

11.6. Relevant Cases

11.7. Technique Files