Students will
- Read a tilt switch with a defined resting state
- Distinguish a held state from a change of state
- Test orientation and vibration limits
Arduino Uno R3
Turn a tilt-switch change into a stable, observable event rather than treating orientation as a guaranteed continuous measurement.
Reviewed connection map
Read before uploading
const int TILT_PIN = 8;
bool previousState;
void setup() {
pinMode(TILT_PIN, INPUT_PULLUP);
Serial.begin(9600);
previousState = digitalRead(TILT_PIN);
}
void loop() {
bool currentState = digitalRead(TILT_PIN);
if (currentState != previousState) {
Serial.println(currentState == LOW ? "contact closed" : "contact open");
previousState = currentState;
delay(30);
}
}Optional engineering record
Choose the prompts that help students explain predictions, evidence, debugging, and transfer. Saving creates a new entry in this browser’s Rudi notebook.
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.
Mount the sensor securely and add a short settling interval after a detected change.
Verify the switch legs, breadboard rows, INPUT_PULLUP setting, and D8-to-GND path.
2026 middle school standards
These are evidence-based crosswalk candidates for curriculum review—not a claim of official alignment.
Students isolate variables, compare observed behavior with the intended purpose, and document a revision.
Lesson evidence: Orientation and repeated-event testfloating-inputs · component-boards
Starting point, not verified curriculum. Review the actual hardware, circuit, code, power requirements, and classroom conditions.
After teaching this lesson