CyberPi: Smart Notifier
In this lesson students will define notifications for specific scenarios based on the features and requirements. Students will also program the smart notified to send notifications for specific scenarios.

Lesson
Overview
Description
In this lesson students will define notifications for specific scenarios based on the features and requirements. Students will also program the smart notified to send notifications for specific scenarios.
Objectives
Use CyberPi to measure light intensity and shaking status.
Define notifications for specific scenarios based on features and requirements.
Use mind maps to analyze how to create a smart notifier.
Program a Smart Notifier which features multiple functions and modes.
Before the Lesson
Preparation
For the teacher and students:
Computer with mBlock 5 installed from here: https://www.mblock.cc/en/download/ or mBlock Web version
Wi-Fi connection to student devices for IoT connectivity
One CyberPi’s with USB-C cable
Pocket shield (optional)
Example program(s): CyberPi – Lesson 5 - Smart Notifier
For students:
Proficiency in block-based coding
Prior knowledge of CyperPi's major features
Knowledge of variables
Review
Warm Up
Objective:
Guide students in thinking about their daily habits and how these habits impact their health. Have them consider using AI technologies to solve problems.
Procedures:
Ask: The COVID-19 pandemic has provoked a global crisis that had a deep impact on our everyday life and learning. Schools are ordered to close, and people must stay at home. The pandemic makes us realize the importance of health. Think about it! Do you have any daily habits that may be bad for your health?
Summarize: Not everyone cares enough about his or her health. Lots of people have some unhealthy habits, for instance, using phones while lying down, sitting, or standing with a curved back and slumped shoulders, and staying up late. In a tech-driven world, we could rely on modern technologies to track our health conditions. For example, we use wearables to count steps, and track our heart rates and sleep conditions through night.
Direct Instruction
Tour of mBlock 5
1. Open the mBlock software or mBlock 5 Web version.
2. Introduce students to the following key areas of the software interface:


Connect the CyberPi
3. Plug the CyberPi into the computer using the included cable. The CyberPi should boot up and the screen will display either the last program uploaded or the Home menu.
4. On the "Devices" tab in mBlock, click the "Add" button. Select CyberPi and click "Ok".
5. Click the "Connect" button. Then, select the USB port and click "Connect".

6. If connected successfully, the button will change to "Disconnect".

Guided Practice
Hands On
Objective:
Introduce students to some scenarios and have them think about how to design CyberPi to send notifications in these scenarios.
Procedures:
Discuss: In school, we take lunch breaks to relax our body. But when at home, many of you will sit there for a long time, watching TV, playing video games or on their phones. We don't move quite often. Sometimes you are just so into reading that you fail to notice the light intensity level. Can you think of any ways to solve these problems?
Summarize: We can design a product to monitor people's conditions and give alerts. For example, if people sit too long, the product will remind them to stand up and relax their body; if it's dark, the product will remind them to turn on the lights.
Introduce: We can use CyberPi to design a smart notification system which features 2 modes – Reading Mode and Sitting Mode. You can change the mode to let the system give specific notifications.
Show students how the smart notification system works.
Work with students to analyze what features their smart notifier must have and draw a mind map.

Independent Practice
Try It
Objective:
Give students the freedom to explore further so that they can enhance their programming skills.
Procedures:
Prepare a CyberPi, connect it to mBlock, and switch to Live mode.
Design the startup interface, prompting users to select a mode.

Reading mode:
Notification text on screen: The program for the other mode stops when one of the modes is selected.

Auto brightness:
Program the light sensor. Set the brightness of LED lights to 100 – ambient light intensity. In this way, when the ambient light gets dimmer, the LED lights turn brighter; when the ambient light gets brighter, LED lights turn dimmer.

Sitting mode:
When you sit too long, it sends alerts:

The program for the other mode stops when one of the modes is selected.
Options: Lights, Sounds, Texts
The system remains a sleep mode unless people sit too long.
The system maintains a sleep mode unless people sit too long. Program the device to determine whether people are sitting there too long and check if the device if the device is being shaken.
Introduce the coding block in the table:


The timer is reset once shaking is detected.
Repeat this piece of code.
Extension
Have students think of other features their Smart Notifier could have to help them develop healthy habits
Have them add those features
A possible mode they can add is one that makes the user shake the device several times to ensure they are exercising regularly
Wrap Up
Wrap-Up & Quick Check
Objective:
To enhance students' communication skills and understanding of their projects, ask them to share their projects in front of the class. In this way, students will be likely to pay more attention to their health.
Procedures:
Invite 2 or 3 students to share their smart notifier in front of the class and have them explain what's special about their project.
Have students discuss: Can you think of any other unhealthy habits? Can you think of any methods to improve your health?
Downloadable Material
Example Program
Educational Standards
K12 CS Framework
K12 CS Framework
Practice 3-1: Identify complex, interdisciplinary, real-world problems that can be solved computationally.
Practice 3-3: Evaluate whether it is appropriate and feasible to solve a problem computationally.
Practice 5-2: Create a computational artifact for practical intent, personal expression, or to address a societal issue.
CSTA
CSTA
2-CS-02: Design projects that combine hardware and software components to collect and exchange data.
Alberta - Grade 7-8 - CTF
Grade 7-8
CTF
Planning, creating, appraising and communicating in response to challenges.
Working independently and with others while exploring careers and technology.
British Columbia - Grade 7-8 - ADST
Grade 7
ADST
• Generate potential ideas and add to others’ ideas
• Identify and evaluate the skills and skill levels needed, individually or as a group, in relation to a specific task, and develop them as needed
• Select, and as needed learn about, appropriate tools and technologies to extend their capability to complete a task
Grade 8
ADST
• Generate potential ideas and add to others’ ideas
• Make a plan for production that includes key stages, and carry it out, making changes as needed
• Identify and evaluate the skills and skill levels needed, individually or as a group, in relation to a specific task, and develop them as needed
• Select, and as needed learn about, appropriate tools and technologies to extend their capability to complete a task
Manitoba - Grade 7-8 - Science
Grade 7
Science (Overall Skills and Attitudes)
7-0-4a Carry out procedures that comprise a fair test. Include: controlling variables, repeating experiments to increase accuracy and reliability.
7-0-4c Work cooperatively with team members to carry out a plan, and troubleshoot problems as they arise.
Grade 8
Science (Overall Skills and Attitudes)
8-0-4a Carry out procedures that comprise a fair test. Include: controlling variables, repeating experiments to increase accuracy and reliability.
8-0-4c Work cooperatively with team members to carry out a plan, and troubleshoot problems as they arise.
New Brunswick - Grade 7-8 - Science
Grade 7-8
Science (Attitude Outcome)
425 show a continuing curiosity and interest in a broad scope of science-related fields and issues
430 persist in seeking answers to difficult questions and solutions to difficult problems
431 work collaboratively in carrying out investigations, as well as in generating and evaluating ideas
Newfoundland & Labrador - Grade 7-8 - Science
Grade 7-8
Science
GCO: Skills - Students will develop the skills required for scientific and technological inquiry, for solving problems, for communicating scientific ideas and results, for working collaboratively, and for making informed decisions.
Nova Scotia - Grade 7-8 - ICT & Mathematics
Grade 7
Mathematics
PR05 Students will be expected to evaluate an expression given the value of the variable(s).
Performance Indicator:
PR05.01 Substitute a value for an unknown in a given expression and evaluate the expression.
PR02 Students will be expected to create a table of values from a linear relation, graph the table of values, and analyze the graph to draw conclusions and solve problems.
Performance Indicators:
PR02.01 Create a table of values for a given linear relation by substituting values for the variable.
PR02.02 Create a table of values, using a linear relation, and graph the table of values (limited to discrete elements).
PR02.03 Sketch the graph from a table of values created for a given linear relation, and describe the patterns found in the graph to draw conclusions (e.g., graph the relationship between n and 2n + 3).
PR02.04 Describe, using everyday language, in spoken or written form, the relationship shown on a graph to solve problems.
PR02.05 Match a given set of linear relations to a set of graphs.
PR02.06 Match a given set of graphs to a given set of linear relations.
Technology
GCO1: Students will be expected to design, develop, evaluate, and articulate technological solutions
GCO2: Students will be expected to operate and manage technological systems
Grade 8
Mathematics
PR01 Students will be expected to graph and analyze two-variable linear relations.
Performance Indicators:
PR01.01 Determine the missing value in an ordered pair for a given equation.
PR01.02 Create a table of values by substituting values for a variable in the equation of a given linear relation.
PR01.03 Construct a graph from the equation of a given linear relation (limited to discrete data).
PR01.04 Describe the relationship between the variables of a given graph.
SP01 Students will be expected to critique ways in which data is presented.
Performance Indicators:
SP01.01 Compare information provided for the same data set by a given set of graphs, including circle graphs, line graphs, bar graphs, and pictographs, to determine the strengths and limitations of each graph.
SP01.02 Identify the advantages and disadvantages of different graphs, including circle graphs, line graphs, bar graphs, and pictographs, in representing a given set of data.
SP01.03 Justify the choice of a graphical representation for a given situation and its corresponding data set.
SP01.04 Explain how the format of a given graph, such as the size of the intervals, the width of the bars, and the visual representation, may lead to misinterpretation of the data.
SP01.05 Explain how a given formatting choice could misrepresent the data.
SP01.06 Identify conclusions that are inconsistent with a given data set or graph, and explain the misinterpretation.
Technology
GCO1: Students will be expected to design, develop, evaluate, and articulate technological solutions
GCO2: Students will be expected to operate and manage technological systems
Ontario - Grade 7-8 - Mathematics
Grade 7
Mathematics
Algebra
C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves events influenced by a defined count and/or sub-program and other control structures
Grade 8
Mathematics
Algebra
C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves the analysis of data in order to inform and communicate decisions
Prince Edward Island - Grade 7-8 - Science
Grade 7-8
Science
GCO: Skills - Students will develop the skills required for scientific and technological inquiry, for solving problems, for communicating scientific ideas and results, for working collaboratively, and for making informed decisions.
Quebec - Grade 7-8 - Science
Grade 7-8
Science (Strategies)
Exploring various ways of solving the problem
Exchanging information
Comparing different possible explanations for or solutions to a problem in order to assess them (e.g. full-group discussion)
Saskatchewan - Grade 7-8 - Science
Grade 7-8
Science (Goals)
Develop Scientific and Technological Skills – Students will develop the skills required for scientific and technological inquiry, problem solving, and communicating; for working collaboratively; and for making informed decisions.
