Difference between revisions of "Anti-Theft Alarm"
(Created page with "{| style="width: 1000px;" |- | ==Outline== 600px|center Make a simple anti-theft alarm system, controlling the system to start with a touch butto...") |
|||
Line 38: | Line 38: | ||
==Module Setup== | ==Module Setup== | ||
− | ====== | + | ====Setup== |
[[File:anywhere_steal-step.jpg|600px|center]] | [[File:anywhere_steal-step.jpg|600px|center]] | ||
*Assemble the modules and sensors: | *Assemble the modules and sensors: | ||
Line 49: | Line 49: | ||
==Programming== | ==Programming== | ||
===Required Program Blocks=== | ===Required Program Blocks=== | ||
− | *[[ | + | *[["ColorLED prepare" program block]] |
− | *[[ | + | *[["ColorLED control" program block]] |
− | *[[ | + | *[["Waiting" program block]] |
− | *[[ | + | *[["Touch button" program block ]] |
− | *[[ | + | *[["Delay" program block]] |
− | *[[ | + | *[["If-do" program block]] |
− | *[[ | + | *[["If-else" program block]] |
− | *[[ | + | *[["Declare as", "item" program block]] |
===Programming Thought=== | ===Programming Thought=== | ||
− | *Declare a variable | + | *Declare a variable "on" to store the state of the switch. You can set open and close two states of the switch with touch button 2. |
**on=0 represents open; | **on=0 represents open; | ||
− | **on=1 represents | + | **on=1 represents closed at night. If there is someone rushing into the museum, the value of on will change into 2; |
**on=2 represents there is someone rushing into the museum, and it is on alarm state, the LED will flash red to alarm. | **on=2 represents there is someone rushing into the museum, and it is on alarm state, the LED will flash red to alarm. | ||
[[File:mixly-ctrl-steal.jpg|600px|center]] | [[File:mixly-ctrl-steal.jpg|600px|center]] | ||
Line 81: | Line 81: | ||
'''4. If on=1, closed at night, the color LED will change into red.''' | '''4. If on=1, closed at night, the color LED will change into red.''' | ||
<br> | <br> | ||
− | If on is 1(closed at night), judge whether the PIR sensor of pin 10 has detected the movement of people, | + | If on is 1(closed at night), judge whether the PIR sensor of pin 10 has detected the movement of people, if it has, set on to 2 (change from closed state to alarm state), otherwise the color LED will light red (it is safe currently, and keep alarm). |
[[File:mixly-ctrl-steal-code3.jpg|600px|center]] | [[File:mixly-ctrl-steal-code3.jpg|600px|center]] | ||
'''5. If on=2, someone has rushed into the house, flash and alarm and then close.''' | '''5. If on=2, someone has rushed into the house, flash and alarm and then close.''' | ||
Line 96: | Line 96: | ||
<br> | <br> | ||
<br> | <br> | ||
− | Q: When it alarms, only the color LED flashes red, which is not obvious enough, an alarm bell is supposed to be added, which will better! | + | Q: When it alarms, only the color LED flashes red, which is not obvious enough, an alarm bell is supposed to be added, which will be better! |
A: You just need to add a buzzer. | A: You just need to add a buzzer. | ||
<br> | <br> | ||
Line 103: | Line 103: | ||
**on=0, the color LED lights green, and it is on open state. | **on=0, the color LED lights green, and it is on open state. | ||
**on=1, if the PIR sensor has detected the movement of people, on=2, and it will enter the alarm state. | **on=1, if the PIR sensor has detected the movement of people, on=2, and it will enter the alarm state. | ||
− | **on=2, the color LED | + | **on=2, the color LED flashes red, and the buzzer alarms. |
[[File:mixly-ctrl-steal-code5.jpg|600px|center]] | [[File:mixly-ctrl-steal-code5.jpg|600px|center]] | ||
Revision as of 06:19, 19 October 2016
ContentsOutlineMake a simple anti-theft alarm system, controlling the system to start with a touch button.
Module BillModule
Other Equipment
Module Setup==Setup
ProgrammingRequired Program Blocks
Programming Thought
Programming1. Color LED prepares, and declare variables.
2. Press the touch button 2 to change the state of the switch.
3. If on=0, open in the daytime, and the color LED will change into green.
4. If on=1, closed at night, the color LED will change into red.
5. If on=2, someone has rushed into the house, flash and alarm and then close.
Technical Specification
Related CasesFAQ |