# IoT Mask & Temperature Detection Project
🚀 An IoT-powered model that combines **AI** and **hardware integration** to detect masks and monitor temperature in real time.
📋 Table of Contents
- [Introduction](#-introduction)
- [Features](#-features)
- [Tech Stack](#️-tech-stack)
- [Hardware Components](#-hardware-components)
- [Setup and Installation](#️-setup-and-installation)
- [Docker Setup](#-docker-setup)
- [Usage](#-usage)
- [Contributing](#-contributing)
- [License](#-license)
---
## 📝 Introduction
This project integrates **AI-based mask detection** with **IoT temperature sensing** to provide real-time monitoring. Using a transformer model for mask detection and Arduino for hardware interfacing, it offers an intelligent and interactive solution for safety and compliance.
---
## ✨ Features
- Real-time Mask Detection: Uses a Transformer model for high-accuracy mask detection.
- Temperature Monitoring: Measures temperature and proximity using DHT11 and ultrasonic sensors.
- LED Indicators: Provides feedback via LEDs based on the detection results.
- Seamless Integration: Bridges backend, frontend, and hardware for smooth communication.
---
## 🛠️ Tech Stack
### Backend:
- FastAPI: For serving the mask detection API.
- Python: For ML model and API development.
### Frontend:
- React: For building an interactive user interface.
### Hardware:
- Arduino Uno: To handle temperature and mask detection inputs.
- DHT11 Sensor: For temperature and humidity sensing.
- Ultrasonic Sensor: For object proximity detection.
---
## 🔌 Hardware Components
1. Arduino Uno
2. DHT11 Temperature and Humidity Sensor
3. Ultrasonic Sensor
4. ESP32/ESP8266 (optional for wireless communication)
5. LEDs (for visual indication)
6. Breadboard and Jumper Wires
---
## ⚙️ Setup and Installation
### Prerequisites:
- Install Python 3.10+
- Install Node.js for the React frontend
- Arduino IDE for programming hardware
### Clone the Repository:
```bash
git clone https://github.com/your-username/mask-temperature-detection.git
cd mask-temperature-detection- Navigate to the backend folder:
cd backend - Install dependencies:
pip install -r requirements.txt
- Run the FastAPI server:
uvicorn main:app --reload
- Navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Start the development server:
npm start
- Open
arduino_code.inoin Arduino IDE. - Connect the Arduino Uno and upload the code.
- Ensure proper wiring of DHT11, ultrasonic sensor, and LEDs.
- Install Docker and Docker Compose.
-
Navigate to the project directory.
-
Build the Docker images for backend and frontend:
docker build -t backend ./backend docker build -t frontend ./frontend
-
Run the backend container:
docker run -p 8000:8000 backend
-
Run the frontend container:
docker run -p 5173:5173 frontend
- Backend: Open http://localhost:8000 in your browser or use an API testing tool like Postman.
- Frontend: Open http://localhost:5173 in your browser.
- Start the Backend: Run the FastAPI server or use the Docker container.
- Start the Frontend: Run the React application or use the Docker container.
- Connect the Arduino: Ensure the Arduino is powered and connected to the system.
- View mask detection results and temperature readings in real time!
We welcome contributions! Please fork the repository, create a new branch, and submit a pull request. For major changes, open an issue to discuss your ideas.
This project is licensed under the MIT License. See the LICENSE file for details.
For any queries or suggestions, feel free to reach out at [email protected].
### Changes Added:
1. Added a **Docker Setup** section with detailed steps for building and running the backend and frontend containers.
2. Included prerequisite tools for Docker in the **Setup and Installation** section.
3. Updated the **Usage** section to reference Docker.