X
Home > Blog > STEM for Arduino > HOW to Make a Card-scanning Door-lock Control Device with Kidsuno

HOW to Make a Card-scanning Door-lock Control Device with Kidsuno

By r November 28th, 2024 86 views
It is an ideal for smart safe house that the Card-scanning Door-lock Control Device features both security and convenience.
In this experiment, we adopt RFID module and a servo to form a door-lock control device, and the RFID module works in real time. When the correct IC card is identified, the door opens; Otherwise, the door won’t open.

Flow

4101

Assembly

line1

Required Parts

41_00

line1

Step 1

41_01

line1

Step 2

41_02

line1

Step 3

41_03

line1

Step 4

41_04

line1

Step 5

41_05

line1

Step 6

41_06

line1

Step 7

41_07

line1

Step 8

41_08

line1

Step 9

41_09

Step 10

41_10

Calibration is required after the servo is mounted. Connect the servo to D13 on the board and connect the board to computer via USB cable.

44_15

Open KidsBlock, click File –> Load from your computer.

3111

Choose D:\Code\1.Code_kidsuno to open Servo_Calibration.sb3 file.

44_16

Click Unconnectedto connect to port and then 2210.

After calibration, disconnect the board to the computer and continue the assembly.

line1

Step 11

41_11

line1

Step 12

Note that the two gears mesh in order to drive smoothly.

41_12

line1

Step 13

41_13

line1

Step 14

41_14

line1

Completed

41_15

line1

Wiring Diagram

4102

Test Code

Open KidsBlock and connect the board to your computer. Click File –> Load from your computer.

3111

Choose D:\Code\1.Code_kidsuno to open 4.1Card-scanning access control machine.sb3 file.

Replace the ID card value in the code into yours.

4103

Click Unconnectedto connect to port and then 2210.

Explanations

5top

Conceive:

First, set the rotation angles for opening and closing the door. Herein, we set angle to 120° to open the door, and 0° to close the door.

Then, when the RFID module receives a correct IC card code, it drives the servo to open the door for 3s. Otherwise, servo stays still.

line2

Build blocks:

  1. Initialization:

    4104

  2. Loop:

    Determine whether the IC card code is correct. If yes, servo opens the door. If not, close the door.

    Replace the ID code with yours.

    4105

5bottom

Test Result

4top

After uploading code, scan the correct IC card, and the door will open for 3s and then close.

4106

4bottom

FAQ
10top
Q: No response after uploading code?
A: Please check whether the IC card value is yours.
Q: After the sensor detects the card, the servo rotates yet the door does not open?
A: Power off immediately! Reassemble the building blocks according to the tutorial, noting that the servo needs to be calibrated before installation. Re-power on after the assembly is completed.
10bottom
HOW to Detect Air Pressure with Kidspico
Previous
HOW to Detect Air Pressure with Kidspico
Read More
Comprehension! HOW to Monitor Smart Home Environment with ESP32
Next
Comprehension! HOW to Monitor Smart Home Environment with ESP32
Read More
Message Us