Arduino Nano - Mosfet - L298N - Dc Motor protoboad fails

Thread Starter

quique123

Joined May 15, 2015
389
Hey guys, Im back with trouble here. I had a project where a Nano would momentarily set a pin HIGH to turn on a Mosfet and feed an L298N in order to make a dc motor vibrate and shut back down to repeat the cycle later and it worked fine. I moved over from breadboard to through hole but I cant seem to make the motor run anymore. The same setup worked on the breadboard but now fails to run the motor.

I know the code is fine because it worked before (on the breadboard). Here is the diagram:
l298Fet.png
I read the voltage between the D5 pin on the nano and GND and I get 5V on the multimeter, so I know the pin on the nano is being set to HIGH as expected.

I read the voltage between 12V of the L298 and the GND of L298 and I get 0 when nano-D5 goes high.

I read the voltage between GND and Mosfet Gate and I get 5V when nano-D5 goes high.

So it must be something else. Here are the images of my board:6063F66F-9C03-4B57-B067-E7EBFED06689.jpeg
 
Last edited:

bertus

Joined Apr 5, 2008
20,317
Hello,

Why are you switching the ground connection of the L298?
The L298 has enable inputs.
What is the voltage on VCC?
That should be the logic voltage.

See this image for all pin functions:

L298_pin_function.png

Bertus
 

Attachments

dendad

Joined Feb 20, 2016
3,316
Switching the GND like that is not a good idea.
You then end up with a "resistor" (the L298) connecting 9V to the Arduino pins.
As mentioned above, use the enables.
I can't quite follow why you want to switch the GND anyway. Already the inputs switch the motor on and off.
 

Thread Starter

quique123

Joined May 15, 2015
389
The voltage is about 9v, it has worked before. What do you mean why am I switching ground?

---Do you mean I should connect the drain to the VCC of the L298 instead of connecting drain to GND?

I'm using a mosfet to switch so that the l298 doesn't drain my battery as it otherwise would.

---So you suggest I skip the mosfet and connect EnA to nano pin 5 and leave In1 to Nano pin 6 and In2 to Nano pin 7?

I took this example from an online project a long time ago.
 
Last edited:

dendad

Joined Feb 20, 2016
3,316
Are you wanting the motor to reverse? Or is it just a vibrator motor?
The L298 chip is pretty old and is quite lossy. If you want good battery life, I'd look at another.
If your motor current is below 800mA, maybe these?
https://www.jaycar.com.au/l9110-bridge-motor-driver-ic-dip-8/p/ZK8882 They too are old and may be hard to get.
If you don't need speed control, a couple of DPST relays can do it and then there is no power consumed when they are off.
 

Thread Starter

quique123

Joined May 15, 2015
389
Just vibrating. I know about the relays but I wanted to keep the package as small as possible.

So do I wire the Drain to Vcc instead?

What about the enable pins suggestion?

Thanks again
 

spinnaker

Joined Oct 29, 2009
7,837
Just vibrating. I know about the relays but I wanted to keep the package as small as possible.

So do I wire the Drain to Vcc instead?

What about the enable pins suggestion?

Thanks again

Why are you using a MOSFET at all??? Use the enable pins or inputs as Burtus mentioned.

http://microcontrollerslab.com/l298n-motor-driver-circuit/

There are MUCH easier ways to do this.

https://www.ebay.com/itm/2X-L298N-DC-Stepper-Motor-Driver-Module-Dual-H-Bridge-Control-Board-for-Arduino/222600657279?epid=15007273833&hash=item33d408797f:rk:1:pf:0
 

dendad

Joined Feb 20, 2016
3,316
On the circuit you have, is Vcc, Enable_A and Enable_B all hooked to +5V? If not, That is possibly why it is not going.

You could try Enable_A and Enable_B hooked to pin 7 and the L298 GND directly to GND (remove the FET) then see what the current is when the L298 is disabled too.
The FET you have cannot easily be used to switch the power. There are ways to do it but get it running then check what the current consumption is with the L298 off to start with.
 

Thread Starter

quique123

Joined May 15, 2015
389
OK,

EnA is jumped which means there is no need to set it to high to make the motor run according to the datasheet of l298.

I just figured out the R was 220Ω instead of 1kΩ. Replaced it and it works again.

However I want to get back to 2 points I consider important that you guys mentioned:

1. I should switch the VCC instead of the the GND, which means I should do this:

Screen Shot 2019-01-11 at 6.13.32 PM.png

2. I should skip the fet and simply do this:

Screen Shot 2019-01-11 at 6.15.26 PM.png
 

spinnaker

Joined Oct 29, 2009
7,837
So you are using the Ardunio module? It would have be nice if you mentioned that from the beginning. There are many, many articles on how to use this module posted on the internet.
 

ScottWang

Joined Aug 23, 2012
6,873
I think you choose the wrong MOSFET, because it was designed for the high voltage, so its Vgs =±14 and the Rds=2Ω, it's very bad for the low voltage as +5V uC, you should choose a Vgs = 4.5V logic level voltage or less.

BSS97 -- Nch, 200V, 1.5A, Vgs=±14V, Rds=2Ω.
 

ScottWang

Joined Aug 23, 2012
6,873
The drain and source of the FET are shorted together in your schematic. Where is the motor connected?

That's the rated maximum Vgs. Vgs(thr) is < 2V; so it's a logic=level FET.
Thanks.
I only found the Rds(on), Vgs=10V, Id=1A.
Do you have another datasheet talking about Rds(on)=2Ω, Vgs=4.5V?
 
Top