Maker Pro
Maker Pro

Using Ardunio and MOSFET to drive 5V to 12V

focspike

May 22, 2014
5
Joined
May 22, 2014
Messages
5
Hello,

I am working on a project which involves using an Arduino Mega, and I am trying to use an NMOSFET (BUZ101S) and an NPN BJT(2N3904) to drive the 5V output from the MCU back and forth between 0V and 12V across "SOL".

At the moment, the problem I have is that Vgs always stays high, thus driving SOL on all the time, and I cant figure out why this occurs.

Here is my circuit diagram:

http://i.imgur.com/ls9l9oa.jpg


Any help is appreciated. Thanks!
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
Hello to our forum.

There seems to be no connection between 0V of the 12V supply (earth symbol at the bottom right) and 0V of the arduino (left). You need to connect these to allow current flowing into the base of the NPN transistor.

Apart from that:
  • Add a flyback diode across the solenoid to protect the MOSFET.
  • Why do you need the MOSFET at all? There is a much more simple circuit involving only an NPN (plus flyback diode and base resistor). Note that the control signal from the arduino needs to be inverted (in SW) fpr the simple circuit.

Harald
 

focspike

May 22, 2014
5
Joined
May 22, 2014
Messages
5
Thank you for the reply,

Sorry for the confusion, I did connect the pin labeled GND on the Ardunio to a common ground with the base of the NPN, and the ground on the bottom right.

Would there be another explanation for why my outputs remain high all the time?

edit: in regards for the flyback diode, would a 1N4001 be fine? And what is the orientation? Thanks
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The link you give will not supply any information without logging in. Why not attach a picture?

What is SOL, is this a solenoid?

I cannot find details of the BUZ1015. I do not see how the circuit would work with a normal enhancement mode FET. It is easy to kill a mosfet if the gate is overvoltaged (20 to 30V).

The load (SOL) is normally connected to the drain.
 

focspike

May 22, 2014
5
Joined
May 22, 2014
Messages
5
Apologies, here is the image:
attachment.php


and the supply I am using is 12V instead of 24v.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
The N channel MOSFET cannot be used as a high-side switch as you have it, unless you can supply a voltage to the gate that is higher (by 4 to 10V depending on the device) than the supply voltage.

You need to connect one side of the the load to V+, other side of load to drain and source to ground to make a low side switch.

Or, you can use P channel MOSFET as you show with drain and source reversed.

Bob
 

focspike

May 22, 2014
5
Joined
May 22, 2014
Messages
5
Sorry I did not make it clear, I have decided to revert to the image I provided above as my circuit instead of the hand drawn one i had before, and I am not having any success.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Well, you have been given a perfectly good circuit in another forum. Why don't you try it?

Bob
 
Top