MOSFET N channel transistor curiosity

Hi everybody!

Nice to meet you all. I am new on this forum (french so please forgive my possible english issues^_^). I am also new on electronic things and my domain is usually more mechanical engineering stuffs.

I have an issue, and despite lots of researches I still do not find precise answer to my questions.

The topic is quite common, command a 12v motor using :

  • 12v alimentation
  • MOSFET N channel IRFZ44
  • Arduino Mega

To summarize, hardware side: - Gate is linked to PWM compatible output of the Arduino (PIN11) - Drain is linked to the motor - Source is linked to the ground

What happens? :

-When I have 0% on PWM signal, that is to say 0 over 255 on analogWrite command, 0V for motor, this is OK - When I have 100%, 255 over 255, motor has 12v, so this is OK too - When I have <1%, or 1 over 255, motor has around 7V and this is the issue - When I have 50%, so 127 over 255, motor receives around 9v.. so quite linear if we consider that starting point is the 7v above.

I have read that I should have resistances between ground and gate to pull down (10 kohms) and between the Arduino PIN and the gate (100 ohms) but nothing changes.

I have tried with :

  • 2 different arduinos
  • with or without resistances and with several values (10k, 100k, 1M for pull down, and 20, 100, 200 for the other one)
  • 2 different MOSFETs

I have seen that tension between PWM signal at 1% and ground was 0.5v, maybe this is a clue? It seems quite high...

I have also read Vgs tension is crucial (logic TTL MOSFET existancy) mine is equal to 10v in the datasheet (seems to high for my Arduino) but finally some other topics say that this is ok because Vgs (th) is 2v mini so Ok for Arduino (and his 5v). As I reach the 12v when I am at 255, I guess that this MOSFET (IRFZ44) is compatible with Arduino PIN?

In conclusion, I am a bit lost with all of this. I really need your help to progress on this topic. :confused:

Really thank you for your help. :) I am aware that this is something that should be easy but I do not find the solution.

Hello 17nico17

Welcome to the Arduino fora. Before you do anything else please take a moment to read General guidance And How to use this forum

You are asking us to help without seeing a schematic or code, which makes helping difficult. We get frustrated and move on to a different question, you don't get good answers.

Thank you.

PS. Your English is fine :)

Wrong transistor for 0V..5V PWM U'll need a logic level transistor (IRL..) or additional transistor (or MOSFET driver) to allow better control over gate voltage

Hi both of you, and thank you for your replies! :)

Sorry for the presentation, I attach the code I have. It is very simple thing so I did not attached it in the first post.

I think the program is not the problem. Maybe this is not perfect but thank to the monitor I can see that the correct information are sent to the transistor.

My connections are the same as the schematic attached (copied from the internet). The only thing is for the moment I did not linked the motor. I want to understand what happens before adding the motor. I just measure the tension that the motor will receive.

Thank you Knut_ny, you confirm what I have read on some posts. :) I still have a question. In my mind, if MOSFET Vgs is too high, Arduino is not able to allow the transistor to be as its lowest resistance. So it would be impossible for me to reach 12v on final output, right? (maybe here is my mistake). In fact I notice that my issue is quite the contrary. I do not reach the 0-7v range. But I have the 7-12v one...

I have seen some guys advising for some logic level transistor but when I look at the datasheet I always see Vgs = 10v, Vgs (th) mini 2v and maxi 4v.... so quite the same as what I currently have.

Could you advise for a precise transistor that would work fine? :)

Really thank you for your help, you are really my last hope on this topic! :o

Montage_2.JPG|434x429

Programme_ARDUINO.JPG|693x420

17Nico17: Hi both of you, and thank you for your replies! :)

I attach the code I have.

Why have you attached an image of text? You have not read and followed the forum instructions have you? Attaching an image of your code is daft.

Your schematic has connections to something on the right hand side that cannot be seen.

As I have already said:

We get frustrated and move on to a different question, you don't get good answers.

Yes, I have read the 2 documents ;)

Oh sorry, I have used "attachement" tool. It was part of the 2nd document. As I had two pictures, I have chosen this option. Did not know it was prefered to add as text instead, sorry again.

The connection on the right hand side is just a diode for the motor (called "diode de roue libre" in french, do not know the english expression). I cut it to not overload the scheme. As for the moment the issue is present without the motor, this diode does not really matter.

Yes, I understand for the rules, this is normal. This is more clumsiness from my side, sorry. :confused:

Here with the good shape :

#include 


int Valeur_analogique_moteur = 0;

//---------------------------------------------------------------------------------
void setup() {


pinMode(11, OUTPUT);
pinMode(41, INPUT);
   Serial.begin(9600); 
  
}

//---------------------------------------------------------------------------------


void loop() { 
  
    unsigned long Haut = pulseIn(41, HIGH, 1000000) ;
    unsigned long Bas = pulseIn(41, LOW, 1000000) ;
                               
    Valeur_analogique_moteur =  Haut*255 / (Haut + Bas); 
    Serial.println(Valeur_analogique_moteur);
                                     
    analogWrite(11,Valeur_analogique_moteur);
  
}

And the picture of the circuit (hope this will work, the preview does not show it):

One of very many better MOSFETs would be the IRLZ44. The L means 'logic level' and you'll see that the Rds is quoted for 5V and that is the best thing to look for.

Steve

That's better :)

The replies from knut_ny(!?!) and slipstick are probably what you need, I have nothing more to add.

Posting images is a pain on here. Upload the image to your post and save. Then right click on the file name of the image and select 'copy link location' (or the equivalent in your browser). Go back and edit your post. Use the 'insert an image' icon from the tool bar at the top of the edit box (roughly in the middle) and use the link you copied.

17Nico17: I have seen some guys advising for some logic level transistor but when I look at the datasheet I always see Vgs = 10v, Vgs (th) mini 2v and maxi 4v.... so quite the same as what I currently have.

Which FET was this? Sounds like they got it wrong too.

The only specifications you need to look at for a MOSFET are the polarity, max Vds and the Rds(on), you should ignore the others until/unless you know what they mean!

If and only if the datasheet has a resistance value for Rds(on) quoted at "Vgs = 4.5V" is the MOSFET logic-level.

If that 4.5 is even lower, then its also logic-level, but you'll need to check the absolute max Vgs isn't too small (+/-20V is good, +/-10V or so is borderline).

Voltage ratings should be at least double the operating voltage to allow for inductive ringing on fast switching edges. So a minimum Vds rating of 25/30V is advised for 12V operation for instance.

Could you advise for a precise transistor that would work fine? :)

Describe the requirements accurately then, max stall current of the motor for instance.

BTW measuring voltages of switching waveforms with a multimeter just gives the average over the waveform, doesn't tell you the actual voltages. A 'scope is needed for this.

Thank you for your help, really, I better understand now. Thank you MarkT and Slipstick!! :) :)

I have found IRLZ34 in a workshop in my city, the guy told me it was the closest he had for IRLZ44. I will try that today evening and tell you if it works.

PerryBebbington, sorry but I am stuck to the link stuff when the picture is on my computer :o I got the rest I guess anyway.

Really thank you for these precise and complete answers. I really hope that everything is going to work fine now! ;)

I'll let you know anyway!

Grrrr bad news, I have the same issue..... :'( In the Arduino monitor my 8 bits value is 5 / 255 and the tension between the Drain and the + is around 8v....

Really do not understand why. No motor to simplify the system, only a PWM and the transistor...

17Nico17: Really do not understand why. No motor to simplify the system, only a PWM and the transistor...

Do you have any load on it at all? Even just a resistor, maybe 100 Ohms or something?

Can't believe it, it works fine with a 3300kohm resistance!!! I did not know it could change the result! Thank you PerryBebbington!

As I am here, maybe you could advise me a diode for the motors? :grinning: I will have 2 motors in parallel. These motors are 12v ones, around 2A in total maximum (they are almost turning without resistancy). They are brushed style 775 type.

What a pleasure to see the tension from 0v to 12v following the % indicated by the PWM generator! 8) 8)

You've not provided a schematic but from your description I suspected you had an open drain you were expecting to have a changing voltage on. With no load there was nothing to provide a complete circuit, so the voltage you were getting was whatever stray voltage you happened to pick up.

Do you understand Ohm's Law and Kirchhoff's circuit laws? They are key to your problem.

As I am here, maybe you could advise me a diode for the motors? :grinning: I will have 2 motors in parallel. These motors are 12v ones, around 2A in total maximum (they are almost turning without resistancy). They are brushed style 775 type.

You need to know the stall current (current with the output shaft locked so it can't turn). The diode must be able to carry at least the stall current +, maybe, 50%.

Thanks for your help PerryBebbington! Ohm’s law yes :wink: Kirchoff’s law too, but not studying that for 10 years :roll_eyes:
All I remmember is that tensions are the same potential at the same nodes and in the different “loops” and that we have current additions at these same nodes.

Regarding my motors, stall current is 20A per motor.

I try again for the circuit picture (this time with the link from my PC). Picture is also attached in case :

|500x250

The usual convention is positive at the top, negative at the bottom of the schematic, the opposite to what you have.

Regarding my motors, stall current is 20A per motor.

Then the diodes need to be rated for at least 25A. I don't have a specific diode in mind, time for you to do some research, unless someone here can suggest one.

Ok, I have so many things to learn :o I have found some diods, do not know if it should to the job...?

1st : DIOTEC SEMICONDUCTOR P2500K 2nd : MBRB2545CT (seems to be two diods inside?

I guess that I do not have the good key words in Google to find what I need because I do not know much about this domain unfortunately... If some guys know about diodes, I take :D

Thank you again (+ for the picture)!

Something I didn’t pick up on in my previous post:
You have 2 motors in parallel that between them might draw 40A. Is the power supply and the device switching the power capable of supplying 40A?

Also, now I am thinking about it, I am not sure about using 2 diodes that will be in parallel as the motors are in parallel. I can see a risk that one diode will end up carrying the kick back from both motors, which is potentially 40A. I think one 50A capable diode is needed, not two 25A diodes.

One point for you PerryBebbington! My general switch is 20A... :confused:

Ok, for the diode, I also thougth about something similar for the parallel/serie stuff. As I do not know how it has to be cabled in the case of 2 motors in parallel, I supposed it was a good idea two have 2 diodes.

My motors will turn freely in a normal use. The only duty they have is to send a ball that will be sent by friction with 2 wheels. Using a instrumented alimentation, current is lower than 1A even when the ball is launched (max normal current).

It could be a good idea to add a fusible (20A) before the motors maybe? A fusible that can be reingaged (I have some like that, they do a "click" when above the indicated current and you can re-engage them). The only way the current is 40A is if a ball is stuck or something like that.

Edit : I forgot to say that my alimentation will be a LI-PO battery, 3S 5000 mAh 20C (11.1V). So I search for a 50A diode now? :grinning: Do you have an idea of the scheme with only one diode?