Absolute Position Encoder With Single Track Gray Code

by holybaf in Circuits > Sensors

15610 Views, 74 Favorites, 0 Comments

Absolute Position Encoder With Single Track Gray Code

gif.gif
MM2.png
MM.png

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

pcb.jpg
Arduino.png
disc3.png

We need a custom PCB with opto sensors, an Arduino, I used Uno and also need an encoder disc.

How Does It Work?

GIF.gif
excel.png
Absolute Position Encoder With Single Track Gray Code

When the disc rotates sensors can detect that dark and light patches change and Arduino can calculate the right position.

Schematic Diagram

Schematic_mademath_2021-11-06.png

Arduino connected to the PCB only 4 wires. GND, +5V SDA SCL

Yes, This Is the Encoder Disc

MM.png

Hidden Track That Sensors Can Detect

track.png
track3.png
MM.png

This area that sensors can see.

Making an Encoder Disc

20211107_143511.jpg
cover1.png
cover2.png
cover3.png
20211107_143453.jpg

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

angle.png
sensors.png

disc3.png
sensors.png

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

Dance of the clock hands
Giant clock project
20211115_190014.jpg
20211115_190100.jpg
20211115_191046.jpg
20211115_193207.jpg
20211115_193220.jpg
20211115_194844.jpg
20211115_194920.jpg
20211115_195056.jpg
20211115_195104.jpg
20211115_195127.jpg
20211115_195218.jpg
20211115_195402.jpg
20211115_195418.jpg
20211115_195433.jpg
20211115_195459.jpg

I made clocks with this encoder.