toothpaste dispenser
projcet description
My fourth project in my robotics class was an automatic toothpaste dispenser with image recognition. Our objectives for the project were to:
Load a toothbrush automatically
Use a sensor to check if the brush was loaded
Dispense a known amount of toothpaste onto the brush
Update a digital twin in OnShape with the current state of the dispenser
Detect the toothpaste with a camera, and take a photo of the brush
Unload the toothbrush
I accomplished all of these objectives with my build. I used OpenCV to continuously take images of the toothbrush loading location, brightening the images and using a color mask to look for the toothbrush.
If the toothbrush was detected, a user could press a button to dispense toothpaste onto the brush using the slider mechanism mounted on the toothpaste tube. A motor and a rack and pinion would pull on the slider from both sides, squeezing the tube and dispensing paste onto the brush. An OnShape assembly of the system would then be updated by the OnShape REST API, relocating the slider in the digital model to its real-life location.
After each extrusion, the camera would take another photo and saturate the image, looking for blue pixels that could indicate toothpaste. When the camera detected toothpaste, the system would reset and return the brush to the user.
Through this project, I learned a lot about image recognition, digital twins and mechanical extrusion of paste. I found that the largest challenge of the project was just getting the paste to dispense accurately onto the brush.
Check out the code on GitHub, and be sure to watch the full system in action at the bottom of the page!