Stepper Motor(28BYJ-48): 두 판 사이의 차이
(Created page with " {{#seo:|title=아두위키 : 아두이노 스텝모터 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 스텝모터, 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 스텝모터를 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} File:스텝모터모터드라이버대표이미지.jpg|class=...") |
(차이 없음)
|
2024년 3월 24일 (일) 15:41 판
The 28BYJ-48 is a stepper motor that can be used with Arduino and MCU controller boards. This document involves the use of the ULN2003 motor driver.
Specifications
- Operating Voltage: 5V
- Step Angle: 5.625°
- 64-step motor
- Half 4 wire
Example Required Hardware
- Arduino board
- Jumper cables
- Stepper motor (28BYJ-48)
- Stepper motor driver (ULN2003)
Connection
The stepper motor is connected to the motor driver with a connector, which is not detailed here.
| Arduino | Stepper Motor Driver |
| D12 | IN1 |
| D11 | IN2 |
| D10 | IN3 |
| D9 | IN4 |
| VIN | + |
| GND | - |
Example Code Overview
The example demonstrates making the stepper motor rotate one full turn clockwise, waiting for 1 second, then one full turn counterclockwise, followed by another 1-second wait, in a repeating loop.
#include <Stepper.h>
#define IN1 12
#define IN2 11
#define IN3 10
#define IN4 9
const int stepsPerRevolution = 2048; // [360/5.625*64/2=2048]
Stepper step1(stepsPerRevolution, IN4, IN2, IN3, IN1); // Note the sequence 4,2,3,1
void setup() {
step1.setSpeed(10);
}
void loop() {
step1.step(2048);
delay(1000);
step1.step(-2048);
delay(1000);
}
Execution Result
Please refer to the link for the operation video.

