Lesson 4 - Safe Access Verification Gate
Challenge 4-1, 4-2, 4-3
Suggested time: 60 minutes. For younger students or first-time users, this lesson may be extended to 70-80 minutes.
Students compare locker access methods, test an RFID starter locker, then improve it so access depends on both card identity and locker state.
I can compare access methods and identify privacy risks.
I can explain RFID UID, saved ID, locker state, and AND conditions.
I can complete and test a safer smart locker program.
Engage
2 min.
A shared smart locker can make storing items easier, but it should not open for the wrong person or keep using old access information.

what information does the locker check? How can we make sure a smart locker is used and accessed safely?
Background
3 min.
Smart lockers use access information to decide who can open a door. Secure access means only the correct user can open it.
To check the user, the locker can use Face ID, a manual code, or an identification card.

RFID is a common identification technology. It uses an RFID reader and RFID cards. Each card has a unique code called a UID.

Transition: Different access methods use different information. Now let's prepare the locker system students will test.
Required items:
| Item | Use in this lesson |
|---|---|
| UNIHIKER K10 | Runs the locker program and shows prompts on screen. |
RFID reader module
| Reads whether an RFID card is detected and reads the card UID. |
RFID card
| Acts as the locker key for registration and access testing. |
| Module cable (4pin) | Connect RFID reader module to K10. |
360 degree servo on P0
| Opens and closes the locker door in the model. |
| Locker model and computer with Mind+ | Students build the locker, upload the starter program, and edit the safer program. |
Build and Connect
Time: 8 minutes
![]() | Have students build the locker model and confirm the RFID reader and P0 servo are connected before opening Mind+. Ask students to upload the starter program and check that the device starts normally. |
![]() | Check before moving on: RFID reader is connected and available in the program. Servo is connected to P0 and returns to the closed position. Starter program is uploaded. |
Debugging Tips:
• Check the version number on the back of the RFID module and make sure the version selected in the program matches it.

• If the locker door does not close at the servo’s initial angle, remove the door and reinstall it in the correct position.

Then teacher can ask:
• Which part reads the access card?
• Which part opens and closes the locker?
• What should be ready before we test card registration?
Explore AI Technology
12 min.
Challenge 4-1: Compare Locker Access Methods
![]() | Teacher guidance Use Challenge 4-1 as a discussion, not a coding task. Guide students to compare RFID card, face scan, and manual code. Ask students what information it stores or uses, and what could go wrong if the information is copied or misused. Expected answer: RFID uses a card UID, face scan uses biometric information, and manual code uses a shared secret. |
![]() | Key ideas before testing Introduce RFID UID as the current card value and ID as the saved authorized card. And then Let students think about the privacy problems. Transition: Now students have the words they need. Let's use them to read and test the starter program. |
• Students should connect each access method to the information it uses, then explain why privacy and misuse risk matter.
Questions for discussion
• What information does the locker need in order to recognize a user?
• Where else could that information be used if someone copied or stored it?
• Why might RFID be safer to study first than face scan in this classroom activity?
Definition
• RFID stands for Radio Frequency Identification. It is a technology that uses radio waves to read information from an RFID card or tag.
• RFID UID - An RFID UID is the unique ID read from an RFID card. It can be used to identify the card. The UID identifies the card, not the person, unless it is linked to a user’s information in a system.
• Biometric Information
Biometric information is data from a person’s body or behavior, such as a face, fingerprint, or voice. Face ID uses biometric information to recognize a user.
• Important Privacy Message
Biometric information is personal and sensitive. It should only be collected with permission, stored safely, and used for a clear purpose. It should not be shared without permission.
Explore Function
10 min.
Challenge 4-2: Read and Test the Starter Locker
Have students read the starter program before touching the hardware. They should find Button A, RFID UID, saved ID, and servo P0.
![]() | Teacher guidance Have students first match program parts to their functions: Button A, RFID UID, saved ID, and servo P0. Ask students to predict what Button A saves before they press it. Expected answer: Button A saves the current RFID UID as the ID used for access. |
![]() | Test guidance Have students test registration, saved card, wrong card, and no card exactly as listed in the student card. They should first write what the locker does. Expected answer: The starter locker can complete basic RFID opening. |
Before testing, students should be able to point to each starter block they will use.
• Button A saves the detected card UID as ID.
• RFID UID is the value read from the current card.
• ID is the saved card value used by the starter program.
• Servo P0 opens and closes the locker.
Starter limitation: it can open the locker, but it does not know whether the locker is occupied.
Expected result: students find that starter behavior is useful but incomplete.
Program Challenge
20 min.
Challenge 4-3: Improve the Locker With State Protection
| Teacher guidance Start from the test evidence. Ask students what can go wrong if the saved card keeps opening the locker or a second card can be saved at the wrong time. Guide students to state the safety goal: the locker should know whether it is occupied before saving or opening. Expected answer: The starter program needs clearer rules for when to save a card, when to Store Item, and when to Take Item. |
| State and condition table Have students complete the condition table before writing variable values. Then explain that the program can represent not occupied with my variable = 0 and occupied with my variable = 1. Ask students to say each rule aloud using both checks: card check and locker state check. |
![]() | Flowchart analysis Students fill the flowchart blanks before looking closely at the target code. Expected answer: Save needs Card detected and my variable = 0; Store needs RFID UID = ID and my variable = 0; Take needs RFID UID = ID and my variable = 1. |
![]() | Students try to add the missing blocks in Mind+ by following the tips. |
Summary - Key AI Ideas Review
5 min.
Summarize the lesson with the class.
• Smart access systems should consider what information they store and how that information could be used.
• A safer locker checks both identity and current locker state before saving a card or opening.
• ID, my variable, and AND logic help the program choose Store Item, Take Item, or keep checking.
AI Program Block Review
| Blocks | Description |
|---|---|
| Initializes the RFID module. |
| Checks whether a card is currently near the reader. |
| Reads the UID from the card that is currently detected. |
| Sets a number variable to a value. |
| Gets the value of a number variable. |
| Sets a string variable to "hello". |
| Gets the value of a string variable. |
| Logical AND, meaning both conditions must be true. |
| Rotates the servo to a specified angle. |
Next Class: Lesson 5
Current Tutorial: Click Here























