Circuit Connection
Circuit Connections
Arduino to L298N Motor Driver
- IN1 → Pin 8
- IN2 → Pin 9
- IN3 → Pin 10
- IN4 → Pin 11
- GND → GND
Motors
- Left Motor → OUT1 and OUT2
- Right Motor → OUT3 and OUT4
Power Supply
- Battery positive terminal → 12V (or VIN) of L298N
- Battery negative terminal → GND of L298N
- Connect Arduino GND and L298N GND together.
Working Principle
When the program starts, the Arduino sends signals to the motor driver to rotate both motors in the forward direction. The robot moves forward for 10 seconds. After that, the Arduino stops both motors for 10 seconds. This cycle repeats continuously, causing the robot to alternate between moving and stopping.