Rotary encoder mounting on gpio connectors

The rotary encoder II plugin installed, no problem, works fine.

I use: pin A - gpio 23 / pin B - gpio 24 and gpio 27 for the pushbutton.
the debounce time on 50.

1 Like

For me, pin A gpio 5 and pin B gpio 6 work, pushbutton gpio 27 does not work, it will not play the song. Which pin should I put the pushbutton on now?

When the pushbutton pauses, I can’t play the song again, or the web radio doesn’t respond at all, neither on the screen nor through the web browser on the computer, so I have to restart it. What can be. Did I connect the wire correctly, because the wire that is connected to the rotary encoder where it says SW, I put it on pin gpio 22.

1 Like

Hi Zoran, I have put a lot of instructions here, may give you a better idea.
There are also instructions about how to best provide the right info to get support with technical issues.

2 Likes

That’s all right, output a and output b worked on pin 5 and 6, and that’s where the Dial Function Volume down/up works. But the push button doesn’t work, and I put it on gpio 22 like in your picture in that manual. Which other pin should I connect to now, because when I followed your picture from the instructions, pins 23 and 24 did not work for the dial function.

1 Like

That depends on the setup you have. Each GPIO can only be used once. E.g. if you use a DAC, that may be using some of the GPIOS, which then can no longer be used for the rotaries.
Due to the enormous amount of possibilities, it is very difficult to say from a distance, what your particular problem may be.
The section with „debugging instructions“ gives some hints how to collect information we need to support you.
There is also some more info about how to generate and share logs here.

1 Like

By the looks of your rotary encoder it has 3 pull up resistors. one of which is probably holding the button switch high. So you’ll need to turn on “Button Logic-level active low” in the settings for it to work properly

2 Likes

Hi, thanks for the reply, it worked when I included what you said. Now, since I have those 3 pull up resistors, do I need to put some resistors or a capacitor or something similar.

1 Like

Ideally you should have current limiting resistors (~10K) in series with the gpio.
Also if you have problems with the rotary encoder not working as expected or the button double pressing a 100nF capacitor between each of the used gpio’s and ground will reduce this significantly

1 Like

Hi, if you have a diagram where to place those resistors, I would be grateful if you could post it. I’m not an electronics guy, so I don’t know where to put it, it’s my hobby.

for your rotary which already has pull up resistors on the DT CLK and SW

extra resistors for protection and capacitors for stability wire like this.

I’m going to put another rotary encoder, do I have to put the second one on other pins or can I put it on the ones where the first one is connected.

1 Like

You can only share the 3.3V and ground. The other 3 needs to have their own GPIO.
make sure you connect them to GPIO’s that are configured as IN and are low.
wiringpi-latest.zip (51.1 KB)

unzip file to /home/volumio
run sudo dpkg -i wiringpi-latest.deb

By executing gpio readall you can see how the GPIO are setup.

 +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
 |   2 |   8 |   SDA.1 | ALT0 | 1 |  3 || 4  |   |      | 5v      |     |     |
 |   3 |   9 |   SCL.1 | ALT0 | 1 |  5 || 6  |   |      | 0v      |     |     |
 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
 |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |
 |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |
 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |
 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |
 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |
 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |
 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |
 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |
 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |
 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
 +-----+-----+---------+------+---+---Pi 3B--+---+------+---------+-----+-----+

Depending on the GPIO pins used some pull up some pull down.


Clk gpio 17 brown
Dt gpio 27 yellow
Sw gpio 22. Green
Works for me with the button logic-level Low ON.

Picture of device on this link

I also have problems with the configuration, I tried everything A on gpio 23, B on 24 and button on gpio 27, volume works but the button doesn’t. then A on gpio 5 and B on 6, volume works, button 27/22 or even 17, button doesn’t work. what do I have to do to make the button work? thanks for your patience

this is how I have wired mine and is working:

I’m sorry but I’m not very practical, I think I understood that you put resistors in front, then I saw so many cables attached in other gpios that I didn’t really understand why all these cables, and I don’t understand which one is clk, dt and sw. I’m sorry, can you be a little more precise, thanks

in practice I was able to make the button work, even in other configurations I tried. now the problem is that every time I restart, the button no longer works, only the volume works, the volume always works, the button doesn’t work after every restart. do you know what the solution could be? Thank you

Only look at the cables connected to the rotary switch.
You should have a little understanding on this matter. its called DYI for a purpose :slight_smile:
image

Not every GPIO is default High or low. Some are toggling.