Using 17HS4401 stepper motor with Arduino and L293D module

Arduino UNO 21-11-24
54 0

Tutorial plan

1- What is a 17HS4401 stepper motor ?

2- What is a L293D module ?

3- Components Required

4- Wiring Diagram

5- Arduino Code

 

 

What is a 17HS4401 stepper motor ?

The 17HS4401 stepper motor is a widely used NEMA 17 stepper motor, which is popular in robotics, 3D printers, CNC machines, and other automation projects.

Applications

The 17HS4401 is ideal for:

3D Printers: For precision movement of axes.

CNC Machines: Used in milling, engraving, or cutting operations.

Robotics: Controls movement for robotic arms or wheels.

Automation Projects: Handles precise rotational movement in pick-and-place machines, conveyor belts, etc.

 

What is a L293D module ?

The L293D module is a popular motor driver module that allows you to control DC motors and stepper motors using a microcontroller (e.g., Arduino, ESP32, Raspberry Pi). It is based on the L293D IC, a dual H-bridge motor driver that can independently control the direction and speed of up to two DC motors or one stepper motor.

The L293D module operates by receiving logic signals (HIGH/LOW) from a microcontroller on its input pins. These signals control the transistors in the H-bridge to set the motor's direction and speed:

How It Works

1- Direction Control:

For each motor, two input pins (IN1, IN2 for Motor A; IN3, IN4 for Motor B) determine the direction:

Example for Motor A:

IN1 HIGH, IN2 LOW: Motor moves forward.

IN1 LOW, IN2 HIGH: Motor moves backward.

IN1 LOW, IN2 LOW: Motor stops.

2- Speed Control:

The enable pins (EN1 for Motor A; EN2 for Motor B) allow speed control by applying a PWM signal.

The PWM duty cycle adjusts the average voltage supplied to the motor, varying its speed.

Applications

Robotics: Driving wheels or robot arms.

CNC and Automation: Controlling stepper or DC motors in precision applications.

DIY Projects: Building RC cars, conveyor belts, or fans.

 

Components Required

Controlling a 17HS4401 stepper motor using an Arduino UNO and an L293D motor driver involves setting up the hardware and programming the Arduino to drive the motor in steps. The L293D acts as an intermediary to handle the current requirements of the stepper motor.

Arduino UNO

Arduino Uno

Acts as the brain of the setup, generating the control signals for the stepper motor.

L293D Motor Driver

Drives the stepper motor by amplifying the low-power control signals from the Arduino to the high-power signals needed by the motor.

17HS4401 Stepper Motor

The load, a bipolar stepper motor requiring precise control for motion.

External Power Supply

Supplies sufficient power to the motor since the Arduino cannot handle the motor's current needs.

Jumper Wires

Fils de connexion

Connects the Arduino, L293D, and motor.

 

Wiring Diagram

1- Connect the stepper motor to the L293D:

The 17HS4401 is a bipolar stepper motor with 4 wires. Identify the two coils using a multimeter or the motor datasheet.

Connect one coil to OUT1 and OUT2 on the L293D.

Connect the other coil to OUT3 and OUT4 on the L293D.

2- Connect L293D to Arduino:

IN1, IN2, IN3, IN4 (L293D inputs) to Arduino digital pins (e.g., pins 8, 9, 10, 11).

VCC1 (5V) on L293D to Arduino 5V.

VCC2 to an external power supply (9V battery).

GND of L293D to Arduino GND and the external power supply ground.

 

Arduino Code

The Arduino will control the motor by sending pulses to the L293D to energize the coils in sequence.

You have to import this libraryAFMotor

Here's a basic example code:

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info