• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Module 9 Unit 2 Motors not getting enabled

Q&A Forum › Category: ESP32 › Module 9 Unit 2 Motors not getting enabled
0 Vote Up Vote Down
Dolon asked 6 years ago

I have completed the circuit and Serial Monitor shows commands being received, but motors are not being enabled.
I have used LeD to check the circuit on breadboard and can see IN 1-4 are being activated HIGH, by relevant buttons.
No signal is evident on the Enable Pins 14 and 32.Have tried moving Slider to 100 but still nothing.
How should I troubleshoot this?

6 Answers
0 Vote Up Vote Down
Dolon answered 6 years ago

After looking online for more information on the L298N drivers, I noticed on one YouTube video that an LED on the driver wis lit .
Since mine was not ON, I decided to try 12V AC Adaptor and the LED lit up.
So it appears that the  4.8V battery pack (with 4x 1.2V rechargeables) is insufficient.
Next I checked each output by connecting to a test LED. and got the following result:
Pin14 NO OUPUT on any Button
Pin27  Output only with Reverse Button
Pin 26 Output with Right & Forward Buttons
Pin 25 Output with Left & Forward Buttons
Pin 33 Output only with Reverse Button
Pin32 NO OUTPUT on any Button
Decided to try with the Enable Jumpers and Motors now work. Will have to edit program to get correct FWD/REV direction.
Still not sure why there is no Enable Output, even with Speed Slider on 100.

0 Vote Up Vote Down
DK answered 6 years ago

Hi
I made a Wifi car first with esp8266, then replaced it with a esp32 using L298N driver
read
https://rntlab.com/question/in-esp32-robot-example-in-course-can-you-use-5v-from-l298n-directly/
 
https://randomnerdtutorials.com/esp32-dc-motor-l298n-motor-driver-control-speed-direction/
 
https://www.youtube.com/watch?v=2AL7HfiRlp4
 
 
Note :

  • Make sure you have all of your grounds connected together. (NodeMCU, Power Source, and Motor Driver)

 
Hope it helps

0 Vote Up Vote Down
Dolon answered 6 years ago

Thanks for the links. The use of the 9V battery should fix the issue of the 4.8V battery pack.
I have now been able to get the motors working with the enable jumpers and have them operating in correct direction to suit the buttons.
Still no PWM output. I checked the Seiral Monitor and it appears that no Slider movement is being picked up.
This line is not printing in the Serial Monitor: Serial.println(valueString);
 

0 Vote Up Vote Down
DK answered 6 years ago

hi

what range is your Slider ie 0 – 100

PWM for esp32 is from 0 to 1023  at 10 Resolution

  • circuits4you.com/2018/12/31/esp32-pwm-example/

Serial.println(“40 % PWM”);
ledcWrite(ledChannel,410); //PWM for esp32

I had to try different values for the car to work ….

Regards

0 Vote Up Vote Down
Dolon answered 6 years ago

The code from your link works perfectly dimming the on board LED. I checked and compared with the WifiCar code but still could not get any PWM output. 
As a last resort, I changed this line: int dutyCycle = 700; and commented out 2 lines in the if/else loop:
//ledcWrite(pwmChannel, 255);
//ledcWrite(pwmChannel, dutyCycle); !
Now I have both enable pins always ON and can tweak the Speed in the program, to get my car working.
 

0 Vote Up Vote Down
Dolon answered 6 years ago

Just an update for those following this. After much searching online and checking code for syntax errors etc and testing different versions, I may have found the culprit.
Its either Microsoft Edge or Windows Defender which is blocking the motorSpeed Get.
  I was using desktop PC to connect to the EsP32 and the webserver. Decided to try with
 my Android phone instead. Immediately got Motor Speed display on the Serial Monitor.
Also added $.ajaxSetup( {timeout:1000}) before the motorSpeed function call. It was missing in the Wifi car code

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.