Introduction: 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.
Step 1: How Does It Work?
When the disc rotates sensors can detect that dark and light patches change and Arduino can calculate the right position.
Step 2: Schematic Diagram
Arduino connected to the PCB only 4 wires. GND, +5V SDA SCL
Step 3: Yes, This Is the Encoder Disc
Step 4: Hidden Track That Sensors Can Detect
This area that sensors can see.
Step 5: 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.
Step 6: Sensors, Dimensions
Step 7:
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
Step 8: Application in Practice
I made clocks with this encoder.