Quick and Dirty Encoder




I am passionate about anything and everything engineering and physics. I am interested in much of...
Here is how i implemented a crude/simple encoder for my arduino robot to provide better navigation compared to using time delay.

Materials used
  1. Optical slotted switch
  2. cardboard
  3. hotglue
Tools used
  1. Pencil
  2. Ruler
  3. Compass (the one you draw circles)
  4. Sharp craft knife
  5. paper (for calculating)
  6. hotglue gun
(sorry for out of focus pictures, din't notice it till way too late)

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: Planning

Firstly measure your sensors and motor, so you can get a rough idea of how big/small you need your disc to be.
so from my measurements, i needed the disc to be slightly less than 1 cm radius and i will cut the slots at 3mm intervals
working that out, i figured i need to spacing to be 18 degrees for each 'tick'.

Step 2: The Disc

Here i cut the circle out before drawing the lines for the 'ticks', it was not a very good idea. You should draw the circle and the lines before cutting it out. 
An inner circle of smaller diameter is drawn to produce a dart-board-like pattern.
Next darken alternate 'ticks' so you can have an idea how it looks like when it is done, you want to make sure you don't end up with 2 'ticks' forced together. Generally you would want to have an even number of lines fanning out from the center.
Then proceed to cut out the darkened parts

Step 3: Attaching to Motor

Now we just need to cut a hole to attach the encoder disc to the shaft and do a final check on where we want to place our switch
depending on the material and tools you use as well as your crafting skills, hopefully your disc would not be as 'fuzzy' as mine.

Step 4: Glue and Use

Finally just glue the switch in place and you are ready to go.
if you are using arduino, you can wire it as you would with a button and test it out with the button or debouncing example program
Thats it!
Please leave any comment (preferably constructive ones )

Step 5: Update* New Encoder Disc

Here you can see various attempts to upgrade the encoder disc to make it more reliable and provide a higher resolution.
The few discs in the first picture (white background) are all hand made, topmost from cardboard as in this ible, 2nd from a flatten aluminum drink can and the other 3 from aluminum sheet. The problem however was that it is quite difficult to make the slits using the tools available to me and my lack of skills. Hence the disc were quite irregular, still usable but not consistent.
The 3 discs in the second picture (black background) are machine made courtesy of a friend of mine, I believe it is made with a wire cut machine. Works like a dream.

Arduino Contest

Participated in the
Arduino Contest

Robot Contest

Participated in the
Robot Contest

Gadget Hacking and Accessories Contest

Participated in the
Gadget Hacking and Accessories Contest

Sensors Contest

Participated in the
Sensors Contest

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    6 Discussions


    5 years ago on Introduction

    I have a question about the type of sensors used in this Instructable. From what I can read of the technical specification for similar units they have a sensitivity of 3mm (.3cm), but nothing more precise. This equates to .125".

    I wish to make something, a quality control instrument, using the sensor with a more accurate, say .01mm. Is there such a sensor for "non-contact" measurement?

    3 replies

    Reply 5 years ago on Introduction

    I do not have the specifications for the unit used in this instructable as it was salvaged from an old printer. But from the test we have conducted it seems to perform well even with gaps of around 1mm.

    I have to admit I am not an expert on these instruments, so I can only give wild suggestions. Maybe look into Hall effect sensors or other optical sensors if you want it to be non-contact. if contact is not an issue, you can try and get some precision rotary encoders.


    Reply 5 years ago on Introduction

    Thanks for the response. At 1mm that makes it .039" gap. Not bad for large objects.

    My plan is to make a simple x-y-z coordinate measuring machine that I can use to measure a 1:24 or 1:25 model car in order to upscale the dimensions and produce a hardtop for a 1965 AC Cobra I am building. The hardtop exists on a 1:25 scale model I already have.

    The individual I bought the fiberglass body from has measured photos of the Daytona Cobra Coupe and produces a fiberglass "Knock-off" of the Shelby Daytona Coupe. He went to a lot of trouble scaling photographs (knowing the wheels where 15"diameter) and calculating every dimension to form the body in a plywood space frame filled in and shaped in "Bondo". I am not that patient.

    Having worked with coordinate measuring machines I believe I can make this concept work. All I need is the means of sensing the proximity (to a plastic model) closer than .125" (3mm).

    Thanks again for the input. I will post my progress as I achieve positive results in my quest.

    John Johnson


    Reply 5 years ago on Introduction

    Thats a very interesting project! So sorry I cannot be of more assistance.
    I wish you all the best in your epic quest. Do share it with the Instructable community =)


    5 years ago

    What type do you recommen for the optical sloted switch.

    1 reply

    I must admit I am not too familiar with Optical slotted switches, but the one i used was salvaged from an old laser printer.