I’ve wired up the car in Project 2, but not getting any power to the wheels. I checked the L298N motor driver with a multi-meter but there is zero power output. I did measure input power to the board (6v +) and the red LED is on. I already replaced this board but same thing, so it seems to be how it’s wired at the board, but I followed the instructions. I see the Enable pins are actually two pins, and I selected the pin towards the edge. The Android WiFi GUI and all esp32 wiring looks fine. Suggestions how to diagnose ?
Are you powering the Motor driver on the “+12V “pin? Do you have the plastic jumper in place? Or did you remove it?
From that photo, everything seems ok. But I don’t know about the rest of the circuit.
How are you powering the ESP32?
It is powered by the power bank (shown in photo under the motor driver. As mentioned, it is connecting to the WiFi and the LEDs are on, so I know the board is working.
It is very difficult to find out what might be wrong.
Do you have another motor driver to experiment with?
As mentioned, I tried a second one. Perhaps I can somehow test the driver in a more simple configuration?
Maybe you can try controlling just one motor.
Did you check the signal that is coming out of the ESP32 GPIOs?
I guess I should know the answer to this by now, but how do I check GPIO signals? On an oscilloscope?
Not necessarily. You could just use a multimeter. Even with PWM you should see an average on your multimeter.. everyone should have a multimeter if working with an Arduino. If you can afford an oscilloscope you can see the waveform of a PWM signal.
If you have an oscilloscope, you should be able to actually see the signal.
If you don’t, as Steve mentioned, you can use an oscilloscope.
Actually I have a small Chinese hand-held oscilloscope and an older large Tektronix scope given to me by a relative. Regardless, I used a standard digital multimeter and got +5v (not +6v) on each pin save for the motor outputs (zero). Interesting, I got 0.5v on each GPIO pin when the esp32 was off (esp32 GRND). If a minimum 6v from the battery pack is required to measure output at the motor output, I can’t get it with just four AA batteries. FYI, the illustration on pg 539 shows AAA batteries.
I’m sorry, but I didn’t understand if you measure the output of the ESP32 GPIOs?
Without anything else, just the output of the GPIOs when controlled with the web server?
The problem may be the with the ESP32. Anything else seems fine to me.
The total of the battery pack was 6V.
I see. I was measuring it where each GPIO connects to the motor board with everything powered on.
If I just power the esp32, this is what I found:
PIN F L R RV S
32 2.6 —————————>
33 0 0 0 3.3 0
25 3.3 3.3 0 0 0
26 3.3 0 3.3 0 0
27 0 0 0 3.3 0
14 2.6 ————————–>
F=forward L=left R=right RV= rev S=stop
GPIO 33 and GPIO 14 are the enable pins. They control the speed of the motors. So, I think that is an expected value.
The other values are also right to control the motors.
So, everything seems fine on the ESP32 side.
I really don’t know what can be wrong :/
Let me know if you find out anything new.
I think you meant GPIO 32 is an enable pin.
This is the second project in a row which I could not succeed, so a bit discouraging ; (
I think failures are good to learn from as long as you can figure out a test plan to determine root cause.
In this case, why would a motor controller not send output signals if it is powered and receiving input signals?
I suppose (low probability) that both boards are defective, but I will buy a few more.
Yes, I meant GPIO 32.
I’m sorry that you can’t get it working – it is very frustrating.
Unfortunately, I really don’t know what might be wrong. Everything seems to be setup properly.
It’s not likely that the two motor drivers are defective, but it’s possible
Just to be clear, if there is less than 6v going to the board, there should still be some kind of readable value? In other words, the board doesn’t have a cut-off diode if <6v ?
Accordingly to the documentation, we must supply between 6 and 12V.
What’s the voltage that you’re supplying?
I am using rechargeable batteries, and no matter what four AA I use I can never get 6v. I went to a five AA pack and register > 6v when I put the multimeter clips over the power input screws. However, when I issue a FORWARD command and put the clips over the motor output screws I still register 0v. I really don’t understand what we are doing that is different. And I assume that an output value would be found regardless if the motor wires were connected?
So those batteries may be your issue. An alkaline battery is nominally 1.5V but supplies around 1.6V when new. Four of those would give you more than 6V. A NiCad or NiMH battery is nominally 1.2V so you would need five to get 6V. A LiPo battery is normally 3.7V for a single cell.
Then there’s the current draw. A motor has high startup current. What is the maH of those rechargeable batteries and how old are they? The current draw may be too much for these batteries. I would use four standard alkaline batteries to start before experimenting with rechargeable batteries.
I replaced the batteries with non-rechargeable AA and it worked! Clearly something here to be learned that I did not realize. When I used the 5 AA (in-series 2000mAh NMH) pack I measured > 6v, yet it did not work. Current draw wasn’t something I was thinking of. So a few questions here:
Why wasn’t a voltage measured at the output screws, even when the motors did not work? If a load doesn’t draw current, by definition then there will be no measured voltage? How does the motor board circuit do this? If I attach a large motor to a 12v battery but doesn’t turn, I can still measure 12v.
How to test a design to ensure proper voltage and current supply before building it?
How to test that rechargeable batteries will furnish adequate current prior to use?
Do battery specs provide useful information regarding minimal current after recharging?
thx again for your continued input, Jack
Battery spec’s will provide all of that including that the old rechargeable batteries are 1.2V.
Batteries will lose part of their maximum current every time they are charged. NiMh batteries are quite old so that 2000mAH is probably down to 800 or even less. So, when you started the motors they were probably pulling over an amp.
For this project you probably would have been better off with a 2S LiPo battery pack designed for model cars. Of course you would also need a charger for that chemistry.
When I design a circuit I use a lab power supply to figure out the requirements then select the best battery chemistry to supply the voltage and current. You can calculate requirements but real world testing is always best.