Electronic – arduino – How to drive 88 solenoids with an Arduino with PWM

arduinopwmsolenoid

For a (crazy) upcoming school project I am converting a piano to be a computer-controlled player piano. I am currently planning on using solenoids mounted under the end of the keys (action side obviously, like Yamaha's DiskClavier system as well as the PianoDisc system).

I am planning on using an Arduino to take MIDI signals and drive all of the solenoids. I need PWM on the solenoids so that I can control the velocity at which the solenoids hit the keys, thereby determining the volume. The problem is, its no easy task to control, using PWM, 88 solenoids using an Arduino.

I was think I could use a generic PWM generator to generate the signals, and there are 16-channel servo PWM generator boards out there that are VERY cheap. However, servos require a very specific type of signal that is rather different that generic PWM which I need here. Does anyone know if these will work to generate generic PWM? (link: http://www.ebay.com/itm/PCA9685-16-Channel-12-bit-PWM-Servo-motor-Driver-I2C-Module-For-Arduino-Robot-/272557014281?hash=item3f75a9fd09:g:6SIAAOSwax5Yozsi)

Once I get a PWM signal, can I just use a MOSFET and diode (for kickback-voltage protection) to drive the solenoids directly?

Anything I'm completely missing here?

Any help and guidance is greatly appreciated.

P.S. I know I'm a little bit crazy trying to do this.

Best Answer

Forget craziness - good for you, investigating and experimenting is a great way to learn.

The NXP PCA9685 module you've identified will drive FETs, as you describe. Put a 1 K series resistor between each PCA9685 output and its FET gate. This limits the current to/from the gate capacitance during PWM output switching to 5 mA max, otherwise the PWM output is driving into a short-circuit on its rising edge.

I would also allow for, or put in, a 10 K pull-down to GND on each PWM output. The PCA9685 data sheet states that the outputs will go low during reset of the IC. On power-up, you don't want dozens of solenoids clicking because its not immediate enough or something else unforeseen. This is purely a precaution, allowing you to put a pull-down on the PCA9685 /OE pin and have the Arduino drive it logic high once the supply has stabilised and the circuit settled. Shouldn't be needed but better to plan it in and not fit the parts in your experimental lash-up.