Connect L298N to ground

I have 9 sensors connected to my Arduino Mega.

Two questions:

  1. Can I connect the GND lines of each sensor to a single Arduino GND pin? As Arduino has several GNDs I don't know if I can only connect one per pin.

  2. I have two motors that I will use with 9V and I will connect them to the 12V input of the L298N.

My question is regarding the GND of the L298N. Is it connected only to the battery or should I also connect it to the arduino? I ask because I see several images, in one it is connected and in another it is not.

  1. All the Arduino ground pins are connected together by copper traces on the circuit board. For your project, you can use any or all.
  2. I don't understand. Your picture shows the proper connections, so why connect the motors to the 12 volt input of the L298N?


1 Like

Thanks, Paul.

One picture shows L298N grounded to Arduino and another not grounded.

I think that the correct thing is to connect it to GND battery and GND Arduino, but, I ask the question so as not to burn anything, I am not an expert.

One picture you posted has wires cut off. Where did they originally go?

1 Like

Ok, look at this picture tell me if it is correct and if I can connect everything like this, please.

I connect the L298N to two motors. I have a 9V battery, I place the positive on the positive of the battery and the negative on the negative of the battery.

The negative of L298N I also put it on the GND of the arduino.

The sensors that I have I also connect them to the same GND.

I just want to know if it is possible. I mean, I'm not going to burn anything?
(Sorry I didn't send the full image, I have a lot of stuff and it's only going to confuse you.)

Looks okay.

Google star grounding.

1 Like

Thanks, I hope I don't burn anything, :rofl:.

A 9 volt battery cannot supply enough current for very long. For a real project, make sure the motor power ground goes directly back to it's negative of it's power supply and use a wire size that will carry the motor current. Use a separate wire to connect the signal ground to the power ground.

I use a step-down voltage at 9V, it is not a small battery, it is a 9,000 mAh battery.

I didn't understand the last thing you said. Imagine that I have a ground wire, I will connect that wire with the negative battery, with the GND of L298N, and with the GND of the arduino and all the other sensors. That tells me @LarryD it's possible, right?

For your project, all negatives and grounds connected together.
For future projects where something like motors that use a lot of current, use appropriate sized wire for + and - to the motors and/or controllers, but use your smaller wires for all other connections.
Still use the smaller wire to make one connection between the high current - and the smaller wire - so all grounds are electrically connected. You do not want the high current and the small signal current to share the same wire, only connect at one point.

Correct me if I'm wrong, please (remember I'm new, sorry if it's basic). You tell me to connect the small wires to the arduino and the big ones to the motor and battery, right? That is, do not use the same size cables.

But what if all the cables are very thick? Would something bad happen or just for aesthetics?

All depends on the size of the cables. As long as the high current carrying wires are not sharing with the signal carrying wires, there is no problem.

1 Like
  1. What happens if the high current cables are shared?
  2. The cables that connect to the arduino are signals, the typical colored ones with pins that you sell, right?

Google "ground bounce".

I honestly don't understand.

Every wire and every connection has resistance, no matter the type of connection or even if soldered or welded. Ohms law states there will be a voltage produced whenever electrical current flows through a resistance. When a high current pulse flows through even a tiny resistance, a voltage is created at that point.
If your Arduino signal also must pass through that connection, it will naturally see that same voltage pulse. If your Arduino pin connected to that signal wire is looking for a pulse on that wire in order to trigger an interrupt, that voltage pulse will trigger the interrupt, even though there was no signal from an attached sensor.
Same applies if your Arduino signal is being watched by an analog pin. That pin will now see the voltage pulse as it is measuring the voltage and will add to or subtract that voltage from what the signal voltage actually is.
In those case you have a condition that is not expected and might confuse the Arduino program. Very hard to debug!

Thanks. Such An Informative Conversation. Happy To BE A Member Of Such Forum

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.