Hello, I'm working on a project where I have to run a 5V dc motor using an L298N motor driver with Arduino. In this project, I've used two different power supplies. One is for Arduino nano which is a 5V adapter another one is for the motor driver which is a 9V adapter (this 9V adapter provides almost 840 mA current). Now, my question is do I need to connect the ground of the motor driver with the Arduino ground? I have provided the connection that I have made.
Well, my motor is not working that's why I'm asking this question. I'm a little bit nervous that if I connected both common grounds, my circuit might blast. So,please give me some suggestions about it.
If You would post a real schematic instead of this picture it might show the reason for the error.
What are the three wires, red, green and yellow, between the L298N and the nano?
Schematics provide pin designations!
You have to connect the grounds. It will not work otherwise. By that I mean the 9V ground and the 5V ground. I do not mean connect either of the motor wires to ground. Disconnect both power supplies before you attach a ground wire between the driver board and the Nano (you should never make any changes to a circuit with the power supply or battery connected).
You can also power the Nano from the 5V and GND terminals on the motor driver, assuming you actually have a motor driver like the one shown in your diagram.
Yes, you are correct. I forgot to say this: you can use the 5V terminal to power the Nano, because these boards normally contain a voltage regulator. To enable this, you need to make a link on the motor board. It is only safe do to this is the motor power supply is between about 6.5 and 12V.
Electricity flows in a loop called a circuit, so you send a signal from Arduino to the drive, that's half the circuit. How does that signal flow through a circuit and back to Arduino? Connect Arduino's GND terminal to the driver's GND. That's the other half of the signal circuit.