1

I have a diagram below using two DC motors and L298N motor driver, and I just want to make sure whether everything will work perfectly fine.

enter image description here

6
  • any code? any photo?
    – tlfong01
    Aug 23, 2021 at 7:53
  • is this photo not accurate enough? and i just want to know whether the circuitry is safe
    – coder
    Aug 23, 2021 at 8:00
  • This is NOT "a circuit diagram" It is meaningless without detail. What does the data sheet say? Unless these are tiny motors AA batteries are unlikely to work.
    – Milliways
    Aug 23, 2021 at 8:17
  • i'm sorry, these are dc motors and driver is L298N module, but if i would replicate this diagram into my circuitry, will one motor surely work without fail, and will this circuitry be safe?
    – coder
    Aug 23, 2021 at 8:21
  • What is confusing is that your diagram shows two motors, but your text states only one. It would have been better to have removed the unused motor from the image, prior to uploading it. Also, please try to fix the grammar and presentation of your posts. Aug 23, 2021 at 17:06

2 Answers 2

3

As long as that diagram is an accurate reflection of the wiring on the L298N module and between the module and the Pi it looks okay.

Of course only one motor will be controlled as no GPIO are shown connected to control the second motor.

Be aware that the module has three jumper pin headers.

  1. Above the motor power, ground, logic power blue sockets. If a jumper is fitted you must not connect logic power to the Pi. The jumper provides logic power from the motor power line.
  2. Over ENA. If a jumper is fitted you must not connect a GPIO to ENA (doing so will feed 5V into the Pi GPIO).
  3. Over ENB. If a jumper is fitted you must not connect a GPIO to ENB (doing so will feed 5V into the Pi GPIO).

To enable a motor you must either fit a a jumper to its enable pin or connect 5V/3V3 to its enable pin or connect a GPIO to its enable pin and set the GPIO high.

3
  • 1
    so instead using ENA or ENB, i should just connect to the input pins to control the dc motor and just leave the ENA and ENB alone
    – coder
    Aug 23, 2021 at 9:24
  • 1
    To enable the motor the corresponding enable must be high using one of the methods given in the answer.
    – joan
    Aug 23, 2021 at 9:25
  • 1
    yes so will this above diagram, work safely without fail, since i haven't done anything you've mentioned above. And if i want to plug in the second motor too, i should connect the input 3 and input 4 as well as ENB
    – coder
    Aug 23, 2021 at 13:16
2

Excellent circuit and it would be work. But the only problem is you cannot control the right motor because you didn't connect GPIOs to IN3, IN4 and ENB port.

As described in datasheet, all of ports in L298N can be driven at 3.3v so you just can connect GPIOs to ENA, ENB and IN1 ~ 4.

3
  • 1
    The OP states that they only have one motor. Aug 23, 2021 at 17:04
  • thank you for your response, so i have edited my post so that both motors would be plugged in, will this work?
    – coder
    Aug 24, 2021 at 5:31
  • Yeah, that will work
    – 박광렬
    Aug 26, 2021 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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