Optical proximity sensor

Optical proximity sensor

A proximity sensor with Calliope on-board means. Detects objects approaching independently of ambient light.


15 mins

from 10 years on


Actually I wanted to equip the Calliope mini Bot with the trick presented here with a collision sensor. Unfortunately the range is a little bit too short for that.
Nevertheless, this is such a good thing that I would like to present it here as a small project.
There are certainly a lot of application cases in which this technology can be used.

How it works:

The measurement is made once with and once without flash. If a difference can be detected, an object must be present.
In the example, the detection is signalled by a rectangle on the LED matrix.
The range is approx. 4cm.


This text as well as the image is published under a CC BY-SA 3.0 DE license. It was originally published in German by Daniel Havlik and translated into English by the Calliope team.

You can find the finished file below.

The program can be opened directly with the MakeCode editor.