Notifications
Clear all

New filament sensor using mechanical switch  

  RSS
Maxime L
(@maxime-l)
Active Member
New filament sensor using mechanical switch

Good day everyone,

I'd like to present you a mod I made on my MK3.

I've read a lot of issues on this forum about the filament sensor triggering false runouts, and different problems with it. When I switched to firmware 3.4.1, my filament sensor made a false trigger as well and so from that time I decided that I needed to change the filament sensor.

For a simple runout detection, I don't see the point of using an optical sensor, this can only cause issues. A simple mechanical switch is all I need and is the most reliable way of detecting filament. Doesn't matter which material or which color, as long as a 1.75mm filament is present, the switch will be triggered.

Before I say anything, just to make sure : I am not responsible for any damage to your printer. Use my firmware and modify your printer at your own risk !

So here's my new mechanical sensor :

Only the sensor cover needs to be replaced. The extruder body doesn't need any change making the replacement much easier.

Parts needed
- 1 x New cover (3D printed)
- 1 x Switch (OMRON SS-5GL2)
- 1 x 10K ohm resistor
- 1 x Connector (I used one I had lying around, if somebody could help find a suitable part number it would be appreciated).
- 1 x PTFE tube of 23mmm
- 2 x M2x15 screw
- 2 x M2 nut
(optional) hot glue

Print settings
- Material and color : Doesn't matter
- Layer height : I used standard 0.2mm
- Infill density : 20%
- Supports : NO

Print time : approximately 50 minutes

Post print
I went through the top hole with a 2.5mm drill just by twisting it by hand. This made the filament transition from PTFE to printed part when unloading filament much smoother.

PTFE tube preparation and installation
The PTFE is cut to exactly 23mm in length. The bottom part is chamfered on the inside and the top part is chamfered on the outside (45°)

The tube is then pushed into the part with the outside chamfer up, into the part.

At this time with a scrap part of filament make sure the flow is smooth through the whole part. Also make sure the filament doesn't get stuck when transitioning from PTFE to the top part (unloading direction). I played with the filament a little bit, also bending it and testing to force it in all direction until everything is smooth (see above post processing with drill bit). Pushing the filament from top to bottom will be done by hand when loading filament so that movement is not really important. However, when the filament moves up, when unloading, it is important that everything is smooth as the filament will be pushed by the machine.

Switch installation
Next the switch is installed as shown with the 2 M2 screws. The holes are a bit bigger than the screws to allow some adjustements of the position of the switch.

Place the switch so that it is barely not activated without filament, and as soon as it is pressed a little bit more, it will trigger. Test again with the scrap piece of filament that the switch triggers correctly in all cases. Also try to push the filament from the bottom and make sure everything is smooth.

With a piece of scrap filament inserted into the part, wiggle the filament and make sure the switch stays triggered in all cases. If it doesn't, adjust the position of the switch until it does.

Optional : hot glue
When I was satisfied with the position of the switch, I hot glued the switch to the part and also put some glue on the nuts to make sure vibrations will not move the switch or unloose the nuts.

Wiring
The wiring is shown on the following picture. The switch is wired as a simple button with a pull down resistor, as detailed here :
https://www.arduino.cc/en/Tutorial/Button

The connector connects on the board at the position shown. It is the row of unused pins located next to the optical sensor connector.

PIN 1 : Input
PIN 2 : GND
PIN 3 :
PIN 4 :
PIN 5 : VCC

Note the orientation of the connector, pin 1 & 2 go on the inside of the board.

Note : The optical sensor and cable can be completely removed, or at least disconnect it from the board.

Before using the printer make sure the switch is wired and works correctly. You can do this by using the newly created menu for that purpose with my new firmware (see section below).

Firmware
I build a new firmware for this mod. It is available for download on this post. My firmware was build from the sources of version 3.4.2 (latest stable release). I don't have any other firmware versions for this mod.

Note : This sensor mod only works with my modified firmware. As new versions of the firmware are released, I will modify them as well and publish the modified version here. Do not use an official firmware.

Firmware modifications :

- Removed 95% of code handling the optical sensor and replaced it with much simpler code using the mechanical switch.
- Optical quality measurement and associated messages removed as there is no optical sensor anymore.
- Filament sensor and Autoload are forced to enabled in the settings menu.
- Calibration wizard and self test both pass succesfully with new sensor.
- Added new menu in Calibration page (see pictures below). Accessible from MENU->CALIBRATION->SHOW FIL. SENSOR. This will show the live state of the switch, you can use this page to test that the switch works correctly before testing in actual using condition.

Don't hesitate to contact me anything if you have any question or issue.

Happy printing !

Best Answer by XscarfX:

i also do not see the link to the stl

Posted : 23/10/2018 2:05 pm
Tiago
(@tiago)
Reputable Member
Re: New filament sensor using mechanical switch

There's a mod to turn laser sensor in a flawless sensor with a small bearing and a printed part. Easier to use since no rewiring needed.
https://www.thingiverse.com/thing:3091625

Posted : 25/10/2018 4:13 am
Williwaw
(@williwaw)
Active Member
Re: New filament sensor using mechanical switch

Hi,
I've implemented a similar mod, that uses a small bearing as a proxy and doesn't requires any firmware change.
The mod can be found at https://www.thingiverse.com/thing:3129921 (it was designed by SIE-Maker), I've been using it by a few days and is working very well, no fails at all, so far.

Posted : 25/10/2018 4:53 am
Maxime L
(@maxime-l)
Active Member
Topic starter answered:
Re: New filament sensor using mechanical switch

Thanks for your input.

I am aware of these solutions, but for me this is just an over-engineered solution for a simple task of detecting if there is filament or not. This still relies on the quality of the optical sensor, it has to be clean, and the ton of code that is needed in the firmware to detect filament movement.

I am not saying my solution works better or that it is the simplest solution for this problem, not by far. I am saying I like to mod things, even if the end result is the same, I'm happy I got it to work, I could do some wiring, soldering, some programming, that's just how I like spending my day 🙂 And at the end I get a perfectly working filament sensor and don't need to be stressed about "will it false trigger on this long print?? I hope not".

Later I will be reassembling my extruder, at this time I will reprint the extruder body with the switch integrated, for an even cleaner looking solution.

Regards.

Posted : 25/10/2018 9:25 am
rob.l6
(@rob-l6)
Honorable Member
Re: New filament sensor using mechanical switch

I like it. Is there a catch anywhere? (No pun intended :mrgreen: )

Posted : 25/10/2018 12:36 pm
tobias.k3
(@tobias-k3)
Trusted Member
Re: New filament sensor using mechanical switch

I designed this mechanical filament sensor for the MK 2(S). It can work with the software here or connected to octoprint

https://www.thingiverse.com/thing:2901634

----------------------------------------------
PRUSA MK2
- Noctua fan 40mm
- MK2/MK3 hybrid extruder

Posted : 26/10/2018 3:31 pm
Migamix
(@migamix)
Trusted Member
Re: New filament sensor using mechanical switch

do you have a location of which you did a firmware code pull and comparison of your changes to original code?
im looking into keeping base code and adding an AND switch to the base and would like to see if you have done much of the footwork here.
basically, fil sense says no filament, roller says there is, so the print continues with only a beep tone warning. better than 11hr failure.

and we’ll be saying a big hello to all intelligent life forms everywhere … and to everyone else out there, the secret is to bang the rocks together, guys.

Posted : 20/11/2018 9:30 pm
Martin_au
(@martin_au)
Reputable Member
Re: New filament sensor using mechanical switch


Thanks for your input.

I am aware of these solutions, but for me this is just an over-engineered solution for a simple task of detecting if there is filament or not. This still relies on the quality of the optical sensor, it has to be clean, and the ton of code that is needed in the firmware to detect filament movement.

I am not saying my solution works better or that it is the simplest solution for this problem, not by far. I am saying I like to mod things, even if the end result is the same, I'm happy I got it to work, I could do some wiring, soldering, some programming, that's just how I like spending my day 🙂 And at the end I get a perfectly working filament sensor and don't need to be stressed about "will it false trigger on this long print?? I hope not".

Later I will be reassembling my extruder, at this time I will reprint the extruder body with the switch integrated, for an even cleaner looking solution.

Regards.

I can't agree with it being over-engineered. If all the optical sensor detected was the presence of filament, then I'd agree that it's over-engineered. However, it can also detect whether the filament is moving, and hence whether it is jammed. This makes all that "over-engineering" worthwhile. The only niggle with it is that it's touchy with regard to filament. However, there are now multiple mods that use a proxy bearing which resolves this problem, allowing the sensor to work with any filament, while still maintaining the ability to detect jams.

Some of these proxy bearing mods have very minimum hardware and printing requirements (eg: My version requires just a bearing and a 10mm countersunk screw, and 2 prints).

Sticking with the switch though, when you redesign it into the extruder body, you may want to make sure the switch is activated at the same spot that the current sensor activates. There's a good chance that the sensor will one day be activated to work with the MMU to detect if filament has properly loaded. This may well require that distances from the MMU to the sensor, and the sensor to the gear are fairly close to standard.

Posted : 22/11/2018 1:00 am
XscarfX
(@xscarfx)
New Member
RE: New filament sensor using mechanical switch

I have created what you have made but i do not sere a firmware link.  where can i find it

Posted : 02/12/2020 10:16 pm
XscarfX
(@xscarfx)
New Member
RE: New filament sensor using mechanical switch

i also do not see the link to the stl

Posted : 02/12/2020 10:19 pm
XscarfX
(@xscarfx)
New Member
RE: New filament sensor using mechanical switch

@martin-a22

i am interested in printing this housing do you have the file

Posted : 03/12/2020 9:34 am
steveBenjamin
(@stevebenjamin)
Active Member
RE: New filament sensor using mechanical switch

Where is the stl download please

Posted : 15/12/2020 11:46 pm
Share: