This is an ATtiny85 based version of filament width measurement tool. It is based on flipper's TSL1401CL filament width measurement tool.
The LED on top of the tower casts the shadow of the filament on the TSL1401CL sensor. It is a line of photodiodes. Sensor output is read by ATtiny85 MCU and processed.
Analog output signal (1,75 volts = 1,75mm) can be read by newest Marlin version for filament width compensation, that is adjusting extruding speed according to filament diameter variations.
It is free software and aimed at being simple to build (no smd tools are required) and cheap (15€ in components + PCB).
See instructions for build details
Comments are welcome
- print the case (base and top) either in black or colour it black with a marker. I use 0.25mm layer height at 75mm/s, 40% infill, 3 perimeters, no support
- de-burr the 5mm led slot, 2mm filament hole and M3 screw guides using a drill bit
- insert a 5mm white led on the top of the tower, use the little "u" part to fasten it in place
Note on resistors
I use a white high luminosity led, therefore I use 10k ohms as R1, you may need to lower it.
R3 and R4 are used to pull HIGH the reset pin with a voltage divider that provides 2.5 volts, this is why they should be equal. When clicking the button, the reset pin is pulled HIGH at 5 volts. If you look at the code you will see that analogRead on reset pin is checked against 600, that is voltage is greater than roughly 2.5 volts.
Although TSL1401CL is a smd component, it can be easy soldered with regular hand iron. Lightly tip each pad with solder, place the component and then melt solder with iron without touching the sensor. Start with one corner and then the opposite, make sure it is well aligned.
If you have a spare Arduino Uno you can use it as ISP for programming the ATtiny85 with the Arduino IDE, alternatively you can use a specific programmer, see http://highlowtech.org/?p=1695.