This is the Smart Motor Driver (aka SAMI) designed to run a micro gearmotor, the objective of this board is to be able to implement a PID control easily over this motors with the corresponding RPM feedback using a hall effect sensor. So it has his own microcontroller and H bridge on board to be capable of do the work by itself.

The host microcontroller (or any system that can use I2C) communicates by I2C in order to give the commands to the smart driver module, this includes speed and direction of the motor. The module will automatically implement the PID to maintain the speed and apply more/less power dynamically in the motor to archive that.

I sell on Tindie

Also the control module is capable of driving the motor for a desired distance or angle and then stop when is reached. For doing that you must specify the diameter of your wheel and the gearbox relation.

To sense the speed of the motor I used a magnetic encoder disk, it is polarized along the surface of the disk. So the hall effect sensor can detect the changes in the magnetic field of the disk and send the signal to the microcontroller. Then using the timer and interrupts we will calculate the RPM of the motor in second plane, so the microcontroller is free to run a PID control algorithm and handle the communication with the host. 

The main idea is to use it in robotics, so by using this modules to control the wheels of the robot it can be possible to make precise movements no matter the surface , the battery charge or even if the robot changes its weight!!!

Also it protects the gears from stripping due to a sudden acceleration or braking and will avoid the battery to trip the protection circuit caused by a current rush. So your precious motors will be safe!

An Arduino library is available for easy use of SAMI, and you can plug a lot of motors fast and easy. 





For install SAMI to a motor you only need to solder it and place the encoder as shown in the next video:

IMPORTANT: your motor should have an extended shaft in order to allow placing the encoder!!!!


JST connector pinout to communicate with SAMI.

ICSP pads for updating firmware. MCLR can be used to restore I2C address of the module.


PCB layout:

The PCB is 0.8mm thick and it measures 10 mm x 20 mm. Is a double layer board.

I2C registers:

Operation modes:

This is a project under development, so please follow me get updates :) This is an open source project, so if you have any ideas to improve it you are welcome. Also you can adapt the hardware and software to run a bigger motor, add a second channel to the encoder or even run a stepper motor instead!!! 

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.0 Generic License.