A 3D-printed dispenser that gives you the amount of toothpaste dentists recommend with one button press. Our team of three built it for Northeastern's Cornerstone of Engineering class.
Press it to get a dose from the slot underneath. The adult setting gives a pea-sized amount and the kid setting gives a rice-sized amount.
Press it once to switch between the adult and kid dose. Press it twice quickly to run the motor backward, which lifts the arm so you can put in a new tube.
The motor spins this screw, and the arm rides down its threads. That's how the motor's spinning becomes a straight push on the tube.
This motor turns the screw. The Pico switches it on, off, and into reverse through the motor driver.
This small computer runs the whole dispenser. I wired it up and wrote all of its code in MicroPython.
The Pico can't power a motor on its own, so this TB6612FNG driver board sits in between. It lets the motor run forward or backward.
These slots on the back let you hang the dispenser on regular bathroom wall screws.
For people with arthritis or Parkinson's, squeezing a toothpaste tube can be painful or even impossible. Kids have the opposite problem. Over a third of them use more toothpaste than they should, because nothing tells them how much is enough.
We wanted to make getting the right amount easy for everyone, from a six-year-old to someone who has trouble using their hands. With our dispenser, it takes one button press.
The dispenser hangs on the wall, and the toothpaste tube slides in from the top. Inside, a 3D-printed screw and a squeezer arm sit up against the tube.
When you press the Start button, the Raspberry Pi Pico (the small computer that runs everything) checks which dose you picked and runs the motor at full power. The motor turns the screw, which pushes the arm down onto the tube for just the right amount of time. Then the motor stops and your toothpaste comes out.
A clear front door lets you see how much toothpaste is left. Two keyhole slots on the back fit regular bathroom wall screws, so you don't need any special hardware to hang it.
There are two buttons. The Start button gives you a dose. The Settings button switches between two doses. The adult dose runs the motor for half a second, and the kid dose runs it for a quarter second. If you press Settings twice within 0.6 seconds, the motor runs backward and lifts the arm back up, so you can load a new tube without taking anything apart.
When you press a button, the metal contacts bounce for a split second, so one press can look like several. To fix that, the code checks the buttons in a loop and waits 25 milliseconds to make sure a press is real. This is called debouncing, and doing it this way meant I didn't need interrupts, a more advanced way of reacting to button presses.
AdultDuration = 0.5 # pea-sized dose
ChildDuration = 0.25 # rice-sized dose
def motor_forward(duration):
ain1.value(1); ain2.value(0) # set direction
pwma.duty_u16(MotorDuty) # full power
time.sleep(duration) # run for dose time
motor_stop() # then stop
def start_mechanism(): # start → dispense
motor_forward(TimeSetting)
We built three prototypes over the semester. The cardboard version helped us figure out the basic layout, like where the tube and buttons should go and how big the whole thing should be. Our first 3D print showed that the screw's threads needed to be closer together so the arm would press evenly without slipping. For the final build, we made the parts fit together more tightly, moved the Pico so it wasn't in the way of the motor wires, and added the keyhole slots for hanging it.
The hardest part was matching how far the arm moves to how long the code runs the motor. If the motor runs too short, you get a different amount every time. If it runs too long, the motor jams. We picked the half-second and quarter-second timings by testing them over an entire tube.
Concept sketch
First 3D print
Physical build
Final 3D model