The Yocto-Knob and Yocto-MaxiDisplay variants have analog inputs for connecting interface buttons: pushbuttons, rotary knobs. However, there was one type of button that was not supported: infinite rotary buttons with quadrature encoder. This limitation has now been lifted.
Principle
Unlike a potentiometer, a rotary knob with a quadrature-encoded output does not transmit its absolute position, but rather its movements: by simultaneously monitoring two contacts that close and open in staggered sequence, we can determine precisely the direction of rotation and the number of steps taken:
Rotary knob with quadrature encoder
This type of rotary knob is usually notched. Turning one notch usually advances the signal by two blanks (half a period) or four blanks (a full period). To correctly identify the direction of rotation, it is necessary to accurately detect the sequence of transitions on the two contacts. It is therefore particularly advantageous to do this directly in the interface module, rather than having to do this monitoring in real time in the software.
For some time now, we've been offering another product that can be configured with DIP switches to read up to six quadrature-encoded rotary knobs: the Yocto-MaxiKnob. But since the use of infinite rotary knobs is particularly convenient for user interfaces, and as we've found a way to integrate it into older modules, we thought it would be a shame to deprive you of it...
Configuration
If you update your module's firmware, new functions quadratureDecoder1, quadratureDecoder2, and so on appear. They are disabled by default, but you can enable them in the module configuration:
Quadrature decoder configuration
The Edges per cycle setting allows you to configure the number of edges per notch of your rotary knob, so that the module correctly counts knob movements.
When a quadrature decoder is enabled, the corresponding inputs on the module are automatically switched to DIGITAL_FAST mode, which enables edge transitions to be monitored at the required frequency. If you change the acquisition mode of any of the inputs, the quadrature decoder is automatically disabled. Note that the input contacts assigned to the quadrature decoders are in reverse order to the anButton inputs: the first quadrature decoder uses the last two analog inputs, and so on.
Once the quadrature decoder has been activated, the module can at any time provide you with the sum of button rotations since the last reset.
Quadrature decoder display
The module thus provides you with an absolute counter as if it were a potentiometer, but based on a relative zero since the knob is infinite.
A small example
By way of example, here's a DIY application we made a while back using a Yocto-MaxiDisplay-G, a Yocto-PT100 and a YoctoHub-Wireless-n. This is a monitoring device for slow cooking. Measures are displayed on the screen by a small Python program and simultaneously sent to Yocto-Visualization (for Web) by the hub itself for remote monitoring. The addition of the infinite rotary knob, connected directly to the Yocto-MaxiDisplay-G, enabled us to add a configuration menu directly on the device:
Interface created with a rotary knob
The Python source code for this example is available on GitHub.
Conclusion
All Yocto-Knob, Yocto-MaxiDisplay, Yocto-MaxiDisplay-G and Yocto-Display owners can now take advantage of this functionality with a simple firmware update.
Note, however, that this functionality is limited to interface buttons that work on dry contacts and with limited frequencies. To read a high-frequency quadrature-encoded or voltage-modulated signal, the appropriate module remains the Yocto-PWM-Rx, as described in this other post.