Keeping the current on

Newbie here!

I’m designing a midi-controlled musical toy orchestrion - piano, drums, etc.

The problem is that the microcontroller has only 27 available output pins, and the piano alone has 30 keys to control.

To solve, I’d like to try multiplexing the microcontroller’s outputs so 5 outputs can drive the entire piano. This would work fine if I only wanted to activate a single solenoid/piano key at a time, but I want to be able to play chords.

Is there a simple way to take a short several-milisecond pulse from the multiplexer and keep that 3.3V signal going to the transistor for a full second after the pulse ends? Would an RC circuit do it, and if so, how big a capacitor would I need?

The transistor at the other end is a TIP102 NPN, and it’s directing 13.8VDC from a big power supply to the solenoid.

Thanks for any advice you guys can give me!

startty:
To solve, I’d like to try multiplexing the microcontroller’s outputs so 5 outputs can drive the entire piano. This would work fine if I only wanted to activate a single solenoid/piano key at a time, but I want to be able to play chords.

By adding some more hardware you can reduce the

uC pin requirements to only two. If the uC sends

serial data using an existing serial bus protocol you

can manage many more than thirty separate loads.

[SPI is popular as is [I2C(the latter was intended for

applications like yours).

startty:
Is there a simple way to take a short several-milisecond pulse from the multiplexer and keep that 3.3V signal going to the transistor for a full second after the pulse ends? Would an RC circuit do it, and if so, how big a capacitor would I need?

To do so gives up firmware control, shifting it to

hardware, which might suit your needs well.

Firmware control is more flexible and that alone

would speed up your development time. Hardware

control is usually more costly and takes more space

and power (critical in portable battery apps).

startty:
The transistor at the other end is a TIP102 NPN, and it’s directing 13.8VDC from a big power supply to the solenoid.

That is typical and should work well. If you were starting

with a clean page for the hardware I’d suggest using

PMOSFets (which are cost competitive, easier to use,

and more efficient).

This topic has little to do with PCB Design, perhaps you can

ask a mod to move it to “Projects”?](I²C - Wikipedia)](Serial Peripheral Interface - Wikipedia)

Thanks bigglez! Yes, this would probably be more appropriate under ‘projects’.

I’ll look into using I2C to send signals to another uC, which in turn can manage the solenoids in the piano. I can see how that would greatly reduce component count in this application. Great idea!

startty:
I’ll look into using I2C to send signals to another uC, which in turn can manage the solenoids in the piano. I can see how that would greatly reduce component count in this application.

The I2C bus doesn't have to be between two (or more)

uC chips. A common arrangement is that the only uC acts

as bus master, and sends messages to other devices,

called slaves, that either output the data to the outside world,

or respond with fresh data to the uC (an EEPROM on an

I2C bus, for example).

Take a look at this [I2C IO chip.

and this [I2C portfolio](http://tinyurl.com/6ybpfd)](http://tinyurl.com/5by6gw)