Potentiometers vs. Rotary Encoders and How to Use Them With Arduino
Among electronic user control components, rotary knobs stand out as some of the most satisfying to use. They can complement touchscreens and other input devices, as well as working well with buttons and switches. But how can you add a knob to your own DIY Arduino projects?
You have two main options: a potentiometer or a rotary encoder. These components may look similar, but the methods for using them with a device like an Arduino microcontroller board are very different. Let’s see how they compare against each other.
Potentiometers vs. Rotary Encoders
Among electronic user control components, rotary knobs stand out as some of the most satisfying to use. They can complement touchscreens and other input devices, as well as working well with buttons and switches. But how can you add a knob to your own DIY Arduino projects?
You have two main options: a potentiometer or a rotary encoder. These components may look similar, but the methods for using them with a device like an Arduino microcontroller board are very different. Let’s see how they compare against each other.
Potentiometers vs. Rotary Encoders
Most of the potentiometers and rotary encoders that DIY enthusiasts will encounter come in a similar form factor. They have a cuboid or cylindrical base with connector legs attached, and a round shaft that twists and has cut-outs for a cap to sit on.
Some potentiometers do look different, such as the ones that come in the form of long slides, like those found on music mixing decks. When it comes to the rotary kind, however, at first glance they look almost identical to rotary encoders, so you’d be forgiven for thinking they are the same.
What Is a Potentiometer?
A potentiometer is in essence a variable resistor. As the shaft is turned, the resistance inside the potentiometer changes, allowing a user to alter the properties of a circuit without having to rebuild it. Potentiometers can be both analog and digital, but digital potentiometers mimic analog ones and this makes them very similar to use.
Potentiometers always have a defined start and end point where the shaft can no longer be turned. Some potentiometers have a bumpy feel when turned, but many are also smooth, like those found on old stereos.
Despite being analog, potentiometers work well with microcontrollers. You can easily set up a potentiometer with a Raspberry Pi Pico or Arduino.
What Is a Rotary Encoder?
Rotary encoders determine the position of their shaft using a sensor to provide an analog or digital signal to the device they are connected to. This tells the device which position the encoder is in. Alongside the rotating shaft, rotary encoders usually also have a built-in button that is actuated by pushing the shaft downwards.
Unlike potentiometers, rotary encoders can turn without stopping, and they almost always have tactile bumps for each of the shaft’s positions. Many modern cars use rotary encoders to control their entertainment systems.
How to Use a Potentiometer With an Arduino
Thanks to their simple design, using a potentiometer with an Arduino is simple. Your potentiometer has three connectors: ground, output, and vref. The ground and vref pins connect to the GND and 5V connectors on your Arduino, respectively, while the potentiometer’s output pin connects to one of the analog inputs on your board.
Read More: Potentiometers vs. Rotary Encoders and How to Use Them With Arduino – MakeUseOf