Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Just an Arduino code using PORTB declarations and array for the passwords A device is used to control the access to a room. Employees need
Just an Arduino code using PORTB declarations and array for the passwords
A device is used to control the access to a room. Employees need to swipe their ID cards in order to unlock the door. The 4-bit long password embedded in the ID card is read through pins 8 to 11 of PORTB of an Arduino board. The magnetic system that is used to lock or unlock the door is connected to an output pin of the microcontroller through a driver and relay. If the voltage of this pin is 5 V (high) then the door opens for 20 sec and an LED turns green (otherwise red). In this problem, it is assumed that 10 employees are allowed to access the room. It is also assumed that the passwords in the array of {0000, 0001, 1001, 0110, 1000, 1111} are restricted and reserved for some other purposes so that entering these passwords will not open the door and turn on the red LED. On the other hand, the passwords in the array of (0010, 0011, 0100, 0101, 0111, 1010, 1011, 1100, 1101, 1110} are eligible to unlock the door and turn the green LED on. You can use the following circuits to give passwords to the board. With the use of DIP switches With no DIP switches Vcc DIP Switch Arduino UNO 1K 1K Arduino UNO W AN To the VCC or GND depending on the input password NNN w w W M 10K w w 1) Write a baby-step algorithm 2) Translate the algorithm to a C code. Specifically, use arrays for this purpose. 3) Design the system and program the microcontroller 4) Test the system A device is used to control the access to a room. Employees need to swipe their ID cards in order to unlock the door. The 4-bit long password embedded in the ID card is read through pins 8 to 11 of PORTB of an Arduino board. The magnetic system that is used to lock or unlock the door is connected to an output pin of the microcontroller through a driver and relay. If the voltage of this pin is 5 V (high) then the door opens for 20 sec and an LED turns green (otherwise red). In this problem, it is assumed that 10 employees are allowed to access the room. It is also assumed that the passwords in the array of {0000, 0001, 1001, 0110, 1000, 1111} are restricted and reserved for some other purposes so that entering these passwords will not open the door and turn on the red LED. On the other hand, the passwords in the array of (0010, 0011, 0100, 0101, 0111, 1010, 1011, 1100, 1101, 1110} are eligible to unlock the door and turn the green LED on. You can use the following circuits to give passwords to the board. With the use of DIP switches With no DIP switches Vcc DIP Switch Arduino UNO 1K 1K Arduino UNO W AN To the VCC or GND depending on the input password NNN w w W M 10K w w 1) Write a baby-step algorithm 2) Translate the algorithm to a C code. Specifically, use arrays for this purpose. 3) Design the system and program the microcontroller 4) Test the systemStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started