MOSFET Stepper Motor driver Odd Problem

Hi All

I have a confusing one. I dont have any diagrams to show atm, but basicly;
I have 4 MOSFET's being controlled from 4 digital pins from an arduino UNO, which ground the connected wire from a 6 wire stepper motor.
The problem i'm having is when i run my code, which sets one of the pins HIGH and the other 3 LOW then has a delay of about 100ms, then repeats with the next pin HIGH and others LOW, only 3 out of the 4 mosfets seem to switch on.
I have tried changing arduinos, changing output pins, mosfets, stepper motors which no luck.
I know i have not put any diagrams or any specs but i dont have any atm but any pearls of wisdom would be apperciated

I know i have not put any diagrams or any specs

or any code...

Here is my code. I have swapped out the 4 mosfets with a darlington array chip that has no trouble working but isnt rated to the stepper motors current, hence the reason for using mosfets.

int motorPin1 = 10; //Brown
int motorPin2 = 11; //Orange
int motorPin3 = 12; //Red
int motorPin4 = 13; //White
int delayTime = 500;
void setup() {

pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delayTime);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
}

pinMode(10, OUTPUT);     
  pinMode(11, OUTPUT);     
  pinMode(12, OUTPUT);     
  pinMode(13, OUTPUT);

You've given the pins nice names; why not use them?

Are you using logic-level MOSFETs?

We're a little short on detail here.

When posting code, please use the # icon on the editor's toolbar.

I'm not the neatest of coders but yes i should use them. The transistors i'm using are FCP11N60 which have a Vgs min of 3v and max of 5v.

When i get time tonight i will sketch up a diagram and upload it as ive got too much work to do it now, and thanks for your help.

No, those MOSFETs have a Vgs max/min of +/-30V if you look at the abs-max-ratings.

They have a gate threshold voltage of between 3 and 5V - if you look carefully thats the gate voltage at which 250uA can flow between source and drain. Typically a MOSFETisn't "on" till the Vgs is several volts above threshold - in fact the threshold tells you the off-point not the on-point.

If you look at the Rds(on) rating its given for Vgs=10V - this is the clear indication that its not logic-level. Logic-level MOSFETs always have the Rds(on) given for Vgs=4.5V (sometimes lower). Data sheets usually say "logic level" if its logic level as well - particularly for TO220 packages since its not the normal case.

Ok, should have looked more closely at the datasheet. I have had them switching on and working from these MOSFETS using the 5v outputs though, its just odd that it will work for 3 of the pins/mosfets but not the 4th on (but the pin/mosfet that doesnt work has changed to another for no reason that i can see?)

rarts:
Ok, should have looked more closely at the datasheet. I have had them switching on and working from these MOSFETS using the 5v outputs though, its just odd that it will work for 3 of the pins/mosfets but not the 4th on (but the pin/mosfet that doesnt work has changed to another for no reason that i can see?)

Yes, you need to use logic level mosfets. Look over this data sheet and see the difference is gate voltage specs compared to what you are trying to use:

Thanks for the link, guess i am getting lucky with some of the mosfets switching on at a Vgs of 3v. i'll see where i can get those in the UK. Cheers

Maybe if you'd put that vital and obvious detail in your first post, we could have saved a great deal of time.

Sorry but i didnt have that detail untill this morning otherwise i would have put it in when i started the post

In general if you don't know where the problem lies then provide all the detail you can (datasheets/schematic/board/code/power supply details)... The threshold thing with FETs is a common issue with newcomers to circuitry, but datasheet authors are writing for people who've understand the basic principle of operation of things like transistors...