What's the easiest way for encoders?

Hi @le51!

Would you provide a detailed scheme of the suggested implementation?
That might mean the succesful ending of my Zynthian project!
Best regards,

1 Like

WOW!! Thank you so much @le51!!
Now only need to interpret it correctly. Anyway, I think I will need a helping hand near me :grinning:

1 Like

Good luck :wink:

Now I have no excuse, it has to be done. I use those bad encoder modules wired directly to GPIOs for years, but I can use only the rotary encoders, not the switches, you know why… I already bought all the parts to build the correct wiring with MCP23017, but I couldn’t find an exact scheme like this. Thank you very much!

One question: why do you use capacitors with the S_1-S_4 switches, but not with the S_5-S_8 switches?

Hi again @le51 !
Yesterday, and after receiving the attached pcb

I put my hands on over the project one more time.
Initially I could locate easily the wire controls A_1 to A_4 and B_1 to B_4 correspondence, however I´m confused when it comes to 5_1 to 5_8. I cannot see them, nor in my pcb nor in your scheme.
May this be a kind of convention beyond my knowledge?

Moreover, when you correlate GPB0-1-108, GBP1-2-109, GPB2-3-110, and say “labelled 100 to 115” I cannot understand where those numbers (100 to 115) arise.

Finally, I have found “zynthian_allinone.sch.pdf” (attached at the end) in which I can find an easy correspondence among encoders and buttons wiring with MCP23017, so: is this a valid guide to apply on your scheme?

If yes, when you speak of encoders –A,C,B,S1,S2– parts, such scheme speaks of –1GND, 2, 3, 4–. Probably for all of you that are engineers is a minor detail but for me is a nightmare :upside_down_face: :rofl:

Best regards

zynthian_allinone.sch.pdf (51.4 KB)

Hi @erasmo

S_1 to S_4 are encoder’s switches

while S_5 to S_8 are for push buttons.

In fact you can bridge any of A_x, B_x, S_x pin to any GPAx or GPBx pin because you can configure the wiring through Webconf with the numbers labelled 100 to 115 in the schematic.

Yes you can allocate the pins anyway you wish using the mechanism in webconf. But do make very careful notes about what you do connect to what and at the very least grab a screenshot of the webconf display and keep it in an easily accessible place. It is amazing how quickly you forget these details once it works and you will find yourself scrabbling around for the details when you come to reconfigure things… Some disreputable characters have even been known to post screenshot of the settings on this very board along side machine names to provide easily accessed backups whilst maliciously claiming such images are really for the overall community good.

Copy one of the official mappings if you can.

Thank you very much for your fast response @le51 !

You have clarified the panorama in front of me, specially the webconf part.
I was in trouble because of a little bit pixelating scheme, where I was reading S (letter) instead of 5 (number) or viceversa.

Please tell me if I understood in a proper way: I can connect so the encoders as the buttons in the MCP23017 GPIO positions that I want, but, observing the correspondence with 100 to 115 numbers of webconf. Is it so?

Thank you so much @wyleu !
I will observe carefully your insights and, definitely, will start copying one of the official mappings.

Excellent advice from @wyleu.

I would add

  • For clarity use different wire colors, one for A pins, one for B pins, one for S pins and one for ground pins.
  • Invest in a cheap multimeter to check if you did not create some shorts circuits during soldering.

Yes. Imagine you’ve wired pin A of controller 3 to PA2 => in webconf, for Encoder B GPIO’s config : X,Y,102,Z where X,Y,Z are B pins config for controllers 1,2,4

Thanks a lot @le51
I´ll give you more info on the progress :wink:

Hi @le51 !

I made some progress as you can see in the attached images (1-3).
All the wire controls from A_1 to A_4; B_1 to B-4 and S_1 to S_4, are connected as the diagram (3) shows, inspired on zynthian–allinone.sch.pdf .

But now I am facing a new issue: please, observe the “default config detail” (picture 4). In your scheme it seems that a connection to GND must be done, but, as after reaching the A2, A1 and A0 pins on pcb, I can see two column options: GND and VCC for A2, A1 and A0.
I am not aware how this has to be done, given that GND is actually bridged by an SMD component (don´t know if resistor or capacitor), so not very sure if I have to connect the bare pins under the VCC column and connect all 3, to ground as suggested.

Excuse me for asking what may be dumb questions, but my electronic baggage of knowledge is tiny compared with my music passion that is large :wink:

Hi @erasmo these 3 resistors are for configuring the I2C address of the MCP23017 device. As is, on your board, they are placed for bridging rhe 3 A0 A1 A2 pins to rhe ground wich is the default config for Zynthian.

So … you are Ready To go :wink:

That´s fantastic! Thank you @le51!
Your answer confirms me another supposition I was guessing, but as I told you, lots and lots of doubts were riding at my side in the process :sweat_smile:

The 3 resistors are marked 0 (OHM), they act as wire bridge To the ground.

Good luck and don’t Forget To continue in Success cases

Of course @le51. I will do as soon the project is finished.
By the way, this morning finally got all buttons and encoders working. Great moment!

All the evening was entirely used to make mechanical adjustments over the enclosure: sanding, drilling, cutting…

A bit work still remains to reach to the end, but, IS WORKING :grinning: :grinning: !!


Hi @le51 ,

Though, almost a month ago, I got my project working, until now I have not been able to finish it properly.
I have had several troubles trying to mount everything into the selected case. Lots of cables fighting among themselves in such a tiny space, forced me to re-route some of them and widen the space. By now almost finished…

On the other hand, a really annoying issue was detected in the very first moment: though all the buttons and encoders worked fine –I was able to assign them to my liking– the screen tactile was lost.
I ´ve been making all kind of connections, so in audio; display and wiring assignments, with no luck until TODAY, when I discovered a strange issue. My screen is a 7" hdmi* with micro hdmi + USB. If when ZYNTHIAN starts (please find attached screenshot of config.) I disconnect the USB screen connector that goes to raspberry, and connect it on again, the tactile comes to life!

I´m not aware of this but, may be due to a code routine of ZYNTHIAN OS that when adding encoders and buttons these get a kind of “primacy” putting USB feed on second place, or something else?
Can you advise any solution?
Best regards,

*my screen can be found here:

Hi @erasmo ,

Yes I’ve notices that too, but I didn’t investigate further.

Hi @le51!

Thank you for answering so quickly as usual :wink:
I have seen the thread you linked and must to comment that some days ago I read (I think was in a raspberry thread) that under certain circumstances the screen USB driver had to be updated to make it tactile again.

I will investigate deeply. If get a solution I will post it.
Best regards,