Rotary Encoder LED Ring User Guide
Rotary Encoder LED Ring User Guide
Rotary Encoder LED Ring User Guide
Table Of Contents:
Introduction 1
Hardware Description 1
Compatible Hardware 1
Pin Descriptions 3
Example Hardware Connection for Arduino 3
Example Code for Arduino 3
Adjusting LED Current and Brightness 3
Diffusing the LEDs 4
Setting the LED Sequence 4
_________________________________________
Introduction
Since rotary encoders have no start or end point, knobs without a position indicator are typically used – as opposed
to potentiometers, where an indicator knob is suitable. Many applications require a visual representation of how a
rotary encoder is reacting to user input as well as the control’s current position. The Rotary Encoder LED Ring
offers a solution with a ring of 16 LEDs that surround the encoder. The designer may implement any desired
sequence on the LEDs by communicating with the onboard series-to-parallel constant current shift register.
_________________________________________
Hardware Description
The Rotary Encoder LED Ring has two separate sections: a rotary encoder breakout and a collection of LEDs
controlled by a shift register. A microcontroller can be used to obtain encoder data and set LED data.
A rotary encoder may be mounted to the printed circuit board in two separate ways. The PCB has (1) mounting-tab
holes and soldering positions for a rotary encoder as well as (2) a hole for the encoder shaft: the encoder may be
soldered to the PCB or fitted through the shaft hole. Compatible rotary encoders are described below in the
‘Compatible Hardware’ section.
The PCB has 15 LEDs in a 270˚ arc and one LED at the bottom of the arc; they are interfaced with a Texas
Instruments TLC5925 16-bit shift register. The interface uses a standard Serial-Data/Clock/Latch-Enable 3 wire
connection that is further described with timing diagram in the TLC5925 datasheet:
http://focus.ti.com/lit/ds/symlink/tlc5925.pdf.
A thru-hole resistor can be used to increase the brightness of the LEDs and is described further in the ‘Adjusting
LED Current and Brightness’ section.
Please see the ‘Pin Descriptions’ section for more information about the 10 available connections.
_________________________________________
Compatible Hardware
The Rotary Encoder LED Ring is compatible with any microcontroller with at least 2 input lines (for the rotary
encoder) and 3 output lines (for the serial interface) available.
It can accept knobs up to 3/4-inch diameter without covering the LEDs. Image 1 shows how a 3/4" knob appears
on a shaft-mounted encoder.
0.9
Brand Models
(.035) Alpha 318ENC Series
Alps EC11, EC12
Bourns PEC11, PEC12, PEL12, PES12, PEC16
CTS 290 Series
Panasonic EVE Series
Sparkfun SKU: COM-09117
13.2
(.520)
2 PLCS.
2.1 +0.2/-0
7.0
(.083 +.008/-0)
(.276)
2 PLCS. 7.5
2.0 +0.2/-0
(.295)
(.079 +.008/-0)
A C B
5.0
(.197)
1.0 +0.2/-0
(.039 +.008/-0)
DIA. 5 PLCS.
30.0 _________________________________________
MM
(1.181) DIMENSIONS:
(INCHES)
12.0
(.472)
Pin Descriptions
Pin Description Section
GND Ground, zero voltage reference
VCC 3 to 5.5 Volts (Yellow, Green, Red LED models) Power
** BLUE LED model requires 3.6 to 5.5 Volts **
ENCA Rotary Encoder A Terminal
Rotary
ENCB Rotary Encoder B Terminal
Encoder
SWTCH Rotary Encoder Switch
SDI Serial Data Input
CLK Clock
LE Latch Enable TLC5925
OE (Active Low) Output Enable; tie to ground for constant operation
SDO Serial Data Output – for daisy chaining units
_________________________________________
If an Arduino is not the desired target device, the example code gives enough detail to outline the procedures
necessary to implement an interface on other programmable devices.
_________________________________________
25
20
15
10
5
0
0 500 1000 1500 2000 2500 3000 3500 4000
Rext – !"
As an example, the image to output that will turn on one additional LED each step looks like:
0000000000000001 (hex 0x01)
0000000000000011 (hex 0x03)
0000000000000111 (hex 0x07)
and so on. This sequence can be written directly to the shift register.
If the same output was created using XOR or OR, the sequence would look like:
0000000000000001 (hex 0x01)
0000000000000010 (hex 0x02)
0000000000000100 (hex 0x04)
and so on. An image would be OR’ed with the previous image and the result would be the same as the first
example.
For details about using bitwise operations, please see the Arduino Reference:
http://arduino.cc/en/Reference/BitwiseAnd
Using the map() function, it is possible to scale the speed of the LED output sequence relative to the encoder
rotation. For example, when rotating the rotary encoder one full revolution, one additional LED is turned on. See
the Arduino Reference: http://www.arduino.cc/en/Reference/Map