DC motor controlled by L9110S Dual-Channel H-Bridge Motor Driver Module - 12V 800mA. ------------------------------------------------- ![ScreenShot L9110S ](https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/extra/images/L9110S.jpg) Hardware -------------------------------------------- [L9110 Datasheet](https://www.elecrow.com/download/datasheet-l9110.pdf) [Blog](http://www.bajdi.com/l9110-h-bridge-module/) The L9110S 2-Channel motor driver module is a compact board that can be used to drive small robots. This module has two independent motor driver chips which can each drive up 800mA of continuous current. The boards can be operated from 2.5V to 12V enabling this module to be used with both 3.3V and 5V microcontrollers. A set of female header pins is used to connect this module to a microcontroller. The motors are attached via two sets of screw terminals. A PWM Pulse Width Modulation signal is used to control the speed of a motor and a digital output is used to change its direction. This module can also be used to drive a single four line two phase stepper motor. Four holes make this board easy to mount onto your robot or other project On-board 2 L9110 motor control chip 1. Module can be driven by two dc motors at the same time or one phase 4 line 2 type stepping motor 2. Input voltage: 2.5-12V DC 3. Each channel has a continuous output current 800 ma 4. PCB Size: 29.2mm x 23mm The four and pins are connected as so to Rpi where GPIO 1-4 can be any GPIO pins Motor VCC and GND are connected to VCC and GND(decouple power supply with capacitor) and remember to connect all gnds L9110S Rpi and power supply to common GND rail) IA controls PWM and IB controls direction 1. B-IA: Motor B Input A - GPIO 2 - PWM 2. B-IB: Motor B Input B - GPIO 1 - DIR 3. GND: ground 4. VCC: 2.5V-12V DC 5. A-IA: Motor A Input A - GPIO 4 - PWM 6. A-IB: Motor A Input B - GPIO 3 - DIR ![ScreenShot L9110S pinout](https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/extra/images/L9110Spinout.jpg) This library was tested on a RF-310T-11400 DC motor. Software ------------------------------------------- This software is same as for the DRV8833 module hence name of class which it was written for originally. Both modules use same example file as well. The file rpi_dc_lib.py contains code for this component It consists of a class called DRV8833NmDc and six methods The methods are called: 1. forward = Drive motor forward, passed one argument = duty cycle % 2. backward = drive motor backward, passed one argument = duty cycle % 3. stop = stop motor, Intended for normal motor control flow passed one argument = duty cycle % 4. brake = brake motor, passed one argument = duty cycle % 5. cleanup = stop PWM and turn off GPIO pins used by motor. Passed a boolean: if False just stop and zero the motor pins, if True also run GPIO.cleanup() for all pins. 6. motor_stop = Intended for emergency/interrupt situations — immediately kills output immediately stop motor output and set stop flag. Does not destroy the PWM object — motor can be restarted. Call cleanup() for full teardown at end of program. Example code is in the DRV8833_or_ L9110S_DC_Test.py file in examples.