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

Arduino Uno R3

Read and map an analog control

Read a potentiometer, observe its full range, and map the measurement to a bounded output value.

CSTA 2026 mapping candidatesNot reviewed by CSTA
MS-PRO-VD-16ProgrammingMS-PRO-RD-17Programming

Students will

  • Wire a potentiometer as a voltage divider
  • Read and interpret analog values
  • Map an observed input range to a bounded output range

Evidence of success

  • The measured value changes smoothly through most of 0-1023
  • The student identifies the wiper as the changing signal
  • The mapped value remains between 0 and 180

Hardware

  • Arduino Uno R3
  • 10 kilohm potentiometer
  • Breadboard and jumper wires

Prerequisites

  • Upload a sketch
  • Open Serial Monitor
  • Identify 5V, GND, and A0

Before class

  • Verify the potentiometer pin order
  • Prepare a known-good 5V-wiper-GND connection
  • Expect endpoint readings to vary slightly

Reviewed connection map

Potentiometer voltage divider

5VOne outside potentiometer pin
PotentiometerCenter wiper provides the changing signal
A0Analog measurement input
GNDOther outside potentiometer pin
  1. Connect the outside pins to 5V and GND.
  2. Connect the center wiper to A0.
  3. Verify the actual pin order before applying power.

Build and test

  1. 01Connect the outside potentiometer pins to 5V and GND
  2. 02Connect the center wiper to A0
  3. 03Print readings while turning through the full range
  4. 04Record approximate minimum, midpoint, and maximum
  5. 05Map the reading to 0-180 and confirm the result remains bounded

Read before uploading

Annotated Arduino sketch

const int CONTROL_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int reading = analogRead(CONTROL_PIN);
  int mappedValue = map(reading, 0, 1023, 0, 180);
  mappedValue = constrain(mappedValue, 0, 180);
  Serial.print(reading);
  Serial.print(" mapped=");
  Serial.println(mappedValue);
  delay(100);
}

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

Reading stays near one endpoint

Confirm A0 connects to the center wiper rather than an outside pin.

Direction feels reversed

Swap the two outside 5V and GND connections; do not move the wiper connection.

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-VD-16

Use variables of multiple data types to store, access, and manipulate data within a program.

Students store and manipulate integer sensor and mapped output values.

Lesson evidence: Recorded minimum, midpoint, maximum, and mapped values
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: Annotated reading and mapping statements
View the official 2026 CSTA standardsStandard text: Computer Science Teachers Association (2026), CC BY-NC-SA 4.0.

Supporting concepts

component-boards · power-and-signals · sketch-foundations

Sources and review

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

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.