# Octoprint Filament Runout Sensor

**URL:** <https://forum.lulzbot.com/t/octoprint-filament-runout-sensor/5190>\
**Category:** Software\
**Created:** [September 8, 2017, 1:11am UTC](https://forum.lulzbot.com/t/octoprint-filament-runout-sensor/5190 "2017-09-08T01:11:21Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![eobie](https://avatars.discourse-cdn.com/v4/letter/e/e8c25b/32.png) [@eobie](https://forum.lulzbot.com/u/eobie)\
**Post date:** [April 4, 2018, 1:53am UTC](https://forum.lulzbot.com/t/octoprint-filament-runout-sensor/5190/16 "2018-04-04T01:53:16Z")

</div>

> [@](#):
>
> Octoprint Filament Run Out Sensor
> 
> **Updated: Learned alot since this post, scroll down for updated instructions**
> 
> _(I dont know if any one has posted this already. But it was new to me and solves a big problem with a lot of 3d printers so I’m sharing.)_
> 
> Octoprint is great. I love watching my printers while I’m working. (Octoprint Anywhere pluggin). I love getting picture progress and completion reports on my phone (pushbullet pluggin). Octoprint is just awesome.
> 
> Hate almost empty spools of filament laying about because your afraid they cant finish a print?  
> Do you use new rolls of filament on a big prints because a half empty roll might run out before job is complete?  
> Or maybe you check constantly, babysitting the printer if a roll is almost finished.  
> Im done with that. The sensor linked below works with Octoprint to pause a print if filament runs out. Once filament run out is detected, the print head moves away from model and cools down until you change filament. (Filament Sensor Reloaded)  
> So then come back to printer. Heat up extruder, change filament, extrude a little, hit resume on Taz 6 and then click resume on Octoprint. Then 😃  
> 20170907\_204214.jpg
> 
> The sensor has 3 wires. But you only need red and white for it to work with Octoprint:  
> Red \> GPIO 4, which is pin 7  
> White \> any ground pin (I used pin 6)  
> filament reloaded (1).jpg
> 
> Octoprint gcode scripts:  
> After print job is cancelled -
> 
> ```plaintext
> G91; Set to Relative position
> G1 E-6 F300; retract the filament a bit before lifting the nozzle
> G0 Z50; move z axis up 50
> G1 Y150 F5000; move part out for inspection
> 
> ```
> 
> After print job is paused -
> 
> ```plaintext
> M600 Z50; pauses print then moves the print head up 50mm so hotend doesn't burn model
> 
> ```
> 
> So just mount the sensor into the filament path. Connect the wires to Octoprint. Add pluggin to Octoprint. Configure pluggin and reboot Octoprint.
> 
> The sensor comes in a 3d printed case. For now I just have it in the filament path, which has worked out so far. Im a noob at designing, but someone can whip up a better implementation. Some1 on [thingiverse](https://www.thingiverse.com/thing:2105007url) integrated a different filament sensor into the filament tube, which is awesome.
> 
> I think this method is a lot easier than adding the sensor to the printer itself. That would involve modifying the firmware and splicing the sensor into your printers circuit board. Which is a possible warranty issue. Besides Octoprint has so any other benefits this just puts it over the top.  
> There isn’t anything special about the module, it’s a standard mechanical endstop housed in a 3d printed case. So you could make your own. Just a matter of positioning the endstop so a break triggers it.  
>   
>   
> [Amazon on Sensor](https://www.amazon.com/dp/B0748C4CS5/ref=cm_sw_r_cp_awdb_1nwRzb488H0RPurl)

I’m more impressed with your goblin and kontronik! I used to run the same setup, had every goblin made, lol… and basically every other 700 clas made as well… 🙂

---

_[View the full topic](https://forum.lulzbot.com/t/octoprint-filament-runout-sensor/5190)._
