0
\$\begingroup\$

I’m trying to build a simple robot using 4 DC motors with 2 LM298's controlled by node mcu and powered by LiPo 3s battery.

Since powering the node mcu directly to the 3s LiPo(11. Iv) would be overwhelming for it, I was thinking of powering it from the 5 V rail of one of the LM298 (it has a built in 7805). Will it be okay to do so or should I use an external 7805 circuit or to go with a dc-dc buck converter. I’m not from electronics background so not very sure which way to go with.

\$\endgroup\$
  • \$\begingroup\$ If by LM298 you mean the L298 read this. Note also that the regulated output is not equivalent to a 7805 - its output can be as high as 7 volts (incoming supply dependent). \$\endgroup\$ – Andy aka Jul 29 '18 at 10:04
2
\$\begingroup\$

The L298 is obsolete. Really. Don't use it anymore. It's inferior in every way I can conceive to more modern competitors. Compare this answer. The LM7805 is kind of in the same category: It's an OK linear regulator, if you have absolutely no alternatives.

With that out of the way: you do NOT want to run your microcontroller off the same voltage regulator that is used by your H-Bridge driver. There's probably a reason the module containing the L298 (you're confusing the chip L298 with a module that contains that chip in your question) comes with its own voltage regulator, and its that there will be highly variable loads on that supply.

Since this is clearly a least-cost solution (why else use an obsolete chip?), the voltage regulators won't be dimensioned to be reliably stable under these loads – they will be sufficiently stable for the L298 and support electronics, but not for your MCU.

So, get a separate voltage regulator for your nodeMCU; by the way, nodeMCU is just the firmware running on an ESP chip, and you're again confusing chip with module.

The espressif ESP8266ex, which is running NodeMCU, is a SoC that takes 2.8V to 3.6V as input voltage. So, unless there's yet another voltage regulator on the wifi module you have, you cannot even use the LM7805 – as that outputs 5V.

So, get a linear regulator that outputs 3.3 V; you don't need multiple amperes of current to drive a node. Make sure you've got at least 200 mA reliably (which probably means dimensioning your linear regulator for 500 mA or so), that would be sufficient, according to Espressif's datasheet.

There's plenty of linear regulators to pick from, most of them much nicer in reaction to load shifts than the LM7805. If in doubt, consult for example TI.com and look for linear regulators with your input voltage, 3.3 V output, and a package you can work with (probably TO-something or *DIP-Something). They have good parametric tables with which you can play. Because you waste (11 V - 3.3 V)·(500 mA)~= 3.5 W of power as heat, you want something with less than 30 °C/W thermal resistance – or else your regulator will get more than 100 °C hotter.

That kind of indicates that for a voltage jump so big, you'd want a switch-mode regulator. Again, plenty of choices to pick from. Again, TI.com (and competitors) have a parameterizable search. You probably want a simpleSwitcher module from TI, as it comes with all things integrated. The TPSM84203 looks like a good choice.

\$\endgroup\$
  • \$\begingroup\$ I always wondered why the motor runs slower than expected even with 3s and 25c (I know 25c is overkill for my case). I should have checked the output voltage of Lm 298 'module' . \$\endgroup\$ – nirmeets Jul 29 '18 at 8:57
  • 1
    \$\begingroup\$ Simply get a better half-wave driver. Make sure your cables and traces are thick enough to carry currents. \$\endgroup\$ – Marcus Müller Jul 29 '18 at 9:07
  • \$\begingroup\$ -half-wave +H-bridge. I'm stupid. \$\endgroup\$ – Marcus Müller Jul 29 '18 at 9:18
  • \$\begingroup\$ @nirmeets for example, the DRV8830 has speed control – i.e. it makes sure the same (average) voltage is always supplied to the motor, no matter whether your batteries are full or nearly empty. That's cool, because a) it means motor speed is constant and b) your battery lasts much longer. And: you connect that thing to your ESP simply via I²C – two wires, one pull-up resistor, done – and can then control the speed and direction via software. So MUCH MUCH better than the L298. \$\endgroup\$ – Marcus Müller Jul 29 '18 at 9:25
  • 1
    \$\begingroup\$ Hi Marcus, Your answer seems to suggest that the OP must not supply 5V to the NodeMCU board, because of the voltage range of the ESP8266 SOC. Did I misunderstand your point? Because that isn't true for any NodeMCU board I've seen - they all have an on-board 1117-clone 3.3V regulator, and can be supplied with (for example) 5V or 12V, a bit like an Arduino board (or they can be powered from say 3.3V, bypassing that 1117 regulator). See here for examples. Hope that helps. \$\endgroup\$ – SamGibson Jul 29 '18 at 10:01
1
\$\begingroup\$

The LM298 module has an 78M05 regulator in DPAK, without extra cooling. The 78M05 has a junction-to-air thermal resistance of ~ 100C/W, so for a 100C rise in temperature it can dissipate 1W. With 11V in and 5V out that means 166mA. The L298 consumes ~ 40 mA max, so there is some 126 mA for external components to draw. That is enough to run an Arduino, some LEDs and LCDs, etc.

But an active ESP8266 is something different! According to https://www.esp8266.com/viewtopic.php?f=13&t=3875 it consumes (all figures approximate) 35mA average when connected, 70mA when searching for a connection, 320mA peak at startup or when communicating.

This might work with your LM298, especially when your NodeMCU is mostly inactive (and the startup is short enough to not overheat the 78M05), but I would certainly not be comfortable with it.

So when you plan to use the WiFi (I assume you do, or you'd have selected an Arduino) use some other way to get your 5V (or better, 3.3V, I don't think it needs 5V) for the nodeMCU. You could use an 7805 with some cooling, but there are very cheap switching modules that can easily do the task, and will make you batteries last longer.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.