# Adding encoders to a home built zynthian

**URL:** <https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631>\
**Category:** Building Zynthian\
**Tags:** gpio-connected-encod\
**Created:** [December 3, 2024, 11:19am UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631 "2024-12-03T11:19:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [December 3, 2024, 11:19am UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/1 "2024-12-03T11:19:02Z")

</div>

Hi everyone,

first I want to say hello to this lovely community, since I am totally new to the board and to RPi stuff in general. I managed to assemble a basic Zynthian using a RPi5 with a 8" Waveshare HDMI Touch connected to my Focusrite Scarlett 2i4 and was already able to play some music, pushing some gigabyte-ish Steinway D samples to the machine and already used it in my bands rehearsal.

Next I wanted to put everything in a nice wooden cigar box and am now in the process of ordering stuff for it. Plans are for now:

- 4 Encoders to GPIO
- replace Focusrite with Hifiberry DAC+/2 ADC and add stereo I/O Jacks

Like already mentioned, I am completely new to the topic and could need some help. You can imagine I have tons of questions already, but to not flood this forum I’ll start with the encoder subject. I promise, I already read through all threads you can find by search terms “encoder”, “GPIO”, “MCP23017” and so on.

I created this table for my own conciderations:

| Notes | BCM | WPI | Name | Pin | Pin | Name | WPI | BCM | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Evtl. + All Enc | | | **3.3v** | 1 | 2 | **5v** | | | |
| X HifiB | 2 | 8 | SDA.1 | 3 | 4 | **5v** | | | |
| X HifiB | 3 | 9 | SCL.1 | 5 | 6 | _GND 0v_ | | | _free GND_ |
| | 4 | 7 | GPIO.7 | 7 | 8 | TxD | 15 | 14 | X ZynMid |
| _free GND_ | | | GND 0v | 9 | 10 | RxD | 16 | 15 | X ZynMid |
| \* | 17 | 0 | GPIO.0 | 11 | 12 | GPIO.1 | 1 | 18 | X HifiB |
| \* | 27 | 2 | GPIO.2 | 13 | 14 | _GND 0v_ | | | _free GND_ |
| \* | 22 | 3 | GPIO.3 | 15 | 16 | GPIO.4 | 4 | 23 | \* |
| | | | **3.3v** | 17 | 18 | GPIO.5 | 5 | 24 | \* |
| | 10 | 12 | MOSI | 19 | 20 | _GND 0v_ | | | _free GND_ |
| | 9 | 13 | MISO | 21 | 22 | GPIO.6 | 6 | 25 | \* |
| | 11 | 14 | SCLK | 23 | 24 | CE0 | 10 | 8 | |
| _free GND_ | | | _GND 0v_ | 25 | 26 | CE1 | 11 | 7 | |
| | 0 | 30 | SDA.0 | 27 | 28 | SCL.0 | 31 | 1 | |
| \* | 5 | 21 | GPIO.21 | 29 | 30 | _GND 0v_ | | | _free GND_ |
| \* | 6 | 22 | GPIO.22 | 31 | 32 | GPIO.26 | 26 | 12 | \* |
| \* | 13 | 23 | GPIO.23 | 33 | 34 | _GND 0v_ | | | _free GND_ |
| X HifiB | 19 | 24 | GPIO.24 | 35 | 36 | GPIO.27 | 27 | 16 | \* |
| \* | 26 | 25 | GPIO.25 | 37 | 38 | GPIO.28 | 28 | 20 | X HifiB |
| _free GND_ | | | _GND 0v_ | 39 | 40 | GPIO.29 | 29 | 21 | X HifiB |

While reading the corresponding thread about [wiring encoders to RPi4](https://discourse.zynthian.org/t/encoders-directly-to-the-gpio-of-the-pi-4/4728) I cam across some wiring suggestions frim @wyleu . I noticed that both of them seem to use pins another post of the same thread recommends to avoid. As far as I understand from corresponding sources I should avoid Pins 3, 5, 8, 10, 12, 35, 38, 40 because of Zynthians Midi I/O and used Pins of the HifiBerry DACs. So I assume I could use the GPIOs marked with a “\*” in any order. Do I get that right?

The other question is about the oftentimes mentioned capacitors. I understood from this forum that they might be needed, or not. From what I understood, I might consider to buy 4 100nF caps and 8 10nF caps and place them between the A(CLK), B(DT) and Switch(SW) pins of the encoder and the corresponding GPIO. My question would be if I can use any type of caps, like [these](https://www.berrybase.de/keramikkondensator-100nf-50v-10-tht-2-54mm). What I also learned by reading these threads is that I might or might not unsolder a resistor on the [encoders](https://www.berrybase.de/drehregler-rotary-encoder-mit-breakoutboard) pcb.

Ok, I’ll stop myself here. Thanks in advance for your kind help already.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [December 3, 2024, 11:34am UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/2 "2024-12-03T11:34:07Z")

</div>

Hi @hannesmenzel! A warm welcome.

I would avoid using pins: 12, 13, 15, 16, 18, 22, 35, 37, 38 & 40 which are the I2S (audio interface) pins on RPi5. You may not be using all of the I2S ports if you use the HifiBerry 2 in, 2 out device but if you want more audio inputs/outputs you might want to use these pins. Of course, if you are sure you only want 2x2 and cannot find sufficient other GPIO then you will need to use these. (There are only 12 spare GPIO that will all be required for 4 encoders plus switches.)

> [@hannesmenzel](#):
>
> place them between the A(CLK), B(DT) and Switch(SW) pins of the encoder and the corresponding GPIO

No, they need to go between the encoder/switch pins and ground.

---

<div class="post-metadata">

**Author:** ![fussl](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@fussl](https://discourse.zynthian.org/u/fussl)\
**Post date:** [December 3, 2024, 11:37am UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/3 "2024-12-03T11:37:48Z")

</div>

[ZynScreen\_v1.5 schematics](https://github.com/zynthian/zynthian-hw/blob/master/ZynScreen_v1.5/ZynScreen_v1.5.sch.pdf) and [V5 control schematics](https://github.com/zynthian/zynthian-hw/tree/master/V5_control) contain everything you need to wire the encoders using an i2c-I/O chip named MCP23017. These are available on complete breakouts and provide an elegant way to connect buttons and things to Pi and you don’t get into problems with GPIO usage. Run the chip at 3.3V (!) as Pi’s GPIO are only 3.3V tolerant.  
Capacitors at ecoders and button switches are never in-series, but bypassing to ground, as sort of denoising (some call it debouncing, which it is not).  
47nF on each pin to ground are quite enough. Larger capacities will provoke flatter slew, making even more transition noise on non-schmitt-triggered inputs, then causing flase triggers.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [December 3, 2024, 11:54am UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/4 "2024-12-03T11:54:20Z")

</div>

Thank you for your fast answer. I considered the direct gpio layout since for now the 4 clickable encoders will be enough for a while. But I guess sooner or later I’ll consider the MCP anyway for some button action.

For the capacitors capacity: It was [suggested here](https://discourse.zynthian.org/t/encoders-directly-to-the-gpio-of-the-pi-4/4728/89) to use different capacity for encoders and switches. So what would you recommend?

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [December 3, 2024, 12:03pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/5 "2024-12-03T12:03:54Z")

</div>

Oh no, the table I used might be on the basis of the wrong RPi. I have to slow down a bit. I referred to the mentioned thread and the [HifiBerry GPIO documentation](https://www.hifiberry.com/docs/hardware/gpio-usage-of-hifiberry-boards/), I could have noticed the wrong numbers.

> [@riban](#):
>
> No, they need to go between the encoder/switch pins and ground.

How would a newbee get that done? Is a bread board a legit alternative. Should I solder a 100nF capacitor from the SW to the GND pin?

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [December 3, 2024, 12:22pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/6 "2024-12-03T12:22:11Z")

</div>

You should use 10nF capacitors between each pin of each encoder and ground. That is 2 capacitors per encoder.

You should use 47nF capacitors between each switch and ground. That is 1 capacitor per switch.

How you practically do this depends on what components you purchase and how you intend to mount them. You ideally want the capacitors close to the switch/encoder. If you buy raw encoders like this:  
 ![image](https://discourse.zynthian.org/uploads/default/original/2X/6/67812b06671dbe4e1e8888c3644bc9c5f0ed2ead.png)  
then you could mount these on some veroboard and put the capacitors between each pair of pins. I think this would be the simplest way to DIY this.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [December 3, 2024, 12:41pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/7 "2024-12-03T12:41:48Z")

</div>

Thanks for now! Like expected there are some considerations open. I’ll happily come back when I made some decisions.

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [December 3, 2024, 1:32pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/8 "2024-12-03T13:32:12Z")

</div>

> [@hannesmenzel](#):
>
> I managed to assemble a basic Zynthian using a RPi5 with a 8" Waveshare HDMI Touch connected to my Focusrite Scarlett 2i4 and was already able to play some music,

Well done…!!

[Course if we heard what you produced. . .](https://wiki.zynthian.org/index.php/Talk:Zynthian_Wiki_Home)

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 2:48pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/9 "2025-02-03T14:48:42Z")

</div>

Sorry, I still did not succeed with understanding what is needed to even order the parts for my plan. So if you would be so kind to help me with my considerations:

- I still struggle with understanding how to get a custom encoder wiring together with any Hifiberry audio hat, no matter if wired directly to gpio or mcp23017. For the dac+ adc: are the 40 holes below the gpio connection duplicates where I could just connect things with a 40 pin header? for the dac2 adc the additional pins seem to be reserved for the dsp header. Are these gpio duplicates as well anyway? And how do I supply power to mcp23017 when Hifiberry states that their hats use every power supply there is on a RPi (I assume I should not just solder power supplies in parallel)? Could I maybe use something like [this](https://www.berrybase.de/prototyping-hat-fuer-raspberry-pi#273a) or [this](https://www.berrybase.de/gpio-edge-erweiterung-gpio-adapter-fuer-raspberry-pi#273a)?
- I see some people mention zynthian projects custom hardware parts, like different zynaptic modules, the official mainboard or control pack which is currently available in the shop. Do these products make things easier in a custom build or are these actually intended to be used in the official kits? Also, I saw this ZynADAC open soundcard, which I could probably build myself if it weren’t me. Would that be recommended, and can it be found somewhere?
- Does anybody has a fool proof tutorial for connecting 4 switch-encoders with a mcp23017 (I know @fussl did provide the schematics, but I am not able to abstract that myself)?
- I’ll leave the question of an additional headphone out for later. There is a good tutorial for this in this discourse, but this would replace the output connectors instead of adding the headphone out to it.

Now that I am at this point I maybe should have bought the 5.1 kit from the beginning and just play music with that. 🫠

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [February 3, 2025, 3:47pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/10 "2025-02-03T15:47:34Z")

</div>

It is all a bit confusing isn’t it?

Zynthian has stages of interface and it’s not a bad idea to start with the most basic run able system.

Which is just a Raspberry Pi on it’s own.  
You can do it but it isn’t very useful in itself because it has no audio out and the SSD you have burnt will assume there is something there so it might well not boot, and you get to see Madame ORam and her error screen…

So how t avoid this well. You will always need to tell a zynthian what kind of audio device you wish to use. This could be a AtoD card attached as a Pi Hat , or it can be a USB device. indeed both can work side by side now thanks to hotplug but that isn’t the issue her. You will need to tell the zynthian which card you prefer. as you might want to switch to different devices. Either way you are going into the webconf to configure This external hardware.

 ![audio-devices](https://discourse.zynthian.org/uploads/default/original/2X/3/3379910ebd25a28898bdac8f532b219aa3c1e7c9.png)

That will at least get you to a running state and if you don’t want an audio device just to boot the zynth then select dummies.

So that’s a minimum zynth but you want to connect encoders?

Well you are into the Wiring section, with it’s bewildering list of options…

 ![wiring](https://discourse.zynthian.org/uploads/default/original/2X/5/5e5ec47c345f0115a556e9a635d3b81bb847cbd1.png)

This is where externally connected devices like encoders are connected into the zynthian system, and over the years it has become involved because there are different levels of device.

But really you will want custom which is down at the bottom.  
And the screen changes considerably…

 ![wiring-custom](https://discourse.zynthian.org/uploads/default/original/2X/d/df6664946d83a3d1c97b21dd50b5efc1bb3e69b4.png)

This is where the encoders are defined and it’s best to understand this before going any further.

The encoder pins directly connected to GPIO pins on the Raspberry Pi are defined by their BCM address.

This is zynthian-amp3.local in my world. it has encoders connected directly to the GPIO pins of the Pi & you can see the config that maps the individual pins on the encoders to the pins on the Pi…

 ![Basic-wiring zynthian-amp3.local](https://discourse.zynthian.org/uploads/default/original/2X/4/4c2d390367c37f983633c0c97e22b9e7fb0cf3d4.png)

And to prove I ain’t lying

 ![IMG_20250203_154709](https://discourse.zynthian.org/uploads/default/original/2X/9/96e052338f0a7e08c80fb8b49b33200ff643beb9.jpeg)  
 ![IMG_20250203_154651](https://discourse.zynthian.org/uploads/default/original/2X/a/a4e55f98e20a4fb7f09f2d0360c10e69335f6bba.jpeg)

**But don’t do that.**

Nowadays we are a little more sophisticated.

Custom display is very useful for showing you what is actually going on down at the low level.

For instance here is the setup for zynthian-rack6.local, A machine with a Behringer !820 connected over US & a zynaptik card ( an early one) connected with a 7" touchscreen display.

 ![wiring-custom-zynthian-rack6](https://discourse.zynthian.org/uploads/default/original/2X/8/83fcab13c51b4e40d9d3f2d293d8fac0460cf2d7.png)

Notice here we have a MC23017 board ( a zynaptik board) here and that explains the 100 range of mappings. This is how the 23017 is recognised across the device. Een thou’ it’s an i2c deice in zynthian world that simply map to a number at this level that identifies the event.

Also notice that there are 8 switch selections and only four for the encoders A & B.  
This is to allow you the extra buttons the interface developed in later life.

The higher level mappings refering to device operations I’ll leave till someone requests it.

Hopefully this gives you some idea as to how this sort of thing is implemented and configured.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 4:00pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/11 "2025-02-03T16:00:16Z")

</div>

Thanks a lot, that is a really comprehensive tutorial for the encoder wiring. Thank you for your patience and help!

My Zynthian is running already sucessfully with an external USB Interface and nothing else. What I don’t get into my head is where to connect the mcp23… expander (and the encoders to it) especially if the dac already blocks all 40 pins physically (even when it does not use some like stated on the Hifiberry page).

So I can somehow imagine how to insert an audio hat alone, and I can somehow imagine how to connect the gpio expander (well, actually not), but how to achieve both?

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [February 3, 2025, 4:06pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/12 "2025-02-03T16:06:52Z")

</div>

You are looking at stackable hats.

You might need to replace the 40 pin connector with a socket with longer pins or construct some umbilical ribbon cable.

[https://amzn.eu/d/eel30AL](https://amzn.eu/d/eel30AL)

 ![edge-connector](https://discourse.zynthian.org/uploads/default/original/2X/8/8e3c3a1247cd4abb30dbb039fe3462f43fbddf80.jpeg)

It’s a job to approach carefully if you’ve never done it before and you would need a good soldering iron, a desoldering tool, a stand or two and lots of patience.

IT’s probably the best result as you can build a rugged frame using the Pi mounting holes. Anything else requires remote located parts so you end up building two pis HAT rigs.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 4:40pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/13 "2025-02-03T16:40:27Z")

</div>

You mean the longer pins would be used to solder the encoder connection cables underneath the audio hat? Otherwise I wouldn’t understand what the longer pins are for, because the hifiberry dacs seem to have no holes to stick them through, just statically soldered pin headers.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 5:08pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/14 "2025-02-03T17:08:31Z")

</div>

I think I have to just sum up better what is my current state of consideration:

- Currently I’m successfully running zynthian with just a Pi5, Focusrite Scarlett USB interface and a 8 inch hdmi touch display.
- My goal is:
  - using a hifibery dacx adc instead and use 2 input 2 output 1/4 inch jacks
  - having 4 clickable encoders
  - having an additional headphone out (later maybe)
  - building all of that into a cigar box

What I understand for now:

- I place the dac on the 40-pin gpio header of my Pi

- I need to figure out what gpio this hat does not use, this will be usable for other stuff, like encoders

- if I consider this hat I see it is stacked onto my pi but does not expose the pins. The second row below are pins that are reserved for the hifiberry dsp unit and I do not find any information if these are maybe just copies of the gpio below.  

- So my current idea would be to exactly find out where to connect the mcp23017 and solder it on top of the hat after figuring out the unused gpios of the hifiberry. Or just find a solution where I can duplicate the number of pins, so that I dont have to solder onto the hat. Maybe this:  

- They state (besides that their hats use all of the power supply pins):

> "Do not use more than a few mA from the 3.3V line. If your circuit requires 3.3V, use the 5V power rail of the Raspberry Pi with an additional voltage regulator. Pin 27 and 28 are always reserved for an ID EEPROM on the Raspberry Pi. Independently which card you use, these pins are **always reserved** and should never be used to connect external components. […] GPIO2-3 (pins 3 and 5) are used by our products for configuration. If you are experienced with I2C, you might add other slave devices. If you a a novice, we don’t recommend this at all. GPIOs 18-21 (pins 12, 35, 38 and 40) are used for the sound interface. You can’t use them for any other purpose.

- So I’m also in doubt if even if I manage to breakout the gpios before or after the audio hat how to use it, because the expander board and even the encoders directly to gpio need power supply also.  
So thats how I am currently stuck. Right now I just think if I just buy the audio hat and stick to the touch encoders.

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [February 3, 2025, 5:39pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/15 "2025-02-03T17:39:48Z")

</div>

So you intend to build a board to house the 23017 and the encoders or the encoder connectors if you are mounting them remotely, and a headphone amp that connects to a Pi Hat stack with an audio card?

I’ve built some fairly involved edge connectors with stripboard attached to the two different sides of the edge connector. This is aided by the fact you can extract all the signals you require form one side of the edge connector for the 23017 interface. Not so sure about how you intend to do headphone amp.

I would council against not using a separate board. You will be taking this thing apart far more times than you initially believe and unless it’s fairly solidly held together you are going to spend a lot of time testing connections.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 5:55pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/16 "2025-02-03T17:55:19Z")

</div>

Though I am really a novice in these things, I do not intend to do anything special. I’ll leave the headphone out for later. Everything I try to achieve is an audio hat with inputs and outputs and the most standard way to connect these 4 encoders. From this board I see many people having done this, but it supersedes my imagination how to do that. There is already a checkout basket at my local electronic parts online supplier collecting dust because I am not able to conceptualize the basics of doing this.

---

<div class="post-metadata">

**Author:** ![wyleu](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/wyleu/32/514_2.png) [@wyleu](https://discourse.zynthian.org/u/wyleu)\
**Post date:** [February 3, 2025, 6:09pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/17 "2025-02-03T18:09:25Z")

</div>

Possibly the easiest solution.

> **[Zynaptik-3 MIDI](https://shop.zynthian.org/shop/brd-0021-1-zynaptik-3-midi-242#attr=14)**
>
> The Zynaptik-3 MIDI module integrates the 3 x standard MIDI ports only (IN/OUT/THRU). The parts for extended input/output are not soldered on, so, unless you solder the parts by hand., it can't be used as a CV-Gate interface or for connecting...

---

<div class="post-metadata">

**Author:** ![Lanfranco](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/lanfranco/32/8094_2.png) [@Lanfranco](https://discourse.zynthian.org/u/Lanfranco)\
**Post date:** [February 3, 2025, 6:48pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/18 "2025-02-03T18:48:22Z")

</div>

Hi, I used this audio card that plugs into the GPIO and has pins that come out to connect the encoders following this diagram:

 ![Immagine](https://discourse.zynthian.org/uploads/default/original/2X/6/6707ccf73d29470ef32c783abea2aaeda8d6775f.jpeg)  
 ![Immagine](https://discourse.zynthian.org/uploads/default/original/2X/0/0a7c9a9cedf9666337781e51bc53e312e9fdaca3.jpeg)

The pins that can be used for the encoders are those marked in bold.

 ![pi4j-rpi-4b-pinout-small](https://discourse.zynthian.org/uploads/default/original/2X/e/e921967b5148fd89b5d9e6be1ce91fb19b3da81e.png)

For the MIDI IN and MIDI OUT I used a board I made myself with CNC and an IC and an optocoupler.

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 8:29pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/19 "2025-02-03T20:29:08Z")

</div>

I assume this doesn’t have inputs. Ok, last attempt. Can I solder this

![Stiftleiste2x20-poligRM254gerade-57894_1920x1920](https://discourse.zynthian.org/uploads/default/original/2X/0/0c5f073b3769ae8e87f958e03604fc4e5ec04f6c.jpeg)

on top of the second array of holes of the hifiberry dac+ adc?

---

<div class="post-metadata">

**Author:** ![hannesmenzel](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/hannesmenzel/32/13014_2.png) [@hannesmenzel](https://discourse.zynthian.org/u/hannesmenzel)\
**Post date:** [February 3, 2025, 9:13pm UTC](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631/20 "2025-02-03T21:13:02Z")

</div>

Ok, I just found [this](https://support.hifiberry.com/hc/en-us/community/posts/10544489649437-DSP-expansion-header-DAC2-PRO?input_string=Connect%20other%20hardware%20to%20Dac2%20dsp%20header) in the hifiberry community.

They say the Dac2 dsp header is simply a copy of the pi gpio. Does it mean I can connect whatever switch or gpio expander to this?

[Next page](https://discourse.zynthian.org/t/adding-encoders-to-a-home-built-zynthian/10631.md?page=2)
