so I am trying to make a circuit using a button, mosfet transistor and a small dc motor (which i have replaced with an LED). I have attached a picture of the circuit. my problem is somewhere in the transistor side of the circuit. nothing happens when I push the button. but if I set up just the button and LED it works fine. Does anyone have any idea of what I could be doing wrong?
It depends on what type of MOSFET you are using. You have to have one that is "logic level" or TTL level since you are driving the gate with a 5V signal from the arduino. If it is not, the MOSFET wants 10-12V on the gate before it will turn on.
You MUST provide details of the components you're using. There are thousands of MOSFETs and most of them are wrong for this use. And what motor you want to use with it is important too.
And that battery is not going to be any use for running a motor for more than a second or two.
Steve
the transistor is a logic level mosfet with a 4v threshold so it should be good with the 5v power from the arduino
That’s not what we asked for. Threshold is usually the turn off spec, not turn on. So maybe it is a logic level mosfet. Just post the part number and remove all doubt for those simply trying to help. You also need to post your code using code tags. Yes, of course it’s a simple program but when asking for help online, more information is better than less.
From what I can see in the out focus photo, you’re missing a resistor in series with led and chances are good the pushbutton is mis-wired. BTW, stripping that much insulation from wire defeats the whole purpose of insulation.
the transistor is IRFZ44N and here is my code.
the picture is low quality because I had to lower the amount of pixels to keep it under 2mb.
const int switchPin = 2;
const int motorPin = 9;
int switchState = LOW;
void setup() {
// put your setup code here, to run once:
pinMode(motorPin, OUTPUT);
pinMode(switchPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
switchState = digitalRead(switchPin);
if(switchState == HIGH) {
digitalWrite(motorPin, HIGH);
}
else{
digitalWrite(motorPin, LOW);
}
}
Unfortunately you obviously don't understand what "logic level" means for a MOSFET because an IRFZ44 definitely isn't one. Threshold doesn't tell you anything very useful because it's about when the device just starts to conduct not when it is fully switched on.
A more useful thing to look at is Rds(on). If that is quoted for a voltage under 5V then you probably have a logic level device. For the IRFZ44 it's only quoted at 10V and you don't have 10V to give it.
Steve
oh ok thanks. I guess the info I got on it was wrong. So you are saying in order to fix my problem I need a different transistor? and if this is what you are saying what transistor would you recommend.
There are many possibilities. One old favourite you could try is the IRL540N. The datasheet says it is logic level (hence the L in the name) and also in the datasheet you'll see the Rds(on) is specified at 4.0V. And if you look at the max. threshold it's 2V.
Steve
