I'm a musician and I'm working on a funny project : control solenoids with a midi keyboard.
So I have a MIDI keyboard connected to my raspberry pi connected to my breadboard. Until now everything is working correctly with 12 LEDs, every time I press a key, a different LED is turned on.
Where I'm stuck, mainly because I lack of electronic and electricity education, is where it come to control the solenoids, I don't really know how to power them, and how to prevent the raspberry from frying.
I've planned to use 12v solenoids using 1.4A
Here is what came out of my researches on the internet. Please warn me, correct me, (help me) if something is wrong...
When a pin on the raspberry is turned on, it's delivering 3,3v power.
The pin should be connected to a resistance (1k), then to a LED (for witness), then to a transistor (TIP120 ?).
The "ground leg" of the transistor should be connected to the ground of the raspberry and the ground of the power supply without any resistance or diode. (I'm really in doubt of that, afraid of frying the raspberry...) .
The 12v power supply (+) should be connected to the solenoid (+).
The solenoid (-) should be connected to the middle leg of the transistor (the one activated when it receive the 3,3v from the pin) and also to a diode (1N4004 ?). That diode should be connected to the + of the power supply.
Is that correct ?
- What to use as power supply ?
- Can I use batteries ? one for each solenoid ?
- Any idea for supply all the solenoids at once ?
I hope I was clear, thanks you very much for your time and answers :)