Teacher Resources: Python with Robots MS Mission 9-3
All Systems Go! Lesson 3: Orientation & Motion
Students use the accelerometer to monitor physical orientation and detect motion, then build a GuardBot that triggers an alarm on any movement.
Overview
In this final lesson of Mission 9, students explore the accelerometer - a tiny chip that measures force in three dimensions. They write programs that read axis values, use orientation data to keep CodeBot pointed up on an incline, and apply proportional rotation speed for smoother control. They also build a GuardBot that detects any motion and sounds an alarm.
🎯 Mission Goal: Students will use input sensors to monitor physical orientation and detect motion.
Learning Targets
- I can use system sensors to monitor physical orientation.
- I can use physical orientation to detect motion.
Key Concepts
- The accelerometer detects orientation in three dimensions. CodeBot can be programmed to act on conditions based on its orientation.
- The accelerometer can also detect motion. Any slight movement can be detected and used to trigger an alarm.
Assessment Opportunities
- Quiz after Objective 10
- Mission 9 Lesson 3 Mission Log
- Submit completed program AccelTest
- Submit completed program GuardBot
- Mission 9 Obj. 8-12 Review Kahoot!
Success Criteria
- Print the 3-axis values from the accelerometer
- Write basic code that keeps CodeBot pointed up
- Improve the basic code for better control using proportional rotation speed
- Detect motion on the X-axis
- Detect motion on all 3 axes
Digital Resources
Classroom Materials
- ▸CodeBot and USB cable
- ▸4 AA batteries per CodeBot
- ▸Sturdy surface on an incline - a yearbook, shoebox, cardboard box, or textbook works great
Real-World Applications
Many electronic devices use an accelerometer for orientation and navigation, including:
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
now) to a new variable (before).
📐
Standards
▾
CSTA Standards - Grades 6-8
- Look through the slides. Decide what materials you want to use for presenting the lesson. The slides can be converted to Google Slides and projected on a large screen.
- Be familiar with the mission log assignment and the questions students will answer. Prepare the assignment to give through your LMS.
- This lesson requires a sturdy surface on an incline. A large book (like a yearbook), a shoebox, or a piece of cardboard propped up works well. The surface doesn't need to be big - CodeBot isn't moving up it, just trying to stay pointed up.
- If you have a word wall or another form of vocabulary presentation, prepare the new terms.
- This lesson follows the instructions in CodeSpace fairly closely. It is chunked into smaller bits of information and simplified for clarity.
- The code in this lesson is similar to CodeTrek, simplified a little for ease of typing and organized similarly to previous missions. All goals will be met.
- Objectives 9 and 10 require an inclined surface. A yearbook, shoebox, cardboard box, or textbook all work. Recommend a small surface that can be picked up and tilted for Obj. 10.
Lesson Outline
Students can write in their log first and then share, or discuss first and then write. The warm-up previews the lesson content.
- Question: What do you know about gravity?
- Question: What are the three dimensions in our world?
The Chrome browser works best, but other browsers also support CodeSpace. Each student will complete a Mission Log. Students can work in pairs or individually.
alarm() function to display the differences in each axis.🗝️ Optional: Mission 9 Obj. 8-12 Kahoot! Review is available for these four objectives.
The post-mission reflection asks students two reflection questions. Answers can vary widely.
You can use a cross-curricular activity as a post-mission activity.
End by collecting the Mission 9 Lesson 3 Log.