2
\$\begingroup\$

Many microcontrollers and logic devices (programmable or otherwise) are capable of drawing very little current when nothing is happening. If a double-throw switch is wired to such a device, then when the switch is moved to one contact-closure position, it's possible for the controller to sleep, drawing essentially zero current, until the switch is moved to the other position. Even if the switch were to sit between the two positions for an extended period of time, or repeatedly oscillate between one position and "open", the system wouldn't have to care, and could remain in a near-zero current state.

Monitoring a single switch input, by contrast, requires consuming a certain amount of quiescent current whenever the switch is closed; the amount required is related to the speed with which software must notice if the switch is open. This is fine for many scenarios involving mechanical switches (in many cases, one can either arrange to have switches be open most of the time, or will be able to get by polling a switch e.g. once every 100ms or so). Rotary encoders, unfortunately, satisfy neither of those conditions. They're as likely to be on an active spot as an inactive spot, and in many cases one will need to respond immediately to a change if one is to have any hope of maintaining an accurate position count.

If a rotary encoder has just two contacts, there will necessarily be a position where both are active simultaneously; the only way to determine when the encoder leaves that position would be to feed current through those contacts to test their state, likely increasing quiescent current by an order of magnitude beyond what would otherwise be achievable (depending upon required response time). If there were three or four contacts wired as:

       **  **  **
Out1: -AAAAAA-----
Out2: -----AAAAAA-
Out3: AAA------AAA

       **  **  **  **
Out1: -AAAAAA---------
Out2: -----AAAAAA-----
Out3: ---------AAAAAA-
Out4: AAA----------AAA

then it would be possible for a processor or other circuit monitoring such an encoder to ignore the state of any closed contact until it saw a different contact close. In the first case, the processor could resolve 1/6 cycle when awake, and be assured of waking up when the device moves to any position marked with ** after having been on another such position (typically 1/3 cycle; just under 1/2 cycle worst-case). The second case would allow 1/8-turn resolution when awake, and would wake up when the device moves 1/4-3/8 cycle. The second design would be somewhat easier to interface with a quadrature decoder, since feeding Out1 and Out3 into one RS latch, and Out2 and Out4 into another, would yield clean debounced signals for the decoder circuit.

I've seen rotary encoders with more than two contacts, but they've all used the extra contacts for purposes of yielding a more detailed binary position. Do any companies make encoders which use extra contacts to allow near-zero-quiescent power while maintaining an accurate position count? Alternatively, would there be any other approach which could be used to monitor an encoder (possibly a higher-resolution one) with near-zero quiescent power?

\$\endgroup\$
  • \$\begingroup\$ It sounds like you are going to answer this yourself? But anyway, floating inputs prevent a microcontroller from that near zero quinscent current rating. Every time the input floats from one state to the other, it has to update its registers, go through its interrupts if enabled, etc. Which is why a button or switch may be "open" logically, but there is almost aways a weak pullup or pulldown holding the input at a steady voltage until the button is closed, forcing it into the other voltage state. \$\endgroup\$ – Passerby Mar 16 '14 at 17:14
  • 1
    \$\begingroup\$ @Passerby: There are many ways to avoid floating inputs. If a SPDT switch is wired so that it can an input high or low, one may feed the switch to a non-inverting gate whose output is connected to its input via e.g. 1M resistor. If the gate is outputting high, the switch will only draw current when the "low" contact closes, and in that case it will only draw current long enough to switch the gate (whereupon it won't draw current until the "high" contact closes). The only "troublesome" case would occur if the switch was closed just enough to have a ~1M resistance itself, but that's not... \$\endgroup\$ – supercat Mar 16 '14 at 17:54
  • \$\begingroup\$ ...apt to happen very often. If a switch has two inputs which it can connect to ground, it can be used to drive a latch made from two inverters that are cross-connected with one-meg resistors. Alternatively, one could have software have at any given time one switch configured as "output low" and the other as "weak pull-up"; whenever the "weak-pull-up" pin goes low, switch it to ground and switch the other pin to "weak pull-up". \$\endgroup\$ – supercat Mar 16 '14 at 18:05
3
\$\begingroup\$

Yes! It's possible for mechanical encoders with detents. It's going to limit you to a fairly low number of steps per revolution because the mechanical tolerances get troublesome.

Consider this CUI part (photo from Digikey):

enter image description here

The detents are such that the encoder outputs are guaranteed to be 'open' at the detent positions, so your pullups will draw no power (the vertical dashed lines indicate possible detent positions).

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Something with detents might work if there were some means of elastically coupling it so that it wouldn't leave one detent until there was enough torque to carry it to the next; I've never heard of such a mechanical design, however. \$\endgroup\$ – supercat Mar 16 '14 at 19:19
  • \$\begingroup\$ I guess if it had a bit of 'slop', the detent would carry it backward or forward, as required. \$\endgroup\$ – Spehro Pefhany Mar 16 '14 at 19:29
  • \$\begingroup\$ Slop by itself wouldn't be sufficient without some elasticity. Generally, on a rigidly-coupled knob with a detent, the torque trying to push the knob toward the previous position will fall toward zero as the switch approaches the threshold, and will then start at nearly zero toward the next position. Elasticity is required to ensure that the switch won't get near the zero-torque location unless it's going to go past it. \$\endgroup\$ – supercat Mar 16 '14 at 19:40
  • \$\begingroup\$ Yes, agreed, it needs elasticity. \$\endgroup\$ – Spehro Pefhany Mar 16 '14 at 20:00
  • 1
    \$\begingroup\$ It's impossible to guarantee that the encoder will always immediately fall to one detent or the other; see Buridan's Principle. That argument applies to all physical systems making a discrete choice (here to continue to the next detent or fall back to the current one). Elaborating the design can only reduce the probability of indefinitely remaining in-between (but that's good enough, particularly in this case because the harm is merely increased power draw). \$\endgroup\$ – Kevin Reid Mar 17 '14 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.