Inductive Sensors MIDI Keyboard

Status
Not open for further replies.

osor_io

New member
Hey all! :eek:

I've had this idea for a while to try to make a 25-key MIDI keyboard based on Inductive Sensors. The rough idea is to lay out a coil per key to make an inductor, and hook that up to an Inductance-To-Digital converter. Then just read those values into a Teensy LC and spit some MIDI out :) The cool thing would then be to map out in software how strong you're pressing the key to vary the MIDI notes sent out the device. A good example would be to hook it up to the volume so you have decent dynamic range when playing and can go as quiet/loud by just pressing soft/hard. Here you have the worst drawing you'll ever see:

idea.png

This is really my first "real" PCB and project like this. I've made PCBs for the Teensy before but pretty much just as "project specific breakout boards" that didn't involve much or any electronics. So please let me know if something looks off or wrong. It's very likely that I missed obvious things.

How it's supposed to work
The setup would have the main PCB (with the teensy and the coils in it) on the bottom, then a spacer PCB in the middle that has no copper, just holes where each of the keys would be. On top of that there will be an aluminium sheet. The idea is that when you press the aluminium that is floating on top of a coil (because of the hole), the metal should bend very slightly, which is enough for the coil and the sensor to pick it up and convert it to a digital signal, like this:

touch_on_metal_idea.png

For a way better explanation check out this document from Texas Instruments (https://www.ti.com/lit/an/snoa951/snoa951.pdf). In Figure 10 you can see a very similar setup to what I'm trying to achieve.

A general explanation of Inductive Sensing also in this video: https://www.youtube.com/watch?v=cnNDUyTttrM

Schematic
I'm attaching the current schematic I made in KiCad to this post. The gist of it is a USB-A connector that goes into an ESD protection chip, then the +5V goes into a regulator to get +3.3V to power up the LDC Converters (Inductance-To-Digital converters) and their oscillators. Each of the LDC chips connects to some of the coils, trying to keep the distance between the chips and the coils as short as possible.

There's the Teensy LC, that I was going to just power by connecting the +5V from the USB cable to VUSB. Also obviously connected to the USB Data lines.

And from the Teensy, one set of the SCL/SDA pins will go to a I2C multiplexer that then will connect to the 8 LDC sensors spread on the board.

Please see the attached View attachment schematic.pdf file.

Layout
I laid out the coils on the PCB using KiCad with some custom code I wrote to generate the coils (since I'd have to do them by hand otherwise with small segments). Here you can see my rough sketch of how I think I'd put everything together.

rough_layout.jpg

The PCB is 40x10cm. In the center I'd like to mount the Teensy, I2C multiplexer, USB-A female terminal and the Voltage Regulator, hopefully making everything fit.

Then from the multiplexer, the red lines show where I was thinking I could route the traces to get to the 8 LDC chips, and then finally each chip has a trace to the inductance coils. These are recommended to keep as short as possible so that's why I'm trying to move the LDC chips close to the cluster of coils they'll manage.

Questions/Worries
As I mentioned above, this is my first time setting up a design like this, so anything that looks off please let me know. I'll also happily take any advice on pretty much anything related to this :D Some more specific questions I had were:

  • Can I power the Teensy LC with the +5V from USB like I'm doing in the schematic, pretty much directly out of the terminal, into the ESD protection chip, then into VUSB? I struggled to figure out if the way I'm trying to do the power delivery made sense.
  • Would the "long" traces from the multiplexer to the LDC chips be a problem? I checked some pages to calculate the pull-up resistor values and it seemed to look fine but I'm not sure.
  • Because of the placement of the keyboard keys, I'm having to do some wiring in the middle of the inductance coils, do you think this could be a problem?
  • I tried to do all the research I could on the values for pull-up resistors, bypass capacitors, etc. But I'm not 100% sure everything is correctly put together.
  • For pull-up resistors, where would you physically put them? Close to the output of the multiplexer or close to the LDC chip?
  • I've seen people mention to put a resistor on the output of the oscillators to dampen ringing, is this necessary?

Thank you all for your time and help! And sorry if this is a longer post than normal.

I've found this forum incredibly helpful before and I hope to learn more and become one of the people helping out here in the future :eek:

Cheers!
 
- The teensy lc is designed to be plugged straight into the usb, so J1 and U2 are a bit redundant. You should also crunch the numbers on how much 3v3 current you need, as while the regulator will supply up to 800mA, the USB you plug into might not.
- "Long" is incredibly varible in terms of electronics. Long to an I2C bus is in the order of meters, so accross this PCB is unlikely be a problem. Keep your data lines as far away from your sensitive analog bits as possible.
- Pullup resistors and bypass capacitors look all sensible to me, though 100uf for the 3v3 line seems a bit generous, I'd probably use another 10u.
- There's probably an answer somewhere in the i2c standard as to where the pullups go, but honestly I'd put them wherever's convenient.
- If the oscilator datasheet asks for one, then place it. Or if in doubt, place a zero Ohm resistor so you can add one later.

I'd thoroughly recommend you mock a single key up and test it out. Once you've got that working you should find getting the board together much easier.
 
Thanks Edward! That has been really helpful :)

- You're right that J1 and U2 are redundant, it's pretty much only there cause I wanted to have a USB-A terminal in the PCB I'll mount this on, but I probably could just have the terminal and connect that directly into the Teensy.
- I kept researching about the "long" traces after the post, plus your notes, I think that those I2C traces should be fine, thanks!
- I'll look into the value of the 3v3 line capacitor, thanks!
- I might try to dig into the I2C standard for the pullups, in any case, when I lay out the board I'll see where it's easier to put them and also probably just leave them there.
- The oscillator didn't seem to ask for anything on the output, but the datasheet wasn't super informative or complete. Placing the 0 Ohm resistor is a good idea :)

It's true that mocking up a single key is a good way to go. I was planning on doing that then got spoiled by how cheap making PCBs seems to be, the difference between setting up a bare board with one key and with all of them seemed pretty small, delivery being most of the cost. Although it might be just better to do it anyway as you say.

Thanks again!

Cheers!
 
Yeah you can drop in the USB port you like, and then just connect it up directly to the teensy. The micro USB on the teensys is a little delicate IMO, so actually using a beefier option is a good shout.

You're not wrong actually, perhaps the right move is to get a full PCB made up, but only place components for one key to debug that. If it works the first time then you've saved a few weeks and a few $, if it doesn't and it needs changes you've not really lost anything.

Ed
 
Status
Not open for further replies.
Back
Top