게시됨 2026-07-16
01사용 방법서보 기구Micro:bit: 간단한 배선 및 코드 가이드
연결서보 기구모터BBC Micro:bit는 로봇 공학 및 임베디드 시스템 분야의 초보자에게 가장 보람 있는 프로젝트 중 하나입니다. 이는 단순한 LED 깜박임과 복잡한 기계 동작 사이의 격차를 해소합니다. 그러나 많은 사용자는 불안한 움직임, 약한 반응, 심지어 전력 오해로 인한 보드 손상과 같은 문제에 직면합니다. 이 가이드는 배선, 코딩 및 문제 해결에 대한 명확한 단계별 접근 방식을 제공하여 프로젝트가 첫날부터 원활하게 실행되도록 보장합니다.
핵심 과제: 전력 및 신호
사용시 가장 큰 장애물은서보 기구마이크로비트에코드가 아니라 전력 공급입니다. Micro:bit의 USB 포트는 5V를 제공하지만 제한된 전류만 공급할 수 있습니다(보통 모든 핀에 대해 총 500mA 정도). 표준 서보, 특히 대형 서보는 시동 및 이동 중에 상당한 피크 전류가 필요합니다. Micro:bit의 3.3V 조정기 또는 USB 라인에서 이를 직접 끌어오면 전압 강하가 발생하여 비정상적인 동작이 발생하거나 보드가 재설정될 수 있습니다.
따라서 첫 번째 규칙은 분리입니다. 서보의 전원을 Micro:bit의 논리 전원과 분리해야 합니다. 공통 기반을 공유하지만 안정성을 보장하려면 에너지원을 구별해야 합니다. 이러한 절연은 모터의 소음이 민감한 마이크로컨트롤러 신호를 방해하는 것을 방지합니다.
필수 구성 요소 및 배선
코드를 작성하기 전에 올바른 하드웨어 설정이 있는지 확인하십시오.
BBC 마이크로:비트 v2: 더 나은 핀 가용성과 3.3V 로직 레벨 호환성을 위해 권장됩니다.
서보 모터: 토크 요구에 따라 표준 9g 마이크로 서보 또는 더 큰 메탈 기어 서보.

외부 전원 공급 장치: 서보당 최소 1A를 제공할 수 있는 5V 배터리 팩 또는 벽면 어댑터.
점퍼선: 남성 대 여성 연결용입니다.
배선도
1. 서보 레드 와이어(VCC): 외부 5V 전원 공급 장치의 양극 단자에 연결합니다.하지 마십시오이것을 Micro:bit의 3V 또는 5V 핀에 연결하세요.
2. 서보 갈색/검은색 와이어(GND): 외부 전원 공급 장치의 음극 단자에 연결합니다. 결정적으로, 이 와이어를 Micro:bit(핀 1, 2 또는 3)의 GND 핀 중 하나에 연결하십시오. 이는 신호 통신에 필요한 "공통 접지"를 생성합니다.
3. 서보 주황색/노란색 와이어(신호): Micro:bit의 핀 0, 핀 1 또는 핀 2에 연결합니다. 대부분의 라이브러리에서 PWM(Pulse Width Modulation) 지원을 위해 핀 0이 권장됩니다.
이 공통 접지를 설정하면 Micro:bit가 고전류 부하를 공유하지 않고 저전압 논리 신호를 서보에 보낼 수 있습니다. 이 표준 관행은 거의 모든 기업에 적용됩니다.모션 제어 애플리케이션마이크로 컨트롤러가 포함됩니다.
서보 동작 코딩
Micro:bit에서는 블록 기반 MakeCode 편집기 또는 Python을 통해 서보 제어에 액세스할 수 있습니다. 기본 원리는 펄스 폭 변조(PWM)입니다. 서보는 전기 펄스의 폭을 해석하여 위치를 결정합니다.
MakeCode 블록 사용

1. 왼쪽 메뉴에서 '고급' 섹션으로 이동합니다.
2. "Servo" 확장을 찾아서 추가하세요.
3.서보 0을 각도로 설정 block.
4. Set the pin to Pin 0 and the angle to a value between 0그리고180 .
5. To create smooth motion, use a loop with small delays. For example, loop from 0 to 180 degrees, incrementing by 1 degree each time with a 20ms delay.
Using Python
If you prefer text-based coding, the microbit library allows direct PWM control, though using a servo-specific library is cleaner.
마이크로비트 수입에서
import servo
# Create a servo object on Pin0
my_servo = servo.Servo(pin0)
# Rotate to 90 degrees
my_servo.write_angle(90)
sleep(1000)
# Rotate to 0 degrees
my_servo.write_angle(0)
When implementing 서보 모터 선택 logic in code, remember that not all servos rotate exactly 360 degrees. Most standard servos are limited to 180 degrees. If you need continuous rotation, you must select a specific 연속 회전 서보 , which changes the coding logic from position control to speed control.
일반적인 문제 해결
Even with correct wiring, problems may arise. Here is how to diagnose them:
Jittering Noise : This usually indicates insufficient power or a poor ground connection. Ensure your external battery has enough capacity and that the GND wire is firmly connected to both the power supply and the Micro:bit.
Servo Won't Move : Check if the signal pin is connected to Pin 0, 1, or 2. Avoid Pin 3, 13, 14, etc., as they may not support the required PWM frequency. Also, verify that the servo is receiving 5V, not 3.3V, as some servos require the higher voltage to generate enough torque.
Micro:bit Resets : This is a sign of power starvation. The servo is drawing too much current from the Micro:bit's shared rail. Re-check your wiring to ensure the servo's VCC is connected only* to the external power source.
Best Practices for Reliability
To ensure long-term success, always test your servo under no-load conditions first. Then, gradually add mechanical load while monitoring temperature. If the servo becomes hot to the touch, it is likely stalled or overworked. Additionally, use a capacitor (eg, 100uF) across the servo's power terminals if possible. This helps filter out electrical noise generated by the motor brushes, protecting the Micro:bit's sensitive electronics.
결론
Mastering how to use a servo on micro bit is a foundational skill in maker culture. By respecting power limits, establishing a solid common ground, and using appropriate PWM signals, you can achieve precise and reliable movement. Start simple, troubleshoot methodically, and expand your projects with confidence. Whether you are building a robotic arm or an automated gate, these principles apply universally to all servo control systems .
Update Time:2026-07-16