X
Home > Blog > STEM for Arduino > HOW to Make an Invasion Alarm with Kidsuno

HOW to Make an Invasion Alarm with Kidsuno

By r November 29th, 2024 80 views
Invasion alarm is a device that alarms when detecting illegal invasion in a prevention area. It plays a pivotal role in security prevention, so it is widely applied to family, stores, warehouses and supermarkets. Thus, our life can be better protected from illegal invasion. Meanwhile, our personal and property safety can also be guaranteed.
In this experiment, we adopt PIR motion sensor, power amplifier and a white LED to form an invasion alarm. When someone is detected, the white LED flashes and the amplifier alarms.

Flow

4201

Assembly

line1

Required Parts

42_00

line1

Step 1

42_01

line1

Step 2

42_02

line1

Step 3

42_03

line1

Step 4

42_04

line1

Step 5

42_05

line1

Step 6

42_06

line1

Step 7

42_07

line1

Completed

42_08

line1

Wiring Diagram

4202

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.2Invasion alarm.sb3 file.

4203

Click Unconnectedto connect to port and then 2210.

Explanations

5top

Conceive:

When the sensor detects a human motion (an invasion), the LED flashes and the amplifier alarms. If it detects nothing, LED will go off and the amplifier will not emit sound.

line2

Build blocks:

  1. Initialization: Set the pins of the PIR motion sensor, white LED module and the power amplifier.

    4204

  2. Loop:

    Read the power level of the board input from the PIR motion sensor.

    Determine whether the power level is 1(indicates an invasion).

    • If yes, the LED flashes and the amplifier alarms.

    • If not, LED will go off and the amplifier will not emit sound.

    4205

5bottom

Test Result

4top

After uploading code, when the sensor detects a human motion (an invasion), the LED flashes and the amplifier alarms.

4206

4bottom

FAQ
10top
Q: After uploading code, the LED and amplifier are no response when you put your palm in front of the sensor?
A: The PIR motion sensor detects only movement rather than objects.
Q: After uploading code, the LED lights up but the amplifier does not emit sound?
A: Rotate clockwise the potentiometer on the amplifier to turn up the sound volume.
3418
10bottom
HOW to Make a Card-scanning Door-lock Control Device with Kidsuno
Previous
HOW to Make a Card-scanning Door-lock Control Device with Kidsuno
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