CyberPi: Houseplant Care
In this lesson students will gain insight on the need of water for plants. Students will use sensors to measure and monitor the moisture of plants. They will also stimulate sunlight and water loss using sensors and send alarms based on the levels of water.

Lesson
Overview
Description
In this lesson students will gain insight on the need of water for plants. Students will use sensors to measure and monitor the moisture of plants. They will also stimulate sunlight and water loss using sensors and send alarms based on the levels of water.
Objectives
Explain the relationship between plants and water and identify how much water different plants need.
Simulate sunlight and monitor the moisture of plants.
Use mind maps to analyze how a plant monitoring device works.
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 4 - Houseplant Care
For students:
Proficiency in block-based coding
Prior knowledge of CyperPi's major features
Review
Warm Up
Objective:
Before students design plant monitoring devices, help them learn about plants and the purpose of the houseplant care project.
Procedures:
Introduce the topic of this lesson:
Say: Plants can clean air, relax our minds and eyes, and add color to the environment. All life needs water. We need water, so do plants.
Play a video demonstration to help students learn more about plants.
Summarize: Water is essential in plant's healthy growth, photosynthesis, and transpiration. Plants have different features, and hence, different water needs. For example, cacti, covered in spines, dry out very slowly, so we can water them once a month. Some plants, such as Chinese money plants (i.e. Pilea Peperomioides) with flat, thin, big leaves, need much water, so we'd better water them every day. Most plants, such as chrysanthemums and morning glories, only need watering once a week
Ask: What will happen if we water our plants too frequently or forget to water them?
Have students think about and discuss the above question.
Summarize: Plants will dry out and wither if we forget to water them. But if we water them too often, they may die of overwatering. We should be aware that overwatering wastes water, especially when it comes to watering many plants, like during agricultural irrigation.
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 the application of a plant monitoring device. Encourage students to think about how to design this project. Enhance students' independent thinking skills.
Procedures:
Introduce the design challenge of this lesson: To design a plant monitoring device to remind plant lovers to water their plants appropriately.
Ask: What features do you think a plant monitoring device should contain?
Possible answers: A plant monitoring device could be able to:
Detect whether a plant has a moisture problem; and
Remind the user to take care of the plant when it has a moisture problem.
Demonstrate the desired outcomes of the Plant Monitoring Device project.
Instruct students to identify the functions and applications of the plant monitoring device by means of the mind map.

Independent Practice
Try It
Objectives:
Instruct students to design the Plant Monitoring Device project.
Have students program different functions of the plant monitoring device.
Procedures:
Prepare to write Python programs:
Have students get their CyberPi devices ready, connect it to mBlock, and switch to Live mode in mBlock.
Distribute the example program to students and ask them to open it.
Observe the three sprites on the stage and analyze their possible features.
Assume the three plants are given the same amount of sunlight in this project.

Instruct students to write programs based on the mind map for project design.
Instruct students to program the project. Make it display current moisture level.
Simulate the water loss process: Use the light sensor to simulate the light. When the light is intense, the plant loses water faster. Remind students that plants have different water loss speeds, so they need to set up the speed accordingly.
Create a variable light to store the data returned by the light sensor.

Create variables moisture1, moisture2, and moisture3. Set different variables to represent the moisture level of the three plants:

Simulate the water loss of the plants:

Tips for coding:
Divide the variables light by different numbers to simulate the plants' drying out process.

Set the condition moisture is greater than 0 to avoid the variables going negative.
Use the wait block to prevent the moisture variables from decreasing too fast.
Display moisture level:
CyberPi's screen can display a bar chart to represent the moisture level of the three plants.

Use different colors to represent the indicators for different plants.
Round off the moisture values with the round block because CyberPi can only display integers.
Make the project send alarms when plants have a moisture problem:
Detect moisture problems: The program decides whether to send an alarm.

Ask students to complete the scripts for Plant Pot plant12 and Plant Pot plant1 in reference to the above example.
Set the two conditions:
1. If the moisture is under 50, it means the plant lacks water;
2. If the moisture is over 110, it means the plant is overwatered.
When one of the conditions is true, the program sends the alarm.
Remind students that they can change the numbers (here 50 and 110) based on their design.
Raise alarms:
When the plant has a moisture problem, a light indicator lights up.
Example of Plant ‘Cactus7’ Indicator:

Ask students to complete the scripts for Plant “Pot plant12” Indicator and Plant “Pot plant1” Indicator in reference to the above example.
However, when the plant's moisture returns to the normal range, the alarm should stop.

Ask students to complete the scripts for Plant “Pot plant12” Indicator and Plant “Pot plant1” Indicator in reference to the above example.
Remind students that they can change the numbers (here 90 and 110) based on their design.
Program the watering process:
Use the joystick to select a plant.
Create another variable and name it: choice.
Use this variable to select a plant.

The variable choice can increase only when it's less than 3 and decrease only when itis greater than 1. Use this setting to limit the variable between 1 and 3.
When the value of choice equals 1, the first plant is selected. When the value of choice equals 2, the second plant is selected. When the value of choice equals 3, the third plant is selected.
Add sprite Diamond3:
Use it as an arrow that will appear under the selected plant on the stage. Modify the sprite’s costumes to differentiate the arrows. Program this sprite as follows:

Water the plants: After you select a plant, pull the joystick down to water it.

Extension
Have students add a new variable called Sunlight
Similar to checking the moisture level, have them check to see if their plant is getting enough sunlight
When it is not getting enough, display "move plant"
Wrap Up
Wrap-Up & Quick Check
Objective:
Have students further explore what they've learned based on this project.
Procedures:
Invite volunteer students to present their projects. Ask students to give feedback on each other's projects and think about how to improve the projects.
Have students introduce a plant (its name, features, and how to take care of it). Encourage them to do online research about the growth characteristics of the plant.
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.
CSTA
CSTA
2-IC-20: Compare tradeoffs associated with computing technologies that affect people’s everyday activities and career options.
2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
ISTE
ISTE
5c: Students break problems into component parts, extract key information, and develop descriptive models to understand complex systems or facilitate problem-solving.
Alberta - Grade 7-8 - CTF & Science
Grade 7
CTF
Planning, creating, appraising and communicating in response to challenges.
Working independently and with others while exploring careers and technology.
Science
Illustrate how life-supporting environments meet the needs of living things for nutrients, energy sources, moisture, suitable habitat, and exchange of gases
Grade 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 & Science
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
Science
- Survival needs.
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 - Science
Grade 7
Science
Identify biotic and abiotic elements in an ecosystem, and describe the interactions between them
New Brunswick - Grade 7 - Science
Grade 7
Science
304-3 describe conditions essential to the growth and reproduction of plants and microorganisms in an ecosystem, and relate these conditions to various aspects of the human food supply
Newfoundland & Labrador - Grade 7 - Science
Grade 7
Science
Identify biotic and abiotic elements in an ecosystem, and describe the interactions between them.
Nova Scotia - Grade 7-8 - ICT, Mathematics & Science
Grade 7
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
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.
Science
Describe conditions essential to the growth and reproduction of plants and microorganisms in an ecosystem, provide examples, and relate these conditions to various aspects of the human food supply.
Grade 8
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
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.
Ontario - Grade 7-8 - Coding & Science
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
Science
3.2 identify biotic and abiotic elements in an ecosystem, and describe the interactions between them
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
Science
Identify biotic and abiotic elements in an ecosystem, and describe the interactions between them.
Quebec - Grade 7-8 - Science
Grade 7-8
Science
Explains how water, light, mineral salts and carbon dioxide are essential to plants.
Saskatchewan - Grade 7-8 - Science
Grade 7
Science
IE7.3 Evaluate biogeochemical cycles (water, carbon, and nitrogen) as representations of energy flow and the cycling of matter through ecosystems.
