Guided physical computing, beginning with the Arduino Starter Kit Classroom Pack

Arduino Uno R3

Trigger to servo motion

Use a verified digital trigger to command two bounded servo positions and test the motion safely.

CSTA 2026 mapping candidatesNot reviewed by CSTA
MS-PRO-RD-17ProgrammingMS-PRO-TR-19Programming

Students will

  • Attach and command a servo with the Servo library
  • Constrain motion to reviewed positions
  • Separate a control signal from actuator power requirements

Evidence of success

  • Servo reaches both positions without binding
  • Released and pressed states consistently select the intended position
  • Student explains why the signal pin does not supply motor power

Hardware

  • Arduino Uno R3
  • Starter Kit hobby servo
  • Momentary pushbutton
  • Breadboard and jumper wires

Prerequisites

  • Read a reliable digital input
  • Identify servo power, ground, and signal leads

Before class

  • Verify the actual servo lead order
  • Test one servo with the intended supply before class
  • Set a safe mechanical range and keep hands clear of attached mechanisms

Reviewed connection map

Button-triggered servo

Button D8-GNDINPUT_PULLUP trigger
Servo signal D9Position command
Servo power + GNDReviewed supply and shared ground
Servo mechanismMove only within verified safe angles
  1. Connect the button between D8 and GND.
  2. Connect the servo signal to D9 and its verified power and ground leads to the reviewed supply.
  3. Test unloaded positions before attaching a mechanism.

Build and test

  1. 01Connect servo GND, 5V, and signal to the verified pins
  2. 02Upload a two-position test with no mechanism attached
  3. 03Wire the D8 button using INPUT_PULLUP
  4. 04Command the active position only when the trigger is verified
  5. 05Attach the mechanism and reduce the range if it binds

Read before uploading

Annotated Arduino sketch

#include <Servo.h>

const int BUTTON_PIN = 8;
const int SERVO_PIN = 9;
Servo actuator;

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  actuator.attach(SERVO_PIN);
  actuator.write(20);
}

void loop() {
  bool triggered = digitalRead(BUTTON_PIN) == LOW;
  actuator.write(triggered ? 100 : 20);
  delay(20);
}

Optional engineering record

Record evidence from this lesson

Choose the prompts that help students explain predictions, evidence, debugging, and transfer. Saving creates a new entry in this browser’s Rudi notebook.

Record your thinking — optional4 prompts

Use these prompts if they help students capture evidence, decisions, or questions. You do not need to complete every prompt or create an entry at every step.

Nothing is saved until you choose this button.

Troubleshooting

Uno resets when the servo starts

Remove the mechanism, inspect the supply, and use an appropriate external servo supply with common ground if required.

Servo moves unpredictably

Verify lead order, common ground, signal pin, and commanded angle bounds.

2026 middle school standards

Potential CSTA connections

Not reviewed by CSTA

These are evidence-based crosswalk candidates for curriculum review—not a claim of official alignment.

MS-PRO-RD-17

Analyze the roles of iteration, selection, variables, and procedures in a segment of code.

Students trace variables, selection, or iteration in the supplied sketch and connect code to physical behavior.

Lesson evidence: Trigger, angle variable, and motion trace
MS-PRO-TR-19

Use systematic strategies to test, refine, and document changes to a computing technology to meet the intended purpose.

Students isolate variables, compare observed behavior with the intended purpose, and document a revision.

Lesson evidence: Range and repeated-trigger test
View the official 2026 CSTA standardsStandard text: Computer Science Teachers Association (2026), CC BY-NC-SA 4.0.

Supporting concepts

power-and-signals · component-boards · motor-types

Sources and review

Arduino Uno R3 documentationArduino Projects Book · CC BY-NC-SA 3.0Arduino Servo library

Starting point, not verified curriculum. Review the actual hardware, circuit, code, power requirements, and classroom conditions.

After teaching this lesson

Make one bounded change—or connect the skill to a project.