<p>Ok, it appears I have gotten it working.  I guess I didn't flash the firmware after reading that the Smart Sensor requires a minimum of 7 mm of <code>FILAMENT_RUNOUT_DISTANCE_MM</code>.  I rebuilt the firmware with the exact settings above and it is now working.  I've tested this by starting a print (calibration cube), I waited for it to complete the first 2-3 layers, then I cut the filament and let it run out.  It did detect the runout and allowed me to reload and continue the print</p>

CC BY-SA 4.0
2022-12-07T22:21:18.677Z
2022-12-08T04:35:27.853Z
2022-12-08T04:35:27.853Z
Semperfi89
<p>I'm trying to figure out how to get my <strong>BTT Smart Filament sensor</strong> to work with my printer.</p>
<p>I have looked at <a href="https://3dprinting.stackexchange.com/questions/18351/getting-btt-filament-sensor-to-work">Getting BTT filament sensor to work</a> and have tried almost everything they did.</p>
<p>Relevant Specs about my printer:</p>
<ul>
<li><strong>Ender 3 (not pro or v2)</strong></li>
<li><strong>BIGTREETECH SKR Mini E3 V3</strong></li>
<li><strong>BIGTREETECH TFT35 E3 V3.0.1</strong></li>
<li><strong>Sensor plugged into <code>E0-Stop</code> on the SKR Mini.</strong></li>
<li><strong>Running latest version of Marlin bugfix 2.1.x (last commit 12/5/2022 12:01:08 EST)</strong></li>
<li>FYI I also do have <strong>OctoPrint</strong> running and connected to the USB port of the SKR (not sure this matters).</li>
</ul>
<p>When I follow <a href="https://github.com/bigtreetech/smart-filament-detection-module" rel="nofollow noreferrer">BIGTREETECH setup instructions</a> and several youtube videos for setting up <code>configuration.h</code> and <code>configuration_adv.h</code>, build the firmware, flash it on the board.  It always starts the print, then immediately stops and reports &quot;Filament out&quot;.  I've tried setting the following options:</p>
<p><code>configuration.h</code> options:</p>
<pre><code>#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
  #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 &gt;followed by M500.
  #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a &gt;FIL_RUNOUT#_PIN for each.
  #define FIL_RUNOUT_STATE     HIGH        // Pin state indicating that filament is NOT present.
  #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  #define FILAMENT_RUNOUT_SCRIPT &quot;M600&quot;
  #define FILAMENT_RUNOUT_DISTANCE_MM 10
  #ifdef FILAMENT_RUNOUT_DISTANCE_MM
    #define FILAMENT_MOTION_SENSOR
  #endif
#endif
</code></pre>
<p>I've tried flipping</p>
<pre><code>#define FIL_RUNOUT_STATE     HIGH
</code></pre>
<p>to</p>
<pre><code>#define FIL_RUNOUT_STATE     LOW
</code></pre>
<p>but it behaves the same.</p>
<p>Anybody have any ideas? Did I miss something?</p>

<creality-ender-3><bigtreetech><skr-mini-e3><filament-sensor>
BTT SKR Mini E3 V3 w/BTT smart filament sensor
Semperfi89
# BTT SKR Mini E3 V3 w/BTT smart filament sensor

(Asked by: username_0 on 2022-12-07)

I'm trying to figure out how to get my **BTT Smart Filament sensor** to work with my printer.

I have looked at [Getting BTT filament sensor to work](https://3dprinting.stackexchange.com/questions/18351/getting-btt-filament-sensor-to-work) and have tried almost everything they did.

Relevant Specs about my printer:

* **Ender 3 (not pro or v2)**
* **BIGTREETECH SKR Mini E3 V3**
* **BIGTREETECH TFT35 E3 V3.0.1**
* **Sensor plugged into `E0-Stop` on the SKR Mini.**
* **Running latest version of Marlin bugfix 2.1.x (last commit 12/5/2022 12:01:08 EST)**
* FYI I also do have **OctoPrint** running and connected to the USB port of the SKR (not sure this matters).

When I follow [BIGTREETECH setup instructions](https://github.com/bigtreetech/smart-filament-detection-module) and several youtube videos for setting up `configuration.h` and `configuration_adv.h`, build the firmware, flash it on the board. It always starts the print, then immediately stops and reports "Filament out". I've tried setting the following options:

`configuration.h` options:

```
#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
  #define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 >followed by M500.
  #define NUM_RUNOUT_SENSORS   1          // Number of sensors, up to one per extruder. Define a >FIL_RUNOUT#_PIN for each.
  #define FIL_RUNOUT_STATE     HIGH        // Pin state indicating that filament is NOT present.
  #define FIL_RUNOUT_PULLUP               // Use internal pullup for filament runout pins.
  #define FILAMENT_RUNOUT_SCRIPT "M600"
  #define FILAMENT_RUNOUT_DISTANCE_MM 10
  #ifdef FILAMENT_RUNOUT_DISTANCE_MM
    #define FILAMENT_MOTION_SENSOR
  #endif
#endif

```

I've tried flipping

```
#define FIL_RUNOUT_STATE     HIGH

```

to

```
#define FIL_RUNOUT_STATE     LOW

```

but it behaves the same.

Anybody have any ideas? Did I miss something?

**Tags:** creality-ender-3, bigtreetech, skr-mini-e3, filament-sensor


---

## 1 answers

### Answer by username_0 on 2022-12-07. Score: 2

Ok, it appears I have gotten it working. I guess I didn't flash the firmware after reading that the Smart Sensor requires a minimum of 7 mm of `FILAMENT_RUNOUT_DISTANCE_MM`. I rebuilt the firmware with the exact settings above and it is now working. I've tested this by starting a print (calibration cube), I waited for it to complete the first 2-3 layers, then I cut the filament and let it run out. It did detect the runout and allowed me to reload and continue the print


---

