Quick and Dirty Encoder

by michaelgohjs in Circuits > Arduino

5088 Views, 24 Favorites, 0 Comments

Quick and Dirty Encoder

IMG_6349.JPG
IMG_6344.JPG
IMG_6348.JPG
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)

Planning

IMG_6328.JPG
IMG_6327.JPG
IMG_6334.JPG
IMG_6329.JPG
IMG_6346.JPG
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'.

The Disc

IMG_6330.JPG
IMG_6331.JPG
IMG_6333.JPG
IMG_6336.JPG
IMG_6337.JPG
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

Attaching to Motor

IMG_6339.JPG
IMG_6340.JPG
IMG_6341.JPG
IMG_6342.JPG
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.

Glue and Use

IMG_6348.JPG
IMG_6347.JPG
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 )

Update* New Encoder Disc

891747_837936569569458_4740930289321948158_o.jpg
1501057_837992199563895_2135100655605094768_o.jpg

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.