Disclaimer: I am a very beginner in electronics and experiencing it's first steps into Raspberry Pi and its functionalities. So, please forgive me any rookie mistakes and correct me if I have any incorrect assumptions.

I want to power DC motors (range 3-6V) using my RaspBerry Pi 4 via a dual L298N motor controller. I have a battery pack of 6V to power my motors. https://www.youtube.com/watch?v=-ikmDMW6tEwThis (2:30 - 3:30) video says the L298N needs a 7-12V input to work properly (due to power drops by the transistors, from other sources). However, to be suitable for my motors, I have chosen for 6V power supply thinking to use the 5V supply of my Pi to supply the electricity input for the L298N (as the L298N requires 5V for it's regulator).

I have two questions:

Q1. Will my setup work when only applying the 6V battery?

Q2. If Q1 does not apply: Is it correct to get 5V from Pi GPIO pin to power the L298N (with 12V jumper removed from the L298N so the 5V power port will be used for energy input)? Or will this mess up my Pi or create any shorts?

  • 1
    you can power motors using the RPi GPIO if you do not mind that the RPi will become an expensive fuse – jsotola Aug 27 at 0:40

6V motors usually work fine with 5V (other than the fact that they run at 80%..85% of it max speed). However, powering a motor from the Pi is only possible for very small motors, which have stall current that the Pi can provide without a significant voltage drop. Even toy motors are often rated for 2A stall current or more, which can easily reboot the Pi because of undervoltage the moment the motor starts.

| improve this answer | |

There is more than one type of motor driver board using the L298N.

The typical board has two voltage inputs and a common ground.

One voltage input is to drive the motors. The other voltage input is to provide logic power to the module.

Typically the board has a jumper which can be fitted to supply logic power from the motor supply. If that is fitted DO NOT connect the Pi's 5V supply to the logic supply.

You can connect the Pi's 5V supply to the motor supply (as long as you don't connect another power source). However don't expect to be able to power much of a motor.

| improve this answer | |
  • But as the 5V input port is just for the logic power, and the 12V input port is for the motor power, the power I will supply to the 12V input port (which is 6V in my case) will be directed to the motors right? I see it this way: the 5V input is just to enable the logic (literally enables the controller to function), and the power supplied to the 12V input port (for the motors) is independent of this. Saying the voltage applied to the motors does not care where the power comes from: from the original power source using the 12V input, or from the 5V input – Matthias Aug 25 at 17:52
  • 1
    Extra clarification: my plan is not to power my motors from the Pi's 5V GPIO directly (as I've read on multiple sites this could serisouly damage your Pi). My plan is to power the logic of L298N controller from the Pi's 5V GPIO. – Matthias Aug 25 at 17:56
  • @Matthias You are asking us to make assumptions and give advice about an unknown motor driver board. – joan Aug 25 at 19:44
  • Apologies. I have a Motor driver module L298N Dual H-Bridge. – Matthias Aug 26 at 8:11
  • @Matthias There must be tens if not hundreds of different makes/models of motor driver boards using the L298N. – joan Aug 26 at 10:23

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.