Posts: 1
Joined: Sat Jun 01, 2013 5:49 am

Reading input from a dial

Sat Jun 01, 2013 6:02 am

I think this would be the right sub-forum to ask this question on.

I don't yet have a raspberry pi, but am looking to get one assuming I can find sufficient answers for this.
I'm looking to create a device that takes input from 3 buttons, and 2 dials. I know the device supports button input, because I've seen a few good tutorials about button inputs using python libraries. So that isn't the problem. The thing I'm having difficulty finding information on are the dials.

I'm looking to use two dials in two separate ways. One is to be read at a stationary position at all times (for example, if the dial is on '7', the device knows that this input is 7. Almost like a volume knob)
The other way I want to use one dial is as a scroll-wheel. Basically, each time it makes a change (scroll up/down) it would recognize that action.

I'm sure a device like the Raspberry Pi has such capability, I just can't find any information on how to read said inputs into the device -- and I don't want to get one until I'm sure it can be done.
Would anyone know either of a great tutorial of how to connect them/use them in this manner, or perhaps be able to explain how to (if it's simple here)?

I apologize if this has already been asked somewhere here, every time I search "dial" in Google, it almost always assumes I'm referring to dial-up modems.

Thanks to all who take the time to answer!

P.S. If anyone knows of a good place to purchase said peripherals, that would be great too :P

User avatar
Forum Moderator
Forum Moderator
Posts: 5466
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Reading input from a dial

Sun Jun 02, 2013 8:13 pm

Something like this: ... ry-encoder with a suitable "knob" might become your dial. Also try searching for "BCD encoded switches" or similar (BCD --> Binary Encoded Decimal) - the "interface" for the latter could be similar to that for "push-buttons" (one for each "bit" of BCD).
HTH, Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See:

Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Reading input from a dial

Mon Jun 03, 2013 8:43 pm

Look up rotary encoders as many can be continuously rotated for your scroll wheel.

Many other forms exist as well

Here's a start ... allpartial
Just another techie on the net - For GPIO boards see http:///

User avatar
Posts: 687
Joined: Sat Jun 01, 2013 12:11 am
Location: Central MN, USA
Contact: Website

Re: Reading input from a dial

Wed Jun 05, 2013 1:27 pm

For the position sensitivity, if you want a more or less continuous change instead of say 10 fixed positions, I would recommend a potentiometer. You need an analog-to-digital converter to read its position. For the up/down dial you need a rotary encoder as recommended already. You need two digital input pins to sense one rotary encoder. If you can stand the position sensitive dial to always reset to a fixed position (or load the last known position) after power cycle then you can also use rotary encoder for it. PI will be able to remember its position as long as it is powered on. If you dial it while the pi is powered off, it wont do anything.

BTW, I found this useful from another tech forum: post your location. If you want to purchase parts, people in your country or area can give you more specific recommendations. You don't want to buy something across the ocean just because someone from that side made a good recommendation ;)
Arduino data loggers, user interface, printed circuit board designer since 2009, RPI 3B 2B 2B Zero Jessie, assembly/C/C++/java/python programmer since the 80's

Return to “HATs and other add-ons”