ELM401
Rotary Encoder Debounce Circuit
Description
The ELM401 is an 8 pin integrated circuit that is
used to ‘debounce’ the signals from a mechanical
rotary (quadrature) encoder. The low power CMOS
technology used ensures that only a very small
current is required over the entire 2.0 to 5.5 volt
operating range.
There is no need for external filtering or
debounce circuits with the ELM401, as this is all
performed within the integrated circuit. The ‘A’ and
‘B’ motion sensing encoder signals are both passed
through a filter then a comparator circuit, and finally
a timer circuit to remove noise and contact bounce,
while the switch input receives standard debounce
processing. The result are three virtually noise-free
signals that are suitable for direct use by an
electronic circuit.
Note that no inversion or manipulation of any
kind is performed on the input signals, other than the
debouncing. If your applications requires decoding of
the signals, you may wish to look at our ELM402 to
ELM408 family of products.
Features
•
•
•
•
•
•
Low power CMOS design
Wide supply range – 2.0 to 5.5 volts
Complete debouncing of the encoder signals
No external filtering needed
Includes switch debouncing circuit
Startup delay timer
• High current drive outputs
Connection Diagram
PDIP and SOIC
(top view)
V
DD
A
1
2
3
4
8
7
6
5
V
SS
A out
B out
Sw out
Applications
• Microcontroller Interfaces
• Monitoring of Encoder Signals
• General Switch Debouncing
B
Sw
Block Diagram
V
DD
A
2
Debounce
Circuit
7
A out
V
DD
B
3
Debounce
Circuit
6
B out
V
DD
Sw
4
Debounce
Circuit
5
Sw out
Rotary
Encoder
ELM401DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
1 of 8
ELM401
Pin Descriptions
V
DD
(pin 1)
This pin is the positive supply pin, and should always
be the most positive point in the circuit. Internal
circuitry connected to this pin is used to provide
power on reset of the internal logic, so an external
reset signal is not required. Refer to the Electrical
Characteristics section for more information.
A (pin 2)
This input is usually connected to what is normally
known as the ‘A’ signal from a rotary (quadrature)
encoder. An external pullup resistor is required for
the encoder (a typical value is 10 KΩ), but no
external capacitors are needed (as the internal
debounce circuitry provides the filtering).
B (pin 3)
This input is usually connected to what is normally
known as the ‘B’ signal from a rotary (quadrature)
encoder. An external pullup resistor is required for
the encoder (a typical value is 10 KΩ), but no
external capacitors are needed (as the internal
debounce circuitry provides the filtering).
Sw (pin 4)
This input may be used to debounce any standard
mechanical contact (from a switch or relay). The
circuitry uses simple set/reset logic to control a timer,
so is not suitable for use with the A or B signal from
a rotary encoder (as those signals continue to
generate sliding noise while the contact is closed).
Sw out (pin 5)
This output is the debounced representation of the
signal that is at pin 4.
B out (pin 6)
This output is the debounced representation of the
signal that is at pin 3.
A out (pin 7)
This output is the debounced representation of the
signal that is at pin 2.
V
SS
(pin 8)
Circuit common is connected to this pin. This is the
most negative point in the circuit.
All rights reserved. Copyright 2011 Elm Electronics.
Every effort is made to verify the accuracy of information provided in this document, but no representation or warranty can be
given and no liability assumed by Elm Electronics with respect to the accuracy and/or use of any products or information
described in this document. Elm Electronics will not be responsible for any patent infringements arising from the use of these
products or information, and does not authorize or warrant the use of any Elm Electronics product in life support devices and/or
systems. Elm Electronics reserves the right to make changes to the device(s) described in this document in order to improve
reliability, function, or design.
ELM401DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
2 of 8
ELM401
Ordering Information
These integrated circuits are only available in either a 300 mil plastic DIP format, or in a 150 mil SOIC surface
mount type of package. To order, add the appropriate suffix to the part number:
300 mil Plastic DIP............................... ELM401P
150 mil SOIC..................................... ELM401SM
Outline Diagrams
The diagrams at the right show the two package
styles that the ELM401 is available in. The first shows
our ELM401P product, which is an ELM401 in a
300 mil DIP package. This is a standard through hole
type dual inline package. The ELM401SM is our
surface mount version of the ELM401. The device
package has a 3.90 mm wide body, and is commonly
called a 150 mil SOIC package.
The drawings shown here provide the basic
dimensions for these ICs only. Please refer to the
following Microchip Technology Inc. documentation for
more detailed information:
•
Microchip Packaging Specification,
document name
en012702.pdf (7.5MB). At the www.microchip.com
home page, click on Packaging Specifications, or go
to www.microchip.com/packaging
•
PIC12F508/509/16F505 Data Sheet,
document
41236E.pdf (1.5 MB). At the www.microchip.com
home page, click on Data Sheets, then search for
12F508.
ELM401P
2.54
6.35
max
10.92
ELM401SM
1.27
3.90
6.00
Note: all dimensions shown are in mm.
ELM401DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
3 of 8
ELM401
Absolute Maximum Ratings
Storage Temperature....................... -65°C to +150°C
Ambient Temperature with
Voltage Applied..................................-40°C to +85°C
Voltage on V
DD
with respect to V
SS
............ 0 to +6.5V
Voltage on any other pin with
respect to V
SS
........................... -0.3V to (V
DD
+ 0.3V)
Note:
Stresses beyond those listed here will likely
damage this device. These values are given as a
design guideline only. The ability to operate to
these levels is neither inferred nor recommended.
Electrical Characteristics
All values are for operation at 25°C and a 5V supply, unless otherwise noted. For further information, refer to note 1 below.
Characteristic
Supply voltage, V
DD
V
DD
rate of rise
Power on reset time
Average supply current, I
DD
Minimum
2.0
0.05
9
Typical
5.0
Maximum Units
5.5
V
Conditions
V/msec see note 2
18
0.6
0.2
30
1.1
0.3
msec
mA
mA
mA
mA
mA
mA
msec
msec
4
%
see note 5
see note 3
V
DD
= 5.0V
V
DD
= 2.0V
V
OL
= 0.25V
V
OL
= 0.25V
V
OH
= 4.75V
V
OH
= 2.75V
see note 4
Output low current
(sink)
V
DD
= 5.0V
V
DD
= 3.0V
10
5.0
2.5
1.7
5.5
50
1
Output high current
(source)
V
DD
= 5.0V
V
DD
= 3.0V
A & B debounce period
Startup time delay
Internal timing variation
Notes:
1. This integrated circuit is based on a Microchip Technology Inc. PIC12F5XX device. For more detailed
specifications, please refer to the Microchip documentation (www.microchip.com).
2. This spec must be met in order to ensure that a correct power on reset occurs. It is quite easily achieved
using most common types of supplies, but may be violated if one uses a slowly varying supply voltage, as
may be obtained through direct connection to solar cells, or some charge pump circuits.
3. The internal reset circuitry stops the ELM401 from doing anything during this period, so that the power
supplies and oscillators have time to stabilize. During this time, all pins behave like inputs.
4. Typical only - the actual period varies with the amount of noise present in the input signal.
5. All filtering, delay, and output timing is based on an internal master oscillator. The frequency of this oscillator
will vary with voltage and temperature. Values shown are typical maximums for 2.0V
≤
V
DD
≤
5.5V, and
temperatures of -40°C to +85°C
ELM401DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
4 of 8
ELM401
Rotary Encoders
A rotary encoder (sometimes referred to as a
quadrature encoder) is a device that produces digital
(on/off) outputs in response to rotary, or circular,
motion. It is often constructed such that it looks very
much like a potentiometer, or audio volume control
(see the picture of a typical device, at the right).
As the encoder shaft is turned, internal contacts
open and close, creating two waveforms that are
ideally separated in phase by 90 degrees (ie ‘in
quadrature’). Actually, you need to provide external
‘pullup’ resistors and a power supply to create these
waveforms, as the contacts themselves can not do
this. An ideal waveform from a rotary encoder would
look like this:
A
A typical rotary encoder
waveforms are not perfectly square with the 50% duty
cycles shown. Figure 2 shows a captured trace from a
real rotary encoder that is more representative of what
you will typically find. Note that the two ‘scope
channels (1 and 2) represent the encoder outputs A
and B, respectively. The ch 1 (A) waveform leads the
ch 2 (B) waveform, which usually means that the shaft
is turning in a clockwise direction.
The first rising edge of the channel 2 waveform
shows another problem that occurs with moving
mechanical contacts - multiple pulses due to bounce.
When two contacts meet, the moving one will tend to
bounce, like a ball does when it is dropped on the
floor. Each bounce results in an electrical connection
being made, then broken, which will look like multiple
inputs to a fast electronic circuit. Various mechanical
means are used to reduce the amount of bounce, but it
can never really be eliminated. The following section
discusses how the ELM401 uses electronic means to
remove the bounce.
B
Figure 1. Quadrature Waveforms
Due to the 90 degree phase difference, when one
waveform changes, the other is always stable. By
noting the direction of the change and the level of the
other input at that time, you can determine the
direction of motion of the shaft.
Rotary encoders are not ideal, however. Due to
their construction, and variations in shaft speed, the
Figure 2. Actual Rotary Encoder waveform
ELM401DSB
Elm Electronics – Circuits for the Hobbyist
www.elmelectronics.com
5 of 8