4 Digital Lock

By Michael Fong

4.1 Project Functionality

This program provides the user a more secure system for the sprayer tractor. The Password system not only allows checking of the password, but also allows the user to modify his/her password freely. Moreover, a second confirmation has been added when the owner tries to change a new password. The program requires the user to key in the password through the keypad, and displays this on the LCD screen, which is shown as the diagram below:


pict

Figure 2: Smart Farming Layout


The keypad has four rows and four columns of keys, where the character # is defined to be the terminal character of password.

12 3A
45 6B
78 9C
0#D

4.2 Project Design

The code is build on a body function called ’pwd˙Main()’, where all other helper functions are called. First of all, the program checks to see if this is the first-time login for the owner. If it is the first time, the program allows the user to create his/her own password in order to get rid of the default password ’NULL’. Due to the internal keypad problem, the Power Box might not grab the correct key. Hence, a patch feature was added to the program. Each time a new password is modified, the user will be asked to confirm the password. After the user logs on, the program allows the user to change to a new password or keep the old one. In addition, the maximum length of the password is 256 characters.