Ultimaker II filament sensor and remote control using Raspberry Pi

The Plan

This is still an idea, growing in my head. I don't know if or when I'll build it.

I want to attach a Raspberry Pi 3 to my Ultimaker II extended.
Obviously with Wifi and USB it will have
  • a camera, watching the print
  • a GPIO pin an Octoprint API call telling the Ultimaker to pause the print (via a tiny firmware modification)
I will replace the small, plastic filament idler pulley on the back of the maching (opposite to the extruder drive mechanism) and replace it with a ball bearing and 2 sensors
  • a trivial 2 bit rotary encoder to meassure the speed and amount of the filament and auto-pause if no filament is transported anymore
  • a load cell with a Hx711 module to tell how much pulling force is applied and auto-pause on no force = filament empty and too much force = something blocks the filament from moving
The too much force - part means it will also detect obstacles that would otherwise lead to underextrusion because filament is still being transported but way less then there should be.
  • a second load cell in the modified "Low friction UM2 spoolholder" will meassure the weight of the spool and thus tell me how much filament is left.
  • the modification is a 12-20cm arm with the load cell attached


  1. DONE: Raspberry Pi with Octoprint installed
  2. DONE: Designed parts for first prototype (using only Encoder and Dummy-Load Cells)
  3. DONE: Rotary Encoder arrived
  4. DONE: Pinout specified
  5. DONE: Waiting for load cells and Hx711 from China
  6. DONE: Test rotary encoder from Raspberry PI command line
  7. DONE: Test Octoprint API from Raspberry PI command line
  8. DONE:  Convert rotary encoder values to binary positions, movements, direction and speed
  9. DONE:  Wrote a simple filament monitor script that detects stalls and reverse movement and pauses the print via the Octoprint API
  10. DONE: Test Hx711 and load cell on Raspberry PI using Python
  11. DONE: The current "pause" in the Octoprint API is dangerous for scripts. It can resume if issued twice. ->fixed in Octoprint update
  12. DONE: solder the final cables and mount things on my UM2extended
  13. DONE:  designed modified "608 mount" to weight the remaining filament.
  14. DONE:  meassuring the weight of the remaining filament works! 
  15. DONE:  Write the final software including monitoring pulling force and spool-scale
  16. TODO: Write an assembly instruction including setting up the software.


Testing rotary encoder
Testing load cell for extruder pulling force

The software

I'm using a Raspberry Pi running Octoprint as the central controller.
The original plan was to use the Octoprint API.
For the final software (Here on GitHub) I decided to write an OctoPrint plugin.
I can not only detect if filament is supposed to move at the moment and issue a pause command without hacking the firmware and dual-using one of the homing switches as an E-Stop.
I can also display information (such as remaining filament) in the OctoPrint web interface
and offer my meassurements as new values in the OctoPrint API.

The parts

New method (using Octoprint API)
Old method (using GPIO signal to pause the printer):
Kommentar veröffentlichen