Reducing Print Failure Anxiety
One of the most useful printer features is a filament run out sensor. A filament run out sensor is some kind of switch that detects the presence of filament, and lets the printer know when it has run out. In most cases this will pause the machine where it is at, and wait for the user to push a button to start again. With it I can start any print without the fear of how much filament left I have on my spool, or repeatedly checking my printer waiting to catch the exact moment when the filament runs out. My two Ender 3 printers were running 24/7 churning out face shield headbands for COVID-19, so I was going through plenty of filament, especially after upgrading the printer to use the V6 with a 0.8mm nozzle.
There are several available solutions to add a Filament Run-out sensor to my Ender 3, but after some internet research I chose to use Pin 29, as that has no impact to other existing components, and does not require me to purchase any specialized parts.
This post will show a step by step of how I added the filament run out sensor to my Ender 3. It is important to note that I made this upgrade at the same time I flashed new firmware, as I had the case open already and was editing Marlin anyway.
Table of Contents
Tools Required
I used a simple Makerbot End Stop style limit switch for this, with a 3d printed case, and some small lengths of bowden tube. There are many kinds of limit switches out there, but this is what I had on hand, and it works well enough for this purpose.
I also use the dupont wire crimp tool along with one single female dupont plug end. Learning how to use this crimping tool has proven invaluable for customizing wire harnesses and electronics.
Lastly I required a soldering iron, as all of the easily accessible controller pins on the Ender 3 are accounted for. Soldering wires onto a PCB requires a steady hand and great care, as it is easy to overheat sensitive electronic components.
The printed case I used was this one:
https://www.thingiverse.com/thing:2443425
This printed case is compatible with these limit switches, as an example:
Here is what I used in a list:
- 22 gauge green wire, about 4 inches long
- 1 male dupont connector
- 1 Female dupont connector
- 4 single dupont connector housings
- Dupont connector crimping tool
- 1 Makerbot style end stop limit switch
- 2 pieces of 1.75mm bowden tube 3 in long
- soldering iron
Unused Pin 29
With the bottom of the case off, I removed the four screws securing the controller to the upper part of the case. After that I was able to position the board to get a good look at the back. In the second picture shown, pin 29 is the left most pin in the row of three in the middle of the board.
I crimped one end of the spare green wire I had with a female dupont connector and housing, and the other end I stripped off a small amount of sheath. I tinned the bare wire to make soldering the controller pin easier.
The technique here is to solder the wire and pin using as little heat as possible, and to do this I place the tinned wire over the pin, and touch the solder with the hot soldering iron, and as soon as the solder on the wire and pin re-flow together, I pull the soldering iron back. Of note is the close proximity of the wire to the mounting hole. There is a raised boss on the case, and I need to makes sure when I put the controller back I don’t crush the wire.
The hard work is now complete! I put the controller back, being careful to to crush my freshly soldered wire, and making sure the male connector is accessible.
Connecting The Limit Switch
I carefully remove the connectors from the housing that came with the limit switch. Then I cut the female end off of the green wire, and crimp on a male connector. I put a single housing on the three wires, and now the plug is ready to go.
The limit switch requires a 5v, ground, and signal connection. I use the 5v and ground from the SPI bus connector, and the green wire connected to pin 29 for the signal. The wires are – Red/5V, Black/GND, Green/Pin 29.
With the wires connected to the controller, I put the bottom cover back on, making sure to route the limit switch wires with the existing wire harness going out towards the back of the machine.
Updating Marlin
I navigated to the pins_MELZI_CREALITY.h page, and changed FIL_RUNOUT_PIN from -1 to pin 29. Now the firmware has the physical pin connection linked to a software handle.
In the configuration.h page I search for RUNOUT and find the Filament Runout Sensor area, and uncomment the FILAMENT_RUNOUT_SENSOR. I made sure inverting was set to true, as I plan an open switch indicating the filament has run out.
Next I searched for NOZZLE_PARK and enabled that feature as well. I made sure the park position was the home position x + 10, y + 10, and z + 20 from the current height. This makes it easy for me to purge the nozzle by hand and clean up the nozzle before resuming.
I uncomment the advanced park feature, as I need it for the filament runout sensor. The default settings are fine except I changed the unload length to zero.
With those changes, I flashed the printer and now the feature works! My choice of sensor simply hangs on the filament. Maybe later I will make something more fancy, but for now this keeps me from wasting precious filament and print time.
A Simple And Cheap Solution
This solution was relatively quick for me to implement, while I already had the printer case open to burn a bootloader and flash Marlin. With a few extra steps and a quick solder, now I have the peace of mind of a filament runout sensor. There are many types of switches and designs to use, but pin 29 was the key feature of this design to minimize impact to other printer functions, and not spending money on custom solutions.
Author
-
Cliff is an Engineer and Maker in the Metro Detroit area
http://www.CreatingWithCliff.com creatingwithcliff@gmail.com Villerot Clifford