Motor with encoder L298 Motor driver

Hi all. I would like some help on code with arduino uno and 75:1 Metal Gearmotor 25Dx54L mm HP 6V with 48 CPR Encoder . I am using L298 Dual H-Bridge Motor Driver. here web address of L298 Motor driver.

OK here it goes what i have in mind. I would like to control this motor to stop at certain place and start it again and must stop every time at same place exactly. Why would i want do this. I have robot 4 axis and pololu 12 channel servo board. Robot axis on 1st base axis i want to turn and stop at same place. Normal servo’s is 180 degree and other servo’s is 360 degree, i would like to use pololu motor to turn base axis to 280 degree and stop same place. Could anyone please help me? I also busy learning how PID motor control work on arduino


You could damage your L298 controlling that gearmotor, so before you start programming your Arduino, you should consider using another, more appropriate motor driver. The L298 can only handle loads of up to 2A (3A when the outputs are paralleled), and that gearmotor can draw up to 6.5A when stalled at 6V. A gearmotor’s stall current will be higher if the motor supply voltage is higher, which it sounds like it is in your application, since the minimum motor supply for your L298 is 7V.

In general, we recommend using motor drivers that can continuously handle the maximum amount of current your motor can draw. Our VNH5019 is an appropriate motor driver for our HP 25D mm gearmotors. The VNH5019 is much newer chip and offers several extra protections like thermal shutdown and short-circuit protection.


OK Cool thank you. I have this motor driver. Website i bought it from:
How do i get encoder to work with it. Thank you in advance

The VNH5019, like the L298, is a motor driver, so it does not inherently have any hardware for reading encoders. To use the motor encoders in your system, you can read them directly with your Arduino using the Arduino Rotary Encoders library. You can learn more about how to do that on this Arduino page about encoders.