Main Content

This is a DC Motor Driver that is controlled via I2C. The I2C Address can be set in the range: 1 to 127. It can read a Quadratic encoder.

I am working on a project that needs about six Motors. There are many DC Motor Drivers available, But.

- The Motors I am using are DC Motors with Quadrature Encoders.
- Quadrature Encoders have an A and B output, which need to be connected to a microcontroller that uses the data from the Quadrature Encoder to ascertain the position and direction of a motor. See my Instructable: Wi-Fi Control of a Motor With Quadrature Feedback : 9 Steps (with Pictures) - Instructables
- This would mean that each motor will have two Encoder connections to the microcontroller, plus the Driver connections.
- There are I2C Motor Drivers, this would reduce the connections for the Motor Drivers, but these do no more than the normal Motor Drivers do, there is no positional feedback through the I2C connection.
- The microcontroller I want to use to control the Motors has a limited number of pins.

I also would like to take away a lot of the processing the microcontroller would have to do controlling all the motors.

- It would be nice if the microcontroller was connected to the Motor Drivers via I2C. Only two wires from the microcontroller connected to all the Motor Drivers.
- It would be nice if the Motor Driver knew the position of the Motor and could send this data back to the microcontroller via the I2C connection.
- It would be nice if the microcontroller only had to send a position command to the Motor Driver and the Motor driver did all the work.
- It would be nice if we could have limit switches attached to the Motor driver so that it would not go beyond them.
- It would be nice if the Motor driver could be given soft limits to stay within.
- It would be nice if the Motor driver could be given a known position from a Station, so that it could set a known position when triggered.

I think I have come up with the solution.

- This Motor Driver is controlled via I2C.
- The Motor Driver can be configured for many scenarios.
- The Max Motor voltage is: 30v.
- The Max Motor current is: 1A, this can be increased by beefing up the traces on the PCB, MOSFETs are rated at 5.8A. (A bit OTT but cheap)
- The System voltage is: 3.3v. There is an option to add a voltage regulator if power comes from a higher source.
- The brains is the STM8S103F3P6, as a slave I2C Device.
- The I2C Address can be set from 0x01 (1) to 0x7F (127). So in theory 127 Motors can be attached to one microcontroller.”

Link to article