Driving a NON logic level mosfet with an arduino.

Hi,can anyone point me to a schematic to switch a non logic level mosfet with an arduino thats non inverting?,i have 2n3906 and 3904 trannys and some tip 29 trannys,ive no opto couplers,i see lots of schematics on the net,they all apear to invert the signal,its for low side switching a motor,the mosfet i want to use is a IRF 3205 cheers Paul m3vuv.

Thought id be flooded with answers to a basic question,im sure others have had the same issues!!,maybe no one knows how to do it??

Hi,

m3vuv:
Thought id be flooded with answers...

in just over 40 minutes?

and no, I don't know the answer but I reckon plenty of others will but 'life' is currently getting in the way of them answering.

Peter

m3vuv:
Thought id be flooded with answers to a basic question,im sure others have had the same issues!!,maybe no one knows how to do it??

The answer you will most likely get is for you to open your wallet and buy a logic level MOSFET. Yes you could use two 2n3904 transistors to doubly invert the pin output and use these to drive your non-logic level MOSFET but you will then need a higher voltage supply to power the second 3904.

Here's 'flood' of an answer...

You can drive a non-logic level MOSFET in exactly the same way as a logic level MOSFET. The result will be that it does not turn on as fully as a logic level MOSFET. Depending on your application that might or might not be acceptable, which only you can decide.

I however prefer Stowite's answer, buy some logic level MOSFETs. Surely the trouble you will need to go to devising and building a circuit to drive non-logic level MOSFETs far exceeds the cost of some new ones of the correct type?

Hi,can anyone point me to a schematic to switch a non logic level mosfet with an arduino thats non inverting?,i have 2n3906 and 3904 trannys and some tip 29 trannys,ive no opto couplers,i see lots of schematics on the net,they all apear to invert the signal,its for low side switching a motor,the mosfet i want to use is a IRF 3205 cheers Paul m3vuv

Two inverters.

Or do the first inversion in your code. HIGH is off, LOW is on.

Can't give you a schematic.

But what is the problem with inverting? You can simply invert the logic in the Arduino to get the same effect as a non-inverting driver. Also applies to PWM.

i cant drive it directly,im suprised you dont know that!!

This is the code its running 
[code/*



*/



#define yellow 9  //Q1
#define orange 10  //Q2
#define brown 11  // Q3
#define black 12 // Q4

#define SW0 2
#define SW1 3
#define SW2 4
#define SW3 5
#define SW4 6
#include <OneWire.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
// set the LCD address to 0x27

int i, j;

void setup()  {

  pinMode(SW0, INPUT);
  pinMode(SW1, INPUT);
  pinMode(SW2, INPUT);
  pinMode(SW3, INPUT);
  pinMode(SW4, INPUT);
  digitalWrite(SW0, 1); // pull up on
  digitalWrite(SW1, 1); // pull up on
  digitalWrite(SW2, 1);
  digitalWrite(SW3, 1);
  digitalWrite(SW4, 7);
  lcd.init(); // initialize the lcd
  lcd.backlight();

  pinMode(black, OUTPUT);
  pinMode(brown, OUTPUT);
  pinMode(orange, OUTPUT);
  pinMode(yellow, OUTPUT);
  all_coils_off();

  lcd.clear();
  lcd.home();
  lcd.print( "M3vuv coilwinder.");

  delay(500); // wait for 1 seconds
  lcd.setCursor(0, 1); // is Home
  lcd.print("Well,Ready to go!");
  
  lcd.print( "M3vuv coilwinder");
  j = 0;

}

void loop() {

  // set turns
  if (!digitalRead(SW0) == 1)   {
    delay(50);
    j = 0;
    lcd.clear();
    lcd.home();
    lcd.print("Turns = 0  ");
    while (!digitalRead(SW0) == 1)   {
      delay(500);
      if (!digitalRead(SW1) == 1) j = j + 1;
      if (!digitalRead(SW2) == 1) j = j + 10;
      if (!digitalRead(SW4) == 1) j = j + 100;
      lcd.setCursor(8, 0);
      lcd.print(j);
    } // end while
    lcd.setCursor(0, 1);
    lcd.print("Ready to wind.");
  }

  if (!digitalRead(SW3))  {
    lcd.clear();
    lcd.home();
    lcd.print("Turns 0  ");
    for (i = 1; i <= j; i++)   {
      reverse(200);
      lcd.setCursor(6, 0);
      lcd.print(i);
    }
    all_coils_off();
    lcd.setCursor(0, 1);
    lcd.print("Finished ");
  }

} // end loop


void all_coils_off(void)  {
  digitalWrite(black, 0);
  digitalWrite(brown, 0);
  digitalWrite(orange, 0);
  digitalWrite(yellow, 0);

}

void reverse(int i) {
  while (1)   {
    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(analogRead(0) / 4 + 5);
    i--;
    if (i < 1) break;

    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 0);
    digitalWrite(yellow, 1);
    delay(analogRead(0) / 4 + 5);
    i--;
    if (i < 1) break;

    digitalWrite(black, 0);
    digitalWrite(brown, 1);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(analogRead(0) / 4 + 5);
    i--;
    if (i < 1) break;

    digitalWrite(black, 1);
    digitalWrite(brown, 0);
    digitalWrite(orange, 1);
    digitalWrite(yellow, 0);
    delay(analogRead(0) / 4 + 5);
    i--;
    if (i < 1) break;
  }
}

e][/code]]

*/

#define yellow 9 //Q1
#define orange 10 //Q2
#define brown 11 // Q3
#define black 12 // Q4

#define SW0 2
#define SW1 3
#define SW2 4
#define SW3 5
#define SW4 6
#include <OneWire.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
// set the LCD address to 0x27

int i, j;

void setup() {

pinMode(SW0, INPUT);
pinMode(SW1, INPUT);
pinMode(SW2, INPUT);
pinMode(SW3, INPUT);
pinMode(SW4, INPUT);
digitalWrite(SW0, 1); // pull up on
digitalWrite(SW1, 1); // pull up on
digitalWrite(SW2, 1);
digitalWrite(SW3, 1);
digitalWrite(SW4, 7);
lcd.init(); // initialize the lcd
lcd.backlight();

pinMode(black, OUTPUT);
pinMode(brown, OUTPUT);
pinMode(orange, OUTPUT);
pinMode(yellow, OUTPUT);
all_coils_off();

lcd.clear();
lcd.home();
lcd.print( “M3vuv coilwinder.”);

delay(500); // wait for 1 seconds
lcd.setCursor(0, 1); // is Home
lcd.print(“Well,Ready to go!”);

lcd.print( “M3vuv coilwinder”);

[/code]][/code]

will the motor still run ok with the signal inverted,i see the main issue is lack of drive voltage for the fet!.

Go on line and search for a HI Side Driver chip. I can only guess what you want as I have no clue as to what your load is and the power requirements. If the logic is backwards you can eaisly correct it with either a transistor, inverter gate or software.
Good Luck & Have Fun!
Gil

Use the suggestion to simply get a logic level avalanche rated MOSFET. Why avalanche it eliminates the diode when switching inductive loads. You can spend some money and get a MOSFET driver designed for just this purpose.
Good Luck & Have Fun!
Gil

m3vuv:
i cant drive it directly,im suprised you dont know that!!

That is just silly.

With your 5v power supply, the 5v string of LED’s [ 5V motors …] and 5v output of the UNO, you do not need anything special.

Of, course, we can only use the information you offered and are filling in the rest.

Also, since this thread is not arduino related but really electronics 101, you might miss that
we have no real care if they are inverting or non-inverting, when you move into micro-controller arena, you just change the software from high to low. and the hardware is not as important.

If you actually do want to know how to run a non-logic level then read the data sheet for the logic level device, look at the internal circuitry and just replicate that with discrete components.

Most of us would rather spend a few cents on a device that does what we want than to use a handful to simulate that same result.

…Or worse is they can invite similar responses and then somebody has to get involved.

And a gentle reminder to all in this thread that I would rather be doing other things so play nice please.

Bob.

op’s didn’t read that till after I posted.

@m3vuv

TOPIC MERGED.

You may want to READ THIS for future reference.
It will help you get the best out of the forum.

Bob.

@m3vuv

Patience is a virtue.
As already mentioned People have other lifes.
And as a further reminder.
This is a forum run by Arduino users for arduino users.
There is very little interaction from Arduino themselves.
They just graciously provide the space we occupy.

Snarky remarks also often put people off helping at all.
Or worse is they can invite similar responses and then somebody has to get involved.

And a gentle reminder to all in this thread that I would rather be doing other things so play nice please.

Bob.

const bool COIL_ON = LOW;

void all_coils_off(void)  {
  digitalWrite(black, !COIL_ON);
  digitalWrite(brown, !COIL_ON);
  digitalWrite(orange, !COIL_ON);
  digitalWrite(yellow, !COIL_ON);

}

You're welcome.

Well,ive got some df72 fets from an old mother board,looks like they will work at logic level,see datasheet,what do you all think?

94-AOD472.pdf (145 KB)

Driving a MOSFET is often more complicated than just applying a voltage to its gate, especially if you're looking to switch it rapidly such as in solenoid or motor uses. MOSFETs are often thought of as being "ideal", requiring no gate currents and thus just throwing a bunch of transistors and pull-up resistors together often seems like a good idea; sometimes it can work just fine, but often it won't.

MOSFETs, especially ones that can carry significant current, often have significant gate and parasitic capacitance, requiring decent amounts of charge to be transferred every time the gate is switched. Check the Ciss and Qg ratings for the MOSFET you want to use. If you use a circuit that translates voltage but is resistive the FET will spend a lot of time (in relative terms) in the "linear region" and may dissipate a lot of power, overheating and failing as a result.

If you're switching a small 2N7002LT1 to PWM an LED, you can do that from a port pin. If you want to rapidly switch a large FET (like the IRF3205) that's switching coil currents (motors, solenoids etc), I'd recommend a low-side MOSFET driver for each FET.

For example, the Micrel MIC4422AYN (or a low-side driver like it) might be a good choice. You need a supply voltage of ~8V (up to 18V) to ensure a good Vgs (so the FET is driven fully on) as well as a few capacitors but this device, or one like it, will provide the currents required for properly switching a FET.

well ive built a test jig using a 21 watt 12v bulb and the d 472 fets seem to be switching har on ok,ie the fet is staying cool,im pulsing it from the arduino,its to run a coil winder using a wantai 57by gh420 hybrid stepper,its for a coil winder so speed doesent matter.,cheers m3vuv Paul.

Wouldn’t it be lots easier to connect the motor as bipolar and drive it with a stepper driver?
TB6560
Is this the motor you have?