Go Down

Topic: MOSFET N channel transistor curiosity (Read 1 time) previous topic - next topic

17Nico17

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.  :smiley-confuse:

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


PerryBebbington

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  :)

knut_ny

#2
Feb 19, 2020, 11:46 am Last Edit: Feb 19, 2020, 11:47 am by knut_ny
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
Ny

17Nico17

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




PerryBebbington

#4
Feb 19, 2020, 01:09 pm Last Edit: Feb 19, 2020, 01:10 pm by PerryBebbington
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:
Quote
We get frustrated and move on to a different question, you don't get good answers.

17Nico17

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.  :smiley-confuse:

17Nico17

Here with the good shape :

Code: [Select]
#include <Servo.h>


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):


slipstick

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

PerryBebbington

#8
Feb 19, 2020, 02:20 pm Last Edit: Feb 19, 2020, 02:21 pm by PerryBebbington
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.

MarkT

#9
Feb 19, 2020, 03:12 pm Last Edit: Feb 19, 2020, 03:14 pm by MarkT
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.
Quote
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.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

17Nico17

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!

17Nico17

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...

PerryBebbington

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?

17Nico17

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?  :smiley-lol:  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)

PerryBebbington

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.

Quote
As I am here, maybe you could advise me a diode for the motors?  :smiley-lol:  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%.

Go Up