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.
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.
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:
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.
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.
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
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
Connects the Arduino, L293D, and motor.
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.
The Arduino will control the motor by sending pulses to the L293D to energize the coils in sequence.
You have to import this library: AFMotor
Here's a basic example code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include <AFMotor.h> // Number of steps per output rotation // Change this as per your motor's specification const int stepsPerRevolution = 200; // connect motor to port #2 (M3 and M4) AF_Stepper motor(stepsPerRevolution, 2); void setup() { Serial.begin(9600); Serial.println("Stepper test!"); motor.setSpeed(150); // 10 rpm } void loop() { Serial.println("Single coil steps"); motor.step(50, FORWARD, SINGLE); /*motor.step(100, BACKWARD, SINGLE); Serial.println("Double coil steps"); motor.step(100, FORWARD, DOUBLE); motor.step(100, BACKWARD, DOUBLE); Serial.println("Interleave coil steps"); motor.step(100, FORWARD, INTERLEAVE); motor.step(100, BACKWARD, INTERLEAVE); Serial.println("Micrsostep steps"); motor.step(100, FORWARD, MICROSTEP); motor.step(100, BACKWARD, MICROSTEP); */ } |
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.
Zaouiet Kontech-Jemmel-Monastir-Tunisia
+216 92 886 231
medaliprof@gmail.com
Robotic site created by MedAli-Teacher info