Introduction: DIY Filament Sensor for 3D-printers

In this project, I show how you can make a filament sensor for 3d-printers that is used to turn the power off when the 3d-printer is out of filament. This way, small filament parts won't be stuck inside the extruder.

The sensor can also be connected directly to the 3D-printers controller board,


3d-printer and filament

thin, flexible metal strips (e.g. from cans)

Power outlet timer switch (needs to be digital and not mechanical)


2 screws

solder equipment (not actually necessary)

Step 1: 3D-printing Filament Sensor

First, the two halves of the filament sensor needs to be 3D-printed. There are two parts to print.

Step 2: Cut Metal Strips and Attach Wires

Cut two metal strips out of some flexible, conducting metal sheet. The metal strips should be 5mm wide. Solder wires to the end of the strips. The wires should be long enough to go from the power outlet and to the filament roll on the 3D-printer.

Step 3: Assemble the Filament Sensor

Use two screws to put together the two 3d-printed parts. Adjust the metal strips according to the picture before tightening the screws. The metal strips should be bent in the end to allow the filament to push the two metal strips away from each other when it is inserted.

Step 4: Locating the On/off Mechanism in the Power Outlet Switch

Next, we need to modify the power outlet timer switch, so it can be switched by our sensor.

Open the power outlet switch and find the wire that activates the switch. (I found 3 wires marked with GND, VCC and OUT, so this was pretty easy in my case.) After I cut the cable with the 3 wires, the internal relay was turned on by default and could be turned off by connecting GND and OUT. This is ideal because when the filament is gone, the sensor connects the wires and the 3d-printer will therefore be turned off.

In some cases the relay is turned off by default and turned on when OUT and VCC are connected. In this case, a pulldown resistor can be added to invert the operation of the relay.

Step 5: Connect the Wires to the Power Outlet Switch

Now, it's time to connect the sensor and the power outlet switch together.

Solder the wires from the sensor to OUT and GND on the power outlet switch.

Drill a hole through the side of the power outlet switch and pull the wires through. I added a cable tie on the inside to act as a strain relief for the wires.

Step 6: Done!

Now that everything is done, you can power the 3d-printer via the new outlet and slide the filament sensor onto the filament. When the end of the filament reaches the sensor, the power is turned off and the 3d-printer will stop.