ELM409
Versatile Debounce Circuit
Description
The ELM409 is digital filter circuit that is used to
interface mechanical contacts to electronic circuits.
All mechanical contacts, whether from switches,
relays, etc. will have inherent ‘bounce’ when they
make or break a connection. When that contact is
used for the electrical input to a digital circuit, the
bounces can easily be incorrectly interpreted as
multiple inputs. The ELM409 contains all of the logic
that is typically required to remove the bounce from
such signals, and provide a signal that has only one
transition.
In addition to providing the standard debounce
function, the ELM409 may also be configured for
other useful functions such as generating pulses or
alternating output levels on signal transitions.
No external components are needed for the
operation of the ELM409, as all timing and logic
functions are performed internally.
Features
• Standard and extra long debounce times
• Schmitt input provides hysteresis
• Complementary circuit outputs
• Needs no external timing components
• Low power CMOS design - typically 1 mA at 5V
• Wide supply range - 3.0 to 5.5 volt operation
• High current drive outputs
Connection Diagram
PDIP and SOIC
(top view)
V
DD
1
2
3
4
8
7
6
5
V
SS
Out
Out
In
Applications
•
•
•
•
Pushbutton interface for logic circuits
Limit switch monitoring
Time delay generation
Power on sequencing
A
B
C
Block Diagram
A
2
B
3
C
4
Control Logic
edge
detectors
pulse
generator
500 msec
debounce
In
5
7
Out
Out
6
25 msec
debounce
edge
detectors
toggle
circuit
ELM409DSA
Elm Electronics – Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
1 of 8
ELM409
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 microprocessor, so an external
reset signal is not required. Refer to the Electrical
Characteristics section for further information.
A, B, and C (pins 2, 3, and 4)
These three pins modify the behaviour of the
ELM409, providing eight different configurations.
They determine whether the output should follow the
input, be a momentary pulse, or toggle the output on
each input transition. As well, they can select either
a standard 25 msec debounce period, or a longer
500 msec one. The longer period may be useful for
some very noisy interfaces, or for situations that
need a slight delay. See the “ELM409 Operation”
section for more details on these options.
In (pin 5)
The signal that is to be processed is applied to this
pin. Before the signal is ‘debounced’, it is passed
through a Schmitt trigger - a special buffer circuit that
has hysteresis in its gain function. The use of
Out (pin 7) and Out (pin 6)
The ‘debounced’ and processed signal is output on
pin 7, while the complement of this signal is output
on pin 6. These are high current CMOS drivers, so
will interface to virtually all of the common digital
logic families.
V
SS
(pin 8)
Circuit common is connected to this pin. This should
be the most negative point in the circuit.
hysteresis means that very slow moving or noisy
signals can be accommodated by the ELM409
without needing the signal to be preconditioned by
any external circuitry. (A standard CMOS input
should never have a slowly varying signal applied,
as it may cause excessive currents to flow internally,
but a Schmitt input circuit does not have this
limitation.)
Ordering Information
These integrated circuits are available in either the 300 mil plastic DIP format, or in the 208 mil SOIC surface
mount type of package. To order, add the appropriate suffix to the part number:
300 mil Plastic DIP............................... ELM409P
208 mil SOIC..................................... ELM409SM
All rights reserved. Copyright 2009 by Elm Electronics Inc.
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.
ELM409DSA
Elm Electronics – Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
2 of 8
ELM409
Absolute Maximum Ratings
Storage Temperature....................... -65°C to +150°C
Ambient Temperature with
Power Applied....................................-40°C to +85°C
Voltage on V
DD
with respect to V
SS
............ 0 to +7.5V
Voltage on any other pin with
respect to V
SS
........................... -0.6V to (V
DD
+ 0.6V)
Note:
Stresses beyond those listed here will likely damage
the 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
Average Supply Current, I
DD
Input (pin 5)
Schmitt trigger
thresholds
Input (pin 5)
Schmitt trigger
thresholds
Output low voltage
Output high voltage
Standard debounce time
Long debounce time
Output pulse width
rising
falling
rising
falling
Minimum
3.0
0.05
Typical
5.0
Maximum Units
5.5
V
V/ms
Conditions
see note 2
see note 3
1.0
2.9
1.0
1.5
1.6
0.6
1.0
0.3
4.2
25
500
50
2.4
4.0
mA
V
V
V
DD
= 5.0V
2.4
V
V
V
V
msec
msec
msec
V
DD
= 3.0V
Current (sink) = 10 mA
Current (source) = 10 mA
see note 4
see note 4
see note 4
Notes:
1. This integrated circuit is produced using one of the Microchip Technology Inc.’s PIC12C5XX products as the
core embedded microcontroller. For further device specifications, and possibly clarification of those given,
please refer to the appropriate Microchip documentation.
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. Device only. Does not include any current supplied to external circuits.
4. The ELM409 uses an internal RC oscillator for the timing. This oscillator typically maintains an accuracy of
2% over the allowed temperature and voltage range.
ELM409DSA
Elm Electronics – Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
3 of 8
ELM409
About Contact Bounce
The circuit of Figure 1 below shows one possible
connection that might be made between a mechanical
switch and a digital circuit. The pushbutton could be
used to summon an elevator, or to turn a circuit on, or
it could be a switch that is operated by foot pressure to
count the number of people entering a room. It does
not matter what the function is actually - in every case
we simply need a clean signal to present to the logic.
Normally, the pushbutton will not be pressed, so
its contacts will be open, and the digital circuit will ‘see’
taken from our pushbutton tests (and shows the output
from the ELM409 in the lower trace). Note that the
signal alternates between high and low several times,
bouncing between the levels. This bounce occurs
when the moving contacts of the switch meet the
stationary contacts, and is simply due to the physics of
the two parts meeting one another. The bounces do
not seem to have a defining characteristic that would
allow the behaviour to be predicted and filtered - it is
basically digital noise.
If this signal were to be input to the digital circuit
as it is, it would be seen as at least two switch presses
(and maybe more). Note that when the contacts open,
there is a similar problem, as shown in Figure 3:
Digital
Circuit
Figure 1. Pushbutton input to digital logic
only a resistor to circuit common (a ‘low ‘input). When
the pushbutton is pressed, the contacts close and the
digital circuit will be connected to the positive power
supply, or a logic ‘high’. It should be a simple matter of
processing this signal, but it is often not.
The oscilloscope trace of Figure 2 shows the
voltage that the digital circuit of Figure 1 might see
when the pushbutton is pressed. It is an actual trace
Figure 3. Bounce on switch opening
Seeing multiple inputs for a single switch press is
certainly not what is intended by any circuit, and it
needs to be addressed. The technique of ‘cleaning up’
such a signal is commonly known as ‘debouncing’, and
that is what the ELM409 does. It simply waits until the
bounces stop, then waits an additional time (the
debounce time) to be sure that there are no more
bounces likely to occur. Choosing an appropriate
debounce time is a design choice, but 25 msec seems
to be a good value.
There are several analog methods of performing
the ‘debouncing’ of a signal, many that work extremely
well, but we do not think that any work better than the
ELM409.
Figure 2. Bounce on switch closing
ELM409DSA
Elm Electronics – Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
4 of 8
ELM409
ELM409 Operation
The circuit of Figure 4 shows how the ELM409
would typically be connected to debounce the signal of
Figure 1. Other than powering the ELM409, all that is
needed is to connect the options pins (A, B and C) to
V
SS
(providing low levels on all three), connect the
noisy switch signal to the input pin, and then connect
the ELM409 output pin to the digital circuit.
The output of the ELM409 in Figure 4 would
appear as shown in the ‘scope traces of Figures 2 and
3 (the lower traces). There is a slight delay (25 msec)
due to the debounce period, but otherwise, the signal
appears as you would expect from an ‘ideal’ switch.
The ELM409 is capable of performing several
other functions on the input signal - it can do more that
just debounce the signal. For example, it can provide
a change in output on the signal edges (transitions
from a low to a high level, or from a high to a low
level), and it can alternate (toggle) the output on each
occurrence of an edge. Each of these possibilities are
selected by changing the logic levels at the A, B and C
pins. The eight combinations are described in Table 1
below, and also appear pictorially on the next page.
4
3
2
1
409
5
6
7
8
Digital
Circuit
Figure 4. Debouncing the pushbutton
Function
Follows
Input
A
0
0
0
0
1
1
1
1
B
0
0
1
1
0
0
1
1
C
0
1
0
1
0
1
0
1
Debounce Period
25 msec
500 msec
25 msec
500 msec
25 msec
500 msec
25 msec
25 msec
Notes
Standard contact debounce
For very noisy circuits
Output pulse is 50 msec wide
Output pulse is 50 msec wide
Output pulse is 50 msec wide
Output pulse is 50 msec wide
Changes on input H -> L
Changes on input L -> H
Pulse on
Rising Edge
Pulse on
Falling Edge
Toggle
on Edge
Table 1. ELM409 options
ELM409DSA
Elm Electronics – Circuits for the Hobbyist
< http://www.elmelectronics.com/ >
5 of 8