DC Motor Control with Arduino and L9110S Driver Tutorial

Added:

Setup Overview
Wiring Guide
Code Logic
Control Flow
Speed Mapping
Testing Results

Setup Overview

0:01
Playing Section
  • 1

    Introduces DC motor control with L9110S driver and rotary encoder.

  • 2

    Explains hardware components and their roles in the system.

  • 3

    Mentions using interrupts for efficient encoder reading.

Basic Arduino programming and familiarity with the IDE, including setup, loop, and digital/analog I/O functions.
Fundamental DC motor concepts, including why microcontrollers require an external driver to handle high-current loads.
The concept of Pulse Width Modulation (PWM) and how it is used to control analog-like behavior such as motor speed.
The operational theory of an H-bridge circuit for reversing motor current and direction.
The basic concept of hardware interrupts and why they are necessary for capturing high-frequency signals from rotary encoders.
Implementing a PID (Proportional-Integral-Derivative) control loop to achieve precise closed-loop speed and position regulation.
Exploring high-power motor drivers (such as TB6612FNG or BTS7960) and transitioning to Brushless DC (BLDC) or stepper motor control.
Integrating the dual-motor control system into a differential-drive mobile robot utilizing odometry-based navigation.
Designing finite state machines (FSM) in software to coordinate complex motion profiles and safety limits.
Interfacing the Arduino motor controller with a primary microcomputer (like Raspberry Pi) using serial, I2C, or ROS (Robot Operating System).
108.4K views446likes12:01@BrainybitsCanadaOriginal Release: 2015-01-27

This tutorial demonstrates how to control a DC motor's speed and direction using a rotary encoder and L9110S motor driver with Arduino. The rotary encoder provides continuous rotation input that is read via interrupt on pin 2, allowing the code to efficiently detect rotation changes without blocking other operations. The encoder's clock pin triggers an interrupt when the rotor position changes, enabling real-time speed and direction control. The motor driver uses PWM signals on pins 10 and 11 to control motor speed, while the direction pin determines rotation direction. A switch integrated in the encoder can reset the motor position to zero. The code maps encoder position values to motor speed, with positions between 0-11 resulting in no movement, 10-20 producing slow forward speed, and 90-100 producing full forward speed.