Filament Width Sensor with 3 LEDs, TSL1401CL, and Arduino Pro Micro
by inornate, published
This is an improved version of Filament Width sensor thing #636420, based on shadow casting idea by Flipper's #454584.
Now this sensor measures the filament width in three directions: -45, 0, and 45 deg. Three LEDs are sequentially light up and the sensor measures shadows from each direction. It (hopefully) compensate out-of-round filament shape.
45deg measurement limits the maximum measurable filament width around 2.5mm, so, unfortunately, this version is only applicable to 1.75mm filament. For 3mm filament, consider upgrade the line array sensor to wider one, such as TSL1402.
- Download the 20150302_Filament_Width_Sensor_3LEDs.zip
- Prepare PCB and solder the components. (tricky and costly part!)
- Print case/sensorCover.stl in matt black material. ABS was better than PLA in many cases. If the material is not dark enough, paint the black inside the towers.
- print three case/led_cap.stl as the cover. mount 5pi LED and cover them with the cap. Connect LEDs like the picture. Aware the polarity.
- Upload the firmware: Filament_Widh_Sensor_3LEDsFilament_Widh_Sensor_3LEDs.ino. You need to install TimerOne library to Arduino IDE. Refer http://arduino.cc/en/pmwiki.php?n=Guide/Libraries and TimerOne-r11.zip
- Turn on the visualizer (TSL1401_visualizer) in Processing. (http://processing.org). Through the case, put a 2mm rod as a reference. Type [0, 1, 2] will select the LED and [j, k] will decrease and increase the LED intensity. Decrease the intensity and slowly increase them until the edge detection algorithm works just fine. The green/red lines indicate the detected edge.
6-1. ([email protected] 26, 2016) If this step crashes and complains about size() function, replace line 31 with [ size (387, 316); ]. Current processing does not allow any variable with size() function.
- Type [c] to calibrate the sensor. Now you're good to go!
- If you need more help, type [h] in Serial [email protected] IDE. Look inside the source files.
- Any suggestion and additional contribution will always be welcomed.
1 x Arduino Pro Micro board
1 x PCB
1 x TSL1401 Line scan sensor
1 x 1Kohm resister (SMD 2012)
1 x 10nF ceramic capacitor (SMD 2012)
1 x 0.1uF ceramic capacitor (SMD 2012)
3 x 200ohm resister (SMD 2012)
3 x 10uF multi-layer ceramic capacitor (SMD 2012)
1 x 2x3 pin header
1 x Molex 5046 (right angle, male type mount)
1 x Molex 5051 (female type socket)
3 x High-brightness LED (5mm radius)
8 x 2mm x 8mm sheet metal screw
- electric wires, pin header sockets, solder, ...
Liked ByView All
Give a Shout Out
Filament Width Sensor with 3 LEDs, TSL1401CL, and Arduino Pro Micro by inornate is licensed under the Creative Commons - Attribution - Non-Commercial - Share Alike license.
What does this mean?
- You must attribute (give credit) to the creator of this Thing.
- You must distribute Remixes under the same license as the original.
- Remixing or Changing this Thing is allowed.
- Commercial use is not allowed.
We're sure inornate would love to see what you've printed. Please document your print and share a Make with the community.
To post a Make simply visit this Thing again and click I Made One to start uploading your photo. It’s even easier to post a Make via the Thingiverse Mobile app (available via Google Play and Apple App Store).