seandoyle
Posts: 8
Joined: Mon Oct 22, 2012 2:26 am

Need to control 48 solenoids from Raspberry Pi

Sat Apr 14, 2018 5:35 pm

Hi -

I'm helping build a musical instrument which can be controlled by a midi keyboard. For output I want solenoids to strike bells that are tuned for a 4 octave range (12 notes per octave). The midi inputs seem pretty easy - the https://github.com/SpotlightKid/python-rtmidi source can read the output from my keyboard just fine on the pi. But I'm not sure how to control this many solenoids.

I see that there are a number of relays (like the SainSmart 16-Channel Relay) which might be chained together - but these are opto-mechanical devices that make noise and I'd like the relays to be silent. I created a simple circuit with an arduino and a Darlington TIP120 and that works great - but I don't know how to address 48 of them from the Pi.

Maybe I could set up a serial connection to some arduinos - but I was hoping that there might be something simpler. I've never built anything like this before.

In terms of power - I'm guessing that only a handful [!] of notes would be playing simultaneously. I also would want to connect the voltage of the solenoid to the velocity of the key press from the midi keyboard.

Thanks for any suggestions!

Sean

PiGraham
Posts: 3935
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Need to control 48 solenoids from Raspberry Pi

Sat Apr 14, 2018 6:07 pm

This is basically the same question posed here
viewtopic.php?f=37&t=210693

viewtopic.php?f=41&t=209663


You can choose to add lots of gpio expanders on the Pi and run lots of wires to lots of transistors or you could wire a serial bus of some sort from Pi to near the solenoids and control the transistors locally. Lots of options.

seandoyle
Posts: 8
Joined: Mon Oct 22, 2012 2:26 am

Re: Need to control 48 solenoids from Raspberry Pi

Sat Apr 14, 2018 7:20 pm

Thanks! I hadn't seen the earlier question. MCP23017 looks like a very good option.

tarantul
Posts: 2
Joined: Sat May 05, 2018 2:18 pm

Re: Need to control 48 solenoids from Raspberry Pi

Sat May 05, 2018 2:43 pm

6x74HC595 on SPI in series (data output of one register connects to data input of next register): https://github.com/rororor/o8_relay_jrc21f-01

Return to “Interfacing (DSI, CSI, I2C, etc.)”