In the age of COVID-19, keeping your distance from others is vital to maintaining public safety. However, many people can be oblivious as to how far away they actually are, or just not know how far away two meters actually is. To help with this problem, I created a social distance "lidar" scanner that sweeps an area and displays a message to alert people who aren't respecting the bubble. I decided to mount this on my bike, as trails often host people that are all too happy to get close to others.Components
The "brain" of this project is the Teensy 4.0, which is a powerful microcontroller that is capable of taking readings, performing calculations on them, and displaying message very quickly.
It has (an albeit overkill for this project) 1MB of RAM and 2MB of flash and a powerful ARM Cortex-M7 processor running at over 600MHz. To measure distances, I went with Sparkfun's VL53L1X ToF laser distance sensor that uses pulses of light to measure how far away an object is.
This is superior to an ultrasonic sensor in several ways. First, light travels far faster than sound, so measurements are done more quickly. Second, a laser is much narrower than a pulse of sound and therefore can be more accurate. Finally, the sensor consumes less power than an ultrasonic sensor and interfaces via the I2C bus. The final component to this project is a simple LED matrix that is driven by several MAX MD72XX ICs, which connect to the Teensy via SPI and can be controlled by very elegant libraries such as Parola.
I began this project by going into Fusion 360 and creating a model of how the ToF sensor board would be attached to the micro servo. After that was done, I made a larger assembly that included a mount for it to attach to a bike. I then exported each piece and 3D printed them.
The program is quite simple in its operation. It starts by initializing the objects for the distance sensor, display, and servo. Next, it enters into the main loop. In this loop, the position of the servo is advanced and the distance is measured. If this distance is less than the set threshold, then the message "BACK" is displayed. Otherwise, "U GOOD" is shown.Use
To test out the system, I went on a trail and began to bike. I noticed that whenever a person got too close, they saw the message and decided to slow down. This project can be used in different areas as well, such as near a cashier or while walking.