1. Purpose This laboratory test is summative.
2. Operational details You should work individually for this test within your laboratory sessions.
You should write an Arduino program that works with the DMU Dev Board that takes inputs from the keypad (KP1), the analouge potentiometer (RPot), rotary encoder (AB DIGITAL ENCORDER), switches (S1) and (S2) and the gyroscope MPU6050 (U1) on the board and displays output on the LED display (SLED1), Liquid Crystal Display (LCD1), Buzzer (SG1) and the LEDs (D1, D2, D3, D5, . . . , D12).
Keypad You will use the keypad for waiking up the system from Quiet state, authenticating a user via a password and giving commands to the system once the user has been authenticated.
Notation: An upper case K stands for a single keypress or a press-and-hold keypress, a lower case k stands for a single keypress only and kh stands for a press-and-hold keypress only. A lower case n stands for a numerical keypress. Partial press is defined as a keypress with duration of less than 0.3s. Press-and-hold has a duration of at least 1.5s. A stuck key is defined as a keypress with duration of 5s.
The format of a valid input from the keypad must be {K..K}∗hnnn..n#nnn..n#, the input begins with 0 or many keystrokes, followed by a ∗h, followed by one or many keystrokes and ending with #. Once unlocked, commands in the form of nn..n# may be repeated. The ∗h is interpreted as unlock and the following numeric key is interpreted as a command number. For example, the sequence of keystrokes ###823***2138∗h1234#5# is a valid input interpreted as unlock, password 1234 followed by command number 5, i.e. the numeric keystrokes between the last pair of a leading ∗h and an ending # is interpreted as pass keys or command numbers depending on the context.
Any partially pressed or stuck key is considered a "no keypress" or empty key press and any other key combination is ignored. A keypress sequence {K..K}∗hn# that takes longer than 1 min is invalid. The numeric inputs must also be a values between 0 and 9.
Semantics: Your program must support the following features for each POT.
1. uppon an invalid key-press sequence the system must lock itself.
2. At any time, a press on the S1 push button must result in initiating repeating a sequence of RED, AMBER, GREEN on the D1, D2, D3 LEDs. A subsequent push on S1 must turn off the D1, D2, D3 LEDs.
3. S2 switch is considered a "tamper" switch, i.e. the operation of the system is only enabled if the S2 switch is in a stuck state and a special "enable password" is entered via the keypad using the keypad protocol given above.
4. password - After the enable procedure, the system enters a locked state. It will wait for a ∗h and a correct "operational password" before accepting commands.
5. commands - After authenticating the user with an "operational password" the system enters a command expectation state
6. 0# - the command 0 will make sure the motor is off, all D5 to D12 LEDs are turned off and then lock the system. If the motor is running, the system will bring the motor to 30rps and extinguish the LEDs from right to left at the rate of 2 per second.
7. 1# - run a motor sequence 1, i.e. the motor is run at 12rps and the D5 to D12 LEDs are consecutively lit at 1 LED per second from left to right. Once all LEDs are lit the motor stops.
8. 2# - run a motor sequence 2, i.e. the motor is run at 12rps and the D5 to D12 LEDs are consecutively extinguished at 1 LED per second from right to left. Once all LEDs are turned off the motor stops.
9. 3# - change the change the authentication password.
10. 4# - use the digital encoder to select and set a velocity for motor sequence
1. You will select a velocity via turning the encoder and set the value with a push on the encoder's button.
11. 5# - use the digital encoder to select and set a velocity for motor sequence
2. You will select a velocity via turning the encoder and set the value with a push on the encoder's button.
12. 6# - use the analogue POT to select the lower threshold for the temperature control. Use # to set the selected value.
13. 7# - use the analogue POT to select the upper threshold for the temperature control. Use # to set the selected value.
14. 8# - this will turn on the buzzer and it will give you an audible feedback on the velocity of the motor.
15. 9# - this will turn off the buzzer.
16. 7 segment display - the seven segment display will be used for a user feedback on the keypad. If the keypad is locked, the 7Seg will show only a dot segment. At that state, the 7seg will be only giving feedback on ∗ presses. Once the keypad has been unlocked via ∗h, then the 7seg enters a "password" state where feedback will be given on # key-press. For other keys only the G segment is giving feedback on key-presses. After the user has been authenticated, the 7seg will have a full feedback on the key-presses including normal, held and stuck key-press.
17. Your system must read the accelerometer values and detect if the board is disturbed. The system will only operate if it is stable. The system must shut down if it is shaken.
18. Your system must also read the temperature values from the accelerometer. If the temperature is higher that 22C (upper limit) the fan must cool it down. The system must display a message on the LCD if the temperature is under 18C (lower limit).
Attachment:- Embedded Systems.rar