3D Printer Filament odometer (Filodometer)

Hi, I am very new to Arduino and am looking for some assistance in understanding how to go about building my first project.

Scope/Objective: To build an independent monitor to attach to my spools of filament and record the usage in meters.

My initial Thoughts: The filament will be fed through the wheels of the counter as it is loaded onto an empty spool. This will ascertain the correct start length and display such on a screen. Once complete, it will then count down as the filament is used and run back through the wheels in the opposite direction. All the while not having to be rethread after the initial loading.

Considerations:
I am certain an Arduino can handle such a simple task but one consideration is what is the smallest that can manage this. Will the coding be a ‘simple’ feat?
My second consideration is the memory. When no longer powered, how can I ensure the counter remembers its last position.
Lastly, my thoughts were to use a 360 rotary encoder to detect the travel of the filament. Will this record both directions?

All together my parts list contains a display, the arduino and the rotary encoder (not forgetting the wiring). Is there anything else I should consider?

Thank you all in advance.

A Nano is pretty small.

Define "simple". A very complex task, to me, may be almost trivial to Nick Gammon. So "simple" is very much a relative term.

Most Arduinos come with EEPROM non volatile memory. If you save stuff to EEPROM at shut down, it will ba available at power up or reset. You have to save it to EEPROM though, it does not happen automatically.

A quadrature encoder can indicate direction as well as counts.

All together my parts list contains a display, the arduino and the rotary encoder (not forgetting the wiring). Is there anything else I should consider?

Not that I can see from your project description.

Thank you for your help!

By simple I mean, the filament passes through, turns the wheel which will in turn turn the rotary to tell the arduino to +/- n* and display as it does it.

Oh excellent, I was unaware that most came with EEPROM so I will keep that in mind when selecting.

Not heard of a quadrature encoder so I shall investigate.

As with almost all projects like yours, the devil is in building the physical components of the mechanism, not in the micro-controller part. How far have you gotten with the design?

Paul

By simple I mean, the filament passes through, turns the wheel which will in turn turn the rotary to tell the arduino to +/- n* and display as it does it.

The program would not be hard for me to write and I am intermediate at best. But we are not here to write code for you. We will, certainly, help to learn what you need in order to write the code.

You will need to supply the type of Arduino board that you wan to use.

I would recommend, as a start, a 16x2 or 20x4 character LCD with an I2C backpack. Those are simple to work with. The hd44780 library for those displays make them almost plug and play. Supply the data sheet for the display.

Supply the data sheet for the encoder that you want to use.

Read the how get the most out of this forum sticky to get some advice on asking questions and to see how to properly post code. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

jimmeywho:
By simple I mean, the filament passes through, turns the wheel which will in turn turn the rotary to tell the arduino to +/- n* and display as it does it.

A common problem with computer projects is that people think on a human level where many complex things are "simple" or "obvious" because we have never needed to think in detail about them.

A computer, on the other hand, is extraordinarily stupid so the programmer has to figure everything out in very great detail including envisaging all the things that can go wrong, or be misunderstood.

To my mind the first step should be to write down in English (assuming that is your native language) in as much detail as you are able every action and decision that your system will need to deal with. Put each action or decision on a separate line. This may seem tedious and time consuming but when it is done the job of converting that description into code will be relatively straightforward. And the total time will be a lot shorter than if you jump into writing code without having the description.

...R
Planning and Implementing a Program

Thank you all for the assistance and great advice!

To try and answer all questions but in a structured way...

The components I am currently looking to use are:

For the design, I only have a rough sketch which I will try and upload shortly. To provide an image however, it will be a box beneath the filament spool. On the front will be the display, a hole for the filament to be fed through and two reset buttons, one for the overall spool count and another for the job usage. The filament will run through a Bowden tube to the wheel/pulley set up at the back which is connected to the encoder. My intention was to set the wheel to be 100mm circumference but as I am now considering adjusting the size to make the most of the 24pulse encoder, therefore either 120mm or 240mm circumference. This is because I feel it may allow for more accuracy.

I apologise if my initial massages came across that I was expecting someone else to code for me. This is not the case. I am more than happy to learn and build this all myself, as I am new to it all however I just need orientation :smiley: I have a basic knowledge of Python so it is not out of this world to learn a new language.

With regards to the coding layout:

  • On power up, is there a spool count in the eeprom, if yes retrieve, if no, set 0. Job count will not be saved and therefore set to 0 on boot. Display counts.

  • on button 1 press, reset spool count to 0 and update display and update eeprom

  • on button 2 press, set job count to 0 and update display.

  • On wheel/encoder rotation:
    Which direction is it turning.
    if onto spool, +n* to spool count.
    if off spool, -n* from spool count and +n* onto job count.
    [*n being the number of pulses the encoder has been turned x the amount of filament each pulse represents, I.e if the wheel is 240mm n= 3pulse x 10mm]
    Update display, with new counts.
    Save spool count to eeprom

I hope that all makes sense. Thank you all!

Links incorrectly inserted. You have accidentally included a closing parenthesis on the end. :astonished:

This rotary encoder is simply not appropriate for the job. It has mechanical contacts so is by no means sufficiently durable and the detents would provide excessive friction in turning.

Search the web for ‘arduino wire cutter’. There are a lot of similarities with those that will carry over to your project.