Day 8: Intrusion Detection System

With the ever-present threat of raiders and the need to safeguard critical areas on the Nebula Raider, it’s essential to build an intrusion detection system. This system will use a keypad to allow entry into high-ranking areas only to those who know the correct entry code. By implementing this system, you will help protect sensitive areas and ensure the security of the ship and its crew.

Components Needed:

Raspberry Pi Pico WH Microcontroller
4×4 Matrix Keypad
LCD1602 IIC/I2C Blue Backlight Display
LEDs (Green for access granted, Red for access denied)
Jumper wires

Set Up the Circuit:

Connect the 4×4 Matrix Keypad to the GPIO pins on the Raspberry Pi Pico (e.g., rows to GP0, GP1, GP2, GP3 and columns to GP4, GP5, GP6, GP7).
Connect the LCD1602 display to the Raspberry Pi Pico using the I2C interface (SDA to GP8, SCL to GP9).
Connect the buzzer to a GPIO pin on the Raspberry Pi Pico (e.g., GP15).
Connect the LEDs to GPIO pins on the Raspberry Pi Pico (e.g., Green to GP11, Red to GP12) using 220 ohm resistor. This resistor can be shared because only one LED will be turned on at a time.

Use jumper wires to make all necessary connections on the breadboard, ensuring a secure and organized setup.

Write the Code:

Open your coding environment and write the following Python code to read keypad input, validate the entry code, and control the LEDs and buzzer.

Test the System:

Upload the code to the Raspberry Pi Pico and run it.
Use the keypad to enter the correct and incorrect codes and observe the system’s response.
Ensure the green LED lights up and the buzzer remains off for the correct code, and the red LED lights up and the buzzer sounds for incorrect codes.
Learning Outcomes:

Keypad Integration: Learn how to connect and use a matrix keypad for user input with the Raspberry Pi Pico.
Security Logic: Understand how to implement security logic to validate entry codes and control outputs based on the input.
Microcontroller Programming: Develop skills in writing code to integrate multiple components and create a functional security system.
Extension Ideas:

Multiple Codes: Extend the project by allowing multiple valid codes for different access levels.
Logging: Add a logging feature to record all access attempts, both successful and unsuccessful.
Remote Monitoring: Create a web interface to monitor access attempts and control the system remotely.
By completing this project, you will have built a crucial security system for the Nebula Raider, ensuring that only authorized personnel can access high-ranking areas. Your work will help protect the ship from intruders and maintain the safety and security of the crew and its operations.

Post a comment

Leave a Comment

Your email address will not be published. Required fields are marked *