Lesson video

In progress...

Loading...

Hello.

My name's Mrs. Taylor.

And I'm really pleased you can be here to join me for our lesson today.

Our lesson today is Data Logging, and this is part of the Systems Approach to Design: Sustainable Futures unit.

The outcome, I can design a control system to log data over time.

There are three keywords in today's lesson.

Data, a piece of information which can be stored and used by a computer programme, a variable, which is a piece of data stored in a computer's memory, which can be accessed and changed, feedback, a signal that is sent back in a loop, depending upon a condition.

There are two parts to our lesson today, data and variables, and data logging.

Let's make a start with data and variables.

Data can be in the form of numbers, characters, symbols, or even images.

In a control system, data can be collected, stored, and used by a computer programme.

Think about your control system for a greenhouse.

What data could we collect to help control its environment? Jun considers data he could collect for his greenhouse control system, the temperature in the greenhouse, the moisture content of the soil, and the light levels in the greenhouse.

We now have a check for understanding.

What data might we collect in a greenhouse control system? Is it A, time, B, year, C, temperature, or D, soil moisture? Pause the video and have a go.

Wonderful.

Let's check.

That's right, the answers are C and D, both temperature and soil moisture are examples of data we might collect in a greenhouse control system.

Well done.

Jun gives reasons for collecting the data for his greenhouse control system.

The temperature in the greenhouse, "To open the window if it gets too hot." The moisture content of the soil, "To remind me to water the crops." The light levels in the greenhouse, "To tell me if the crops are getting enough light." By using a range of input components, the greenhouse data can be collected.

As the data can change, it needs to be stored as a variable.

A variable is a named piece of data stored in a computer's memory, accessed and changed by a computer programme.

A variable can hold one value at a time, which can change, such as the temperature in the greenhouse or the moisture content of the soil.

Here, we have a check for understanding.

Read the sentence and complete it with the missing words.

Pause the video.

Fantastic.

Let's check.

A variable is a named piece of data stored in a computer's memory, which can be accessed and changed by a computer programme.

Well done.

In this example, the temperature data is collected, stored, and used by a computer programme.

An input, such as a temperature sensor or a thermistor, is used to collect the data.

The data is then stored in a variable in the computer's memory, in this case, a micro:bit memory.

The variable is then displayed using an output, such as the micro:bit's LED display.

In this example, the temperature is measured and stored in a variable.

Here, we can see using a flow chart, start, measure the temperature, is the temperature above 30 degrees Celsius, yes, then open the window, or no, close the window.

The variable is compared to a set temperature using a feedback loop.

A decision is then made to either open or close the greenhouse window.

We now move to task A.

There are three parts.

Part one, define data and give an example, and part two, define variable and give an example, and part three, using your planning flow charts, identify and explain the data your greenhouse control system is collecting.

Pause the video and have a go.

Wonderful.

Let's have a look at some of the answers you may have come up with.

For part one, you may have said, "Data can be in the form of numbers, characters, symbols, or even images.

In a control system, data can be collected, stored, and used by computer programme.

The temperature data can be collected in the greenhouse.

This could be used to open the window if it gets too hot." And for part two, you may have said, "A variable is data stored in a computer's memory, which can be accessed and changed.

In the greenhouse control system, this could be temperature, moisture levels, or light levels." And for part three, you may have said something similar to this, "My control system is collecting the soil moisture level data using a sensor as an input.

This data can be then used to alert the gardener or user when to water the plants." So, here, we can see using the flow chart, start, measure the soil moisture, is the soil moisture less than 200, yes, display water me string, or no, which results in no action.

My control system is collecting the temperature data using a sensor as an input, the data can then be stored as a variable and compared to a set temperature using a feedback loop.

This could be used to control an output, like a servo motor, to open and close a window if it gets too hot.

So, here, we can see start, measure temperature, is the temperature above 30 degrees Celsius, yes, display string opening, and rotate the server 30 degrees, or no, display string closing, and rotate the server zero degrees.

Well done.

We now move to the second part of our lesson today, data logging.

Data logging is the collection of data over time.

We log data over to allow us to look at patterns or trends.

These patterns can be used to make predictions.

For example, in the greenhouse control system, we can record the moisture of the soil every day.

From this data, we can then see how often the plants need to be watered.

Jun designs a control system to measure the moisture in the soil.

He uses a micro:bit and a soil moisture sensor to model and code the system in Tinkercad.

The soil moisture sensor is connected to pin zero and ground.

These are the positive and negative connections.

The third connection is the feedback signal, this is connected to pin one.

Here, we have a check for understanding.

What are the three connections on a soil moisture sensor? Is it A, positive-signal-ground, B, negative-feedback-ground, C, positive-feedback-ground, or D, positive-feedback-negative? Pause video and have a go.

Wonderful.

Let's check.

That's right, it's C, positive-feedback-ground.

Well done.

He uses the code block digital right pin zero high to power the sensor.

After a wait, he adds a set to code block and changes the variable to moisture and read analogue pin one.

When button A is pressed, the moisture sensor reading is displayed as a number on the onboard LEDs through the show number block.

Jun tested his programme and recorded the moisture data of the soil in a spreadsheet.

He can then use this data to predict how often he needs to water the plants.

Jun recorded the soil moisture data every morning for a month in a spreadsheet.

And here, we can see the readings beginning with 11, 813, 792, and so on.

Jun used the data he had collected to create a graph.

Jun watered the plants three times in the month.

Can you spot when? That's right, where the peaks are.

We have another check for understanding now.

What is data logging? Is it A, recording information on a graph, B, recording information in a notebook, C, recording information over time, or D, recording information using sketches? Pause the video.

Wonderful.

Let's check.

That's right, it's C, recording information over time.

Well done.

When the data has been logged, it can be analysed and used to manage the greenhouse conditions.

For example, analysing the soil moisture levels over time can help identify how often to water the plants before the soil becomes too dry.

It may be necessary to combine data when analysing, such as temperature and moisture levels.

We now move to task B.

For part one, open the link programme from the gallery in Tinkercad.

Part two, simulate the programme and explain what happened.

To adjust the moisture level, click on the sensor.

For part three, add to the programme measuring and displaying the temperature.

Part four, simulate the programme and explain what happened.

Part five, add to the programme measuring and displaying the light levels.

And part six, simulate the programme and explain what happened.

Pause the video and have a go.

Wonderful.

Let's have a look at some of the answers you may have come up with.

For part one and two, Jun says, "When I press button A, the moisture level is displayed on the built-in LEDs.

I changed the levels with the slider and recorded a minimum of 11 and a maximum of 813." For parts three and four, Jun says, "When I press button B, the temperature is displayed on the onboard LEDs.

I changed the levels with the slider and tested the programme at different temperatures." And for parts five and six, Jun says, "When I press button A and B simultaneously, the light level is displayed on the onboard LEDs.

This is proceeded with an L to indicate light.

I changed the levels with the slider and tested the programme at different light levels." Well done.

We now move to a summary of our learning today.

Data can be stored and used by a computer programme, this could be numbers or words.

Different types of data can be collected from a control system, such as temperature, light levels, or moisture levels.

A variable is a piece of data stored in a computer's memory, which can be accessed and changed.

Data logging is a collection of data over time.

Feedback is a signal that is sent back in a loop, depending upon a condition.

I'm really pleased you could join me for our lesson today.

Thank you, and well done.