An FPGA Application of Home Security Code Using Verilog
An FPGA Application of Home Security Code Using Verilog
Zaim Zakwan Aminuddin1, Irni Hamiza Hamzah2, Ahmad Asri Abd Samat2, Mohaiyedin Idris2,
Alhan Farhanah Abd Rahim2, Zainal Hisham Che Soh2
1
Kedah Industrial Skills and Management Development Centre, Sungai Petani, Malaysia
2
Centre for Electrical Engineering Studies, Faculty of Electrical Engineering, Universiti Teknologi MARA, Pulau Pinang, Malaysia
Corresponding Author:
Irni Hamiza Hamzah
Centre for Electrical Engineering Studies, Universiti Teknologi MARA
Cawangan Pulau Pinang, Permatang Pauh Campus, 13500, Pulau Pinang, Malaysia
Email: [email protected]
1. INTRODUCTION
The security system in the past was mechanical, consisting of a plain wall or a wall with a watchdog
[1]. In our day-to-day lives, security is a major concern, and access control systems were an important link in
the security chain [2]. People access their households and workplaces frequently every day and there are
many problems associated with security and accessibility [3]. Even though urbanization and the frequency of
criminal activities had increased in recent decades, the old-fashioned key-and-lock method is still commonly
utilized in today's guard system, posing security and efficiency issues [4], [5]. The effectiveness of the old-
fashioned key and lock method may be jeopardized because the keys are vulnerable to being misplaced or
duplicated [6]. Nowadays, with the urbanization and miscellaneous criminal types, the efficiency of the key-
and-lock has been challenged [7]. The digital lock system plays a vital role in providing security and
reducing personnel in the home and building automation situation [8]. It is necessary to reprogram by an
electronic door lock rather than replace the whole physical key lock in which obviously is cost saving [9]-
[11] and reduce time [12], [13].
Microcontrollers and microprocessors were used in the new generation security system, which
provide 100 percent theft and burglary resistance [2]. Several development platforms have been designed to
meet the hardware and software needs of such applications, especially since they require large-scale data
processing. For that purpose, reconfigurable architectures such as FPGAs is increasingly used due to their
high flexibility [14]. Field programmable gate arrays (FPGA) is another alternative for embedded systems in
which trial and error is possible, does not have a fixed instruction set and process instruction in parallel
processing. The biggest advantage of using the FPGA device as a new component in the industrial
environment is that the different hardware features of FPGA (flexible and reusable integrated circuit,
computing parallel tasks, cost efficiency and multiple input/output capability) that can be designed by a
developer for different application platforms after production [15]. FPGA can provide a wide opportunity for
modern applications. On the contrary, application specific integrated circuits (ASIC) is unable to be
reprogrammed, limited capabilities and much rely on the sequential process. This is because it is designed for
one sole purpose and they function the same their whole operating life [16]. An Arduino UNO using
ATMEGA328P chip as microcontroller, the input and output of the electronic digital lock system using 4x4
matrix keypad, LCD 16x2 and a buzzer connected with the Arduino UNO [1]. Another aspect point to ponder
is FPGA was found to be more efficient in terms of execution time and less space than the other platforms
mentioned above [17]. FPGA-based systems are more suitable to control technique which requiring parallel
performing [18], [19]. Currently, FPGA have received huge attention of researchers due to their relatively
high performance, low power consumption, reconfigurability and fast development round [20]. The keyless
lock system was a security feature that only allowed the house owner to unlock the door by sliding the secret
code on the Altera DE2-115 trainer board's slide switches [6]. It's not very user-friendly to use a switch as a
passcode input. Home security code lock system presented by Saleh [21], was almost identical to the FPGA
application on a smart home security system in which using FPGA for the system with add-on Arduino UNO
for the temperature sensor LM35 and servo motor as the entrance access [22].
Finite state machine (FSM) is a sequential circuit that controls number of inputs by following a pre-
defined number of states, each of which is a stable entity that can occupy several states [1]. the research in
[23]-[25], utilized the FSM approach, which uses a Xilinx board and ModelSim to allow the lock to only
open when the desired passcode was entered or the specified sequence is detected by the system using a
keypad [23]-[25].
In this project, an Altera DE2-115 trainer board will be used as the brain of the home security code
lock system. The objectives of this project are to design digital hardware circuit of home security code lock
using verilog hardware descriptive language (HDL). Then, the process of verifying the functionality on the
digital hardware circuit of home security code lock was being done using ModelSim. Later, the performance
is verified by downloading the design onto the Altera DE2-115 trainer board. In this project, a button and a
keypad will interact as the way to unlock the entrance which user can changing this unlocking method using
a single switch.
2. RESEARCH METHOD
Figure 1 shows the design flow of methodology for this home security code lock using verilog HDL.
During design, verification and simulation process, the first step was designing the digital circuits of home
security code lock system using verilog HDL. Next step, verify the design whether it was following the
desired output or not via ModelSim. Then, using Quartus II Pin planner to assign device I/O pins [26]. After
that, upload into the board and project testing to check whether the result was as expected or not.
The flowchart method for home security code lock system is shown in Figure 2. The system
includes two unlocking methods to open the home entrance, as previously mentioned. If the user does not
turn on the switch, only the push button will work, which means the keypad will not work even if the keypad
was pressed. If switch was off, the green LED will only light up when the pushbutton was pressed.
Meanwhile if the switch was on, 7-segment will display “L” and Red LED will light up toindicate the door
still is still lock. Only when the correct passcodewhich were “2, 6 and C”, then only the 7-segment will
display “U” and Green LED will light up to indicate the door is unlocked.
A 4x4 matrix membrane keypad is used in this work as shown in Figure 3. Figure 4 illustrates the
circuit schematic connection rows and columns of the keypad. As for the function operation of the keypad,
the button will detect when both of a row and column detected at falling edge. Table 1 provides the values for
the rows and columns for the button that was detected as being pressed. For example, button number 4 when
C1 of the column is zero and R2 of the row is zero.
Figure 5 illustrates the top module design of home security code lock implemented in the DE2-115
using verilog HDL. Inside of the top module, there were 3 sub-modules, decoder, FSM and display
controller. The role of sub-module decoder was to decode the input from the keypad. Next sub-module was
FSM which only effect when keypad was using to unlock the home entrance. Last sub-module was display
controller that display the 7-segment to indicate user the digit that were entering, which also only effect when
using keypad to unlock the home entrance.
Int J Reconfigurable & Embedded Syst, Vol. 11, No. 3, November 2022: 205-214
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 207
Figure 3. 4x4 Matrix membrane keypad Figure 4. Schematic layout of 4x4 keypad
Int J Reconfigurable & Embedded Syst, Vol. 11, No. 3, November 2022: 205-214
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 209
(a)
(b)
Figure 7. Simulation and verification when switch off and pushbutton was pressed with (a) ModelSim
simulation and (b) Altera DE2-115 verification
An FPGA application of home security code using verilog (Zaim Zakwan Aminuddin)
210 ISSN: 2089-4864
(a) (b)
Figure 8. Simulation and verification when switch off and pushbutton was unpressed with (a) ModelSim
simulation and (b) Altera DE2-115 verification
(a) (b)
Figure 9. Simulation and verification when switch off and pushbutton was pressed with (a) ModelSim
simulation and (b) Altera DE2-115 verification
Int J Reconfigurable & Embedded Syst, Vol. 11, No. 3, November 2022: 205-214
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 211
“Locked 6” on the Altera DE2-115 trainer board when keypad of “6” was pressed. Finally, Figure 13 shows
the outcome of “UC” stands for “Unlocked C” on the Altera DE2-115 trainer board when keypad of “C” was
pressed. The “U” will notify that all the previously entered combination was correct and the system will be in
“unlocked” or reset state. Table 2 and Table 3 are the summary on the results that had been obtained from
Figure 7 until Figure 12.
Figure 10. ModelSim simulation when keypad “2”, “6” and “c” correctly entered. “L” indicates “Lock” and
“U” indicates “Unlock”
4. CONCLUSION
In conclusion, the FSM method has been chosen for this project to design digital hardware circuit of
home security code lock using verilog HDL in Quartus II. The design is then simulated to verify the
functionality on the digital hardware circuit of home security code lock in ModelSim. By ModelSim, the
timing diagram were being observed and analysed to ensure the layout of the design is as desired. Then,
download the design onto the Altera DE2-115 trainer board. The observation on the results achieved via the
ModelSim simulation and verification via Altera DE2-115 trainer board satisfied the theoretical part in FSM.
REFERENCES
[1] D. Jovcic, “Series LC DC circuit breaker,” High Volt., vol. 4, no. 2, pp. 130–137, Jun. 2019, doi: 10.1049/hve.2019.0003.
[2] P. Pareek and H. D. Nguyen, “Probabilistic robust small-signal stability framework using gaussian process learning,” Electric
Power Systems Research, vol. 188, p. 106545, Nov. 2020, doi: 10.1016/j.epsr.2020.106545.
[3] S. Leonelli and N. Tempini, Data Journeys in the Sciences, Springer, 2020, doi: 10.1007/978-3-030-37177-7.
[4] G. Nguyen et al., “Machine learning and deep learning frameworks and libraries for large-scale data mining: a survey,” Artificial
Intelligence Review., vol. 52, no. 1, pp. 77–124, 2019, doi: 10.1007/s10462-018-09679-z.
[5] R. Vinayakumar, M. Alazab, K. P. Soman, P. Poornachandran, A. Al-Nemrat, and S. Venkatraman, “Deep learning approach for
intelligent intrusion detection system,” IEEE Access, vol. 7, pp. 41525–41550, 2019, doi: 10.1109/ACCESS.2019.2895334.
[6] K. Sivaraman, R. M. V. Krishnan, B. Sundarraj, and S. Sri Gowthem, “Network failure detection and diagnosis by analyzing
syslog and SNS data: Applying big data analysis to network operations,” International Journal of Innovative Technology and
Exploring Engineering (IJITEE), vol. 8, no. 9 Special Issue 3, pp. 883–887, 2019, doi: 10.35940/ijitee.I3187.0789S319.
[7] A. D. Dwivedi, G. Srivastava, S. Dhar, and R. Singh, “A decentralized privacy-preserving healthcare blockchain for IoT,”
Sensors, vol. 19, no. 2, pp. 1–17, 2019, doi: 10.3390/s19020326.
[8] F. Al-Turjman, H. Zahmatkesh, and L. Mostarda, “Quantifying uncertainty in internet of medical things and big-data services
using intelligence and deep learning,” IEEE Access, vol. 7, pp. 115749–115759, 2019, doi: 10.1109/ACCESS.2019.2931637.
[9] S. Kumar and M. Singh, “Big data analytics for healthcare industry: impact, applications, and tools,” Big Data Mining and
Analytics, vol. 2, no. 1, pp. 48–57, 2019, doi: 10.26599/BDMA.2018.9020031.
Int J Reconfigurable & Embedded Syst, Vol. 11, No. 3, November 2022: 205-214
Int J Reconfigurable & Embedded Syst ISSN: 2089-4864 213
[10] L. M. Ang, K. P. Seng, G. K. Ijemaru, and A. M. Zungeru, “Deployment of IoV for smart cities: applications, architecture, and
challenges,” IEEE Access, vol. 7, pp. 6473–6492, 2019, doi: 10.1109/ACCESS.2018.2887076.
[11] B. P. Lik Lau et al., “A survey of data fusion in smart city applications,” Information Fusion, vol. 52, pp. 357–374, 2019, doi:
10.1016/j.inffus.2019.05.004.
[12] Y. Wu et al., “Large scale incremental learning,” 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition
(CVPR), 2019, pp. 374–382, doi: 10.1109/CVPR.2019.00046.
[13] A. Mosavi, S. Shamshirband, E. Salwana, K. Chau, and J. H. M. Tah, “Prediction of multi-inputs bubble column reactor using a
novel hybrid model of computational fluid dynamics and machine learning,” Engineering Applications of Computational Fluid
Mechanics, vol. 13, no. 1, pp. 482–492, 2019, doi: 10.1080/19942060.2019.1613448.
[14] V. Palanisamy and R. Thirunavukarasu, “Implications of big data analytics in developing healthcare frameworks – A review,”
Journal of King Saud University - Computer and Information Sciences, vol. 31, no. 4, pp. 415–425, 2019, doi:
10.1016/j.jksuci.2017.12.007.
[15] J. Sadowski, “When data is capital: Datafication, accumulation, and extraction,” Big Data & Society, vol. 6, no. 1, pp. 1–12, 2019,
doi: 10.1177/2053951718820549.
[16] J. R. Saura, B. R. Herraez, and A. Reyes-Menendez, “Comparing a traditional approach for financial brand communication
analysis with a big data analytics technique,” IEEE Access, vol. 7, pp. 37100–37108, 2019, doi: 10.1109/ACCESS.2019.2905301.
[17] D. Nallaperuma et al., “Online incremental machine learning platform for big data-driven smart traffic management,” IEEE
Transactions on Intelligent Transportation Systems, vol. 20, no. 12, pp. 4679–4690, 2019, doi: 10.1109/TITS.2019.2924883.
[18] S. Schulz, M. Becker, M. R. Groseclose, S. Schadt, and C. Hopf, “Advanced MALDI mass spectrometry imaging in
pharmaceutical research and drug development,” Current Opinion in Biotechnology, vol. 55, pp. 51–59, 2019, doi:
10.1016/j.copbio.2018.08.003.
[19] C. Shang and F. You, “Data Analytics and machine learning for smart process manufacturing: recent advances and perspectives in
the big data era,” Engineering, vol. 5, no. 6, pp. 1010–1016, 2019, doi: 10.1016/j.eng.2019.01.019.
[20] Y. Yu, M. Li, L. Liu, Y. Li, and J. Wang, “Clinical big data and deep learning: Applications, challenges, and future outlooks,” Big
Data Mining and Analytics, vol. 2, no. 4, pp. 288–305, 2019, doi: 10.26599/BDMA.2019.9020007.
[21] S. Bin Saleh et al., “Smart home security access system using field programmable gate arrays,” Indonesian Journal of Electrical
Engineering and Computer Science (IJEECS), vol. 11, no. 1, pp. 152–160, 2018, doi: 10.11591/ijeecs.v11.i1.pp152-160.
[22] M. Huang, W. Liu, T. Wang, H. Song, X. Li, and A. Liu, “A queuing delay utilization scheme for on-path service aggregation in
services-oriented computing networks,” IEEE Access, vol. 7, pp. 23816–23833, 2019, doi: 10.1109/ACCESS.2019.2899402.
[23] G. Xu, Y. Shi, X. Sun, and W. Shen, “Internet of things in marine environment monitoring: A review,” Sensors, vol. 19, no. 7, pp.
1–21, 2019, doi: 10.3390/s19071711.
[24] M. Aqib, R. Mehmood, A. Alzahrani, I. Katib, A. Albeshri, and S. M. Altowaijri, “Smarter traffic prediction using big data, in-
memory computing, deep learning and GPUs,” Sensors, vol. 19, no. 9, pp. 2206–2239, 2019, doi: 10.3390/s19092206.
[25] N. Stylos and J. Zwiegelaar, “Big data as a game changer: how does it shape business intelligence within a tourism and hospitality
industry context?,” in Big Data and Innovation in Tourism, Travel, and Hospitality, 2019, pp. 163–181, doi: 10.1007/978-981-13-
6339-9_11.
[26] Q. Song, H. Ge, J. Caverlee, and X. Hu, “Tensor completion algorithms in big data analytics,” ACM Transactions on Knowledge
Discovery from Data, vol. 13, no. 1, pp. 1–48, Jan. 2019, doi: 10.1145/3278607.
BIOGRAPHIES OF AUTHORS
Zaim Zakwan Aminuddin was born in Teluk Intan, Perak on 12th July 1997. He
obtained his B.Eng(Hons) in Electrical and Electronic Engineering in 2021, Diploma in
Electronic Engineering in 2018 from Universiti Teknologi MARA, Penang Branch Campus,
Malaysia. He is currently undergo training Experiencing on Bosch Sensor and IoT Technology
at Kedah Industrial Skills and Management Development Centre. He can be contacted at
email: [email protected].
Irni Hamiza Hamzah was born in Machang, Kelantan on 6th December 1974.
She obtained her B. Eng (Hons) in Electrical and Electronic Engineering in 1998, MSc.
Electronics System and Design Engineering in 2005 and PhD in BioMEMs Sensors in 2013,
which all had been obtained from School of of Electrical and Electronic Engineering,
UniversitiSains Malaysia, Malaysia. She is currently a Senior Lecturer in Electronic
Engineering Department, Faculty of Electrical Engineering, UniversitiTeknologi MARA,
Penang Branch Campus, Malaysia. Her research interests include biosensors, BioMEMs,
neural networks and renewable energy. She is a registered Board of Engineers Malaysia
(BEM) Professional Engineer. She can be contacted at email: [email protected].
An FPGA application of home security code using verilog (Zaim Zakwan Aminuddin)
214 ISSN: 2089-4864
Ahmad Asri Abd Samat received a BSc. (Hons) Electrical and Electronic
Engineering from MARA University of Technology, Malaysia and M. Eng (Electrical Energy
and Power System from University of Malaya, Malaysia in 2004 and 2006, respectively. In
2019, he finished his PhD in the field of Electrical Machines and Drives from Universiti Sains
Malaysia, Malaysia. Now, he is a Senior Lecturer in Electrical Engineering at the Faculty of
Electrical Engineering, Universiti Teknologi MARA, Permatang Pauh Penang, Malaysia. He is
looking forward to explore new area of research and collaborations with other parties. He can
be contacted at email: [email protected].
Zainal Hisham Che Soh was born in Machang, Kelantan on 16th March 1974.
He obtained his B. Eng (Hons) in Electronic Engineering from University of Leeds, UK in
1997, MSc. in Computer Science in Real-Time Software Engineering from UTM in 2004 and
PhD in Electrical and Electronic from USM in 2013. His research interest in internet of things,
big data, distributed/parallel computing, artificial intelligence, microcontroller system and
wireless sensor network. He works in UiTMPulau Pinang under Faculty of Electrical
Engineering, UiTM, Pulau Pinang. He is a member of IEE, IET, BEM and MySEIG. He can
be contacted at email: [email protected].
Int J Reconfigurable & Embedded Syst, Vol. 11, No. 3, November 2022: 205-214