Transistor advice

Hello everyone, I’m new on this forum, I hope I won’t be against any rule or general etiquette with this post. I’m a newbie with arduino, I just have a little bit of experience in general electronics…

I want to build a small robot remote controllable from my smartphone, using an arduino and some lego pieces… By now is just a car. everything worked fine, but I cannot regulate the speed of the motor with my arduino nano (I just connect the motor to the battery as a first solution).

What I planned (looking around for information and tips) was to produce with analog write a pulsed signal, to average it in order to get a DC signal, put this inside a gate of a MOSFET. This way I regulate the current from drain to source, moving my DC motor as I wish regulating the duty cycle at the pin.

However nothing works. I even tried to connect the 5V battery directly at the gate, but it seems no current flows. I’m using a IRF740 as mosfet, on the datasheet there is a typical “gate threshold voltage” of 3V, but in the plots the curves far from 0 are the ones with V_{GS} > 6V (even if the scale is in Ampère).

Would it be that this MOSFET is not ideal for arduino? and that I should buy a MOSFET with a lower threshold? Do you have any suggestions in this case?
Or I’m just missing something? I heard about the H bridge for DC motor, but I would like to start with easier components firstly… I’m of course open to any suggestions.

I put a drawing of what should be my circuit.

Many thanks to everyone :slight_smile:

simone256:
Hello everyone, I’m new on this forum, I hope I won’t be against any rule or general etiquette with this post. I’m a newbie with arduino, I just have a little bit of experience in general electronics…

I want to build a small robot remote controllable from my smartphone, using an arduino and some lego pieces… By now is just a car. everything worked fine, but I cannot regulate the speed of the motor with my arduino nano (I just connect the motor to the battery as a first solution).

What I planned (looking around for information and tips) was to produce with analog write a pulsed signal, to average it in order to get a DC signal, put this inside a gate of a MOSFET. This way I regulate the current from drain to source, moving my DC motor as I wish regulating the duty cycle at the pin.

However nothing works. I even tried to connect the 5V battery directly at the gate, but it seems no current flows. I’m using a IRF740 as mosfet, on the datasheet there is a typical “gate threshold voltage” of 3V, but in the plots the curves far from 0 are the ones with V_{GS} > 6V (even if the scale is in Ampère).

Would it be that this MOSFET is not ideal for arduino? and that I should buy a MOSFET with a lower threshold? Do you have any suggestions in this case?
Or I’m just missing something? I heard about the H bridge for DC motor, but I would like to start with easier components firstly… I’m of course open to any suggestions.

I put a drawing of what should be my circuit.

Many thanks to everyone :slight_smile:

To get started. Nobody will understand “nothing works”. Explain how functions fail.
To controll DC motors PWM is very useful. Combined with logoc N-channel MOSFETs it works well. Drop the idea about a smotth dc. A normal FET might not work due to the low, 5 volt, max output from Arduinos.
If You only go in one direction MOSFETs can be used instead of H-bridges. I use a H-bridge for a fwd/bwd running DC motor and it was easy to get started.

Say you have a pipe leading into a tank and a pipe leading out to a drain and you can put a valve on the incoming pipe or on the outgoing pipe and don't care about what happens in the tank we name Load.

Some FETs work well as top/in valve for a circuit and others work well as bottom/out valve... just mixing that metaphor.

On Youtube there is a channel named AddOhms belonging to a member here (The Bald Headed Engineer). He has a series of electronics tutorials, one covers MOSFETs. I had to take notes. I had to watch it enough times to have to take notes. If I need to check another MOSFET, I will need to watch it again since I lost those notes......

I bought IRLZ44N's.
The N tells me that this FET is better suited at the bottom dumping current to the drain/GND.
The L tells me that the gate is Logic Level (2 to 3V to open full) as opposed to 10V.

Get rid of the capacitor.

Some good logic level MOSFETs:

Get rid of the capacitor.

And the connection to GND above it?

I see no protection diode. When the motor stops there will be a back surge. Might even get smoke!

If you PWM, you should use an H-bridge if only for the protection. H-bridges have different modes and the more efficient/smooth mode pumps the surge right back into the motor coils when the OFF part of the PWM happens. You don’t get that with just a FET, but possibly a bit more circuit could do the same on PWM LOWs.

But if the motor is very small/low power then forget the H-bridge unless you want to control turn direction.

Thank you everyone!!!

Railroader:
To get started. Nobody will understand "nothing works". Explain how functions fail.
To controll DC motors PWM is very useful. Combined with logoc N-channel MOSFETs it works well. Drop the idea about a smotth dc. A normal FET might not work due to the low, 5 volt, max output from Arduinos.
If You only go in one direction MOSFETs can be used instead of H-bridges. I use a H-bridge for a fwd/bwd running DC motor and it was easy to get started.

Yeah, I'm sorry. That was just a: "The motor doesn't spin". What do you mean by "Drop the idea about a smooth DC"? You mean that capacitor+resistance are not that effective in averaging?

GoForSmoke:
Say you have a pipe leading into a tank and a pipe leading out to a drain and you can put a valve on the incoming pipe or on the outgoing pipe and don't care about what happens in the tank we name Load.

Some FETs work well as top/in valve for a circuit and others work well as bottom/out valve... just mixing that metaphor.

On Youtube there is a channel named AddOhms belonging to a member here (The Bald Headed Engineer). He has a series of electronics tutorials, one covers MOSFETs. I had to take notes. I had to watch it enough times to have to take notes. If I need to check another MOSFET, I will need to watch it again since I lost those notes......

I bought IRLZ44N's.
The N tells me that this FET is better suited at the bottom dumping current to the drain/GND.
The L tells me that the gate is Logic Level (2 to 3V to open full) as opposed to 10V.

Thanks for the metaphor and the reference, I still am not totally confident with the "gate threshold voltage" which seems to be of logic order on my datasheet, but probably there is a difference between open and full open. I'll check the L and the plots on the datasheets in the future :slight_smile:

larryd:
Get rid of the capacitor.

Some good logic level MOSFETs:

https://forum.arduino.cc/index.php?action=dlattach;topic=690136.0;attach=368349

Thanks for the link, but why should I get rid of the capacitor? Does the mosfet perform the averaging on its own? And why should I keep the resistance in this case?

GoForSmoke:
And the connection to GND above it?

I see no protection diode. When the motor stops there will be a back surge. Might even get smoke!

If you PWM, you should use an H-bridge if only for the protection. H-bridges have different modes and the more efficient/smooth mode pumps the surge right back into the motor coils when the OFF part of the PWM happens. You don't get that with just a FET, but possibly a bit more circuit could do the same on PWM LOWs.

But if the motor is very small/low power then forget the H-bridge unless you want to control turn direction.

Yes I didn't added it mostly because I didn't really understood why it should help. Does the mosfet produce a reversed reaction when "turned off" (or when the PWM goes down if the averaging is not performed) that could damage the motor?

However yes the motor is pretty small, the current at 5V should be 200mA (even if I think it's if unloaded).


I even have few BJTs by the way, in particular 2N2222A. Do you think it's worth to try with them? Or should I definitely prefer mosfets over BJTs? Thanks!!!

I’d have to get the 2N2222A datasheet then re-watch AddOhms to make sure I didn’t miss anything.

MOSFET half open == heater. Depending on current drawn through and heatsink it may burn up.

BJT’s get hot conducting less current by far than power FETs.

The 1st FETs I bought were low power 2N7000’s (50 for $5), 250mA Max but at least logic level. I used them to drive G4 led disks and had to blink those fast since Max Load is not Continuous Load and the G4 disk draws 240mA. Next time I bought I got FETs good for > 10A, 60 of them for $10 shipped when buying a few singles cost 80 cents each. (watch for deals always)

A Darlington is a BJT driving another BJT. The ULN28xx chips are Darlington arrays with built-in protection diodes. The 7 channel version costs about 1/4 of what the 8 channel version does. They are pre-cheap-FET small motor driver chips from the 90’s. For 200mA you might not need a heat sink, at 500mA you for sure do.

Here’s another MOSFET tutorial:
https://www.electronics-tutorials.ws/transistor/tran_6.html

As far as back-surges, those are from inductive components like coils that build a magnetic field while running. When the power goes off, the field collapses quickly putting a current surge through the coil and down whatever path it can take. Without a protection diode or H-bridge in the proper mode, that surge can burn parts out.

“. . . but why should I get rid of the capacitor?”

MOSFETs get very hot when they go from OFF to ON to OFF ‘slowly’, that’s what your capacitor is making happen.

So I should not use a MOSFET half open? Because my intention was to regulate the speed continuously opening "just enough" the MOSFET. Should I use them only as ON/OFF switches? What's best for my purposes, a potentiometer?

The speed of rotation for many DC motors can achieve using PWM control.

Lots of information on how to do this on the internet.

A potentiometer can be monitored with the Arduino then its setting value (/4) is sent to a motor MOSFET driver using analogWrite() i.e. PWM.

simone256:
So I should not use a MOSFET half open? Because my intention was to regulate the speed continuously opening "just enough" the MOSFET. Should I use them only as ON/OFF switches? What's best for my purposes, a potentiometer?

No, it will be very inefficient as well as making beaucoup heat.

The FET can carry current like only a relay could before. But relays have limits and pitfalls of their own.
FET can be switched quickly at high frequency with no problem, unlike relays.

PWM sends a pulse every 2ms. That PWM output couples with the momentum of the load and the motor makes bigger ripples all its own.

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled “How to use this Forum”.
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Please google…

arduino pwm motor control

It will help you understand PWM and motor speed control.

Thanks… Tom… :slight_smile:

Reason to use an H-bridge is sign-magnitude drive. The article also gets into voltage ripple.

https://www.modularcircuits.com/blog/articles/h-bridge-secrets/

You could DIY an H-bridge given this know-how.