Absolute Position Encoder With Single Track Gray Code
by holybaf in Circuits > Sensors
15955 Views, 75 Favorites, 0 Comments
Absolute Position Encoder With Single Track Gray Code
I made a rotary encoder. Due to its 60 steps (6 degree) resolution it suits to make clocks.
There is a very good and detailed description of the single track Gray code here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6111776/.
My instructable is only about physical realization now.
Supplies
We need a custom PCB with opto sensors, an Arduino, I used Uno and also need an encoder disc.
How Does It Work?
When the disc rotates sensors can detect that dark and light patches change and Arduino can calculate the right position.
Schematic Diagram
Arduino connected to the PCB only 4 wires. GND, +5V SDA SCL
Yes, This Is the Encoder Disc
Hidden Track That Sensors Can Detect
This area that sensors can see.
Making an Encoder Disc
You can print out and glue on to the disc surface these pictures, or you can do it manually:
I used 38mm wide insulating tape. Cover the disc like that. Put tape along the disc. Make sure that the tapes meet at the midline of the disc. Scratch with a sharp knife along the 4 red lines. You can remove and swap two pairs of opposite triangles now.
Sensors, Dimensions
It shows the disc pattern and reading head distribution of a period-60 code. The generated sequence: [13, 3, 6, 2, 6, 13, 3, 6, 2, 6]. The head interval [5,]. One step will be 360/60= 6°, so step 13 will be 78°. The sensors are 30 degrees apart
Application in Practice
I made clocks with this encoder.