This week, we revised our design and plan for our project. We have decided to go with a bass guitar instead of a lead guitar due to our personal preference, and the fact that we felt it would best fit whatever song the robot orchestra ends up playing. We ordered parts (solenoids, guitar picks, rectifier diodes, 10k resistors, MOSFETs -- full list of what we used will be published when we finish up with the prototyping phase).
Throughout the testing phase, from when the solenoids arrived in the mail, research has been done to find how solenoids could be controlled from microcontrollers. The main components needed to use solenoids from the Teensy are MOSFETs, rectifier diodes, and 10k resistors.
The solenoids require 12V to operate, but Teensy's only output 3.3V. The most logical way, and most common way to make use of solenoids with Teensy's is to use a MOSFET. In simple terms, a MOSFET is a switch, that allows a current to flow through it when a different current is applied. The two currents do not need to be the same voltage, meaning the MOSFET can allow a 12V signal to pass through when a 3.3V signal is applied (given there is a 12V power source).
The differing operating voltages of the Teensy from the solenoids is so great that there is a risk of shorting something on the Teensy. When solenoids return to the OFF state, the remaining electricity has to go somewhere, and that is what can damage the hardware. The role of a rectifier diode is to keep current running in one direction, so having a rectifier diode prevents reverse flow of current, eliminating that risk.
The resistors in our circuit help the signals keep a safe current for our MOSFETs. Resistors reduce current flow, and expel of that extra energy in the form of heat. The resistors connect the signal wire from the Teensy to the ground rail of the breadboard, which is also connected to the Teensy ground terminal and the 12V ground.