Mission 2-1: Introducing CodeBot - PwR MS

Mission 2-1: Introducing CodeBot | Python with Robots MS
Mission 2-1 Lesson Plan

Introducing CodeBot

Students meet the CodeBot - exploring its physical features, connecting it to CodeSpace, and writing their first CodeBot program.

⏱ 30-40 min 🎯 Grades 6-8 💻 CodeSpace 🤖 CodeBot 🐍 Python
View Lesson Outline
📋

Overview

Mission 2-1 introduces students to the CodeBot CB3 robot. Before any coding begins, students explore the robot's physical hardware - its LEDs, motors, sensors, buttons, and other peripherals - and learn to categorize each as an input or output device. This mission builds the vocabulary and conceptual foundation students need to start programming CodeBot in the missions that follow.

🎯 Mission Goal: Students will identify the main components of the CodeBot and classify each peripheral as either an input or output device.

🎯

Learning Targets

  • I can identify the main components of the CodeBot.
  • I can identify CodeBot inputs and outputs.
💡

Key Concepts

  • There are a lot of hardware peripherals on the CodeBot, including sensors, LEDs, motors, buttons, and a speaker.
  • Some of the peripherals are used for input, and others are used for output.

Assessment Opportunities

☑️

Success Criteria

  • Identify the parts of the CodeBot
  • Identify a peripheral as input or output
🧰

Classroom Materials

🌍

Real-World Applications

🤖The microcontroller on the CodeBot is the same type of chip found in billions of everyday devices - from microwaves and thermostats to cars and medical equipment. Learning to program one means learning to program them all.
🏭Embedded systems programming is one of the fastest-growing fields in tech. Engineers who write code for microcontrollers work on everything from pacemakers to Mars rovers.
🚀

Extensions & Cross-Curricular

ExtensionMake a list of common input and output devices.
Lang ArtsStudents write about technology today and its impact.
ScienceStudents research a microcontroller or another everyday technology device.
ExtensionSupports language arts through reading instructions and reflection writing.
🔤

Vocabulary

CodeBot - The programmable wheeled robot used in this course, controlled by Python code written in CodeSpace.
Physical computing - Using code to interact with and control real-world hardware like sensors, lights, and motors.
Firmware - The software installed on the robot that lets it run your Python programs.
import - A Python keyword used to bring in a module - a set of pre-built tools - so you can use them in your program.
Module - A collection of pre-written Python code that adds capabilities to your program, like controlling CodeBot's motors or lights.
Peripherals: Devices that give input or output to the CodeBot; they include LED lights, speaker, motors, line sensors, proximity sensors, an accelerometer and push buttons.
Motors: Programmable electric engines; powers the wheels.
LEDs: Light emitting diodes; tiny and efficient electronic components that produce light.
Wheel encoders: Discs that rotate, counting the invisible IR light beam pulses through its slots.
Static electricity: A charge that can build up and causes a jolt and spark when grounded.
📝
Preparing for the Lesson

See Getting Started with CodeSpace for help with the steps below.

  • Claim your license for Python with Robots MS.
  • Create a class on the teacher dashboard and generate a join code.
  • Charge CodeBot robots the night before class.
  • Verify all USB cables are working - test one connection yourself before class.
  • Check that students' computers have the Web Serial API enabled in Chrome.

🧑‍🏫
Teacher Notes
  • The first CodeBot connection is the most common sticking point. If a student can't connect, check: (1) the USB cable is fully seated, (2) they clicked the correct COM port in the browser dialog, (3) the robot is powered on.
  • Chromebooks require a special setup for Web Serial. If your school uses Chromebooks, check the support FAQ before class.
  • If students finished other Firia Labs packs, they already know CodeSpace navigation - you can move through the early objectives more quickly.
🗺️

Lesson Outline

💡Lesson Tips and Tricks
Teaching tip: You can use a variety of discussion strategies to get the most engagement from your students. For example, you can have students write their answers before asking anyone for an answer. You can use one of many think-pair-share methods. You can have students write their answer and share with someone, and then have other students share answers they heard from their peers. You can randomly select students to answer.
🗣️Pre-Mission Warm-up

Slides 2-3 - Students can write in their log first and then share, or discuss first and then write in their log.

  • Ask: What are some things you can connect to a computer or laptop?
  • Introduce the term "peripheral". Peripherals can be connected to a computer or laptop, like a keyboard, mouse or printer. They can also be connected through the circuit board, like a sensor, LED or button.
  • Ask: Why do you think you should learn how to program a computer?
  • Students can share their answers. You may want to revisit this question at the end of Mission 3, and periodically throughout the Mission Pack.
💻Mission 2 Lesson 1 Activities

Students do not need the CodeBot for this lesson, but they will need a computer or laptop and access to the Internet. The Chrome browser works best, but other browsers also support CodeSpace.

  • Each student will complete a Mission Log (print or digital).
  • Students could work in pairs through the lesson, or they can work individually.
Teaching tip: Mission Introduction -- slides 4-7 Definition of CodeBot and a list of outputs and inputs. Students will write this information in their log. You can point out where the peripherals are on the CodeBot now, or after Objective 5 during the CodeBot review.
Teaching tip: Objective #2 -- slides 10-13 Students will answer a question in the mission log assignment. The CodeBot has 17 LEDs, but only 13 are easy to find. The user LEDs are in the middle of 'bot, and they turn red. The line sensor LEDs are on the bottom edge of the 'bot, and they turn green. Each proximity sensor also has a very small LED just below it. They light up when the proximity sensor actively senses something. The other two LEDs are difficult to find and not used in coding. One is above the power switch, labeled D21. The other is above the left proximity sensor, labeled D2.
Teaching tip: Objective #4 -- slides 15-16 The wheel encoder is easiest to find if students rotate to the back of CodeBot. It is a little black disc mounted on the yellow motor.
Teaching tip: Objective #5 -- slides 17-18 The buttons are named BTN-0 and BTN-1, but in code students will just use 0 or 1. The reboot button is not used for input in a program.
Teaching tip: Quiz -- slide 19 Before students take a short quiz, they learn about static electricity and how to avoid it when handling the CodeBot. They will answer questions in the mission log assignment. The quiz question is shown below.
Teaching tip: More CodeBot Peripherals -- slides 20-22 The instructions in Objectives 1-5 cover most of the CodeBot, but students should be able to identify the sensors and buttons as well. Use the slides or workbook pages to review more parts of the CodeBot. Then have students label the parts of the CodeBot on their mission log assignment.

🗝️ With the CodeBot review, you can ask students to indicate if a CodeBot part is input or output.

🧑‍🤝‍🧑Post-Mission Reflection

The post-mission reflection asks students to think critically about technology. You can change the questions if there is something else you want to emphasize with your students.

  • Inspect your CodeBot. All electronic devices you use have similar circuit boards inside. Name a few devices you use every day that might contain computer chips or "microcontrollers" such as the one on the 'bot.
  • What is something you do that uses an electronic device? How do you think this activity was done before electronic devices?

You can use an extension or cross-curricular activity as post-mission activity. You can show the Code.org video on how computers are changing everything. (link above)

You can use the Mission 2 Obj. 1-5 Kahoot as a lesson review. (link above)

End by collecting the Mission 2 Lesson 1 Log.