Adding Motion to Your micro:bit with a Servo Motor

In this activity, students will explore how physical computing can bring simple creations to life by integrating motion into a craft using a micro:bit and an 180° servo motor. While an airplane craft kit is provided as one option, students also have the option to design their own object to incorporate a moving element.

In this activity students learn how servo motors function and connect to the micro:bit via ‘pins.’ Using Microsoft MakeCode, students program the micro:bit to control servo movement, allowing their design to rotate, swing, or animate.

Grade Levels: 3 - 12
Subject Matter: Algorithms, Physical Computing, Programming, Cross-Curricular Integration: ELA, Cross-Curricular Integration: Social Studies
Concepts: Programs and Algorithms, Computing Devices and Systems, Data and Information
Standards: 3-5.PA.2, 3-5.CD.1, 6-8.CD.2, 6-8.CD.3, K-2.PA.1, K-2.PA.2, K-2.PA.3, K-2.PA.4, 3-5.CD.2, 3-5.PA.3, 6-8.PA.1, 6-8.PA.2, 6-8.PA.3, 3-5.DI.1, 6-8.DI.1, K-2.CD.1, K-2.CD.2
  • Average Rating: 0.0 (0 ratings)

Activity Instructions

  1. Introduce the activity
    1. Introduce physical computing: “How can you code real objects to move?”
    2. Show examples of servo motion (swinging arm, rotating propeller, animated sign)
    3. Explain real-world uses (robotics, automation, engineering design)
  2. Wiring & Concept Mini-Lesson
    1. Video: https://youtu.be/qdX86in2YXo?si=abjkzT1SKANZsNP4
    2. Introduce servo motor wires:
      1. Brown = Ground
      2. Red = Power
      3. Orange = Signal
    3. Demonstrate how alligator clips with pigtails connect servo wires to micro:bit pins

 

  1. Build Phase
    • Students construct the physical structure that will hold or support the servo-driven motion. Choose one path:
      1. Option A: Follow airplane craft kit instructions
      2. Option B: Design a custom craft that includes a moving part
  2. Coding the Servo
    • Open Microsoft MakeCode for micro:bit
    • Introduce basic servo blocks:
      1. Set servo position (0–180°)
      2. On button press or loop control
    • Students test and adjust movement range
    • Encourage iteration: “What angle (0-180) works best for your design?”
  3. Integration & Testing
    • Attach servo securely to craft
    • Download and run code 
    • Observe movement
    • Debug wiring or adjust code if needed
    • Encourage peer troubleshooting

Tips for Running Activity

  • Build and make a test model before executing this activity with students
  • Know your supplies – if you have many colors of cords, be prepared to help students navigate through connecting the servo to micro:bit in small groups
  • Start with simple code first so everyone is successful moving their servo motor together before allowing them to make alterations for their creation

Assessment Opportunities

Students share:

  • What they built
  • What movement they programmed
  • One challenge they solved
  • One improvement they would mak

Extension Opportunities

  • Extension: Add sensor input (button, light, motion trigger) to control servo behavior
  • Advanced: Create multi-step motion sequences or synchronized movements

Elements of this resource were created by BBC micro:bit, then curated by the team at Nextech.

Learn More