Teacher Resources: Python with Robots MS Mission 9-1
All Systems Go! Lesson 1
Students use system sensors to monitor battery power and display battery health with a user interface.
Overview
In this first lesson of Mission 9, students learn how to access CodeBot's built-in system sensors to read battery voltage and detect whether the 'bot is powered by batteries or USB. They use that data to calculate battery capacity using a table lookup and then using the equation of a line. Students then create a simple user interface (UI) using the power LED to communicate battery health - no screen required.
🎯 Mission Goal: Students will use system sensors to monitor battery power and display battery health with a UI.
Learning Targets
- I can use system sensors to read battery voltage and power source.
- I can print the capacity percentage using a table.
- I can calculate the capacity percentage using the equation of a line.
- I can create a user interface to display battery health using the power LED.
Key Concepts
- CodeBot can measure its own battery voltage and detect whether it is powered by USB or batteries.
- System sensor data can trigger alerts to avoid problems. Even without a screen, CodeBot's LEDs can display sensor information.
- A graph of battery discharge over time can be approximated with a straight line, making it easier to calculate capacity percentage.
- The power LED - just above the power switch - can be turned on and off with code to communicate battery health.
Assessment Opportunities
- Mission 9 Lesson 1 Mission Log
- Submit completed program BatteryTest
- Mission 9 Obj. 1-4 Review Kahoot!
Success Criteria
- Read battery voltage using system sensors
- Indicate battery or USB power using system sensors and the power LED
- Display capacity percent using a table
- Calculate and display capacity percent using the equation of a line
- Use the power LED as a UI to communicate battery health
Digital Resources
Classroom Materials
- ▸CodeBot
- ▸USB cable
- ▸4 AA batteries per CodeBot (don't need to be fresh - variety of power levels is more interesting!)
Real-World Applications
This kind of code is already in the devices students use every day. Many electronics monitor battery power to ensure reliability, extend battery life, and prevent unexpected shutdowns.
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
0 if the power switch is set to batteries, 1 if USB.
v.
📐
Standards
▾
CSTA Standards - Grades 6-8
- If your students skipped Mission 8 as recommended, make sure you have entered the classroom dashboard and unlocked Mission 8 so students can continue to Mission 9.
- Look through the slides. Decide what materials you want to use for presenting the lesson. The slides can be 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.
- All CodeBots need four AA batteries. They do not need to be fresh - a variety of power levels can make the activity more interesting.
- 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 occasionally gives extra examples or definitions.
- The code in this lesson is similar to CodeTrek. It is simplified a little for ease of typing, and some non-required code is left out. All goals will be met.
- The activities include a lot of testing using the console panel for printing results. The console panel can be resized to show more text - just drag up the gray line above the tab headings.
- All CodeBots should have batteries in their battery pack for testing. Batteries don't need to be fresh. In fact, having batteries at a variety of power levels can make the activity more interesting.
- The lesson uses the equation of a line to calculate the percentage. If your students haven't learned this yet, you can just give them the code or teach a short lesson on the concept first.
Lesson Outline
Students can write in their log first and then share, or discuss first and then write. The warm-up questions review CodeBot sensors from previous missions.
- Question: What are some sensors on CodeBot you know how to use?
- Question: What other information from a CodeBot sensor would you like to have access to?
The Chrome browser works best, but other browsers also support CodeSpace. Each student will complete a Mission Log. Students could work in pairs, which is advantageous since this lesson requires testing during each objective.
🗝️ Optional: Mission 9 Obj. 1-4 Kahoot! Review. A review Kahoot! is available for all four objectives in this lesson.
The post-mission reflection asks students to think about how a battery tester can be used in other CodeBot programs. Answers can vary widely - this is a good topic for class discussion.
You can use a cross-curricular activity as a post-mission activity.
End by collecting the Mission 9 Lesson 1 Log.