1. Description
kidsbits blocks coding photo interrupter module is fully compatible with kidsbits control board and Lego building blocks.
You can easily connect it to kidsbits control board for communication using an RJ11 cable without worrying about wrong connection and damage.

This is a high performance kidsbits photo interrupter module. The sensor is mainly composed of a photo interrupter, which belongs to an optical oscillating photoelectric switch optical sensor.
The upright part on the module combines an infrared light emitting diode and shielded infrared detector.
By emitting a beam of infrared light from one end to another end, the sensor can detect an object when it passes through the beam.
Useful for many applications such as optical limit switches, pellet dispensing, general object detection, etc.
2. Technical Parameters
- Interface: EASY plug
- Operating voltage: DC 5V
- Output signal: digital signal
3. Wiring Diagram

4. Import kidsbits library
Begin with the Mixly blocks coding, you should first import the corresponding kidsbits library for those sensor modules.
Connect the control board to your computer using a USB cable.
Then open the Mixly blocks software 0.998, set the board to UNO R3, select your correct COM port. On the upper right corner you can switch the language.

After that, click Import, import the keyes-kidsbits library. Shown below.


If import custom library successfully, you should see the sensor module library shown below.

Click on the display screen block of keyes_kidsbits, you can directly use the corresponding module.

5. Test Code

Check the C language code:

6. Test Result

Hook it up and upload the code success, powered on, you should see both the LED on the light interrupter module and D13 indicator on the control board are turned on.

If pick a paper up on the groove of module to interrupt the light, both LED lights are turned off.

7. Extensions
You can use this module to make a counter. When an object passes through the groove of photo-interrupter module, it will record a data to control the D13 indicator on the control board turning on and off.
When passing an odd number of times, the D13 indicator turns off.
When it passes an even number of times, the D13 indicator lights up.
The number of passes can be observed on the serial monitor.
You can refer to the test code and test result below.

Click the Code to check the C language.

Then click to open the monitor and set the baud rate to 9600.

