I bought another small motor driver, this time a module with 2 L91110 H-bridge chips. These dual L9110 H-bridge modules can be found for 3-4$ on Ebay or from Chinese webshops. The module has 2 L9110 IC’s, so it can control 2 DC motors or 1 stepper motor. You can download the datasheet of the chip here. The L9110 works with voltages from 2.5 to 12V and can give a continues current of 800mA. With a maximum peak current of 1.5-2A. More then enough for a small DC motor.
The board has 6 male pins and 2 double terminals. The motors connect to the 2 terminals. In the middle of the male pins are the VCC and GND pins. This is the input voltage for the L9110 chips. Some H-bridges like the L293 and L298 require a logic voltage and a separate voltage for the motors, the L9110 does not. You only have to supply it one voltage (between 2.5 and 12V). The other 4 pins control the direction and speed of the motors. Pin A-IA and A-IB control motor A, and Pin B-IA and B-IB control motor B. To control motor A you set pin A-IA high and pin A-IB low, to change the direction you just set pin A-IA low and pin A-IB high. Same thing for motor B. If you want to control the speed of both motors you will need 4 pwm pins. Instead of just setting a pin high you pwm it. I tested the board with 2 small dc motors and fed the chip 5V, the output voltage at full pwm was 4.5V. Here is the sketch to test the module with 2 small DC motors:
/* http://www.bajdi.com L9110 motor driver controlling 2 small DC motors */ const int AIA = 9; // (pwm) pin 9 connected to pin A-IA const int AIB = 5; // (pwm) pin 5 connected to pin A-IB const int BIA = 10; // (pwm) pin 10 connected to pin B-IA const int BIB = 6; // (pwm) pin 6 connected to pin B-IB byte speed = 255; // change this (0-255) to control the speed of the motors void setup() { pinMode(AIA, OUTPUT); // set pins to output pinMode(AIB, OUTPUT); pinMode(BIA, OUTPUT); pinMode(BIB, OUTPUT); } void loop() { forward(); delay(1000); backward(); delay(1000); left(); delay(1000); right(); delay(1000); } void backward() { analogWrite(AIA, 0); analogWrite(AIB, speed); analogWrite(BIA, 0); analogWrite(BIB, speed); } void forward() { analogWrite(AIA, speed); analogWrite(AIB, 0); analogWrite(BIA, speed); analogWrite(BIB, 0); } void left() { analogWrite(AIA, speed); analogWrite(AIB, 0); analogWrite(BIA, 0); analogWrite(BIB, speed); } void right() { analogWrite(AIA, 0); analogWrite(AIB, speed); analogWrite(BIA, speed); analogWrite(BIB, 0); }
Thank you very very much!!!!! Its exactly what i’m finding, only you post something about this!
On dx.com there are cheap h-bridges, the same as it.
Mine the GND and VCC are on the far right, but otherwise its pretty much the same. A and B are swapped (although that makes no difference) and its red not blue, big whoopie do 😛
Thank you I almost fried my board do you have a schematic or diagram for this project with IR added also?
Very good tutorial, simple and clear, thank you.
As a side note – despite what the datasheet for L9110 H-bridge module claims, both 1 and both 0 are giving open outputs i.e. there is NO BREAK functionality for L9110 (at least the one I have here). According to the datasheet both 1 and both 0 should be breaks. Anyway – I prefer the existing behaviour of either forward, or backward or open.
very clear tutorial, thank you,
one question I have to the programing of module,
I use model “L9110S H-bridge” – similar,
with software writen above motors works well
I tried to modify software to work with just one motor, see below:
void backward()
{
analogWrite(AIA, 0);
analogWrite(AIB, speed);
analogWrite(BIA, 0);
analogWrite(BIB, 0);
}
and the motor doesn’t take any action (with previous version of backward works fine)
any ideas why?
regards
pawel
Hello,
I tried these DC motor controller but if you want to control your DC motors with a PWM signal, you should remove the Caps which are connected to the output (the two caps close to the “Motor A” “Motor B” writings on the board)
I fried two of these things by driving them with a 500 Hz PWM signal at 7.4V and I think this is caused by the capacitors on the output.
Also, depending on your power supply (if you are driving the DC motors from a higher voltage than the logic part), you may also want to remove the 4 10K resistors at the bottom of the board, these are pull up connected to VCC.
Francois
Can we use this driver for 1/4 or 1/8 step resolution? or is there a way to manipulate using a code to make this driver working by 1/4 or 1/8 step resolution?
I knew, there is another motor driver that can work by pre-configured step resolution like A4988 but I found this motor driver is more cheapest rather then A4988.
Sorry I don’t have much experience with stepper motors. While the datasheet mentions driving stepper motors there is no example schematic in it.
Hi,
Please could you describe how to add the PWM pins.
Do you think it would be possible to control this driver with a joystick?
Add pwm pins? Of course you could control it with a joystick with the help of a micro controller …
I still have no idea whatsoever in how to attach this onto my arduino. I’m sorry I am a newbie so I need help attaching it to my arduino because I’ve been sitting for an hour trying to attach this thing to my arduino-uno R3. PLEASE HELP.
Uh, the pin connections are described in the beginning of the code.
Thanks for this post, it help me a lot.
Hi, I’ve got one of these, but I wish to control it without a Arduino, but instead by feeding it signals from a 555 timer toggle circuit. So when pin 3 is sinking it goes one direction and when it is sourcing it goes in the other. Do you think this would be possible?
I have managed to get the toggle circuit to light one set of LEDs and then alternate to another with a single press of a button, but I can’t get the module to respond to this setup.
Long time since I’ve played with a 555, can’t help you.
What are left() and Right() for ? aren’t u just turning the motors back and forth?
Im only using one motor, do i still need the left() and right () functions?
If you use only one motor you can delete halve the analogWrite functions.
Works when connected via USB power to arduino nano but not with a 9v battery. Can you post connection with battery.
I wouldn’t recommend using these ICs for PWM control for the following reason. When both inputs are HI or LOW both outputs are pulled to ground. This effectively shorts the motor windings which attempts to bring the motor to an abrupt halt. The IC will handle the resulting intermittent back EMF generated if the motor is just used run forward, stop, run backwards, etc. Using a PWM signal on the input will definitely stress the IC beyond its recommended operating parameters. For PWM control, the motor windings should be open circuit in the un-powered cycle and only short circuit to brake (stop). This is why some of you are frying the ICs, sorry.
[…] Although I did not put any research into it, I made an educated guess that hooking up the train’s engine directly to the Arduino pins would not be a good idea. It would probably draw too much current, and hooking inductive loads directly to electronic controls without special provisions is not a good idea in general. I looked for a simple module with an H-bridge type of power driver. The online shop where I already found the Arduino and WiFi module had one called ‘L9110S’. […]
how can i control this functions with buttons or a joystick
So maybe you can help:
I am using this module to light led when both A and B are forward and run motors when both A and B are in backward with diode for motors.
when i run only one A or B part its OK and works great, but as soon as i am trying to do same on both A and B motors and LEDs something wired happens unpredictable though program in arduino is same. so for details logic is following
forward A and B (LEDs)
delay
backward A (motor1)
delay
backward B (motor2)
delay
can you help?
Hello,
I would like to know which is the maximum frequency which this module can work on.
Thanks a lot,
Victor
How about drop voltage from this driver? In the input i supplying 6v but on the output from this driver i get just 2v. What happened? And the current is very low abou 2mA but the motor stil can rotating, but it’s very hard drive it in the first time drive. I must push the motor load then the motor can handle it esp. for low rotation speed