Using 28BYJ-48 stepper motor by Micro:bit board

Micro:bit 12-11-24
46 0

Tutorial plan

1- Definition of 28BYJ-48 stepper motor

2- Components Needed to command 28BYJ-48 stepper motor by Micro:bit

3- Circuit Setup

4- Programming Micro:bit with Makecode

 

 

Definition of 28BYJ-48 stepper motor

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.

Components Needed to command 28BYJ-48 stepper motor by Micro:bit

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:

Micro:bit board

This is the central control unit

The GPIO expansion card for the Micro:bit card

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:

Jumper wires

Breadboard (Optional):

Breadboard

Power Supply:

 

Circuit Setup

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)

 

Programming the Micro:bit with Makecode

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 program

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