Skip to content

50mL Tube Mixer

A lab tube rotator is a motor, a clamp and a knob, and it costs several hundred dollars. This is the same job done with two hobby servos and an ESP32: a 50 mL conical tube sits in a printed cup on a two-axis gimbal, and the whole thing tumbles end over end at whatever speed you dial in. It is small enough to leave running on a shelf inside a cabinet, which is the reason to build one rather than stand there inverting a tube by hand for twenty minutes.

How it moves

Two standard-size servos sit at right angles to each other in a printed yoke. The lower one’s shaft is horizontal and swings the whole yoke through the inversion — that is the end-over-end axis. The upper one sits inside the yoke with its shaft pointing up, and the printed tube cup bolts straight to its horn, so it rotates the tube about its own long axis at the same time.

Run one and you get a rocker. Run both and the liquid never travels the same path twice, which is what a proper rotator does and what a rocker doesn’t. The rest of the build is one ESP32, a 0.96” OLED and a single knob: turn it to set the speed, read it off the display.

This page is written from the build in the video. The STLs and the sketch are not in the project folder yet — the cup, the yoke and the electronics deck are all printed parts you would currently have to model, and the firmware you would have to write. The parts list below is complete and correct; the files are what is still owed.

Parts

Some links below are Amazon affiliate links. As an Amazon Associate I earn from qualifying purchases — at no extra cost to you. It helps keep these guides free. Outside the US, they should send you to your own Amazon store; if one doesn't, searching the part number there will find it.

The 50 mL conical tubes are the ones you already have. Model the cup around the tube you actually run — conicals from different suppliers are close but not identical at the shoulder — and print one before you print six.

Printing it

Print the tube cup and the yoke in PETG. PLA is fine on a bench at room temperature and is the wrong answer anywhere warm: a PLA part under constant load creeps long before it looks soft, and the cup is under constant load every time the tube swings past horizontal. PETG also takes an alcohol wipe, which anything living near a bench eventually gets.

SettingValue
Layer height0.2 mm
Infill40% for the cup and yoke, 20% for the deck
Perimeters4 — the load is on the walls, not the infill
SupportsOnly under the cup’s overhanging flange
MaterialPETG for anything that moves; PLA+ for the deck

Print the cup with its open end up, so the layer lines run around the tube rather than across the thin flange that takes the screws. A cup printed on its side will split along a layer line the first time a full tube swings through.

Wiring

There is no sketch in the folder, so this table is functions rather than pin numbers — pick your own GPIOs and write them into your own code. Every one of these is a normal ESP32 assignment, and none of them is fussy.

PartConnects toNotes
Tilt servo signalAny output-capable GPIOThe orange lead
Spin servo signalAny output-capable GPIOThe orange lead
Both servos, powerThe 6 V rail, not the ESP32Red and brown leads
OLED SDA / SCLThe ESP32’s default I2C pins, 21 and 223V3 and GND
Encoder CLK / DT / SWThree GPIOs with pull-ups enabled3V3 and GND
GroundsAll commonedIncluding the two supply rails

Do not run the servos off the ESP32’s 5 V pin. Two MG996Rs starting a sweep together draw far more in that instant than a USB port or a dev board’s 5 V trace will hand over. The rail sags, the ESP32 browns out and reboots, and it looks exactly like a firmware bug — so you go and rewrite working code. Two step-downs off the one 12 V brick ends it: 6.0 V for the servos, 5 V for the ESP32, grounds tied together at a single point.

Assembly

  1. Melt the heat-set inserts in first, while the printed parts are still loose and you can get an iron square to the hole. Doing it after the servos are in means working around them.

  2. Centre both servos before you bolt anything to a horn. Power them up and drive them to their mid-position first. A horn fitted at a random angle costs you half the travel on one side, and on the tilt axis that is the difference between inverting and nearly inverting.

  3. Mount the spin servo in the yoke, then the cup on its horn. Check the cup runs true — a cup that wobbles will throw the balance off through the whole sweep.

  4. Hang the yoke on the tilt servo’s horn and balance it with a full tube loaded. Get the tube’s centre of mass as close to the tilt axis as the geometry allows. Every millimetre off-axis is torque the servo holds continuously, and an MG996R held against a load all afternoon gets hot.

  5. Wire the deck last, with the two supply rails set on a meter before anything is plugged into them. Set 6.0 V and 5 V with no load connected, then check them again with the servos moving.

Traps worth naming

Seat the cap properly. This is a machine whose entire job is turning a tube of liquid upside down. A cap that is finger-tight and not quite square empties itself into the servo. Check it every single run — it costs a second and the alternative is a stripped gearbox.

Leave headspace. Fill to 40 mL at most in a 50 mL tube. Inversion mixes because the bubble travels the length of the tube; fill it to the shoulder and nothing moves but the tube.

Buy metal-gear servos. The MG996R’s gears are metal. The plastic-gear equivalent in the same case will strip a tooth the first time the tube swings past horizontal and the load reverses, and a stripped servo does not announce itself — it just quietly stops holding position at one end of the sweep.

Files & downloads

The source files for this project aren't in the repo yet — there's nothing to download beyond the notes. They land in projects/50ml-tube-mixer/ when they do, and this section fills itself in.

Every file for this project on GitHub →