# L298N ENA/B PWM Speed Controlling Not Working

**URL:** <https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407>\
**Category:** General Guidance\
**Created:** [February 16, 2025, 12:10am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407 "2025-02-16T00:10:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 16, 2025, 12:10am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/1 "2025-02-16T00:10:05Z")

</div>

Hello!  
I am currently using an [Arduino R4 Minima](https://www.amazon.com/dp/B0C78K4CD4?ref=ppx_yo2ov_dt_b_fed_asin_title) board and an [L298n Motor Driver](https://www.amazon.com/dp/B0BBF4HLT5?ref=ppx_yo2ov_dt_b_fed_asin_title).  
I tried to use them following this tutorial from the [arduino project hub](https://projecthub.arduino.cc/lakshyajhalani56/l298n-motor-driver-arduino-motors-motor-driver-l298n-7e1b3b) and this one from [YouTube](https://www.youtube.com/watch?v=E2sTbpFsvXI).

When I have the jumper wire connecting the ena pin to the other pin (see green circle diagram below), everything works smoothly. However, when I remove the jumper pin and attempt to control the speed of the motor via the ena pin, the motor will not spin at all. I have 2 of these drivers and neither work with the ena/enb pins, and I tried all the pwm ports on my arduino, but to no avail. Thank you!

> **Current code I am using to attempt to control the motor speed (taken from the arduino project hub article)**
>
> ```arduino
> int motor1pin1 = 2;
> int motor1pin2 = 3;
> int motor1ena = 11;
> 
> void setup() {
> // put your setup code here, to run once:
> pinMode(motor1pin1, OUTPUT);
> pinMode(motor1pin2, OUTPUT);
> pinMode(motor1ena, OUTPUT); 
> }
> 
> void loop() {
> // put your main code here, to run repeatedly:
> 
> //Controlling speed (0 = off and 255 = max speed):     
> analogWrite(motor1ena, 100); //ENA pin
>   
> digitalWrite(motor1pin1, HIGH);
> digitalWrite(motor1pin2, LOW);
> delay(3000);
> 
> digitalWrite(motor1pin1, LOW);
> digitalWrite(motor1pin2, HIGH);
> delay(3000);
> }
> 
> ```

> **Diagram of my circuit**
>
> ![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/5/d/e5d486feb24dcb42c07ad73b9a9af6ecfc9f96ad.jpeg)

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 16, 2025, 12:11am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/2 "2025-02-16T00:11:53Z")

</div>

Due to limitations, I wasn't able to post this in the original post, but here is a video (albiet low-quality) of my problem.

> **Video of my problem**
>
> [20250215\_155618.mp4 - Google Drive](https://drive.google.com/file/d/1VHLYOvOB7xCQl99aBeez1c1sZh_GGf9w/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [February 16, 2025, 12:49am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/3 "2025-02-16T00:49:59Z")

</div>

Please extract the essential information and post it here. No way watching tutorials.  
Here's some advice: [How to get the best out of this forum - Projects / General Guidance - Arduino Forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681308)

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [February 16, 2025, 12:53am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/4 "2025-02-16T00:53:53Z")

</div>

To power motors from an Arduino is asking for problem. Get an external psu.

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [February 16, 2025, 12:54am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/5 "2025-02-16T00:54:12Z")

</div>

![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/5/d/e5d486feb24dcb42c07ad73b9a9af6ecfc9f96ad.jpeg)

- **Never** power a load from your Arduino. 😱  
i.e. only very light loads are allowed.

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [February 16, 2025, 1:09am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/6 "2025-02-16T01:09:13Z")

</div>

Resolution is ok, but I have some more bad news:

Never use metal objects in powered up electronics. Those pliers can easily short something out.

Besides this I think you're making progress 😉 🙃  
Curious to hear how it works with an separate psu

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 16, 2025, 4:43am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/7 "2025-02-16T04:43:03Z")

</div>

> [@Railroader](#):
>
> Please extract the essential information and post it here. No way watching tutorials.  
> Here's some advice: [How to get the best out of this forum - Projects / General Guidance - Arduino Forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/681308)

Oh my bad about the links... its a shame people try to post malware here.

> [@ledsyn](#):
>
> Besides this I think you're making progress 😉 🙃  
> Curious to hear how it works with an separate psu

Lol yeah once I get my step up module, we'll see how it goes... 😅

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 18, 2025, 12:39am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/8 "2025-02-18T00:39:14Z")

</div>

Recieved the voltage conveter, and the ena pin works, kinda...

At first the motor spins just fine, but in 5 seconds it goes to spinning normally to being too weak to spin, whilst both the motor and blue voltage converter make weird noises.

[![](https://europe1.discourse-cdn.com/arduino/original/4X/7/5/1/75148192fdaee903f11bbeb70c4a6e2615d178d7.jpeg "Arduino Motor Problem") ](https://www.youtube.com/watch?v=4DCU_W6ZtJk)

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [February 18, 2025, 3:13am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/9 "2025-02-18T03:13:29Z")

</div>

So you power the motor from a separate PSU now? Please make a **complete** diagram this time.

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 18, 2025, 3:49am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/10 "2025-02-18T03:49:44Z")

</div>

Oh yes my bad.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/5/d/a/5da237f5331a57c8134559ce798874bb938c6bb7.jpeg)

The first green one boosts the voltage from 1.5v to 5v and the second blue one (which is the one making a clicking noise) boosts the voltage from 5v to 12v, which then powers the L298n.  
My arduino is powered by my laptop from a USB C cable.

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [February 18, 2025, 3:59am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/11 "2025-02-18T03:59:22Z")

</div>

Please elaborate on the 1.5 part. In the picture the batteries are in series = 6 V

How many batteries, what size?

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 18, 2025, 4:31am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/12 "2025-02-18T04:31:47Z")

</div>

> [@ledsyn](#):
>
> How many batteries, what size?

Four double A, 1.5v each.

> [@ledsyn](#):
>
> Please elaborate on the 1.5 part. In the picture the batteries are in series = 6 V

Oh my gosh I am dumb thank you so much 🙏  
So I'm probably overloading that first green voltage converter...  
Tomorrow I'll fix the circuit and see what happens

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [February 18, 2025, 2:28pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/13 "2025-02-18T14:28:27Z")

</div>

Maybe, but if it haven't released the magic smoke yet it's probably ok.

Best setup would be a 12 V battery, or Lithium batteries to get 3.6 V x 4 and go downhills from that. You could drive the motor without any conversion, and one buck converter for 5 V, smaller losses.

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [February 28, 2025, 6:29am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/14 "2025-02-28T06:29:04Z")

</div>

Sorry for the delay, I had quite the busy week 😅  
Anyways though, I soldered 2 4-AA battery packs together to make an 8 AA battery pack, wired that to the L298N, and ran the code.  
It does run for a lot longer (15 seconds), and the PWM speed works, but then proceeds to dp the same thing of rapidly deteriorating to spinning weakly to not at all, even though the voltage of the batteries only dropped to 12.2V (although it does seem weird how 8 AA batteries were delivering more than 12V...)

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/6/d/9/6d9f2ec500aeae67f47420525af2407200854383.jpeg)

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [March 1, 2025, 8:35am UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/15 "2025-03-01T08:35:06Z")

</div>

> [@gigahertz-t](#):
>
> the same thing of rapidly deteriorating

I think your L298N is busted, do you have a spare?

Another thing, why not power your Uno from the batteries to Vin directly?

> [@](#):
>
> weird how 8 AA batteries were delivering more than 12V

New batteries can be at a slightly higher V.

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [March 1, 2025, 6:00pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/16 "2025-03-01T18:00:57Z")

</div>

> [@ledsyn](#):
>
> I think your L298N is busted, do you have a spare?

I figured out that for some reason the L298N wouldn't work if I powered the arduino from it's 5v output, so I used a seperate power supply for said arudino (3 AA batteries with 5v step up)  
I was going to try to use my spare L298N, however, when I plugged my 5v power supply to the Arduino 5v pin (mistake #1, should've used the VIN pin), the arduino didn't turn on. I then made a big mistake and connected my laptop to it via USB (mistake #2) and got the rice krispy electric death omen of snap, crackle, and pop....

So I gueas that's the end of that for now..., thank you for all your help though! 🙏  
(I might get another one... I never like leaving a project unfinished)

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [March 1, 2025, 6:05pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/17 "2025-03-01T18:05:32Z")

</div>

No! That sucks, I'm sorry to hear that. What released the magic smoke, whether it was visible or not?

---

<div class="post-metadata">

**Author:** ![gigahertz-t](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/gigahertz-t/32/1197326_2.png) [@gigahertz-t](https://forum.arduino.cc/u/gigahertz-t)\
**Post date:** [March 1, 2025, 7:42pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/18 "2025-03-01T19:42:17Z")

</div>

The middle black chip had a little explosion and flame. There is a little hole where it detonated and shot a little flame from

 ![20250301_114109](https://europe1.discourse-cdn.com/arduino/original/4X/0/6/d/06db57533475aa03f51d8b9a150e4e388d42d387.jpeg)

---

<div class="post-metadata">

**Author:** ![ledsyn](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ledsyn/32/1203827_2.png) [@ledsyn](https://forum.arduino.cc/u/ledsyn)\
**Post date:** [March 1, 2025, 8:12pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/19 "2025-03-01T20:12:42Z")

</div>

Yikes. One careless move and it's gonski. 😕

Get back soon, take care now.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 28, 2025, 8:13pm UTC](https://forum.arduino.cc/t/l298n-ena-b-pwm-speed-controlling-not-working/1354407/20 "2025-08-28T20:13:21Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
