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?
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.
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
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);
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
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.
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