The 28BYJ-48 is a small, inexpensive, unipolar stepper motor widely used in DIY electronics projects, automation, and hobby robotics due to its high precision and ease of use with microcontrollers like the Arduino. It operates through precise steps, making it ideal for applications requiring controlled movement, like in camera gimbals, robotic arms, and small CNC machines.
Key Characteristics
Type: Unipolar stepper motor.
Operating Voltage: Typically operates at 5V DC, which makes it compatible with standard USB power sources and microcontroller output.
Step Angle: It has a step angle of 5.625°, meaning it takes 64 steps to complete one rotation of the motor shaft.
Gear Ratio: The motor includes an internal gearbox with a gear reduction ratio of 1/64, which increases the precision of movement to 4096 steps per revolution of the output shaft (64 steps × 64 gear ratio = 4096 microsteps).
Torque: The gearbox increases torque, making the motor suitable for low-speed applications that require more force.
Control: Controlled by an external driver circuit, such as the ULN2003 driver board, which helps to sequence the power to the coils in the correct order to produce smooth movement.
To control a 28BYJ-48 stepper motor with an ESP32, you’ll typically need a ULN2003 driver module. The ULN2003 helps to manage the current needed by the motor, which the ESP32 can’t handle directly due to its limited current output per GPIO pin. Here’s a guide to wiring and coding the setup.
Micro:bit:
This is the central control unit
The GPIO expansion card for the Micro:bit card
The GPIO expansion board for the Micro:bit board expands the capabilities of the Micro:bit board by adding more input/output (GPIO) pins and additional functionality.
28BYJ-48 stepper motor
ULN2003 driver board for the stepper motor
Connecting Wires:
Breadboard (Optional):
Power Supply:
Connect the 28BYJ-48 to the ULN2003 driver module:
The 28BYJ-48 stepper motor typically has a 5-pin connector that fits directly into the ULN2003 board.
Connect the ULN2003 to the Micro:bit:
IN1 on ULN2003 → P0 on Micro:bit
IN2 on ULN2003 → P1 on Micro:bit
IN3 on ULN2003 → P2 on Micro:bit
IN4 on ULN2003 → P3 on Micro:bit
VCC on ULN2003 → (+) on power supply (9V battery)
GND on ULN2003 → (-) of power supply (9V battery)
1- Open the MakeCode editor at https://makecode.microbit.org/.
2- Create a new project by clicking on "New Project."
3- Add the HC-SR04 extension:
Look for "Extensions" and click on it.
In the search box, type "sonar" to find the "stepper motor" extension.
4- Add custom blocks to control a 28BYJ-48 stepper motor with Micro:bit using buttons A and B in Microsoft MakeCode, you can create a program where pressing button A rotates the motor forward, and pressing button B rotates it backward.
Here’s how to set up and program it in MakeCode:
Download programEducational 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