Anelok: tactile switches (1/2)

Werner Almesberger werner at
Fri Oct 23 08:36:39 UTC 2015

Since everybody agrees that the slider was the wrong approach, I
now made a first try with good old mechanical switches. For this,
I replaced the sub-PCB of one of my 2014 devices with one that
has three switches instead of the capacitive slider.

Now, there is one little problem: I only have two signals (CAP_A
and CAP_B) but three buttons. This is how I solved it:

On the left, we have the usual configuration with a pull-up
pulling the line up and the switches closing to ground. Current
flows with the respective switch closed are shown in pink.

To read the middle switch, I change the GPIO configuration such
that one channel becomes ground as well. The other then reads the
middle switch.

This is nice and simple. However, it has two limitations:

- if more than one switch is closed, CAP_A and CAP_B will read
  low, so we cannot distinguish, say, Top + Bottom from
  Top + Middle.

- in either configuration, one switch will not produce a change
  when operated. This means that the MCU has to periodically poll
  the switches, changing between configurations.

Since Anelok is only interested in the middle switch for waking up
from standby, we can still avoid polling in standby, making this
solution more power-efficient than the capacitive slider. I haven't
implemented that yet, though.

The design files for the new sub-board are here:

And this is what it looks like:

I used switches from the E-Switch TL3315 series, which are not too
expensive (each USD 0.125 @ 1000), have 2nd and 3rd sources (i.e.,
Panasonic EVQPQ series and C&K PTS 530 series), and are easy to

One could also use bare domes and save a few cents, but these are
not easily sourced as individual parts and may be more difficult to
solder (I have a few but never used them).

- Werner

More information about the discussion mailing list