ESP32C3+MT3608+TB6612FNG -> 12V DC Motor

Hey.

Can someone take a look? The trash can is becoming more and more enticing… :expressionless:
Maybe a pair of fresh eyes could to wonders.

The problem seems to be with the TB6623FNG - or with me; but anyway.
It’s getting the right voltages were it should: VM-12V, VCC-3.3V, STBY-3.3V.

I’ve looked at the connections, time and time again, and everything is ok.
But the 12V doesn’t reach the motor or A1+A2; there’s a tiny reaction forward and reverse when the gpios are activated by the code (esphome) but nothing more than that.

What is the max current output of the ESP32 5V line? You are stepping it up and trying to power the motors with it and it’s unlikely to be designed for that kind of power handling.
from adafruit: ( Vmotor - This is the voltage for the motors, )

1 Like

Are you familiar with Ohm’s law?

Ohms_law_wheel_WVOA

If not, now would be a great time to learn, and you get to be one of today’s lucky ten thousand. :tada:

Just because the “open circuit voltage” to the motor controller (when the motor is switched off) reads 12V doesn’t mean that the circuit is able to provide enough power (measured in watts, which is volts times amps) to the motor.

You haven’t provided the specifications for the motor you are using, but let’s say for the sake of argument that it draws 1A at 12V when running. That would be 12W.

To get 12W from 5V requires 12/5 = 2.4A at 5V, ignoring losses in your MT3608 step-up board.

It is unlikely that the power supply going to your ESP32C3 (presumably USB on a dev board?) can source enough power — so when you exceed the power capacity of the supply (at the weakest point), then the voltage will drop. The MT3608 can’t hold the output at 12V if the input can’t supply enough power. What will happen is that the voltage will drop under load.

All About Circuits has an introductory resource for learning more about Ohm’s law.

If you want more help, you’ll really have to provide more detail about where the 5V is coming from and exactly which components you are using.

1 Like

leads to the schematic

I’m somewhat familiar with this, I have one of these boards with a battery running off a solar panel at home. There is a charge circuit on the board… The power supply part of the schematic is relatively complex.

However, one bit that is not complex is that the 5v pin on the Xiao board is directly connected to VUSB (usb-c), all the e-fuses, rp-diodes and regulators sit downstream of this.

EG: there should be no issue with the XIAO board itself limiting the supply (unless you draw so much power that you burn out the tracks/connectors),

This means the limit is the step-up circuit itself… and the USB power supply.

2 Likes

Thank you for the feedback, everyone.

@easytarget that was my thought exactly… We are talking about a 12V DC Motor / 280rpm - I’ve test the motor, without a load, and it was drawing 40mA.


I can make it work at 6V, if I tune down the MT3608 (booster), but beyond that (9V-12V) no luck.

Try running the loaded motor directly from the MT3608.
If that works the problem is not with the power.

Is U3 a breakout board? The names and number of pins do not match a raw part.

I don’t see a direct logic ground between U1 and U3 meaning the logic control may be floating. U3’s ground is picked up from the output of U2 and it is not clear if that is logic ground.

More info on U2 Modules source and the configuration of U3 Module/part would help.

2 Likes

That’s one the first tests I did; it worked without a problem outputting 12V to the motor.

U2 - MT3608 (Aliexpress)

  • Supply Voltage: 2-24 V
  • MT3608 2a Boost Board DC-DC Adjustable Power Supply Module Wide
  • Voltage Input 2/24V to 5/9/12/28V

Product parameters:

  • Output voltage:>5V-28V
  • Efficiency:>93%
  • Output current:2A

The U3 it’s the TB6612FNG from Keyestudio:

  • Power supply voltage: VM=15V max, VCC=2.7-5.5V
  • Output current: Iout=1.2A(average) / 3.2A (peak)

Theoretically, it shouldn’t have any trouble running this setup.
VM is being supplied by the 12V coming from the MT3608 and the VCC by the 3.3V from the ESP32C3. I did check on both ends.

I also checked the continuity between all GND, for integrity - and they all share a low resistance (0Ω).

I’m testing this on a PCB I design, so I even wondered if the problem could be there, but I did change the width of the traces were the 12V would be running, for some ‘slack’, to 1mm instead of the default 0.3mm (0.254mm); and also added to the clearance in between.

1 Like

My earlier assumptions about the current were for a larger motor, clearly! (I’ve seen questions without context from others who didn’t understand the relationship between voltage, current, and power, thus my description of Ohm’s law. :smiling_face:)

.25mm of 1oz copper can carry 1A with 10°C temperature rise. 1mm for 40mA is far more than plenty, and .25mm spacing is OK for up to 50V. So that is unlikely to be related to your problem.

2 Likes

I note that 0v (gnd) is bonded via U2.

  • Have you verified that -vin and -vout on U2 are bonded (shorted, Zero ohm) in the module?
  • If not there needs to be an external bond between gnd on U1 and U3. or a seperate gnd bond to the correct and pin on U3
  • This is what @donkjr was describing above.

Also; U3 has three gnd inputs, are they equivalent? or is one of them a specific ‘logic’ ground connection?

Edit:
What is the startup/stall current on your motor?
40mA is, I assume, the unloaded current. What do you see if you Stall it?

  • This is the Current you need to design around. Not the no-load run current.

And even though your step-up converter is very efficient you need to remember that 1A to the Motor is 2.4A draw on the 5V USB supply…

1 Like

Also, note that the startup/stall current measurement would be with the load attached.

I looked, and the step-up converter is max 93% efficient, so 5V current is about 2.6x the 12V current.

If I understand correctly, the same power supply and the same step-up converter successfully ran the motor without the TB6612FNG motor controller in the way?

2 Likes

@easytarget yes, they are. I checked throughout the grounds - they are all bounded. I was even checking with one probe on the usb input of the ESP32C3.

You’re right about the current I’ll have to design around; but for now let’s just say it’s the test phase… If I can’t turn on the motor, unloaded, there’s not much hope for the next phase. :pensive:

@mcdanlj yes; it runs without a problem.


I did another test I hadn’t remember to do before:

  • I stepped-down (relative to initial 12V it was outputting) the booster U2 (MT3608) to 6V. With everything connected - it works without a problem: forward/brake/reverse.
  • I let the motor run (fwd), then I start to step-it-up; it keeps running at 9V / keeps running at 12V.
  • I stopped the motor. The booster is still outputting 12V; I start again and nothing - just that slight movement the motor does.

It seems to shows (even if the motor’s load is lighter due to its momentum) it’s not a matter of overdrawing. Mostly, it seems as if the STBY of the TB6612FNG it’s not getting High enough(?) to start the motor.

just a thought, if the driver is set to deliver 1A at 12V that’s 12W of power and at 6V that’s 6W of power. But as others mentioned, start current is going to be much higher for a brief period so maybe it’s trying to pull 24W at 12V and can’t supply that while at 6V the 12W to start is there to start and keep it running.

1 Like

Quite the reverse in my opinion. It’s exactly what I expect from an overcurrent at start.


I’d be willing to bet that the motor will run if at this point:

You give the shaft a twist in the correct direction.


The startup current of a DC motor is much much much larger than it’s running current.

At 6v the PSU/Upstep does not overload on the startup and does not brown out. At 12V the doubled voltage means doubled current, and it does brown out. This is what @dougl is saying above too.

1 Like

Have you tried ramping PWMA duty-cycle to soft-start the DC motor?

The datasheet I find of the TB6612FNG is pretty sparse and doesn’t cover details of protection circuitry, if any.

3 Likes

Since the motor does not stall when connected directly to the 12V supply.
Guessing something in U3 is limiting the current?

Logic supply voltage (VCC) can be in the range of 2.7-5.5VDC, while the motor supply (VM) is limited to a maximum voltage of 15VDC. The output current is rated up to 1.2A per channel (or up to 3.2A for a short, single pulse).

Could the motor draw more than 3.2A @12V on startup?

You could measure the stall current of the motor by locking the shaft and measuring its current for a brief period.


Although this looks like a hardware issue I have been fooled by software before.
I would disconnect U1 and jump all the control signals and PWM to run the motor at full throttle thereby eliminating the software.

1 Like

Ugh… I solved the trouble - finally.
Thanks everyone for your ideas and advice!

Meanwhile, going down the rabbit hole, encountering bifurcations and galleries, and trying everything I could think of, I added a pull-down resistor (10kΩ) between the STBY and GND; then I simply put aside the code and connected STBY directly to 3.3V and even 5V - so it would always be on High. I added a 1000µF 16V capacitor between the VM and the GND pins of the TB6612FNG, hoping it would help with the initial surge to start the motor… Still no luck.

Then I changed direction; I noticed, while I was stepping-up/down the MT3608, that the motor would stop as if when I pressed the knob a little harder the circuit would get open. So I took it off and added a mini DC booster module I had around with default 12V - still, and that’s when things got weird - whose specifications said: “Input 5V: Will output 8V 0,7 A, 9V 0,7 A, 12V 0,5 A

Anyway, after that I did what I should have done from the beginning and connected the ESP32C3 to the bench power supply. I set it at 5V 1A, output it and… OCP. :expressionless:

Set it to 2A and… it worked.

Then I checked the charger I was using for tests: 5V⎓1A.
Then I looked at the DC mini booster I was trying…
Then I watched multiple times the current output from the bench power supply, when the motor would start: 180mA/130mA/535mA/175mA… Some variation should be related with the Bluetooth & WiFi modules of the ESP32.

Scratching my head, I thought about the different chargers I used before to test, and simply concluded it must have been different faulty variables that were always affecting the end result.

P=VI 12V at 1.5A is 121.5=18W while 5V at 1A or 5*1=5W so no way can you get 18W when you are only putting in 5W.

And if you are using a USB cable to supply the power LOTS of those USB cables are crap and made of very thin wires which means higher resistance which will drop Voltage by the time the 5V from the power supply gets to the ESP32 and instead of 5V you are starting with ~4.8V which results in even LESS input power to start with.

Your experimentation got you to what many of us have been saying. Good that you can now move onto the next problem or better, a running project.