Those solenoids will need over 300mA each at 12v, so firstly make sure you have a good 12 power supply.rcrummett wrote:Tony -
Thanks for the suggestion on the ULN2803. I have looked at the pinout and tried to simulate a Darlington connected transistor...it looks like the output level is the same as the input. So am I running the GPIO pin through an amplifier to get 12V and then connecting that to the input? Thanks again for the help.
Yeah...maybe I need to read the description a little better... In that case, the MOSFET route sounds like the way to go. I've ordered the SOT23 adapters and will get the FETs tomorrow.BudBennett wrote:$5 gets you 5 of the SOT23 adapters (plus some others) which can mount 2 devices each - all of 10 of your drivers. You can hunt for through-hole devices, but the vast majority of new tech is SMT, at lower prices.
The polarity of the GPIO doesn't matter...
Where do I connect the 12V supply?Tage wrote:The cheapest way to drive a 12V solenoid or relay is to use a MOSFET. This transistor has three terminals. Connect Source to GND, Gate to the GPIO pin of the Pi, Drain to one end of the coil. If you are using long wires you need to add a 24V zener diode with Anode to GND and Cathode to Drain, to protect the MOSFET against voltage transients. A 0.5W or 1W zener is fine.
Code: Select all
I = V/R = (12V -Vled) / 100 = 10 / 100 = 100mA