Some of the outputs of the Phidgets USB interface will be used to drive AC voltage. For these I’ll simply use a solid state AC/DC relay because it provides reliability and isolation from the AC line. Plus it’s much cheaper than building your own circuit unless more than an Amp or so needs switched.
The rest of the outputs will be used to drive solenoids using a MOSFET solenoid driver as pictured below. The MOSFET driver was chosen simply because I was concerned about the somewhat limited mechanical life of the relays in a transistor relay driver.
MOSFET Solenoid Driver: This is a very simple circuit and is repeated for each of the solinoid or other DC devices we wish to control with the Phidget USB interface. It accepts a digital 5 volt input and can drive a significant amount of voltage and current depending on your selection of MOSFET. I have added a LED to the circuit as well to indicate the state, after all… the most important part of a fancy machine is a lot of blinking lights.
R2 is a a 1M Ohm resistor intended to drain the voltage on the input when it goes to 0 and speeds up the switching speed (as the MOSFET gate can act as a capacitor. R1 should be sized to limit the current though the LED, with a typical LED with a 1.7 voltage drop and 20mA current rating , R1 = (V – 1.7)/ 0.02. Or 515 Ohms at 12V or 1115 Ohms at 24V, etc. (round up to the nearest resistor).
Phidgets recommends D1 be a 1N4148 diode, which is a high speed 200mA 100V diode. Due to some of the currents I will need to be switching, I’ll be using a 1Amp or better version instead.