Use pwm to control speed of at motor driver

arduinomotorpwm

Ive got this motor driver from Sparkfun, https://www.sparkfun.com/products/9670. Where I get it that setting ENA and IN1 to high will enable connected motor 1 to og full speed in one direction.

But, can I connect IN1 to pwm and in that way control the speed? For instanse, instead of full speed I could get 50% speed by adjusting the dutycycle? And if I wanted I could read CSA pin to get the actual break "force"?

Best Answer

You can feed this driver with PWM signal.

I suggest to use ENABLE pins for PWM signal, this will allow you to use only one PWM channel in microcontroller for both motor directions.

You don't have to put PWM signal to both ENA and IN pins, you can use simple microcontroller output for IN pins and drive it like this:

enter image description here

And yes, you can use current sense outputs to measure "break force" on motor.

Related Topic