Project Overview
The "Secure-Guard" Access Controller is a foundational study in Event-Driven Security Software. By translating physical button presses into an abstract array of integers, the system demonstrates how a simple microcontroller can manage high-stakes logic like industrial access control. The project features a dual-layer interface: a tactile keypad for user interaction and a 16x2 LCD for real-time telemetry, including an integrated "Lockout" countdown timer to prevent brute-force attacks.
Technical Deep-Dive
- Combinatorial Entry Logic:
- The Array-Matching Algorithm: The firmware defines a
predefinedCode[4]array. As the user presses buttons A, B, C, or D, the Arduino populates aninputBuffer[4]. Access is only granted if the element-wise comparison between the two arrays yields a 100% match. - State Machine Management: The logic is non-blocking. Instead of waiting for a button press, the code continuously polls the digital input pins, using a pointer variable to track the current index in the input sequence.
- The Array-Matching Algorithm: The firmware defines a
- Parallel LCD Bus (HD44780 Topology):
- 4-Bit Mode Efficiency: To conserve Arduino pins, the display operates in 4-bit Parallel Mode. The
LiquidCrystallibrary manages the RS (Register Select) and E (Enable) pins to time the injection of data nibbles into the D4-D7 registers, allowing for high-speed screen updates without flickering. - V0 Biasing: The 10k potentiometer provides the critical analog bias needed for the liquid crystal segments, ensuring high-contrast visibility across varying ambient lighting conditions.
- 4-Bit Mode Efficiency: To conserve Arduino pins, the display operates in 4-bit Parallel Mode. The
- Asynchronous Telemetry & Timing:
- The Millis() Countdown: To ensure the countdown timer accurately reflects the remaining access window without freezing the keypad input, the system utilizes
millis()-based timing. This creates an asynchronous experience where the HMI remains responsive even during high-computation phases.
- The Millis() Countdown: To ensure the countdown timer accurately reflects the remaining access window without freezing the keypad input, the system utilizes
Engineering & Implementation
- Feedback & Indicators:
- Tri-State HMI:
- Red LED (Locked): Denies access and triggers the "Incorrect Code" penalty.
- Green LED (Authorized): Triggers the hypothetical locking mechanism (e.g., a relay or solenoid).
- Yellow LED (Standby/Ready): Indicates the system is actively polling for inputs.
- Tri-State HMI:
- Electrical Signal Integrity:
- Internal Pull-ups: The pushbuttons are configured in an active-low state. By leveraging the ATmega328P's internal 20k Ohm Pull-up Resistors, the design eliminates the need for external hardware resistors, reducing the overall bill of materials (BOM) while ensuring stable digital thresholds.
- Brute-Force Mitigation:
- The project implements a software "Lockout" phase. After three failed attempts, the system enters a wait state, effectively paralyzing the
inputBufferuntil the cooldown timer expires, a core principle in modern electronic vault design.
- The project implements a software "Lockout" phase. After three failed attempts, the system enters a wait state, effectively paralyzing the
Conclusion
Secure-Guard is more than a simple lock; it is a demonstration of how structured software states can provide robust physical security. By mastering LCD telemetrics and combinatorial logic, developers can scale this system into complex multi-user biometric or RFID-based entry points.