Fouad
Published

Arduino Servo Motor Control with Motor Driver Shield L293D

In This Tutorial, i'm going to show you how to control a servo motor with the H-Bridge Motor Driver

BeginnerFull instructions provided16,787
Arduino Servo Motor Control with Motor Driver Shield L293D

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Sunfounder L293d motor driver shield
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

Story

Read more

Custom parts and enclosures

Components Required

Schematics

Assembling Hardware

Code

Servo_H_Bridge.ino

Arduino
#include <AFMotor.h>
#include <Servo.h>              
Servo name_servo;               

int servo_position = 0 ;

void setup() {
  
  // Define the servo signal pins
name_servo.attach (10);         


}

void loop() {
 for (servo_position = 0; servo_position <=180; servo_position +=1){

    name_servo.write(servo_position);
    delay(10);
  }

  for (servo_position=180; servo_position >= 0; servo_position -=1){

    name_servo.write(servo_position);
    delay(10);
  }
}

L293D Library

Servo Motors Library

Credits

Fouad

Fouad

1 project • 9 followers

Comments