Project: Midi instrument with velocity

Hi there,

I’m working on midi keyboard wit the shape of a bandoneon.
All the design are free to use GitHub - piwicode/bandoneon: DIY physical midi instrument with keyboard velocity

I tried multiple software (Fritzing, EasyEDA, Eagle) and KiCad has the best experience because it is both powerful and convenient to use.

I would like to share with you the current state of the design. This is my first PCB board, and I’m looking for feedback on schematics and mostly on the PCB. More eyes see more. If you want to share something, try to provide explanation, a link some documentation or calculation so that I can ramp up.

Here we go:

  • The instrument has 71 keys
  • I want to measure velocity and avoid manufacturing pushbuttons, hence I use magnetic keyboard push buttons
  • The position is measured by 71 hall effect sensor SS39ET
  • The analog signal is converted by 9 MCP 3008
  • I use an Adafruit Feather M4 to bitbang 9 SPI buses in parallel
  • The bus frequency is 2 Mhz the voltage is 3.3V.

The PCB uses 2 layers. Maybe that is a mistake, but I would like to use 2 layers if this can works

I put ground fill on two faces: the one on the back is for return current, the one on the front is to avoid wrapping.

I have no idea of what I’m doing with regard to return current, crosstalk and track size. Please let me know if you know more.

The project files are here https://github.com/piwicode/bandoneon/tree/main/boards/bandoneon
Let me know if there is a convenient way to export the project for online preview.

Edit: Here is a link to the pcb in an online viewer.

Thank you to everyone who take a look.

I’m not GitHub user (have no time to search for anything there). I think that for this forum the whole project is out of topic, but KiCad designed PCBs you want to get feedback opinion of course are within the topic of the forum.
You can put zipped KiCad project by dragging it onto your post. Probably some users will open it and comment, but for me the screenshots are better because I’m writing from Win7 PC and KiCad since V6 needs at least Win 10 so I don’t have it here. But you need not to worry about me.

I think it’s fine according to the description of the category.

1 Like

I found an amazing online viewer named kicanvas.org.
Yet again another example of how KiCad ecosystem can make collaboration easy.

Just click that link to view my PCB:

https://kicanvas.org/?github=https%3A%2F%2Fgithub.com%2Fpiwicode%2Fbandoneon%2Ftree%2Fmain%2Fboards%2Fbandoneon

Just to elaborate a bit further, I use KiCad Step export and DXF import to exchange data between KiCad and Fusion360. Here is a link to the design.

You should add a decoupling capacitor next to each sensor.
100nF in 0603 package should do it.

for the decoupling of the ADC, I personally I would put a 10uf (in 0805) and a 100nF for the decoupling.

I would also add decoupling cap next to the potentiometter (100nF), but here it’s probably not needed.

also put at least 10uF next to the the joystick plug.

I would also put some ESD protection. I usually use the SRV05-4. But it’s designed for 5V. It will still protect a 3.3V circuit but the protection is not as good. And of course, each needs a decoupling cap (100nF).
I would protect first every single line that goes to a connector (not the power supply line, but the others).
I would also protect every long line.
It’s very cheap, and if you get the board made by someone like JLCPCB it cost almost nothing.

I’m guessing that the feather M4 is connected via USB and it’s poviding the power supply to the board.

Only had a chance to take a brief look but to it looks great and I can see a lot of work has gone into it :smiley: Looks like the buttons on a Accordion ! I must check out Kicanvas.org more closely…Cheers.
:mouse:

Bertrand, Mousey, thank you for taking a look.

Bertrand, how did you choose to add decoupling capacitors to the sensors, and how did you pick the value? I’m willing to learn.

It’s common values that we use all the time.
100nF for fast decoupling close to the device.
10uF for a slower decoupling that could be a bit further.
With those 2 you can cover the need for electronics connected to a microcontroller, so up to a few MHz.
At higher frequency, it become a lot more complex, but that is another story.

The rule of thumb is that a 100nF is working for a distance of around 3cm. So basically you need one decoupling cap for each device. And if a device has more than one pair of supply pin, you are supposed to put a decoupling cap at each power supply pin pair.

I also tend to put a bigger caps (10uF), next to a plug that is sending power away to something else. lower value are no use because of the distance created by the cable.

And you also need bigger caps around a power supply, but in your case the supply is provided by the MCU board.

After you may need something bigger if your board have some motors, but it’s not your case.

Finaly about ESD protection, if you have the board soldered by a fab house, it does not cost much, and it make the board a lot thougher. Well, my board are running in an environnement where I do have a lot of ESD created, so I must have them. So no the easiest is to put protection on each 5V line, and not really think too much about it.

In your case, the board will be touched by a human, so you can have some ESD discharge. That why I would put some protection on the board.

The decoupling caps have 2 roles.
first decoupling : providing current for fast switching event. ensuring that the voltage of the power supply remain stable.
Without those, the supply voltage will drop for a small aount of time, and it can create various issue. With you sensor that would be a bad measurement.
With your ADC that could be a communication error.

Second, it’s also a protection again electrostatic discharge (ESD), if you touch the board and you have walked on carpet before. The static electricity will reach your device. It will go through the protection diode of the device toward the power supply. Or it will go trough the bigger ESD protection diode if you have put some.
There if there are some fast acting decoupling cap, the electricity will be stored by the caps, and the voltage will remain clamped.
Without the caps, the energy will only be stored in parasitic caps, and the voltage will increase a lot, and it can kill your device.

Thank you Bernard! I already added ESD, and I will add more caps.