Pull-up resistors values and wetting current

Status
Not open for further replies.
Hi!

I'm currently in the process of adding some new MIDI-capable thumb pistons to my digital pipe organ, and I plan on using the Teensy 3.2 as it's perfect for this. The plan is to use a couple of MCP23017 IO expanders to handle the 19 pushbuttons and their built-in LED's. As not all LED's will be used, it would technically be possible without expanders, but I want to future-proof for when (not if ;)) I decide to add more buttons.

The thing is that I'm not sure about if the built in pull-up resistors of the MCP23017 (100k) will be enough. It will at 3.3V give me 33 µA of current though my switches and I'm not sure that is enough to overcome the (unspecified) wetting current of the switches. I have no idea what current would be sufficient to keep oxidation down, especially at 3.3v. Maybe 1 mA with 3.3K resistors would be better? Am I overthinking this? I'd rather do it right the first time so I don't have to take the organ apart more times than necessary.

The buttons I plan on using are the Adafruit 16mm Illuminated momentary pushbuttons https://www.adafruit.com/product/1479. I would prefer real organ thumb pistons, but they are very expensive (I've seen prices around 20-50 USD a piece engraved).

Any input on this would be greatly appreciated.

Edit:
I'm thinking maybe active high would be a better solution, but then the question is what pull-down resistor values that are appropriate. If I were to aim for 10 mA though the switches I would need a 330 Ohm resistor for pull-down, but would that be enough to keep the input low when the switch is open? Or maybe 5 mA would be enough.
 
Last edited:
Active low seems to be more robust, especially in rough or noisy environments, and it’s often easier to wire.
Pull up resistors might be 10kOhm in your use case, I’d only go for lower resistance and higher current with unreliable switches or in automotive environment.
 
So I'm now close to soldering everything together, but I need some guidance on whether to use the internal pullup resistors of the MCP23017 or if I should use external ones for my buttons.

The internal pullups are 100K according to the data sheet. I'm new at this so I'm not if that is sufficient or not. I'm wiring 24 pushbuttons and putting inside a digital pipe organ, so I'm not very interested in having to redo it. Any help would be appreciated :)
 
100K pullup resistors are a little on the weak side, but should probably work.

If you will be using long wires or if the environment has a lot of electrical noise, you might want to use lower value (stronger) pullup resistors. 4.7K or 10K are common choices, or even 1K could be useful.

For reliance to noise, especially from strong radio signals, the best thing you can do is keep the 2 wires for each button close together. One goes to the MCP23017 and the other goes to GND connected close to the GND pin on that MCP23017. If you think of the circuit as a loop, current flowing from the MCP23017 to the button and back, minimizing the physical area of that loop will reduce the susceptibility to noise and electrical interference.
 
Ok, I think I will go for 3.3K resistors. That will give me 1mA trough the buttons when pushed, which I think would be sufficient.

The wires will probably be 2-4 meters full circuit (not exactly sure yet, haven't taken the console apart to measure yet). I was planning on using a common ground for all buttons, and run one or two ground wires back to the board. I'm using a ribbon cable for this. The buttons also have integrated LED's that are going to run in a separate ribbon cable placed right next to the one for the buttons.

I have though about using a matrix for the buttons and skipping the MCP23017 but then I would need diodes and I need the MCP23017 for LED's anyway so I can as well use another one for the buttons. I did make a circuit diagram in KiCad but it's messy with all the wires and I haven't learned how to move things around and have the wires automatically reroute.

I'm not very concerned about radio signals, although the wire length will make a nice antenna. The cables running inside for the keybeds and pedalboard are both long and unshielded and it's no issue, but I'm guessing the voltage is higher. I'm guessing 12 to 24V.
 
If anyone could take a look at this circuit diagram and see if I have screwed anything up in terms of the pullups (to the right, 3.3K), or anything else for that matter, I would be very grateful :)
kicad.jpg
 
Status
Not open for further replies.
Back
Top