Rotary encoder mounting on gpio connectors

Hello, I have a question about the Rotary encoder.
I have a rotary encoder like this, I don’t know which manufacturer and which model it is, so I’m interested in whether I have to put a resistor or something similar when I connect it to the raspberry pi 4, and if anyone has an idea how to connect it all to the gpio connectors. I will put two rotary encoders, one will be for amplifying the sound and the other for play/pause and switching songs.



I use 3.3 volts.

I connect the wires as in this picture.

The plugin is installed and I set it up as in the picture and it gives me an error.
Screenshot_16


I use periods per Tick 1/1 for a rotary encoder KY-040.

1 Like

And when I put 1/1 periods per Tick, it doesn’t work, it won’t increase the volume. And when I press the pushbutton, it pauses the song for a few seconds and plays the song again, so I don’t know what it could be. I did not put any resistors, but direct wires from the rotary encoder to the gpio pins.


try GPIO 5 and 6 for A and B

1 Like

I am currently flashing a new volumio image, I will let you know if I also encounter this problem.

1 Like

I’ll try to change the pins to 5 and 6. And I’m thinking of putting another rotary encoder, so that the second one is for transferring songs to the pushbutton, maybe I’d set it to restart. are there new pins for that second one?

Thank you.

1 Like

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.