Getting the right vertical angle is easy with this simple design
I am working with several other engineers to design a new class of low-cost robots for teaching computational thinking to STEM students. As we started to roll out our design to our students, we focused on giving our students a great user experience. One of the most challenging problems was precisely mounting our awesome new VL53L0X time-of-flight sensors. This blog will discuss creating a simple 3D printed part that makes mounting simple and vertical angle calibration easy to adjust.
Backstory — why we love time-of-flight distance sensors
Until a few years ago, most of our CoderDojo educational robots used the ubiquitous and low-cost HC-SR04 ultrasonic “ping” distance sensor. We call them “ping” sensors because they work similarly to the “ping” sound signals used in submarines to detect distance in the water.
However, a new class of distance sensors has become incredibly affordable in the last few years: the new time-of-flight laser distance sensor.
Here is a photo of the new time-of-flight distance sensor on the left compared with the older HC-SR04 ultrasonic distance sensor.
Both these sensors are now produced at high volumes, driving the sensors' cost below $3 when purchased in quantity 10, which is typical of a small CoderDojo coding club. But the time-of-flight sensor uses very low-power and kid-safe pulses of laser light to calculate distance. This is unlike the older ultrasonic ping sensor that sends sound wave pulses out and measures the time for the return sound.
From our physics classes, you might recall that light travels 186,000 miles per second. In contrast, the speed of sound is only about 1/5th of a mile per second. So we can see that light travels roughly a million times faster than the speed of sound. So to time the speed of these pulses returning requires very accurate clocks! Integrating this technology into a $3 part is a truly amazing feat of engineering, which we won’t go into in detail here. Still, the take-home point is that we want to incorporate the benefits of using light to measure distances into our CoderDojo robots. We still think the newer HC-SR04P (note the P for “Pico-compatible” 3.3-volt interfaces) ultrasonic sensors are still advantageous. We will use them in some of our robot designs when appropriate.
The challenge with aiming the small time-of-flight sensors
The problem I had with these small sensors is that I didn’t really understand their characteristics when I first started testing them. We were so excited to get them we literally just put some hot glue on our sensors and stuck them to the bottom of the robots!
The problem with this is that our collision avoidance robots didn’t work very well on surfaces that reflected the laser light from the floor. The robots would get some “false positive” collision avoidance readings and continually turn. The problem turns out they were aimed straight out in front at an angle almost parallel to the floor. But the laser beam was not a perfect point of light. It has a cone-shaped field, and the bottom of the cone was pointing down to the floor.
Time-of-flight sensor verticle angle adjustments
The solution was to angle the sensor up about 3 degrees. This gave us a very accurate distance measurement on all the surfaces we tested. So now that we figured out the problem, how can we make it easy for our students to adjust in the classroom? The answer was a small 3D printed holder that allowed the angle to be adjusted by slightly bending the header pins.
We found we can use small plyers to make small changes in the angles of the header pins to adjust the sensors. We can easily do this to continually adjust our robots until we get a good signal on reflective surfaces. We used M3x6 (metric) machine screws to mount the sensor on the bottom of our SmartCar chassis and M3 nuts. Alternatively, you can use #4–40 1/4 inch non-metric screws. Note that we keep the top of the SmartCar chassis open to mount a breadboard, displays, and buttons to control and program the SmartCars.
I want to thank my friend Gerd for doing the design and printing of these sensor mounts. Designing these mounting connectors is not easy. They need to be designed to be easy to print and work on a wide variety of 3D printers with tolerance for alignment errors.
We plan to include these sensor mounts in our CoderDojo Twin Cities robotics kits. The designs are available to any schools and coding clubs that would like to print their own under the Creative Commons Sharealike Noncommercial Attribution license. You can access the 3D model files directly from the onshape.com website.