This project implements a smart home security system using IoT technologies. It includes a motion detection module, a backend server, and a web-based frontend interface to display notifications.
The project consists of the following components:
index.html
: HTML file containing the frontend interface code for displaying notifications.server.py
: Python file implementing the backend server to handle notification requests.motion/motion_detection.py
: Python file that detects motion using a PIR sensor and sends notifications to the server.
Before running the project, ensure the following prerequisites are met:
- Raspberry Pi or similar device with GPIO support.
- PIR sensor connected to the appropriate GPIO pin.
- Python 3.x installed on the device.
- Required Python libraries installed (
RPi.GPIO
,requests
,flask
).
Follow these steps to set up and run the project:
-
Clone or download the project repository.
-
Install the required Python libraries using the command:
pip install RPi.GPIO requests flask
. -
Update the
SERVER_URL
variable inmotion_detection.py
andserver.py
to the appropriate address of your server. -
Open a terminal and navigate to the project directory.
-
Start the backend server by running the command:
python server.py
. -
In a separate terminal, navigate to the
motion
directory using the command:cd motion
. -
Run the motion detection module by executing the command:
python motion_detection.py
. -
Open a web browser and go to
http://localhost:3000
to access the frontend interface.
-
The motion detection module will monitor the PIR sensor for any motion. When motion is detected, it will send a notification to the backend server.
-
The backend server receives the notification and stores it. The frontend interface fetches notifications from the server and displays them.
-
You can customize the frontend interface, add additional features, or integrate with other services as needed.
Contributions are welcome! If you have any suggestions or improvements for the project, feel free to open an issue or submit a pull request.
Special thanks to the open-source community for providing helpful libraries and resources used in this project.