276°
Posted 20 hours ago

ELEGOO 5 sets 28BYJ-48 5V Stepper Motor + ULN2003 Motor Driver Board for Arduino

£9.9£99Clearance
ZTS2023's avatar
Shared by
ZTS2023
Joined in 2023
82
63

About this deal

The 28BYJ-48 is one of the cheapest stepper motors you can find. Although it is not super accurate or powerful, it is a great motor to use for smaller projects or if you just want to learn about stepper motors. stepper.moveTo(-3*SPR);//Same as above: Set the target motor position (i.e. turn motor for 3 full revolutions)

In the following three examples I will show you how you can control both the speed, the direction and the number of steps the stepper motor should take. In these examples I will be using the AccelStepper library. In this tutorial, we will learn about the 28BYJ-48 stepper motor and how to interface it with Raspberry Pi Pico using a UNL2003 driver. The 28BYJ-48 stepper motor is inexpensive and one of the most commonly used stepper motors out there. It comes with a UL2003 motor driver attached to it that is responsible for driving a stepper motor. The reason for using a driver is that the Raspberry Pi Pico GPIO pins can not provide enough driving current to a 28BYJ-48 stepper motor. The second important reason is that it protects the board’s pins from getting damaged due to the high current requirement of a stepper motor than a maximum current that Raspberry Pi Pico pins can provide. After a bit of research I found that the 28BYJ-48 can be converted from its original 5 wire unipolar stepper, to a 4 wire bipolar stepper. This modification allows us to really improve the torque and speed. Some sources state more than 2x the torque! What’s more, its really simple! Parts List Below you can find the specifications for both the stepper motor and driver that are used in this tutorial. 28BYJ-48 Stepper Motor Specifications Rated voltageIn the loop section of the code, I used a different way to let the motor rotate a predefined number of steps. First I set the target position with the function moveTo(). Next, we simply use the function runToPosition()to let the motor run to the target position with the set speed and acceleration. The motor will decelerate before reaching the target position. void loop() { The first part of the code up to the loop() section is exactly the same as in the previous example.

Next, we will define the input pins of the motor connections with the Arduino. As you can see we have used the digital pins 7,6,5 and 4 to connect with IN1, IN2, IN3 and IN4 respectively. However, you can use any other suitable Arduino digital pins as well. #define IN1 7 In the setup(), set the stepper speed using the setSpeed method. The stepper speed is in rpm. myStepper.setSpeed(5); is a uni-polar 5V stepper motor that takes electrical signals as input and rotates by converting these input signals into mechanical rotation. It consists of 4 stationary coils rated at +5V. These coils are known as a stator and make a ring around the rotor. Because of 5 volts operating voltage, we can easily drive this motor from any microcontroller such as Raspberry Pi Pico, ESP32, ESP8266, Arduino or TM4C123 Tiva Launchpad, etc. It has a 1/64 reduction gear set and therefore moves in precise 512 steps per revolution. These motors are silent in comparison to other DC motors and servo motors. You can achieve positional control easily without needing extra circuitry and components. Stride Angle The 28-BYJ48 Stepper Motorsare one of the most commonly used stepper motors. You can find this or similarmotors in your DVD drives, Motion camera and many more similar devices. The motor has a 4 coil unipolar arrangement and each coil is rated for +5V hence it is relatively easy to control with any basic microcontrollers. These stepper motors consume high current and hence a driver IC like the ULN2003 is mandatory. To know how to make this motor rotate we should look into the coil diagram below.

Datasheet

A stepper motor can move in accurate, fixed angle increments known as steps. For practical purposes, a stepper motor is a bit like a servo: you can tell it to move to a pre-defined position and can count on getting fairly consistent results with multiple repetitions. Servos though, are usually limited to a 0-180 degree range, while a stepper motor can rotate continuously, similar to a regular DC motor. The advantage of steppers over DC motors is that you can achieve much higher precision and control over the movement. The downside of using steppers is that they are a bit more complex to control than servos and DC motors. The 28BYJ-48 Stepper Motor Datasheet In this case I called the stepper motor ‘stepper’ but you can use other names as well, like ‘z_motor’ or ‘liftmotor’ etc. AccelStepper liftmotor = AccelStepper(MotorInterfaceType, motorPin1, motorPin3, motorPin2, motorPin4);. You can create multiple stepper motor objects with different names and pins. This allows you to easily control 2 or more stepper motors at the same time. // Initialize with pin sequence IN1-IN3-IN2-IN4 for using the AccelStepper library with 28BYJ-48 stepper motor:

stepper.moveTo(200*counter); //Set the target motor position (multiply by whatever number you want to define how much to move per encoder pulse) I cut the code size down and modified it so you can specify Speed and don't need direction. Just call 'stepper()' and give it the number of steps you want to rotate. Use negative numbers to reverse the direction. You'll probably need to change the values for IN1-IN4 to match the pin numbers on your Arduino:Motor Connector Header is used to connect the stepper motor. It provides output from four Darlington pair transistors. Pin The modification for this is easy…really easy. Most information I can find online involves removing the blue cover on the stepper, and making a small cut to the PCB trace for the red (5v/12v) wire. I went ahead and did this on my first attempt and it does indeed work as intended. The statement #defineis used to give a name to a constant value. The compiler will replace any references to this constant with the defined value when the program is compiled. So everywhere you mention motorPin1, the compiler will replace it with the value 8 when the program is compiled. // Motor pin definitions: Never step the A4988 without having a stepper hooked to it's outputs, it will likely fry it. For that matter, it may be advisable to not connect to your 12V power supply until your stepper motor are connected securely to each of the four outputs, on each of your A4988s.

This is merely some simple code to get you started on getting the stepper motor up and running. Starting out in the electronics arena can be pretty daunting and at times can fill you with feelings of doubt and inadequacy, especially when your code doesn’t run. To use a 28BYJ-28 stepper motor with Raspberry Pi Pico, we will be required to attach it with the ULN2003 motor driver. This is necessary because the current consumption of 28BYJ-48 is around 240mA. That means the current required to drive coils by applying a sequence of control signals is also almost 200mA. The pins of Raspberry Pi Pico can not provide current of this magnitude. Therefore, we need a ULN2003 driver which translates low current output of Raspberry Pi Pico pins into higher current that meets the requirement of stepper motor control signals. Precise Positioning– Stepper motors move in precise steps. As such, they do well in applications that require precise positionings, such as 3D printers and camera platforms.Stepper motors can be driven in different modes and they have a specific gear ratio. Both factors have an influence on the number of steps per revolution. For this example, we shall drive the motor in a mode known as the full step mode, with each step corresponding to a rotation of 11.25 degrees according to the datasheet. That means there are 32 steps per revolution (360/11.25 = 32). In addition, the manufacturer has specified a gear ratio of 64:1 for the 28BYJ-48 stepper motor. How it works? The stepper motor does have its disadvantages as compared to the aforementioned two. However, you should still take stepper motors into consideration for its several critical advantages. This tutorial was a getting started guide for stepper motors with the ESP32. Stepper motors move one step at a time and allow you to position the motor shaft at a specific angle. This stepper motor has a stride angle of 5.625 degrees. That means 28BYJ-48 will complete one revolution in (360/5.625) 64 steps by taking one step at a time and in one step it covers a 5.625-degree distance. However, the stepper motor can also be used in full-step mode. In full-step mode, the angle of each step is 11.25 degrees. That means the motor completes its one revolution in 32 steps instead( 360/11.25). The 28BYJ-48 stepper motor requires 240mA current to operate and it also consumes power at an idle condition. Therefore, it is recommended not to power the 28BYJ-48 stepper motor directly from any microcontroller. Instead use an external 5 volts power supply. Interfacing Raspberry Pi Pico with 28BYJ-48 Stepper Motor and ULN2003 motor driver

Asda Great Deal

Free UK shipping. 15 day free returns.
Community Updates
*So you can easily identify outgoing links on our site, we've marked them with an "*" symbol. Links on our site are monetised, but this never affects which deals get posted. Find more info in our FAQs and About Us page.
New Comment