Skip to content

Rotary Encoder and Buttons

vitotai edited this page Jan 29, 2018 · 4 revisions

Operation

Rotary Encoder is slick when it is installed properly. You can easily control BrewPi by single device it the rotary encoder has pushdown function. The operation of rotary encoders:

  • Turn right/left to change values
  • pushdown for set/enter

Buttons are simple to use.

  • Press UP/DOWN to change values
  • Press UP AND DOWN for set/enter

Installation

Only one port is needed on the panel for a rotary encoder. However, capacitors might be necessary to make it work smoothly. Including POWR/GND, 5 connections are needed. Pull-up resistors might be needed if the rotary encoder doesn't have them. (The description above is applicable for mechanical rotary encoders.)

Depending of the type of buttons used, you might need one or two port on the panel. Due to the fact that the PINs BPL uses are already pull-up, (or internal pull-up can be enabled) only one signal and one ground connection per button are needed. No extra components are needed. Debounce circuit might be used, but it is not necessary and makes nearly no difference.

Hardware/software requirement

The nature of rotary encoders requires interrupt service, which is the way original BrewPi does. On the other hand, buttons can be polled, although the response might seem insensitive.

The most critical issue of rotary encoder is that cheap mechanical rotary encoders connect the PinA and PinB to ground and V+ to generate the signals. Depending on the position of the rotary encoder, PinA and PinB will be grounded or pulled to HIGH. If you use GPIO 0,2,15 for rotary encoder, you need some luck to get ESP8266 boot up.

ESP8266 doesn't have much pins, there are no other pins available to use a rotary encoder. Using IO Expander, PCF8574, is a solution, which calls for extra hardware.

Clone this wiki locally