
There is nothing groundbreaking in this mini-project, but maybe someone will find it useful.
One day I decided to make animated stairs (steps) lighting.
Illumination of steps sequentially up or down depending on the direction of entering the stairs. But that's not what we're talking about here.
While the backlight control system was working properly, the trigger systems at the bottom and top of the flight of stairs needed development.
At the beginning, the cheapest solution, i.e. PIR sensors. I will say right away that PIR in such a system is a misunderstanding. Very slow reaction time (1 - 2 seconds) and unpredictable activation zone. You can climb up to three steps in two seconds. I could not set it in any way, the more so that about 1 m from the stairs there is a home communication route.
The next idea was an IR barrier. Amazing reaction speed. As far as I remember about 3ms from beam interruption. The disadvantage of this solution (at least in my case) was the placement of the transmitter and receiver on opposite sides of the entrance to the stairs.
And finally I found a solution that is a compromise of response time and quite precise setting of object detection. Laser reflective sensor. The module takes about 50 measurements per second. This is sufficient to quickly start the lighting control system.
System description:
The VL53L1x laser module in this case works in the "short" mode (catalogue note) with a maximum range of 135 cm and communicates with the ESP03 via the I2C bus. The latter receives data about the measured distance and, based on them, sends a low or high state to the output. ESP in AP (configuration) mode is used to set the operating distance in real time, which facilitates calibration after installation of the system at the final location. Of course, the system can be extended with additional functions. Here is the basic version.
The waveform at the GPIO01 VL53L1x output. Low status informs about the completed measurement.

Configuration menu:

Scheme and source code of the program.

Cool? Ranking DIY