Year 3 Lesson 9
Smart Safe Overview
During this lesson, students will gain understanding of algorithms, events, actions and the use of ‘If-Then’ to define the flow within a system. Students will integrate and exhibit learning by creating a ‘smart safe’ system that alerts the user when the safe has been opened.
Key Information 45 or 90 minute lesson
Lesson Structure
Learning Objectives As a result of this lesson, students will be able to: ➜ Recognise the importance of providing clear and concise instructions.
Warm-Up Mini-lesson
➜ Explain key features of an effective safe and demonstrate understanding of what makes a safe ‘smart’.
Worked Example – Let’s Build!
Challenge 1
➜ Create a ‘smart safe’ that has a sound alert to confirm that the alarm is on standby.
Challenge 1 – Debug It! Challenge 2
➜ Create an image-capture feature in the system to photograph the intruder opening the ‘safe’.
Chilli Challenges & Exit Ticket
➔ Opportunity to extend understanding and reflect on learning.
Curriculum Topic (refer to the Curriculum Alignment Map)
S
T
E
A
M
Computing
KS2
Materials Required SAM Labs STEAM kit
Black marker pens
Scissors & glue
Plain paper
The Student Handouts can be used alongside each lesson.
Ⓒ 2019 SAM Labs
1
Year 3 Lesson 9
Smart Safe
Warm-Up
Recognise the importance of providing clear and concise instructions.
Key Information to Share: ● An algorithm is a set of definitive, clear instructions that can be written and followed in order to solve a problem. ● An effective set of instructions is well-ordered, clear and concise. ● The advantage of written instructions is that they don’t change, whereas spoken/oral instructions can and this can be a disadvantage. An algorithm should stay the same in order to be tested and can then be adapted.
Activity ● In pairs, students can number themselves ‘1’ and ‘2’. Number 1’s leave the room whilst Number 2’s have 1 minute to memorise the drawing of a safe on the Lesson Slides (slide 4). ● After the minute is up, bring up Slide 5 and invite Number 1’s back in. ● “Can you give clear, concise instructions to your partner?” Number 2’s firstly provide their partner with verbal instructions on how to draw the safe. Then, without receiving feedback, Number 2’s write down their instructions and pass them to their partner who can have a second attempt. ● Students share their sketches and compare them to the original drawing of a safe. Think, pair, share: “What was effective, or ineffective, about the instructions you were given?” Students can compare sketching from verbal and written instructions. ● Explain that the instructions were the input which the brain processed like a computer. The output was Number 2s’ sketch. Understanding this process helps to develop algorithmic thinking.
Link Forward: Students construct their own 3D safe.
Mini-lesson
Explain key features of an effective safe and demonstrate understanding of what makes a safe ‘smart’.
Key Information to Share: ● Features of an effective safe could include an alarm, flashing light, proximity or motion sensor, light sensor etc. ● To enable a safe to work effectively, it needs to be planned to follow an algorithm. ● Each system created in SAM Space has an input and an output. ● In computing terms, an input can also be described as an ‘event’ and an output as an ‘action’. Activity: ● Think, pair, share: “Can you identify features of an effective safe?” Students can discuss features that provide protection for the contents of safes. Discuss how If-Then statements can help in the design of an effective safe. Ⓒ 2019 SAM Labs
2
Year 3 Lesson 9
Smart Safe
In the Student Handout, students can use the template of a 3D cube to cut out, stick onto card, then fold to construct their ‘safe’. Students could choose some small items such as buttons to represent the contents. Opportunity to discuss different materials which could be added in order to increase the effectiveness of the safe. Students can complete the keyword activity in the Student Handout.
Keywords: Algorithm
A process, or set of instructions, to be followed in order to solve a problem.
Safe
A strong cabinet with a complex lock, typically used for the storage of valuable items.
Input
A value that is taken into a system to be processed. An input can also be described as an event.
Output
Data or information that is generated. An output can also be described as an action.
If-Then
Part of an algorithm that determines what happens next. It can be described as a conditional statement.
Let’s Discuss: “Which SAM Block could be used as an input in the system in order to make the safe ‘smart’?” Students can discuss with a partner how they could build a system that would alert the user when their ‘safe’ had been opened.
Link Forward: Students build a system which activates an alert when their ‘safe’ has been opened.
Ⓒ 2019 SAM Labs
3
Year 3 Lesson 9
Smart Safe
Worked Example – Let’s Build!
Create an alarm system for your ‘safe’.
Instructions Step 1 Turn on and pair: ● 1 Light Sensor block ● 1 RGB LED block and drag onto the workspace. Also drag on: ● 2 Compare blocks ● 2 Colour blocks.
Step 2 Connect the blocks as shown.
Step 3 In the settings of the Compare blocks, set as follows: ● 1st: ‘≥ 30’ ● 2nd: ‘≤ 29’.
Step 4 In the settings of the Colour blocks, set as follows: ● 1st: red ● 2nd: yellow.
Workspace
Notes
Explain that the RGB LED will be the first alert to indicate that the ‘safe’ has been opened. Explain that the Light Sensor block is the ‘event’ (input) and the RGB LED block is the ‘action’ (output). The Compare and Colour blocks are the ‘If-Then’ part which determine the action (output). Ensure the students understand the meaning of the symbols ‘≥’ and ‘≤’. Explain that the Colour blocks define the colour of the RGB LED output. The Light Sensor values will now determine whether the RGB LED illuminates yellow or red. A value of ‘0–29’ will turn it yellow, a value of ‘30–100’ will turn it red. Explain that Yellow means the alarm is ‘on standby’ and red means the alarm has been triggered i.e. the ‘safe’ has been opened.
Ⓒ 2019 SAM Labs
4
Year 3 Lesson 9
Smart Safe
Step 5 Put the Light Sensor inside your ‘safe’ and the RGB LED outside of it. Test your system.
Note, students can use the ‘safe’ they created in from the template in the Student Handout. Explain that if the Light Sensor is inside the box and the RGB LED is outside the box, the following should be true: ● If the box is closed, then the RGB LED is yellow. ● If you open the box, then the RGB LED is red. Note, students may need to adjust the value range in the Compare settings depending on the light levels in the room to ensure that the above conditional statements are true. Opportunity for students to measure the light levels in different areas of the room.
Challenge 1
Create a ‘smart safe’ that has a sound alert to confirm that the alarm is on standby.
Instructions Step 1 Drag onto the workspace: ● 1 Sound Player block ● 1 additional Compare block. Connect the blocks as shown.
Workspace
Notes
Explain that the Sound Player will enable a sound to be played to confirm that the alarm of the ‘safe’ is on standby.
Ⓒ 2019 SAM Labs
5
Year 3 Lesson 9
Smart Safe
Step 2 In the settings of the new Compare block, set to ‘> 3’.
Explain that this setting means that when the ‘event’ (input) occurs (the Light Sensor reads a value greater than ‘3’) the Sound Player will emit a sound. Note that ‘> 3’ has been chosen here so that the sound plays in low lighting to confirm the alarm is on standby. Opportunity to discuss other values that could be used. Explain that as soon as the ‘event’ (input) occurs – the Light Sensor reads a value of light – the system will now have two ‘actions’ (outputs): an alarm sound and a light; yellow when the values of light are ‘0–29’, and red when the values are ‘30–100’.
Step 3 In the settings of the Sound Player, set to ‘Set Alarm’.
Ensure students can describe each part of the system, and know that they have added a single sound to indicate when the alarm for the ‘safe’ is on standby (turned on).
Step 4 Test your system.
Checks for Understanding: “What is the event (input) in this system? What does the symbol ≥ mean?”
Challenge 1 – Debug It!
How can I make the alert more effective when the ‘safe’ is opened?
Instructions Step 1 Drag onto the workspace: ● 1 virtual Buzzer. Connect the blocks as shown.
Workspace
Notes Connecting the Buzzer to the ‘≥ 30’ Compare block means that when the ‘safe’ is opened (when the light reading is greater than or equal to 30), the buzzer will sound as well as the RGB LED illuminating red.
Ⓒ 2019 SAM Labs
6
Year 3 Lesson 9
Smart Safe
Note, this is to avoid excess noise levels in the classroom! Opportunity to link the Buzzer sound with musical notation. Note that ‘C’ is the default note.
Step 2 In the settings of the Buzzer, slide the volume down. Step 3 Drag onto the workspace: ● 1 Interval block. Connect the blocks as shown. Step 4 In the settings of the Interval block, set to ‘3 seconds’.
Discuss whether 3 seconds is an appropriate interval for an audio alert.
Step 5 Test your system.
Ⓒ 2019 SAM Labs
7
Year 3 Lesson 9
Smart Safe
Challenge 2
Create an image-capture feature in the system to photograph the intruder opening the ‘safe’.
Instructions
Workspace
Notes
Step 1 Drag onto the workspace: ● 1 Camera block ● 1 additional Interval block. Connect the blocks as shown.
Note, if it’s the first time the Camera block has been used on the device, access will need to be given for the Camera to take and store the images. Discuss the three ‘actions’ (outputs) that will occur if the light level (the ‘event’ or input) is greater than or equal to 30.
Step 2 In the settings of the Interval connected to the Camera, set to ‘500 milliseconds’.
Explain that this Interval setting will cause the camera to take an image every 500 milliseconds. Note that images will be stored on the device. Encourage students to position the device they’re using (e.g. iPad) next to their ‘safe’, with the camera pointing towards it. When students open the ‘safe’, the following actions (outputs) should be triggered:
Step 3 Test your system.
● ●
Step 4 View the images in the gallery on your device.
●
the RGB LED illuminates red Images are taken every 500 milliseconds the Buzzer sounds at set intervals
The images should be found within the Pictures folder on a computer and the Photos app on an iPad. Opportunity to discuss the positioning of the camera in terms of the image results. Discuss the addition of a camera to the ‘safe’ – there may be differing opinions. Ⓒ 2019 SAM Labs
8
Year 3 Lesson 9
Smart Safe
Step 5 Discuss your system.
Ask the students to define the ‘event’, ‘action’ and the ‘If-Then’ parts in the system. ● Event (input) = Light Sensor. ● Actions (outputs) = RGB , LED, Sound Player, Buzzer, Camera. ● If the value of the Light Sensor is greater than or equal to 30, then the RGB LED illuminates red, the camera takes pictures and an alarm sounds (indicating ‘safe’ being opened). ● If the Light Sensor is less than or equal to 29, then the RGB LED illuminates yellow (indicating standby). ● If the Light Sensor = 3, then the Sound Player will play a sound. They can record their system on their Student Handout.
Checks for Understanding: “What is the impact of the Interval block on the Camera block? What is one reason why a safe needs to be carefully designed?” Ⓒ 2019 SAM Labs
9
Year 3 Lesson 9
Smart Safe
Chilli Challenges
Experiment with creating a light that flashes on and off. Can you create a system where the light flashes quicker than the sound plays?
Experiment with adding a reset feature after the alarm has been triggered. Can you use the Key Press and Text blocks into the system? Hint: Enter ‘reset’ in the Text block.
Experiment with adding a timer so the alarm is only active during a set time period. Can you add a Time Trigger block into the system?
Exit Ticket
Reinforce the learning objectives of the lesson. ● ● ●
In the Student Handout, students can: record and reflect on their results from the Challenge annotate their system apply what they have learned to the real world.
Ⓒ 2019 SAM Labs
10