PICNIC

Exercise 3 Integration of door security system function (Binding experiment)

■ Exercise 3

1. Goal of Exercise 3

2. About the functions integrated

3. Practical example

4. Submission of Exercise 3

5. Point of consideration

■Report submission system

 

→Click here if you have some questions and comments.

←Back to the table of contents

Updated April 29, 2005 21:51

 

●Goal of Exercise 3

As Exercise 3, submit the exercise of "Integration of door security system function (Binding experiment)". →Click here for the submission of exercise.

Each module created so far

・Exercise 0: Monitoring (RB4 LED#4) of the state of opening and closing of the door (RB0)
・Exercise 0: At-home mode / Absence mode (RB5)
・Exercise 1: Web display of the counter for the number of times the door is opened and closed (Counter)
・Exercise 2: Actuation of alarm after the timeout of "the state of the door being open" (timer, RB7)

Create test7 module including these specification and the undermentioned operation (e), which is

・Display and notification of "The door alarm was actuated during absence" (RB6 / Relay#1)


●Integrated functions

The test7 module of which functions were integrated as a door security system operates as described below.

<Operation>

(a) At-home / absence modes are configured in RB5 (absence="L", at-home="H").

(b) Operations in both at-home and absence modes

・State of opening and closing of the door (RB0) → Output to LED#4 (RB4) with positive logic (for monitoring of the door state)
・Perceiving the state transition from the closing to opening of door, then adding 1 to the counter.
・Displaying the counter to the web control screen.

(c) Operations in the at-home mode

・When a certain period of time goes by in "the state of the door being open", the alarm is actuated.
・Timeout time to actuate the alarm is set to about 10 seconds.
・When the door is closed, the alarm stops.

(d) Operations in the absence mode

・When a certain period of time goes by in "the state of the door being open", the alarm is actuated.
・Timeout time to actuate the alarm is set to about 1 second.
・When the door is closed, the alarm stops.

(e) Display and notification of "The door alarm was actuated during absence" (RB6 / Relay#1)←New function

・When once the alarm was actuated in the absence mode, RB6 is turned on.
・The alarm output of RB6, for example, can be connected as a movable signal of patrol light.
When switching from the absence mode to the at-home mode, the output of RB6 is turned off.


<Reference>
・It is recommended to add functions to Exercise 2: test6 module.
Make good use of the storage variable, tmp which is the current PORTB output value.
・The amount of coding of the test7 module created experimentally: Approx. 100 steps.

 

●Practical example

(0) Immediately after power-on (default: absence mode, RB5="L")※Keep the door closed.

(1) Change to the at-home mode. (RB5="H") → Open and close the door once. → The counter becomes 1.
→ Leave the door open. → (In 10 seconds) → The alarm is actuated. (RB7)
→ Close the door. → The alarm stops (restitutes). The counter becomes 2.

(2) Change to the absence mode. (RB5="L") → Quickly open and close the door once. → The counter becomes 3.
→ Leave the door open. → (In 1 second)→ The alarm is actuated and the alarm notification turns on (RB6).
→ Close the door. → The alarm stops (restitutes). The counter becomes 4. The alarm notification holds the ON state.

(3) Chane to the at-home mode. (RB5="H") → The alarm notification turns off (RB6).


●Submission of Exercise 3

【Exercise 3】(Binding experiment)
Create the test7 module of which functions are integrated as a door security system. Set the timeout time to about 10 seconds.Using the changes of the state of door sensor, the web control screen and the counter value, confirm working as required.

(1) Create the test7 module of which functions are integrated as a door security system.

(2) Using the state of door sensor, the web control screen and the changes of counter values, confirm to work as required.

(3) Change the version number of the assembled source file to
ver1.2.0.8
And change arbitrarily the footer of the web control screen to your student ID number and so on.

(4) Save the assembled source file under the name of v1208e3.asm. (English one byte characters/ Lower-case alphabets/ Do not use one-byte katakana and double-byte characters as file name.)

(5) From the following report submission system, upload v1206e1.asm. We will mark your report after receiving it.

<How to submit>
For the program you created, submit the assembled source file (the extension is not *.hex but *.asm) by using the following report system (with the file upload function).

We will judge resubmission or completion after checking the operation of the file you submitted. You have to resubmit if there are any defects in the operation. You can finish if the operation is OK.

Click here to submit the report of Exercise 3 (Exercise number: picnic-exp03).

(6) You have to "wait our judgement". Send an e-mail to here if you do not receive the result of judgement for a long time.

(7) If you received the judgement of resubmission, correct the defects indicated, change the filename to the name of v1208e3a.asm and so on and submit it.

(8) Without (7) (that is, the judgement of completion), your report Exercise 3 was accepted and you can finish.

 

●Point of consideration

Point of consideration on this time's specification and implementation is as follows. You do not have to answer it as a report, but make sure to arrange your thoughts before you finish the program and submit your report.

 

[1] This time, "at-home mode" and "absence mode" are switched with the RB5 output from the web control screen. In actual operation, connect the mode switch to the RB1 input allocated to the CN4 port of peripheral expansion kit and use the state of this switch for switching mode, so that the convenience will improve. In this case, an unexpected action will occur unless the priority between RB5 controlled from the web screen and the RB1 input which is a physical switch is considered. Think about this problem.

[2] Long use of in-use elements and ports of peripheral expansion kit, door sensor, wiring between sensors and so on will cause breakdown, malfunction (stuck-at fault to either H or L) and wire breakage across the ages. This is an unavoidable fact. For the portability and reliability improvement as a door security system, designing (redundancy) to keep the failure of partial elements and sensor in the background is required. Make mention about the designing of sensor input system and alarm output system considering that.
(Hint: In the peripheral expansion kit, the RB0 and RB1 inputs and the RB6 and RB7 outputs are composed of exactly the same circuits. Reduction of feasible functions by redundancy is unavoidable. The failure of microcomputer board shall be separately thought.)

 

 

Shinshu University Graduate School on the Internet

wasaki@cs.shinshu-u.ac.jp
Copyright(c) 2005 Katsumi Wasaki. All rights reserved.