Introduction: DIY Filament Sensor

About: Artificial Intelligence Developer

Hey! This was a weekend project of mine. While stuck in Covid lockdown in the U.K. there's nothing much to do except create and make things. Using some spare parts which any hobbist will have I was able to create a sensor which warns me when I'm low on filament for my 3D printer.

As any 3D printerist will know, running out of filament mid print is one of the most painful experiences to have to watch. (Ok maybe I exaggerate a bit).

This simple circuit sets off a buzzer when the filament passes through this system using a little limit switch pressed against the filament.

Disclaimer: I'm not responsible if anyone causes injuries or death to themselves or others, nor am I resposible if they cause damage to objects after building a project identical or similar to this instructable.

For this project you will need:

  • Some wire
  • A battery (I used an 18650 however with the right holder anything smaller can fit in this)
  • A limit switch
  • A buzzer
  • Double sided stickypads (to attach to the printer)


  • 3D printer for the case (and filament)
  • Glue gun (and glue)
  • Soldering iron (and solder)
  • Wire strippers
  • Wire cutters


  • A charger
  • A second switch

Step 1: The Circuit Design

This is a very simple circuit where there is a battery connected to two switches and a buzzer all in series. For the buzzer to go off (make a noise) both switches must be closed (turned on).

I chose to have a second switch for when the filament runs out, while I replace the filament I'm not having this making noise.

Step 2: 3D Print the Case

Printing the case took around 2 hours. I used PLA + in white however any choice will work, this is just what I had on station.

The settings I used were:

Layer height 0.2mm (you can be more detailed if you want but this doesn't need to be high quality)

Fill 10%

Supports N/A

Shell Thickness 0.8mm

Step 3: Wire Up the Circuit

Wiring the circuit is very simple since it is just a series cirucuit. Following the circuit diagram or follow the video to see how this is done.

The limit switch needs to be wired using the COM (common port) and NO (normally open) this is so that it makes a connection while there isn't anything pushing against it. If you wire this wrong the buzzer will stay on (this will be annoying).

Step 4: Charge the Battery

Hopefully this was completed prior to the rest of the steps in this project however this can be a rooky mistake made by a lot of people. Always be cautious handling batteries and electricity.

Step 5: Test

Finally test the system. Once you know it works add it to your printer. I used double sided sticky pads.

Battery Powered Contest

Participated in the
Battery Powered Contest