Life is accelerating toward a breakneck pace, and time is more valuable than ever. If you're like me and would like to squeeze every extra second out of every day, why not build a machine, a marvelous, magical machine, to automate a piece of it? The Morning Routine Machine can do just that! At the push of (several) buttons, the MRM can automatically load the perfect dollop of toothpaste onto your preferred toothbrush at a set time. Impossible you say? Nay! Follow along and I'll show you how I built it!
Step 1: Parts and Materials
(2x) servo extension (12")
(x) 4-40 screw
(x) 4-40 nut
(4x) 8-32 screw
(4x) 8-32 nut
Acme threaded rod
24" x 24" x 1/8" clear acrylic
36"x 24" x 1/4" plywood
3D printer filament/resin
Step 2: Mechanical Design
I produced the whole system using a combination of Fusion 360 and Illustrator. I began by carefully modeling the servos and other purchased parts, designing around the fixed parts (toothbrush, plastic syringe). I designed the entire system to be made out of a combination of 3D printed and laser-cut parts, fastened mostly with 4-40 screws as much as possible. You can find the .stl and .svg files attached above. To simplify the design process, I broke the system down into four main assemblies: toothbrush holder, carriage, dispenser, and main body. The details of each assemblies are explained in depth on their respective steps.
In order for more of the mechanisms to be useful outside of this design, I modeled servo horn adapters for both the micro and standard servos. These adapters each have slots for the original horns as well as spaces for four 4-40 nuts on the reverse side. The adapters simply pop under the horns, so they need to be fastened to a plate or an other object to remain seated.
Step 3: Electrical Design
The entire system is powered by a single 5V 3A power supply, which is quite sufficient as only one motor is actuated at a time. The Edison can potentially draw up to 500 mAh and the rest of the components (motor driver, RTC, and OLED) draw negligible amounts of current. The system is powered on or off via a mini toggle switch.
The Intel Edison is the main controller for the system. The breakout board allows for the Edison to easily communicate to the other systems. The board connects to the motor driver, RTC, and OLED screen via I2C.
A PWM driver board controls the five servomotors. and has male headers for quick connections to the servo cables. Although the board's motor power can be driven from an external supply, for simplicity I've tied the VMOT to the VCC pin as the whole system essentially runs at 5V logic.
A rotary encoder acts as the main input for the user. The outputs from the encoder are directly connected to the digital pins of the Edison
A tiny 128 x 32 OLED serves as the main source of visual feedback for the user. The OLED only requires five connections to operate: SDA and SCL to the I2C bus, RST to one
Step 4: Body Assembly
The back plate forms the base for the rest of the system and a solid mounting point for most of the components. The back plate is made from 1/4" plywood. The Edison and PWM driver mount to the base with four 2-56 screws each, with the Edison on the face and the driver on the reverse.
The back plate and front plate are spaced and held together with five spacer plates. Each spacer attaches to the plates with a t slot joint that is fastened with a 1" x 4-40 screw and matching nut. The plates are nearly symmetrical, however one edge has shorter tabs so that they don't pop out the front. The power jack and switch mount to the bottom rightmost spacer.
The front plate has relatively few connections and mostly serves to protect the machine during operation. The rotary encoder pops into place and is secured with its matching nut. The OLED screen is fastened with four 2-56 screws.
Step 5: Toothbrush Assembly
The entire machine is made to accommodate the toothbrush holder which is the main and most complex part of the system. The holder has two servo actuated joints to actuate its sub-assemblies: the head and base. Laser-cut parts are colored dark blue whereas 3D-printed parts are neon green.
The head assembly secures the toothbrush from falling. The design is inspired by the kinds of drop-down bars you'd find on a roller coaster seat. A single micro servo actuates the arms which are held by two spacers. The servo attaches to the main laser-cut plate via a 3D adapter and is fastened with two 4-40 screws. The bar has four slots through which black elastic band is woven, providing a firm, yet flexible means of securing the toothbrush.
The bases consists of a small 3D-printed cup to keep the brush from falling over. Another adapter acts as a right angle bracket for attaching the laser-cut joints which are actuated by the base's micro servo. The servo can maintain position and rotate down after the toothbrush has been loaded in the assembly. The plates are fastened with eight 4-40 screws- four into the back of the main plate and two to secure each of the side plates attached to the servo.
Step 6: Rack and Pinion Assembly
A single wooden rack acts to feed the toothbrush towards the paste dispenser. The rack has three unique 3D-printed parts for assembly: a carriage, headrest, and spacers.
Carriage - the main adapter for mounting the holder assembly to the rack and is fastened with three 4-40 screws. A headrest mounts further down the rack from the carriage and serves to reduce the stress on the holder's base servo when the holder is flat.
Headrest - reduces stress on the holder's base servo when the assembly is lying flat. The headrest attaches via a single 4-40 screw.
Spacers - keep the rack aligned in the center of the body plates. The spacers are all identical and mount to the rack each with a 4-40 screw.
A mating pinion gear attaches below the rack. The pinion is also cut from 1/4" plywood and mounts to a standard continuous rotation servo. The servo itself needs to be spaced a little offset from the baseplate, so it has two identical rectangular spacers. The servo is attached to the based with four 8-32 screws.
A single micro switch serves to allow "zeroing" the rack to a known position. The micro switch is mounted to its spacer with two 2-56 screws and the spacer itself is mounted to the base plate with two 4-40 screws.
Step 7: Dispenser Assembly
A small armature mounts below the dispenser to keep any wayward toothpaste from falling out. An actually plastic bottle beverage cap is glued to the 3D-printed armature, as this is a bit more "food safe" and has plenty high walls for catching paste. The armature screws into a micro servo hub assembly. The micro servo itself is mounted via two mini spacer pieces, one of which is U-shaped to allow space for the power and signal wires.
The linear actuator is by far the most complicated mechanism of the whole machine and does the work of actually dispensing the toothpaste. The core of the consists of an ACME threaded rod and nut pressing down on a syringe. The nut is mounted within a large gear. This gear is sandwiched between two thrust bearings to allow free rotation while keeping the gear properly fixed in place. The thrust bearings and gear fit within two cap assemblies which allow the whole assembly to be mounted to the base plate. A standard servo mounts outside of the more complex gear assembly and drives the inner gear via its own hub-mounted gear. The whole actuator is fastened with six 4-40 screws with four to mount the assembly to the base and two to keep the caps closed.
Step 8: Software
The code for the Morning Routine Machine is an Arduino-style sketch running on the Edison. The program has three main tasks: allowing the user to set the time, allowing the user to set the "alarms" of when the dispensing sequence should be run, and actually running the sequence.
Here is a brief description of the actual code:
Display Time (menu item 0) - displays the current time and allows the user to cycle through, select a menu item, and checks to see if the current time matches the alarm time and also for the clock display on the
Set Time (menu item 1) - allows the user to set the current time for the machine. This also writes the current time to the RTC for maintaining time between power cycles.
Set Alarm (menu item 2) - although not an actual "alarm," this allows the user to define when, if at all the system should run.
Run Sequence (menu item 3) - runs an ordered sequence of the following steps depending on the current system state
getServoPostions() - reads the analog voltage of the micro servos if available and checks to see if they match known positions.
zeroCarriage() - runs the pinion motor until it contacts the limit switch and then reverses direction for a set time until the carriage is away from the dispenser.
setBar(boolean) - sets the holder bar up or down.
lowerBrush() - lowers the holder assembly to be flat.
setCap(boolean) - opens or closes the spill cap.
dispense(int) - drives the linear actuator assembly for a set time.
Step 9: Final Thoughts
This is quite the ridiculous machine, I'll admit, but I've had quite a good time making it. It's given me some interesting ideas about future Rube-Goldberg/over-engineered automation projects (breakfast machine, anyone?) and I hope it's done the same for you!