# Call for discussion: Encoders via GPIO and/or via USB(Microcontroller)

**URL:** <https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791>\
**Category:** Hardware\
**Created:** [June 14, 2017, 1:24pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791 "2017-06-14T13:24:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [June 14, 2017, 1:24pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/1 "2017-06-14T13:24:18Z")

</div>

Hi @ll,

I have read the topic [Encoders on MCP23017](https://discourse.zynthian.org/t/encoders-on-mcp23017/758/13). Really nice idea and very fancy. This can solve much problems with soundcards != hifiberry…

I also had much talks at Maker-Faire-Berlin last weekend about getting a Zynthian. Most people said that they would like to get a kit, but don’t want to solder any PCB (Yes - most of us know: this is not as complicated as it seems). Also they are afraid about the bunch of connections to make. Altogether it looks more complicated as it might be.

I have been thinking about solving this complexity over the last year: A year ago I tried to use the encoders via Arduino instead of using the GPIO pins of the RPi. I connected the Arduino itself via USB(-serial) to the Zynthian and implemented a small and hacky patch for the zyncoder-library. The code for getting the turn-direction of the encoder was stored in a Arduino sketch. The Arduino was only sending:

- `B1:ON\n` (Button 1 pressed)
- `B1:OFF\n` (Button 1 released)
- `B3>\n` (turning B3 on step to the right)
- `B3<\n` (turning B3 on step to the left)
- …

Yes - there is nearly the same problematic like soldering the PCBs - but the input section is more encapsulated and can be created as one module on one PCB. Only one USB cable would be necessary for connecting the whole encoder PCB to the rest. And the Raspi doesn’t need to catch interrupts from the GPIO anymore.

A slightly more enthusiastic approach would be a bidirectional protocol, which supports LCDs… or uses OSC as a (bidirectional) protocol. The absolute nicest way (for me) would be to use a preprogrammed display like a [Nextion](https://nextion.itead.cc/) (this would implicate a complete rewrite of the UI… not really realistic at the moment).

… only my thoughts. What do YOU think? Is it worth to think/talk about this? Perhaps as an addition to the current encoder usage?

Regards, Holger

---

<div class="post-metadata">

**Author:** ![mheidt](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/mheidt/32/773_2.png) [@mheidt](https://discourse.zynthian.org/u/mheidt)\
**Post date:** [June 14, 2017, 6:34pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/2 "2017-06-14T18:34:42Z")

</div>

I am in when development is needed.  
And yes, the wiring is too complex for the end user.  
If we had a board with knobs connected via USB to your computer, checking out the code, and it would work…nice.  
And if everything would work in a browser and we could navigate elements in the browser with the knobs…  
Mod-ui and webconf directly on the raspberry screen.

---

<div class="post-metadata">

**Author:** ![SrMouraSilva](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/srmourasilva/32/93_2.png) [@SrMouraSilva](https://discourse.zynthian.org/u/SrMouraSilva)\
**Post date:** [June 14, 2017, 8:39pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/3 "2017-06-14T20:39:05Z")

</div>

Hello, in my project [Pedal Pi] ([http://pedalpi.github.io](http://pedalpi.github.io)) I developed the architecture so that it was possible to add components in order to facilitate the development of new interfaces for control.

There are basically two categories of components: Open components (which basically convert the API to some protocol, such as REST or Serial) and physical components (which allows visualization and control by displays, buttons …).

* * *

At the beginning of the project, we had developed a [prototype](https://github.com/PedalPi/Android-Controller) to control the device through an android application. We use [ADB](https://developer.android.com/studio/command-line/adb.html?hl=en) to send the serial commands.

I believe that installing an application on a smartphone and connecting it to Raspberry over USB is the simplest way for end users to mount a Zynthian.

---

<div class="post-metadata">

**Author:** ![beckdac](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/beckdac/32/519_2.png) [@beckdac](https://discourse.zynthian.org/u/beckdac)\
**Post date:** [June 15, 2017, 3:05pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/4 "2017-06-15T15:05:55Z")

</div>

Just saw this on eBay. It would be stackable with a DAC and require next to 0 wiring effort.  
[http://www.ebay.com/itm/222149343386](http://www.ebay.com/itm/222149343386)

Edit: not sure if it breaks out the INT pins.

---

<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:** [June 15, 2017, 3:35pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/5 "2017-06-15T15:35:06Z")

</div>

Do we want to declare a maximum number of HAT’s we will put on a Pi ? 😨

---

<div class="post-metadata">

**Author:** ![Axeman](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/axeman/32/278_2.png) [@Axeman](https://discourse.zynthian.org/u/Axeman)\
**Post date:** [June 15, 2017, 8:15pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/6 "2017-06-15T20:15:41Z")

</div>

This is the way I do almost every user panel in my hardware projects.

Even in my home lights control system, the switches and pushbuttons handling is off-loaded to a dedicated uP, that says to the main controller “Pressed pushbutton 1, Switch 2 is on, Double clicked pushbutton 3” and so on…

---

<div class="post-metadata">

**Author:** ![Keeze101](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/keeze101/32/21_2.png) [@Keeze101](https://discourse.zynthian.org/u/Keeze101)\
**Post date:** [June 15, 2017, 11:06pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/7 "2017-06-15T23:06:41Z")

</div>

I think Teensy can handle al the IO and communicate via usb?

---

<div class="post-metadata">

**Author:** ![beckdac](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/beckdac/32/519_2.png) [@beckdac](https://discourse.zynthian.org/u/beckdac)\
**Post date:** [June 16, 2017, 3:24am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/8 "2017-06-16T03:24:39Z")

</div>

Yes, I’m using a teensy for a way more complex midi controller, but honestly for four encoders, nothing more than an MCP23017 is required.

Is the goal to simplify wiring or have more elaborate on box controls?

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [June 16, 2017, 7:29am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/9 "2017-06-16T07:29:35Z")

</div>

Thanks to all for answering and letting share their ideas!

> [@SrMouraSilva](#):
>
> I believe that installing an application on a smartphone and connecting it to Raspberry over USB is the simplest way for end users to mount a Zynthian.

Yes - this will be an option. But having to support a software on different smart-phones is absolutely out of _my_ scope 🙂 Also I am not sure if this can be really used live on stage.

> [@wyleu](#):
>
> Do we want to declare a maximum number of HAT’s we will put on a Pi ? 😨

This should not be a show-stopper. In fact you won’t really use a stack of more than two or three hats. This has side-effects to the cases - perhaps a standard case does not fit anymore. Anyway for my PiSound card the standard case will not fit due to the MIDI connectors on the board.

> [@beckdac](#):
>
> Is the goal to simplify wiring or have more elaborate on box controls?

I think simplify wiring is the way to spread Zynthian over the world. For more controllers there are several additional options (MIDI, uC/USB, …). The goal should be to have a well defined system which is **easy to build and use**. For me: Fernandos standard design with four encoders, soundcard and a display.

What I have identified in this discussion:

- Stage/live compatibility?
- Is compatibility to a case important?
- Is external hardware needed or should a smartphone/tablet (optional) be used as controller?
- Is an expansible controller system necessary or only the four /standard) encoders?
- Is the goal to simplify wiring or have more elaborate on box controls?

> [@beckdac](#):
>
> Just saw this on eBay. It would be stackable with a DAC and require next to 0 wiring effort.

The MCP23017-hat seems to be a very nice toy! But you still have to create a set of cables for the encoders and you have to solder the MIDI input opto (also if using a uC for encoder-controlling).

Will a dedicated “all-in-one” PCB the best solution? I have something like a hat in my mind. One PCB with direct soldered encoders and MCP23017 plus MIDI opto. Only one ribbon cable to the Raspi and a cable for the MIDI connector… But one “big” PCB is a limitation for some cases or displays…and how to produce this PCB (Kickstarter?) very much problems… difficult to solve…

Regards, Holger

---

<div class="post-metadata">

**Author:** ![Andy](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@Andy](https://discourse.zynthian.org/u/Andy)\
**Post date:** [June 17, 2017, 7:26am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/10 "2017-06-17T07:26:25Z")

</div>

I’m an electronics engineer and can make a board. I’d avoid the Kickstarter approach since the expectations of backers would be high. If the campaign was a success, then someone could be soldering hundreds of boards. It would be easier to publish the gerber files so people can order boards locally or from China. I haven’t looked into it, but some China manufacturers (like Seeedstudio) offer packages with component sourcing & assembly.

I think that the biggest challenge is defining what is needed. I like the idea of a single PCB with the encoders & other logic on it. But there are many Zynthian variants out there with different screen sizes so having separate encoder boards makes sense.

Making a HID class compliant USB controller is straightforward with the right Arduino (Micro?). But then the USB port would be blocked.

As Johnny Nash sang…“There Are More Questions Than Answers”

---

<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:** [June 18, 2017, 11:51am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/11 "2017-06-18T11:51:12Z")

</div>

The basic interface is built around four encoders and a flat screen, but I would suggest a lower level option.  
A pure hifiberry amp or hiberry DAC+ in a hifiberry case with an external USB driven 4 knob box, and an HDMI touch screen.  
You loose two usb connectors certainly but the only self build component is the usb connected ( & powered) knob interface box. It separates the interface from the device.

It allows me to place my hifiberry amp on the floor driving the speakers and the USB control interface a usb cable away on the mic stand with a hdmi screen somewhere, I don’t even need it to be touchscreen, loosing only xy control.

Simple, easy to transport to gigs and means you keep Ethernet, HDMI, Power connections and audio signals or speakers off the stage. but give a user an awful lot of power in a very neat contraption.

Plus we have an easy to use approach to the encoder issue that pushes hardware-software crossover into a much less core functionality. The hobbyist is more empowered.

Just thinking . . .

---

<div class="post-metadata">

**Author:** ![lod](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@lod](https://discourse.zynthian.org/u/lod)\
**Post date:** [June 18, 2017, 9:58pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/12 "2017-06-18T21:58:53Z")

</div>

@C0d3man :After reading @beckdac [topic about jack2mid](https://discourse.zynthian.org/t/jack-midi-input-using-joy2midi-not-working/799)i … maybe using a game pad like a xbox or PS controller (a standard Item many people have around anyway) as a makeshift easy to use default input device is an great idea! This might help people to get a easy first entrance into the zynthian world.

Of cause that would not be integrated into the case but as soon as someone likes the zynthian that way is open for a more serious approach.

---

<div class="post-metadata">

**Author:** ![beckdac](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/beckdac/32/519_2.png) [@beckdac](https://discourse.zynthian.org/u/beckdac)\
**Post date:** [June 18, 2017, 9:59pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/13 "2017-06-18T21:59:51Z")

</div>

Stop reading my mind! 😉

This is exactly what I was trying to figure out.

---

<div class="post-metadata">

**Author:** ![lod](https://discourse.zynthian.org/letter_avatar_proxy/v4/letter/l/a88e4f/32.png) [@lod](https://discourse.zynthian.org/u/lod)\
**Post date:** [June 18, 2017, 10:01pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/14 "2017-06-18T22:01:45Z")

</div>

Thank you @beckdac that is a genius idea of yours!

Just great!

---

<div class="post-metadata">

**Author:** ![beckdac](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/beckdac/32/519_2.png) [@beckdac](https://discourse.zynthian.org/u/beckdac)\
**Post date:** [June 18, 2017, 10:07pm UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/15 "2017-06-18T22:07:08Z")

</div>

The other bonus is that there are a bunch of bluetooth based “joy” devices which would not require any wires or power.

---

<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:** [June 19, 2017, 6:51am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/16 "2017-06-19T06:51:18Z")

</div>

Do we have a MIDI sysex code and suggested protocol for remote control via MIDI?

0xF0 xx

encode 1 left 0x00  
encoder 1 right 0x01  
encoder 1 switch 0x02

encoder 2 left 0x10  
encoder 2 right 0x11  
encoder 2 switch 0x12

encode 3 left 0x10  
encoder 3 right 0x11  
encoder 3 switch 0x12

encoder 4 left 0x10  
encoder 4 right 0x11  
encoder switch 0x12

sort of thing . . .

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [June 19, 2017, 8:30am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/17 "2017-06-19T08:30:16Z")

</div>

Hi all,

I think we have to differ the different approaches. And we should have in mind, what Zynthian should be. My personal point of view:

- a dedicated music instrument (black box - no idea of what is inside) stable and usable on stage
- easy to use and build

A game-controller might be a nice thing for controlling - but nothing for a real instrument on stage. Don’t misunderstand: I like the ideas! All ideas mentioned are really good - but IMHO as a 2nd way to control a Zynthian.

So I think there are three groups of interested users (a user might be in more than one group):

- Musicians
  - wants to use a stable instrument on stage
  - need reliable hardware (and software 😉 )
  - has money 🙂

- Maker
  - want to tweak the system
  - likes to build from scratch
  - don’t fear solder irons

- Fun-User
- likes the idea of open source synth
- won’t invest much money
- won’t solder PCBs

And we have currently the following ideas:

- Standard encoder/MIDI PCBs (as the current ones: solder by yourself)
- PCBs with preinstalled hardware (e.g. Seeedstudio) and connection via USB
  - uC based (Arduino, Teensy)
    - MIDI compatible (sysex)
    - OSC compatible
    - own protocol

- Game-controller (PS, XBox, “BT”)

So there should be three ways for building a Zynthian:

1. Standard controller for Makers
2. Easy controllers (Game controller) for Fun-Users
3. Prebuild controllers (uC) for Musicians

For 2.) “only” programming is needed. For 3.) a hardwaredesign and programming is needed.

Ok - stopping here to give time for disassemble my ideas 🙂

Regards, Holger

---

<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:** [June 19, 2017, 9:37am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/18 "2017-06-19T09:37:32Z")

</div>

I think you have missed a group of users.  
Roadies or Keyboard Assistants, Assistant Stage Managers, Mixing Engineers … all kinds of names  
basically people who are not performing but are technically adept enough to install and operate stage related equipment . . .

Roadies  
wants to use a stable equipment on and off stage  
need reliable hardware (and software 😉 )  
has No money 🙂  
don’t fear solder irons

These people can often be found building the stage kit, mixing the pa, providing foldback mix, panicking on talkback, loading up samples and patches for on-stage musicians, stripping it all down and humping it out at the end of the night…  
They are REAL experts on connectors…

They are the real users of swiss army knifes , ( and gaffa tape…)

ON their behalf I would ruthlessly reduce the numbers of cables on stage in any system and beef up the connectors to something you could take on military maneuvers .

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [June 19, 2017, 11:31am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/19 "2017-06-19T11:31:10Z")

</div>

> [@wyleu](#):
>
> Roadies  
> wants to use a stable equipment on and off stage  
> need reliable hardware (and software 😉 )  
> has No money 🙂  
> don’t fear solder irons

==\> More or less also makers 😉 perhaps they drink more beer 😂

---

<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:** [June 19, 2017, 11:50am UTC](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791/20 "2017-06-19T11:50:00Z")

</div>

It’s the ruggedising that probably differentiates the two:  
A Maker knows the idiosyncrasies of their own kit but may not understand the implications of stage use, thank god the Internet never got a picture of the first synth I built 😨  
The first time I plugged it in on stage it took out the Residual Current Device simply because they were a fairly rare device back then (1979) Earth/Neutral Short, and I knew no better.

I also witnessed an early testing of a drum synth, nice electronics but it lasted about two minutes with a fairly light fingered drummer cos all the mountings were anchored in plastic …

Sorry to bore with nostalgia, but a roadie will point you at use cases that often the musician doesn’t really appreciate.  
I still see people turning up at open mic nights with kit in the original cardboard boxes, and wonder why after a couple of wire trips wonder why the input jacks crackle, and who are surprised by quite where the final volume control should be. . .  
Also Stage Assistants tend to be the people who play in the effects, click tracks, backing tracks and set up the patches for theatrical performances and I see the zynthian as eminently suitable for that kind of use.

Sound effects for stage performance become so easy with fluidsynth for instance.

I will shut up now . . .

[Next page](https://discourse.zynthian.org/t/call-for-discussion-encoders-via-gpio-and-or-via-usb-microcontroller/791.md?page=2)
