L9110S motor driver
The HG7881 dual motor driver module: two L9110S chips, one per motor, on a small blue board. Aliases: L9110, HG7881, L9110S fan driver.
It is the cheapest motor driver there is, and the one in the Pico kits and the
small two-wheel robot kits. Each L9110S is two push-pull outputs, one per input,
so one chip is a whole H bridge for one motor. There is no enable pin and no
separate motor supply: VCC runs the chips and the motors.
Pins
| Pin | What it does |
|---|---|
B-IA, B-IB |
Motor B's two inputs. |
GND |
Ground. |
VCC |
Supply for the chips and the motors, 2.2 V to 6.5 V. |
A-IA, A-IB |
Motor A's two inputs. |
OA1, OA2 |
Motor A. |
OB1, OB2 |
Motor B. |
The truth table
Each output follows its own input:
| IA | IB | Motor |
|---|---|---|
| H | L | one way |
| L | H | the other way |
| L | L | brake |
| H | H | brake |
There is no coast. Equal inputs tie the motor's two wires together through
the bridge and it stops hard. For speed, put analogWrite on one input and hold
the other low; the motor is driven and braked in turn.
const int A_IA = 5; // PWM
const int A_IB = 4;
void forward(int speed) { digitalWrite(A_IB, LOW); analogWrite(A_IA, speed); }
void reverse(int speed) { digitalWrite(A_IB, HIGH); analogWrite(A_IA, 255 - speed); }
In reverse the PWM input is inverted, because the other output is now high.
While it runs
The face shows what each motor is being told: off, fwd, rev or brake.
What the model gets right
From the UMW L9110S datasheet:
The logic table, both brakes included.
Input thresholds. A low is at most 0.25 of VCC and a high at least 0.7 of
it. On a 6 V supply that is 4.2 V, so a 3.3 V board's HIGH is not a high and the
motor never turns. Between the two thresholds the sheet promises nothing; the
model keeps the input's last state.
No pull-downs. The inputs draw 0.1 µA, so an unwired input is not a direction. Its output is left off rather than guessed.
Saturation. 0.19 V at 100 mA across the two transistors in a motor's path: about 1 ohm a side.
The supply. 2.2 V to 6.5 V operating and 8 V absolute maximum; past that the outputs are dead. Module listings often say 12 V; the chip's sheet does not.
Where the current comes from. With a battery on VCC the bridges are part of
the analog solve, so the motor's current comes out of the pack and it sags.
What it does not model
The 800 mA continuous rating, the 500 mW package limit, and the flyback diodes.
Common mistakes
Expecting both inputs low to coast. It brakes.
Running it from 9 V or 12 V because a listing said so. The chip is rated to 6.5 V.
A 3.3 V board on a supply above about 4.7 V: its HIGH is under 0.7 of the supply.
See it in action
L9110 motor by hand has the whole truth table on two switches. Open it at /templates.