SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By thankyou
#163779
I am driving a solenoid through a MOSFET that is controlled by an Arduino. I saw the attached circuit in a book (it has a motor instead of solenoid but it's the same idea) and I have some questions. Why is there a buffer between the Arduino I/O pin and the MOSFET gate? Is it for isolation and/or current gain? How does the impedance matching provide isolation? What would be the consequence of not using it? I thought the MOSFET gate already is high impedance, so why is isolation needed? Also why is there a resistor from the gate to +12V if it's an N channel MOSFET? Lastly, is it really necessary to have a separate power source for the Arduino? I know it's for noise isolation reasons, but I don't notice any effect on my circuit when I use same power source for the solenoid and Arduino. I hope that's not too many questions. :mrgreen:
You do not have the required permissions to view the files attached to this post.
By fll-freak
#163780
Based on the MOSFET, the gate voltage to turn on the transistor may need more than the logic level voltage provided by the Micro. The 74HC07 is an open drain buffer. When P0 is on, the gate is shorted to ground through the 74HC07. When P0 is off, the 74HC07 is disconnected, and the 10k resistor pulls the gate to 12V. This is likely over the threshold needed by the IRF511 to turn on the FET.
By UhClem
#163787
The 74HC07 has an open drain output so it can pull it low but requires the external resistor to pull it high.

The data sheet I pulled up (parts from other vendors may vary) shows a clamp diode to Vcc on that open drain output. If you used a part like that here the gate drive to the MOSFET would be limited to a bit above 5V because of this clamping. In that case the open drain buffer buys you nothing.
By waltr
#163800
I also don't like the use of that 74HC07 in this circuit. The output will see +12V and if the part has a clamp diode (this may not be the case for every make of 'hc07) then the MOSFET will never be completely off. A very careful study of the data sheet for the exact version (manufacture) is needed to know if this part will work in this circuit.
Also, a 74HC07 is a hex part so is a waste if only one is needed but a pcb space saver if you need six gates.

I would use either a small signal NPN transistor or logic level N-ch MOSFET instead of the 'hc07.
By thankyou
#163822
Thanks for the advice. My final question is whether you really need a separate power supply for the Arduino. I don't see any visible noise effect when I use the same power supply...
By waltr
#163832
If it works with one PS then all is good.
The one other thing to check is the 5V regulator on the Arduino board. Does it get hot? If not then you're good, If it does then maybe a lower Voltage to the Arduino board would be better.