Skip to the content
PCBKitNew board
2 layers69 × 30 mmAbsolute Encoder, the printed circuit board in 3D

Why would you want an absolute encoder over a quadrature encoder?

Size
69 × 30 mm
Copper layers
2
Thickness
1.6 mm
Parts
22
Nets
16
Pads
74
Tracks, vias
96, 8
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
9 Sep 2024
Updated
10 Dec 2024

Overview

Absolute Encoder is an open-source printed circuit board by biomurph, from the biomurph/Absolute_Encoder_Board repository on GitHub, published under the CERN-OHL-P-2.0 licence. It is a 2-layer board of 69 × 30 mm with 22 parts on 16 nets, routed with 96 tracks and 8 vias.

It is built around the 74LS165PC. Its parts include 9 resistors, 2 connectors, 2 switches, 1 capacitor and 1 IC.

Main components

1

README

README.md

#DEVELOPMENT BRANCH

Absolute Encoder Board

Welcome to the Open-Source Absolute Encoder Board Repository. Here you will find hardware designs and files that support the Absolute Encoder. The GrayCode Arduino Library is available for installation via the Arduino IDE, just do a search for GrayCode in the Libraries Manager

What is it?

Encoders come in different types. Most people are familiar with quadrature encoders, which use two pins that change state sequentially in different order depending on the direction of rotation. One of the limitations of quadrature is that a microcontroller needs to be paying attention (usually with pin-change interrupts) in order to keep track of each step and count accordingly CW or CCW steps. In certain applications, the need for interrupts and constant attention to the encoder pin change can be limiting. Enter the Absolute encoder. This device can have 3 or more pins that maintain their coded state to show their rotational position. That means that any time you want to, you can read the encoder pins and get the correct positon without having to always keep track. Wikipedia has a great Gray Code Page for those who want to deep dive.

Why would you want an absolute encoder over a quadrature encoder?

  • You are using a Raspberry Pi or other single board computer. These are powerful devices, but they run their software under an operating system which can make it hard to catch fast changes in a quadrature signal. All you need is one missed step to be off track.
  • You have encoder inputs but no room or overhead to provide the user dynamic feedback. Say you have a couple of dials on your project box, with a sticker or other static indicator of dial position. The absolute encoder will reliably report it's rotational position whenever asked, without having to keep track of dial movement.

Those two reasons are good enough for me!

How does it work?

The encoders in this project use Gray code, also know has Reflected Binary code. It was invented in order to avoid electro-mechanical glitches in rotary circuits. A rotary switch, for example that has 4 pins which output a binary coded decimal (BCD) may have more than one pin (bit) changing state during a transition between positions. This means that it can be possible to misread the rotational position at the transition point between rotational sections. With Gray code, only one bit is changed during each rotational transition, making it far more stable and resistant to glitches and bad readings. Here is a chart of Decimal, Binary, and Grey encoding.

DecimalBinaryGray
000000000
100010001
200100011
300110010
401000110
501010111
601100101
701110100
810001100
910011101
1010101111
1110111110
1211001010
1311011011
1411101001
1511111000

Here's another rendering of the Gray code, arranged in a circle. This is the bit pattern of the dial, counting up when it is traveled clockwise.

GrayCodeWheel

Hardware

The hardware is in prototype stage. I am using the PAC18R Absolute Encoder from Bourns. They have a 5 pin output, 4 signal pins and 1 common pin, and come in 8 or 16 switch positions. These encoders have detents, which means they 'snap' into rotational position much like an old CRT television set knob does. The board design will carry 2 encoders and use a PISO shift register to read their positions. SW1 position data is in the low nibble, and SW2 data is in the high nibble. These boards can be daisy-chained, and the GrayCode library is designed to read off as many encoder boards as you have connected. The distance between the encoders is 35mm (1 3/8") on center.

ENCODER SWITCH ORIANTATION

The PAC18R comes in 8, 12, and 16 position variants. I have not seen the 12 position switch widely available, but the GrayCode library will handle it if you come across one. The shafts on them are 6mm diameter and flatted D type. The flatted side, if you are relying on it, is positioned differently relative to the 0 (zero) position. Here's a diagram showing where the flatted position of the shaft is at position 0 for each switch relative to the PCB.

FlattedD

NOTE: The 12 position variant has the same flatted D orientation as the 16 position variant

PIN CONNECTIONS

There are 6 pins on each end of the board which allow for daisy-chaining mulitiple boards together. The Inhibit pin is pulled LOW on the board, so you don't need to use it unless you need to use it (HIGH is Inhibit, LOW is Hibit). The pinout on the left edge is as follows:

Pin NameFunction
+VPositive Voltage Input: 3V to 6V
GNDConnect to Voltage Ground
CLKShift Register Clock Pin
LShift Register Load Pin
SER_OUTShift Register Serial Out Pin
INHShift Register Inhibit Pin

The only difference with the pinout on the right edge is the SER_IN pin. When daisy-chaining, connect the +V, GND, CLK, L pins, and the SER IN of the first board to the SER OUT of the next board, and so on.

Here is the schematic GrayCode Schematic

Here is a photo of the production ready prototype AEB_bareBoard AEB_compSide AEB_iso AEB_scale

Absolute Encocder Documentation © 2024 by Joel Murphy is licensed under CC BY 4.0

Parts

22
QtyValueFootprintReferences
9100KResistor_SMD:R_0402_1005MetricR1, R2, R3, R4, R5, R6, R7, R8, R9
4Mount PTHMountingHole:MountingHole_2.2mm_M2_Pad_TopBottomH1, H2, H3, H4
2~Flywheel:PAC18RS1, S2
10.1uFCapacitor_SMD:C_0603_1608MetricC1
174LS165Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU1
1LOGOFlywheel:Flywheel_LogoG***
1LOGOFlywheel:GrayCodeWheelG***
1LOGOFlywheel:oshwa-logo-gearG***
1PISO_INConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ2
1PISO_OUTConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ1

Questions

How big is the Absolute Encoder PCB?

It measures 69 × 30 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Absolute Encoder use?

22 parts, built around the 74LS165PC. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Absolute Encoder KiCad files?

From the biomurph/Absolute_Encoder_Board repository on GitHub, at the commit this page was made from: the board is Hardware/Absolute Encoder.kicad_pcb and its schematic Hardware/Absolute Encoder.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Absolute Encoder design in my own project?

Its repository publishes it under the CERN-OHL-P-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers128.3 × 50.8 mmCD32 Controller, the printed circuit board in 3D

    CD32 Controller

    BleuLlama/AmigaSchematics

    Schematics of various Commodore Amiga related items

    33 parts58MIT
  • 2 layers128.6 × 81 mmAfterglow, the printed circuit board in 3D

    Afterglow

    bitfieldlabs/afterglow

    Pinball retro afterglow

    203 parts32
  • 2 layersPanel old, the printed circuit board in 3D

    Panel old

    dankar/altair8800

    What started as a Intel 8080 emulator turned into a Altair 8800 emulator with associated hardware for a front panel.

    103 parts31MIT
  • 2 layers254 × 134.6 mmNew enet, the printed circuit board in 3D

    New enet

    jayacotton/inettools-z80

    Inet tools for z80-rc2014 tcp/ip stack code.

    36 parts22MIT
  • 4 layers180.3 × 211.3 mmFor real 486, the printed circuit board in 3D

    For real 486

    Xeraster/32bit_486_motherboard

    A completely DIY 486 motherboard. Even the chipset is a DIY fpga thing. This version has a 32 bit front side bus and a 16 bit ISA bis

    256 parts18GPL-3.0
  • 2 layers100 × 100 mm1551-III Pico, the printed circuit board in 3D

    1551-III Pico

    ytmytm/1551-rePico

    Commodore 1551 disk-drive replacement for Plus/4, C16 and C116: Pico2 + 6510T + CPLD in a Pi1551-III case, host via tcbm2sd. Firmware/GCR derived from 1541-rePico.

    80 parts16GPL-3.0
  • 2 layers85.1 × 31.8 mmEsp01Expander, the printed circuit board in 3D

    Esp01Expander

    ruenahcmohr/esp_01Expand32

    esp-01 (esp8266) IO expander, 16 output, 16 input = 32

    20 parts15
  • 2 layers75 × 50 mmRemnant, the printed circuit board in 3D

    Remnant

    hsgw/Remnant

    4x2 macro keyboard with attiny85 based digispark

    29 parts14