1
\$\begingroup\$

I'm planning a project which will involve converting an old pipe organ console into an electronic MIDI controller. I intend to use a Teensy 4.1 in conjunction with an array of shift registers to control the many inputs and outputs required.

Each key on each keyboard (there will be between 2 and 4 keyboards, each with 61 keys) is fitted with phosphor bronze contacts which act as a push-to-make switch when a key is pressed. I have been informed that these will not work reliably at 3.3V and were intended for use at 12V. To overcome this I am thinking of using an external 12V power supply along with a simple potential divider at each shift register (74HC595 EDIT: 74HC165) input pin to reduce the voltage level to ~3V:

The shift register Vcc and ground pins will be connected to the microcontroller (at 3.3V). Please correct me if I'm wrong but I think this arrangement will enable both the higher potential switching at the keyboard contacts and also the lower ~3V input required at the IC level.

I understand that a ratio of 3:1 for R1:R2 is required to reduce the voltage from 12V to 3V (slightly less than 3.3V to allow for fluctuations), and that the absolute values of R1 and R2 then determine the current draw. So values of R1 = 9k and R2 = 3k will result in a draw of 1 mA when the key is pressed. Larger resistance values therefore mean improved efficiency, i.e. less power wastage? Note also that I expect the phosphor bronze contacts which constitute the switches will have a substantial resistance of their own, which I will measure when I acquire the instrument. I understand I will have to factor in this resistance and the associated voltage drop when determining the values of R1 and R2.

The switches are arranged in parallel circuits, so I don't believe that opening/closing one should have an effect on the other parallel branches? If the current draw when the switch is closed (as determined by the R1 and R2 values) is << than the current rating of the power supply then the current should be fairly constant in each branch regardless of how many keys are pressed?

My background is (clearly) not in electronics. I would appreciate any critique/corrections of this proposed plan and any advice on alternative solutions etc. I will be assembling the electronics by hand, most likely using stripboard and soldered components, so a straightforward solution would be ideal.

\$\endgroup\$
8
  • 2
    \$\begingroup\$ 1 mA wetting current may be insufficient for the switch contacts. \$\endgroup\$
    – Andy aka
    Apr 19 at 11:21
  • \$\begingroup\$ @Andyaka thanks for the comment- I guess I could determine experimentally what current is needed for reliable operation. But I'm correct in thinking that by keeping the resistance values high I am reducing the power consumption & hence running costs? \$\endgroup\$
    – jsbach
    Apr 19 at 11:27
  • \$\begingroup\$ I would hope that the "substantial" contact resistance of the switches would be in the milliohms range - nothing to affect your calculations. \$\endgroup\$
    – Simon B
    Apr 19 at 11:31
  • \$\begingroup\$ If the switches are individually accessible and removable, it may be possible to clean and hard-gold-plate each contact point; then it should work reliably at 3.3 Volts. Suggest the expertise of a plating company if possible, at least for an analysis of feasibility (phosphor-bronze should be plateable, but there may be caveats only they know.) \$\endgroup\$
    – rdtsc
    Apr 19 at 12:02
  • \$\begingroup\$ Reducing the current through the voltage divider will reduce power loss. However the output voltage will also be more susceptible by the load (here the shift register). The shift register will effectively put a resistor in parallel to the lower resistor of the voltage divider and therefore alter the ratio. Edit: I checked the datasheet of the 74hc595 and the input pin current is 1uA. So it should be negliable for this application. In this case the switch contact resistance will have a greater effect on the ratio. \$\endgroup\$
    – 11011100
    Apr 19 at 12:09

1 Answer 1

1
\$\begingroup\$

Yes, that will work, using a resistor divider to convert down is a simple but effective solution. Be sure that your 12V is reliable, as an increase or surge from this will be translated (1/4 of it) to the 74HC595. Though as you're shooting for 3V, you'd need a fairly big over-voltage to damage it.

I would be inclined to check first that the switches don't work with 3v3. They're still just mechanical switches, making or breaking a circuit, and while they'll have some resistance I'd expect this to be small, and I wouldn't expect it to be voltage-dependent.

A final note, you might want to look up multiplexing as an alternative to using shift registers.

\$\endgroup\$
11
  • \$\begingroup\$ Shift registers are a better solution here. They'll use the same or fewer chips than muxes. And the switches will be sampled simultaneously rather than staircased. Despite the mux sampling skew being very small to insignificant, the shift registers design it out altogether for nothing. \$\endgroup\$
    – TonyM
    Apr 19 at 13:27
  • \$\begingroup\$ Thank you. Unfortunately it seems that a layer of oxidation builds up on them over time and the higher potentials are needed to overcome this reliably. As was suggested above I might look into gold plating if the contacts can be easily removed. \$\endgroup\$
    – jsbach
    Apr 19 at 14:20
  • \$\begingroup\$ With regards to multiplexing, I had initially intended to follow the scheme described here (openmusiclabs.com/learning/digital/input-scanning-matrix/…), but couldn't figure out as simple way to make it work while keeping the contacts at 12V. If I can gold-plate and operate them at 3.3V I will probably follow this scheme, using 8 shift registers to cover each note and a different microcontroller pin for each keyboard. \$\endgroup\$
    – jsbach
    Apr 19 at 14:23
  • \$\begingroup\$ @TonyM you can mutliplex just with the uController, no need for additional chips. \$\endgroup\$
    – LordTeddy
    Apr 19 at 16:12
  • \$\begingroup\$ @jsbach if you need 13V, then I can't offhand see a way to multiplex that's easier than doing what you're doing. \$\endgroup\$
    – LordTeddy
    Apr 19 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.