Lesson 8 - Harvest & Storage Stage: Ventilation System

Lesson 8 Storage Stage: Ventilation System

 

 

image3.png Challenges: 8-1, 8-2

Students learn how to use button events to adjust a humidity threshold for controlling a ventilation fan.

image5.png I can create a variable to store a humidity threshold.

image5.png I can use button events to adjust the threshold value.

image5.png I can use conditionals to control a fan based on sensor data.


Engage

image7.png 2 min.

Different crops need different storage conditions! Potatoes need dry storage—humidity below 60%. Pumpkins can handle up to 75% humidity. Onions need it even drier—below 50%.

image9.png

How can we build a smart ventilation system that lets us set the right humidity level for whatever crop we’re storing?


Background

image7.png 3 min.

Variable: A variable is a named container that holds a value. Giving it a clear name helps anyone reading the program understand what it represents.

image10.png

Fan Module: Unlike components we turn on or off (like a pump), the fan can run at different speeds using the analog P0 output PWM block. The value range is 0–1023, where 0 means stopped, and 1023 is full speed.

image11.png

image12.png

NOTE: The fan requires a certain minimum PWM value to start spinning. This threshold is approximately 400, so students are advised to set the PWM value above this number.


Build and Connect

image7.png 10 min.

image13.pngBuild together following the Building Instruction.

After groups finish building, prompt them to discuss the questions below:

In a barn, is moisture higher at the bottom or top? Where should the sensor go—and why?

Where is the fan in your model? Why that position?

Have students install the fan and sensor with pins and liftarm blocks, according to the discussion.

NOTE: Make sure the fan blades are not blocked or touched while spinning.


Program

image7.png 25 min.


Challenge 8-1: Button Fan Speed Control

image16.pngAsk students to connect the DHT11 sensor to P0 and the fan module to P1.
image17.pngimage18.png
Guide students to open a new project in Mind+ and load program8-1.
Show students how to create a variable and have them create a variable for the fan speed with a readable name.
image19.pngimage20.png
Show students how to use the when button pressed to add 100 to or subtract 100 from a number variable.
Guide students to pick a step value (e.g., 50, 100, or 500) and type it into the change speed by block. Ask: "How does the step size affect how you control the fan?"Here is a sample code:Have students discuss how this programming concept could be applied, like to show a score that changes over time.
image21.pngimage22.png
Explain: Values above 1023 generally won't make it "more powerful"—instead, they can cause issues such as truncation, errors, or unpredictable behavior. Always keep PWM values within the valid range supported by the hardware.
Guide students to add constrain block to make the speed stay between 0 and 1023.
Here is a sample code:


Challenge 8-2: Adjustable Auto-Ventilation System

image23.pngAsk students to load program 8-2.
Explain: "In this challenge, we will build a system that automatically controls the fan based on humidity—and lets us adjust the target humidity without editing the code."
image24.pngimage25.png
Challenge students to set the starting value of the threshold to 60%.
Here is a sample code:


Extra Practice

image7.png 5 min.

Challenge students to optimize their ventilation system with an intermittent cycle.

image26.png

The variable doesn’t know the limit that it represents. Try a different to make the threshold stay between 0 and 100.

image27.png

 

Next Class: Lesson 9

Current Tutorial: Click Here

icon Lesson 8.zip 5.51MB Download(0)
License
All Rights
Reserved
licensBg
0