Encoders made EASY?

Yes. Set to dummies the raspi worked alright again.

I did some changes copying other configurations I found from you. Specifically one, in which you suggested the A and B configs recommended, but setting all switches to 0.
Gave red error too.

May I have “burnt” an encoder with an improper hot application?
The first one I soldered with a more powerful iron, but last three changed to a soldering iron less powerful.

I doubt it, it’s all about 0v so you arent passing currents of any large size.

I found that guessing and trying does’t really help because the encoders require both pins to be connected for the software to make any sense out of it all.
The best approach I found was to use the switches to get it sorted out using the Back & select switches because these have the most useful effect…

Work out which pins these are on and follow the rather confusing route to work out which configs you need to put in the wiring sections.
Once you have the four switches worked out then proceed to the select encoder and connect hat up and select the correct values for your configuration.

That will prove one encoder ( the select) and once you have done that it’s just a matter of being methodical to sort out the others.

A parameter page is good because that does nothing other than use the encoders to move values on the screen rather than elements like menus, and it will allow you to see if you have the encoder pins the right way round.

Try to work out the relation between the GPIO pins & the pin from the chart.

Many thanks @wyleu!
I´ll try it.

Good luck. It’s just logical.

Do you have a multimeter and could you show pictures?,
Don’t worry how ‘creative’ the construction is, it’s all part of the process.
Do you intend to add the s1-s4 switches to your rig?

This zynth does good work most days…

1 Like

Hi @wyleu!

Thank you for your recommendations. I must try it.

As I am going deep in Zynthian project, my doubts, fears, and electronic limitations have started to vanishing after reading, and reading, and more reading, subjects about the topic; Raspi and arduino. Is a fascinating world in which, many dreams I ever had as piano player, come to life.

For today, I have this idea in mind : toast a fresh Zynthian OS in the card and try again.
Yesterday I experienced some difficulties when playing some minutes with my Zynthian “project”.
In a given moment, the sound started to play as if in stacatto mode. I believe that was a some kind of cc message interaction of my keyboard, after changing an instrument. That behaviour did not make any improvement after resetting and rebooting Zynthian several times.
Only got terminating the issue, after resetting my keyboard. From that moment, Zynthian started to perform well again. Strange.

Answering to your question: Yes. I have a multimeter. What kind of pictures/reading should I take to advance?
Probably it would be interesting adding switches but you know, encoders not working yet…, I see switches as an added difficulty :joy:
Also I had thought adding a general potentiometer volume :joy: :joy:

I will inform you of my advances.

Start with a picture of the device as it’s seen from the performers perspective. That way we can see what you have as your interface.

Then photgraph the back of the device, so we an see how the various controls presented to the performer, are connected to the Pi that’s doing stuff.

Then present individual details showing how individual components are implemented. Encoders edge connectors that sort of stuff.

It provides excellent context that descriptions often ignore.

Adding Switches: Put a little thought into it.
It costs nothing other than time.

Where would you place them on your hardware interface? What would you want them to do? how would you connect them to the Pi? Actually it’s a moot point because I dont think we actually support GPIO pin use of s1-s4 switches, they are only an option on i2c connected zynths( someone will confirm implement, or deny this…)

When the machine was staccato’ing did the red panic icon appear?

IT’s probably a good idea to read up the wikipedia page on rotary encoders, or incremental encoders as they should, probably, be more properly called.

First couple of paragraphs gives the idea. You can check they are working with a multimeter measuring continuity ( the friendly buzz mode…). Connect across the two pin, not the centre one and rotate the shaft, you willl hear a clicking of buzzes as you turn.

The great thing is this doesn’t just work at the encoder pins. It works all the way back on wires, so you can check it’s working, by disconnecting any connectors from the Pi & checking the connection makes it round that loop. It’s easier to do than describe…!

PAtience and understanding are the secret, and as soon as you get it right, you will forget it all as you just assume it works until something goes wrong, so make copious notes, so you don’t have to work it all out again, and take pictures they also can sve you many hours of head scratching.

1 Like

Hy @wyleu!

Here I start with some pictures of my setup (calling device to my cable mumble-jumble it should be a bit pretentious):

But, well, that so simple configuration, is working!
Now, I´ll show you my encoders direct gpio cable process:

As you can see, I first labelled each cable one by one, testing continuity with the multimeter; then I soldered carefully (so much carefully at the extent of my possibilities as you can guess) and started to test, maintaining non used cables isolated, but ready for later use.

The supposed wiring that should work it doesn´t. Is giving RED ERROR all the time
By the way, when yesterday I faced the stacatto issue did not get a RED ERROR in any moment, obviously with gpio cable disconnected.

Today I burnt a fresh Zynthian OS, and tried again. The same result: RED ERROR.
Even I tried putting -zero- on encoder pins A & B for trying only switches. I got some random results, but only on switch LS, which worked sometimes when clicking on.

I must say than before, I tested the 4 encoders with multimeter as your recommendation, and it all seemed to work fine, buzzing when rotating clockwise with contacts on outer pins. I could then aware that to get sounding when in counter clockwise, I had to change to the other pin :wink:

Now I will show some pics of my design. I will start explaining why I got a PI 400. Basically for a question of thermal performance. I read in several webs that PI 400 did not need any kind of cooling, which was great to avoid noise.
So I began with Zynthian OS on it. After my first impressions, really positive, I decided to give it an enclosure. I found an interesting option, precisely with a PC fan cooler, as showed in next pic

I bought a second hand -and only 4 bucks- AKASA fan cooler. Made of black solid aluminum. In the 3/4 view, you can see a kind of box below. That box it has enough room to allocate the PI 400 + cables. On the rear only 2 USB3 connectors. I want to make all connections needed inside the box(screen; encoders, and so on) letting only power supply connector and USB out to connect keyboard & audio card. Simple.

I have to cut a rectangle for screen (which need to be fitted somehow to aluminum) and 5 holes for encoders + a volume button. Perhaps a tiny hole for a LED working , when device is on, though not decided yet.

Now I will show the initial facing ideas to implement design over AKASA

The left shows a design with minor alterations of the surface itself. I like it but is some bulky: 30x30 cm. The second option 30x16 cm is a cut down, cleaning all the aluminum out the inner box to reduce the size. Over the top, a plastic bi-color BLACK/WHITE with laser engraved texts, will occult all the cuttings while giving a neat aspect.

After talking with @riban about if encoders should be placed left or right for right or left handed people, I came to the conclusion than top was the optimal position for any kind of user. So I placed them over.

To end this “large speech” when you asked me about switches, I have to say that initially I didn´t think in them, because could not find an implementation GPIO direct. But, as I told you before, I am reading interesting topics so in raspberry as in arduino and cannot discard anything.

The only important thing to me now, is get working the 4 encoders of apocalypse… :scream: :joy:

How do you find the Pi400?

Where are you going to mount the encoders?

I have tried to trace your wiring from the picture. I only checked the first encoder you have labelled “CH” with the blue sleeve. It appears this is connected:

RPi Pin RPI Use Colour Encoder Pin
6 GND Blue SW
8 GPIO 14 / Tx D0 Slate DT
10 GPIO 15 / Rx D0 Black GND
12 GPIO 18 Red CLK

This looks wrong:

  • Pin 6 should be connected to encoder GND
  • GPIO 14 & 15 are used by Zynthian for its hardware MIDI port

Hi @riban!

Thank you very much, but I cannot understand your reasoning.
I used the next table as indicated upon


Based on the table nomenclature, I did this wiring over CH encoder:

23 CH Switch SW Purple
24 CH Right A DT Gray
25 CH Gnd C GND Black
26 CH Left CLK Red

Is not correct?

What @riban tells you is that you wired the CH encoder like this


Which, as he stated is not the way… For example your black wire is not GND, but Pin 10, which is RxD

Ha! They won’t align with any of the UI which can be configured to place it’s controls on both sides of the screen or just one side.

Hi @Keeze101!

I appreciate your explanation but I still don’t understand. Please take a look at this:

This was my guide to wiring all.
I identified every pin on GPIO properly, so I cannot figure why are you indicating 8,10,11,12 gpio pins instead of 23,24,25,26 that are which I soldered.
Sorry but I do not see the relation. At the same time, I am pretty happy to have connected it wrong, so I have the possibility to make it work, but, please I need to SEE IT

Hi @riban!

Yes I supposed that. But, initially, it doesn´t matter for me have the pots in a row and the controls over 1 or 2 columns not aligned at all. I suppose that will not represent a big problem getting used to such correspondence.
Well, if finally is uncomfortable, I will change them.
Right? Left? I will delay my decision until the last minute! :rofl:

Tomorrow I will record a video showing the pin correspondence

Looking to your foto of the connector, it seems that you numbered sequentialy on both sides. eg 1-20 on one side and 21 to 40 on the other side. But the connector is odd 1-39 on one side and even 2-40 on the other side… ?

Ouch! I din´t know that!
I guessed 1-20 and 21-40.
Moreover, reading the graphic I used, I could not figure out such thing.
Thank you very much.
In my whole life I had never did such assumption.
Big mistake. Big learning.
A long trail to discover about raspberry yet…

Start with the multimeter to identify the pins on the connector that are joined to ov. With the pi off buzz from exposed metal work to the pins and gnd or zero on the pins and match that up against the pin out of the gpio connector.

Then set the multimeter to voltage and after turning on the pi identify the 3.3v & 5v pins. Be careful not to short these out as you do so, that can damage the pi especially the 3.3v line.

Once you have done this you know which pins are which so you can check the ends of your ribbon cable to ensure these voltages are present at the end of your connector wires.
This will help you ensure which gpio pin is which.