Connect with us

Using Ardunio and MOSFET to drive 5V to 12V

Discussion in 'General Electronics Discussion' started by focspike, May 22, 2014.

Scroll to continue with content
  1. focspike

    focspike

    5
    0
    May 22, 2014
    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!
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    11,702
    2,716
    Nov 17, 2011
    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
     
  3. focspike

    focspike

    5
    0
    May 22, 2014
    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: May 22, 2014
  4. focspike

    focspike

    5
    0
    May 22, 2014
  5. duke37

    duke37

    5,364
    772
    Jan 9, 2011
    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.
     
  6. focspike

    focspike

    5
    0
    May 22, 2014
    Apologies, here is the image:
    [​IMG]

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

    BobK

    7,682
    1,688
    Jan 5, 2010
    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
     
  8. focspike

    focspike

    5
    0
    May 22, 2014
    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.
     
  9. BobK

    BobK

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

    Bob
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-