Building a DIY Filament Width Sensor Using Digital Caliper

This post is about how to build a DIY filament width sensor using digital caliper with built-in data port.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: The Schematic

Step 2: Description of Key Components

Filament Puller

It has 1 stepper motor and 2 rollers. The rollers are driven by the stepper motor to pull the filament away from the digital caliper.

Digital Caliper

It has a data port which enables the reading of data by external devices such as Arduino. For details about its data format and other info., please refer to my other post at:

Control Box

It houses the electronics for reading the read outs from the digital caliper, reading the motor speed control input from the trimpot, controlling the motor speed and displaying the read outs on the LCD.

Step 3: The Code

There seems to be problem posting my code here (the format is all messed up). Please visit my blog for the complete code.

Step 4: Issue

Digital caliper measures the clamp's travel distance by measuring the variation in capacitance but the capacitance tends to drift due to factors such as the build quality of the caliper, environment, etc. For normal use, because the caliper is zero out each time before taking the measurement, the capacitance drift can be ignored because the capacitance of the clamp's starting point and the ending point are known and the caliper will be zero out again before each use. However, when the caliper is used in an environment that doesn't zero out for long period of time, the accuracy of the measurement is greatly impacted by the capacitance drift. Because of the above issue, other ways for measuring small distance (with 0.01mm accuracy) need to be used.

1 Person Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

8 Discussions


3 years ago

Just to make sure I understand the scope of this project: the width sensor allows you to monitor the thickness of the extruded filament in real time, but it does not do anything to correct the thickness if it's thicker or thinner than 1.75mm or 3mm, correct? It's just a visual guide

1 reply
Wei-Hsiung Huangoch

Reply 3 years ago

You could use the 100K potentiometer to control the speed of the stepper motor and this will change the thickness of the filament.

Wei-Hsiung Huangruizvict

Reply 3 years ago

Sorry. I don't have it. Do you plan to build this project after seeing a demo video?

ruizvictWei-Hsiung Huang

Reply 3 years ago

It would be good to see the video, because the interested people can see many details of the instalation and functioning. What do you think about it?


Wei-Hsiung Huangruizvict

Reply 3 years ago

Sorry. Been busy moving all my stuff and I've torn apart the machine. The schematic and code should work just fine. The issue is with the drifting of the caliper's measurement as mentioned at the end of my post - If you ever build one, please make a video and share. :-)


3 years ago

Hi Wei-Hsiung Huang

The "code" of this project dissapear from your blog? I click on the link that you place and there is nothing!!!

1 reply