https://github.com/ajaparicio36/fire-detection-rpi
Fire Detection with External AI Model with Smoke Detector and Alarm connected with a Raspberry Pi
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.3%) to scientific vocabulary
Repository
Fire Detection with External AI Model with Smoke Detector and Alarm connected with a Raspberry Pi
Basic Info
- Host: GitHub
- Owner: ajaparicio36
- Language: Python
- Default Branch: main
- Size: 12.4 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
🔥 Smart Fire Detection System 🚨
A distributed fire detection system using Raspberry Pi, YOLOv5, and React. Features real-time fire detection through computer vision and hardware smoke detection.
🌟 Features
- 🎥 Real-time fire detection using YOLOv5
- 💨 Hardware smoke detection
- 🚨 Configurable alarm system
- 📱 Web dashboard for monitoring and control
- 🔄 Real-time updates using Socket.IO
- 🛡️ Distributed architecture for better performance
🏗️ System Architecture
┌─────────────────┐ ┌──────────────────┐ ┌────────────────┐
│ AI Service │◄───┤ RPi Server │◄───┤ Frontend │
│ (YOLOv5 Model) │ │ (GPIO + Camera) │ │ (React + UI) │
└─────────────────┘ └──────────────────┘ └────────────────┘
🛠️ Prerequisites
- Raspberry Pi 3B or better
- Python 3.8+
- Node.js 16+
- Web camera
- Smoke detector (GPIO compatible)
- Alarm bell/buzzer
- High-performance computer for AI service
📥 Installation
1️⃣ AI Service Setup
```bash
Clone repository
git clone
Create and activate virtual environment
python -m venv venv
Windows
.\venv\Scripts\activate
Linux/Mac
source venv/bin/activate
Install requirements
pip install -r requirements.txt
Start AI service
python model_server.py ```
2️⃣ RPi Server Setup
```bash cd fire-detection-system/rpi-server
Create and activate virtual environment
python -m venv venv
Windows
.\venv\Scripts\activate
Linux/Mac
source venv/bin/activate
Install requirements
pip install -r requirements.txt
Start server
python server.py ```
3️⃣ Frontend Setup
```bash cd fire-detection-system/frontend
Install dependencies
npm install
Start development server
npm run dev
Build for production
npm run build ```
🌐 Static IP Configuration
Windows
- Open Network Settings:
Windows Key + R -> ncpa.cpl - Right-click your network adapter -> Properties
- Select "Internet Protocol Version 4 (TCP/IPv4)" -> Properties
- Use these settings:
IP address: 192.168.1.10 Subnet mask: 255.255.255.0 Default gateway: 192.168.1.1 DNS: 8.8.8.8, 8.8.4.4
Raspberry Pi OS (Linux)
Method 1: For newer versions (using dhcpcd)
Edit dhcpcd configuration:
bash sudo nano /etc/dhcpcd.confAdd these lines:
bash interface eth0 # or wlan0 for WiFi static ip_address=192.168.1.11/24 static routers=192.168.1.1 static domain_name_servers=8.8.8.8 8.8.4.4Restart networking:
bash sudo service dhcpcd restart
Method 2: For older versions (using interfaces)
Edit the interfaces file:
bash sudo nano /etc/network/interfacesAdd these lines for Ethernet (eth0):
bash auto eth0 iface eth0 inet static address 192.168.1.11 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4
Or for WiFi (wlan0):
bash
auto wlan0
iface wlan0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Restart networking:
bash sudo /etc/init.d/networking restartIf using WiFi, make sure your WiFi credentials are in
/etc/wpa_supplicant/wpa_supplicant.conf:bash sudo nano /etc/wpa_supplicant/wpa_supplicant.confAdd:network={ ssid="Your_WiFi_Name" psk="Your_WiFi_Password" }
📌 GPIO Pin Configuration
- Smoke Detector: GPIO 17 (Physical Pin 11)
- Alarm Bell: GPIO 18 (Physical Pin 12)
🚀 Usage
- Start AI Service on your high-performance computer
- Start RPi Server on your Raspberry Pi
- Start Frontend application
- Access the dashboard at
http://localhost:5173
🔧 Configuration
Default ports: - AI Service: 5001 - RPi Server: 5000 - Frontend: 5173
Update the connection settings in:
- ai-service/config.py
- rpi-server/config.py
- frontend/src/config.ts
🔍 System Monitoring
Access the dashboard to: - 👀 View real-time camera feed - 📊 Monitor smoke detector status - 🔄 Check system uptime - 🎛️ Control alarm system - 📝 View event logs
⚠️ Troubleshooting
Camera not detected ```bash
Check camera
v4l2-ctl --list-devices ```
GPIO Permission Issues ```bash
Add user to gpio group
sudo usermod -a -G gpio $USER ```
Network Connectivity ```bash
Test connections
ping 192.168.1.10 ping 192.168.1.11 ```
🛟 Support
For issues and feature requests, please open an issue in the repository.
📜 License
MIT License - feel free to use in your projects!
Owner
- Name: Anthony John
- Login: ajaparicio36
- Kind: user
- Location: Philippines
- Twitter: ajaparicio36
- Repositories: 1
- Profile: https://github.com/ajaparicio36
Student from Central Philippine University Studying BS in Software Engineering Acads / Pro Gaming
GitHub Events
Total
- Watch event: 1
- Push event: 24
- Create event: 3
Last Year
- Watch event: 1
- Push event: 24
- Create event: 3
Dependencies
- 304 dependencies
- @eslint/js ^9.17.0 development
- @types/react ^18.3.17 development
- @types/react-dom ^18.3.5 development
- @vitejs/plugin-react ^4.3.4 development
- eslint ^9.17.0 development
- eslint-plugin-react-hooks ^5.0.0 development
- eslint-plugin-react-refresh ^0.4.16 development
- globals ^15.13.0 development
- typescript ~5.6.2 development
- typescript-eslint ^8.18.1 development
- vite ^6.0.3 development
- autoprefixer ^10.4.20
- lucide-react ^0.468.0
- postcss ^8.4.49
- react ^18.3.1
- react-dom ^18.3.1
- socket.io-client ^4.8.1
- tailwindcss ^3.4.17