Posts

Showing posts with the label Motors

Controlling DC motors with a L298n dual h bridge motor controller

Image
In this blog I will discuss how to control a DC motor with a L298n Motor controller. A L298n motor controller can be used to control the direction of a motor and also the speed of a DC motor. Materials required An arduino uno, Few male to male jumper wires, Few male to female jumper wires, A DC motor(in this project i used a 100rpm ,12 V motor), A l298n motor controller, A 9V battery , A Snap connector Making the Arduino connections Connect the In1 and In2 pins to pins to pins 7 and 8 on the Arduino. Connnect the ENA pin to pin number 5 on the Arduino. Connect the motor to the OUT1 and OUT2 pins located on the side of the motor controller Connect the 12V pin to the + terminal of the battery using the snap connector Connect the GND pin of the motor controller to the -terminal of the battery and the GND of the Arduino Connect the 5v pin on the motor controller to the Vin pin on the Arduino. The code T...