

Motors are rotating in opposite direction?įor this, reverse the terminals of the motor connecting the Motor driver module.If you are planning on assembling your new robot, you will eventually want to learn how to control stepper motors. Project not working?Įnsure that the circuit you have made is according to the circuit diagram. A Voltage rating less than this will not work. Ensure that you must supply 12v to the L298 Motor Driver module. Note that 1 is the minimum value and 255 is the maximum speed. } Troubleshooting Robot is moving too fast?įor this change value of motor speed in the code. NewPing sonar(trig_pin, echo_pin, maximum_distance) //sensor function

#include //Ultrasonic sensor function library. Note: Install the following library into the library folder of the Arduino IDE : New ping library

The GND terminal is connected to the battery’s negative terminal and it is also connected to the Arduino board GND pin and 5v is connected to “Vin” of the Arduino board to power the Arduino board. The motor driver has another 3 terminals, in which one is 12Volt connected to the battery. This servo motor is commonly used in RC applications which can rotate 90 degrees in both the direction or approximately 180 degrees in total.įollow this table in order to make your connections.įor L298N motor driver module, motors are connected to the motor terminals of the motor driver module. The MG90S is a metal gear servo motor commonly used in RC applications. The practical Distance that can be measured is 2cm to 80cm but theoretically, it is mentioned that the distance can be up to 400 cm. Then sensor waits for the wave to be reflected and calculates the distance of how far is the object when in front of the sensor. Ultrasonic sensors work on the principle that it emits waves at a higher frequency that cannot be heard by humans. The Trig pin transmits an ultrasonic wave and the ECHO pin receives the reflected signal from the object. There are two other pins called TRIG and ECHO pins. 5volts is supplied to the VCC pin and GND is connected to the GND of Arduino. It is an Arduino-based robot that uses Ultrasonic sensors to avoid collisions. Obstacle avoidance refers to the ability of a robot to detect obstacles in its way and to find its own way to move without collision. So in this tutorial, we are going to make obstacle avoiding robot with an L298N motor driver module using Arduino and ultrasonic sensors. It is Increasing with the advancement of technology at a decent pace. Previously we made Line Follower Robot and Surveillance Robot. As a branch of engineering, the applications of robotics are numerous. Robotics is an interesting and rapidly growing sector in this era.
