{"id":30891203,"url":"https://github.com/winter1165/digital-inhaler","last_synced_at":"2026-04-11T04:32:25.072Z","repository":{"id":310981078,"uuid":"1041959864","full_name":"WinTer1165/Digital-Inhaler","owner":"WinTer1165","description":"The Digital Inhaler project is designed for asthma patients. It's low development costs, use of open source tools, and adaptability to local requirements, the project is not only technically advanced but also a practical, life enhancing step towards more connected healthcare for millions of asthma patients in resource limited environments.","archived":false,"fork":false,"pushed_at":"2025-08-28T20:19:26.000Z","size":29188,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-29T02:00:27.340Z","etag":null,"topics":["arduino","c","cpp","cse323","esp8266","iot-device","learn","nsu"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WinTer1165.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-21T09:14:55.000Z","updated_at":"2025-08-28T20:54:52.000Z","dependencies_parsed_at":"2025-08-21T12:38:02.340Z","dependency_job_id":null,"html_url":"https://github.com/WinTer1165/Digital-Inhaler","commit_stats":null,"previous_names":["winter1165/digital-inhaler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WinTer1165/Digital-Inhaler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinTer1165%2FDigital-Inhaler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinTer1165%2FDigital-Inhaler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinTer1165%2FDigital-Inhaler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinTer1165%2FDigital-Inhaler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WinTer1165","download_url":"https://codeload.github.com/WinTer1165/Digital-Inhaler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinTer1165%2FDigital-Inhaler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274225655,"owners_count":25244555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","c","cpp","cse323","esp8266","iot-device","learn","nsu"],"created_at":"2025-09-08T18:04:14.065Z","updated_at":"2025-12-30T21:27:38.086Z","avatar_url":"https://github.com/WinTer1165.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Inhaler System\n\n## IoT-Based Asthma Management Solution for Bangladesh\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Platform](https://img.shields.io/badge/Platform-ESP8266-blue)](https://www.espressif.com/)\n[![Arduino](https://img.shields.io/badge/Arduino-Compatible-green)](https://www.arduino.cc/)\n\n---\n\n## Table of Contents\n- [Problem Statement](#problem-statement)\n- [Our Solution](#our-solution)\n- [Features](#features)\n- [System Architecture](#system-architecture)\n- [Hardware Components](#hardware-components)\n- [Software Requirements](#software-requirements)\n- [Installation Guide](#installation-guide)\n- [Circuit Diagram](#circuit-diagram)\n- [Cost Analysis](#cost-analysis)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n\n---\n\n## Problem Statement\n\nAsthma affects **7% of Bangladesh's population** (approximately 11.9 million people), with particularly high prevalence among children and urban populations due to:\n- High air pollution levels\n- Dust and particulate matter\n- High humidity (60-90% year-round)\n- Rapid urbanization\n\n### Current Challenges in Inhaler Usage:\n\n| Challenge | Impact |\n|-----------|---------|\n| **Incorrect Usage Technique** | 70% of patients use inhalers incorrectly, reducing medicine efficacy |\n| **Poor Adherence** | 50% of patients miss doses or take incorrect dosages |\n| **No Digital Tracking** | No way to monitor usage patterns or medication history |\n| **Environmental Correlation Gap** | Cannot correlate attacks with environmental triggers |\n| **Untracked Emergencies** | Emergency usage often goes unreported |\n\n### Existing Solutions \u0026 Limitations:\n\n1. **FindAir SmartHaler** (€89/~$95)\n   - Still in testing phase\n   - Too expensive for Bangladesh market\n   - Limited availability\n\n2. **Smart Inhaler Add-on** ($40)\n   - Not locally available\n   - Requires smartphone connectivity\n   - No environmental monitoring\n\n---\n\n##  Our Solution\n\n\u003cimg src=\"https://github.com/WinTer1165/Digital-Inhaler/blob/main/images/IMG_0572.jpg?raw=true\" alt=\"Device Photo 1\" style=\"width:300px;\"/\u003e\n\u003cimg src=\"https://github.com/WinTer1165/Digital-Inhaler/blob/main/images/IMG_0573.jpg?raw=true\" alt=\"Device Photo 2\" style=\"width:300px;\"/\u003e\n\u003cimg src=\"https://github.com/WinTer1165/Digital-Inhaler/blob/main/images/IMG_0574.jpg?raw=true\" alt=\"Device Photo 3\" style=\"width:300px;\"/\u003e\n\nA **locally-manufactured, affordable IoT smart inhaler system** designed specifically for Bangladesh's healthcare ecosystem.\n\n### Key Differentiators:\n-  **Affordable**: Target price under $15 (BDT 1,800)\n-  **Local Manufacturing**: Can be produced in Bangladesh\n-  **Environmental Monitoring**: Real-time air quality tracking\n-  **Offline Capability**: Works without constant internet\n\n---\n\n##  Features\n\n![Demo GIF](https://github.com/WinTer1165/Digital-Inhaler/blob/main/images/demo.gif?raw=true)\n\n\u003cimg src=\"https://github.com/WinTer1165/Digital-Inhaler/blob/main/images/ui.png?raw=true\" alt=\"UI/UX\" style=\"width:900px;\"/\u003e\n\n\n### Core Features\n-  **Puff Detection \u0026 Counting**: Accurate force-sensitive resistor (FSR) based detection\n-  **Real-time Web Dashboard**: Monitor usage from any device\n-  **Environmental Monitoring**: Temperature, humidity, air quality, and pressure tracking\n-  **Smart Medication Reminders**: Customizable alerts for medication schedules\n-  **Usage Analytics**: 7-day history with graphical visualization\n-  **Find My Inhaler**: Buzzer and vibration for locating misplaced device\n-  **Offline Data Storage**: EEPROM-based storage for offline usage\n-  **Auto Time Sync**: NTP-based time synchronization\n\n### Advanced Features\n- **Asthma Risk Assessment**: Risk calculation using environmental factors\n- **WebSocket Real-time Updates**: Live data streaming to connected devices\n- **Maximum Dosage Alerts**: Warns when approaching daily limits\n- **Emergency Detection**: Identifies unusual usage patterns\n\n---\n\n##  System Architecture\n\n```\n┌─────────────────────────────────────────────────────────┐\n│                    Smart Inhaler Device                 │\n├─────────────────────────────────────────────────────────┤\n│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌─────────┐  │\n│  │   FSR    │  │  BME280  │  │  MQ-135  │  │  OLED   │  │\n│  │ (Puff)   │  │(Env Data)│  │(Air Qual)│  │(Display)│  │\n│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬────┘  │\n│       │             │             │              │      │\n│  ┌────▼─────────────▼─────────────▼──────────────▼────┐ │\n│  │              ESP8266 NodeMCU                       │ │\n│  │   ┌──────────────────────────────────────────┐     │ │\n│  │   │ • Sensor Data Processing                 │     │ │\n│  │   │ • Web Server (Port 80)                   │     │ │\n│  │   │ • WebSocket Server (Port 81)             │     │ │\n│  │   │ • EEPROM Storage Management              │     │ │\n│  │   └──────────────────────────────────────────┘     │ │\n│  └─────────────────────┬──────────────────────────────┘ │\n│                        │                                │\n└────────────────────────┼────────────────────────────────┘\n                         │\n                    WiFi │ 802.11 b/g/n\n                         │\n           ┌─────────────▼──────────────┐\n           │      Local Network         │\n           │   ┌──────────────────┐     │\n           │   │   Web Interface  │     │\n           │   │  (Responsive UI) │     │\n           │   └──────────────────┘     │\n           └────────────────────────────┘\n```\n\n---\n\n##  Hardware Components\n\n### Required Components\n\n| Component | Model | Quantity | Purpose | Approx. Cost (BDT) |\n|-----------|-------|----------|---------|-------------------|\n| **Microcontroller** | ESP8266 NodeMCU | 1 | Main processor with WiFi | 650 |\n| **Force Sensor** | FSR 402 | 1 | Puff detection | 645 |\n| **Environmental Sensor** | BME280 | 1 | Temp, humidity, pressure | 490 |\n| **Air Quality Sensor** | MQ-135 | 1 | Air quality monitoring | 174 |\n| **Display** | 0.96\" OLED I2C | 1 | Local display | 290 |\n| **RTC Module** | DS3231 | 1 | Time keeping | 250 |\n| **Buzzer** | Active 5V | 1 | Audio alerts | 50 |\n| **Vibration Motor** | 3V Mini | 1 | Haptic feedback | 100 |\n| **Resistor** | 10kΩ | 1 | Pull-down for FSR | 5 |\n| **Wires \u0026 PCB** | - | - | Connections | 200 |\n| **Enclosure** | 3D Printed | 1 | Device housing | 200 |\n| **Battery** | Li-Po 3.7V 1000mAh | 1 | Power supply | 250 |\n\n**Total Development Cost: ~BDT 3500 ($29.50)**\n\n### Pin Connections\n\n```\nESP8266 NodeMCU Pin Configuration:\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nA0  ← FSR (with 10kΩ pull-down to GND)\nD1  → I2C SCL (BME280, OLED, RTC)\nD2  → I2C SDA (BME280, OLED, RTC)\nD5  ← MQ-135 Digital Output\nD6  → Buzzer Signal\nD7  → Vibration Motor Signal\n3V3 → Power for I2C devices\n5V  → Power for MQ-135\nGND → Common Ground\n```\n\n---\n\n##  Software Requirements\n\n### Development Environment\n- **Arduino IDE** v1.8.19 or higher\n- **ESP8266 Board Package** \n\n### Required Libraries\n```cpp\n// Install via Arduino Library Manager:\nESP8266WiFi         // Built-in\nESP8266WebServer    // Built-in\nWebSocketsServer    // v2.3.6 by Markus Sattler\nWire                // Built-in\nAdafruit_Sensor     // v1.1.4\nAdafruit_BME280     // v2.2.2\nRTClib              // v2.0.3\nAdafruit_GFX        // v1.11.3\nAdafruit_SSD1306    // v2.5.7\nArduinoJson         // v6.19.4\nNTPClient           // v3.2.1\n```\n\n---\n\n##  Installation Guide\n\u003cimg src=\"https://raw.githubusercontent.com/WinTer1165/Digital-Inhaler/bda6932cfa721df9af1bc6edc74ee1808390fdb8/images/circuit-schematic.svg\" alt=\"Circuit Diagram\" style=\"width:600px;\"/\u003e\n\n###  1. Hardware Setup\n\n1. Assemble components according to the circuit diagram\n2. Ensure all I2C devices have unique addresses:\n   - BME280: 0x76 or 0x77\n   - OLED: 0x3C\n   - RTC: 0x68\n\n### 2. Software Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/WinTer1165/Digital-Inhaler.git\ncd digital-inhaler/smartinhaler\n\n# Open in Arduino IDE\n# File → Open → SmartInhaler.ino\n```\n\n### 3. Configuration\nEdit `config.h` to set your WiFi credentials:\n```cpp\nconst char* WIFI_SSID = \"Set_WiFi_Name\";\nconst char* WIFI_PASSWORD = \"Set_WiFi_Password\";\n```\n\n### 4. Upload Code\n1. Select Board: `Tools → Board → NodeMCU 1.0 (ESP-12E Module)`\n2. Select Port: `Tools → Port → COMx` (or `/dev/ttyUSBx` on Linux)\n3. Click Upload\n\n### 5. Access Web Interface\n1. Open Serial Monitor (115200 baud)\n2. Note the IP address displayed\n3. Open browser and navigate to: `http://[IP_ADDRESS]`\n\n---\n\n## Circuit Diagram\n\nSee the included circuit schematic for detailed wiring instructions. Key connections:\n- All I2C devices share SCL (D1) and SDA (D2) lines\n- FSR requires a 10kΩ pull-down resistor\n- MQ-135 requires 5V power supply\n- Use level shifters if needed for 5V/3.3V compatibility\n\n---\n\n## Cost Analysis\n\n### Development Cost (Prototype)\n| Category | Cost (BDT) | Cost (USD) |\n|----------|------------|------------|\n| Components | 3,600 | $30.00 |\n| Assembly | 400 | $3.33 |\n| **Total** | **4000** | **$33.33** |\n\n### Production Cost (Scale: 1000 units)\n| Category | Cost (BDT) | Cost (USD) |\n|----------|------------|------------|\n| Components (bulk) | 800 | $6.66 |\n| PCB (mass production) | 100 | $0.83 |\n| Injection molding | 100 | $0.83 |\n| Assembly | 50 | $0.41 |\n| **Total** | **1,050** | **$8.73** |\n\n### Comparison with Existing Solutions\n| Product | Price | Availability | Features |\n|---------|-------|--------------|----------|\n| **Our Solution** | $8-15 | Local | Full environmental monitoring |\n| FindAir SmartHaler | $95 | Import only | Limited features |\n| Generic Add-on | $40 | Not available | Basic tracking only |\n\n---\n\n## Usage\n\n### Initial Setup\n1. Power on the device\n2. Connect to WiFi network (automatic)\n3. Access web dashboard\n4. Set medication reminders\n5. Configure max puff limits\n\n### Daily Usage\n- **Normal Use**: Simply use the inhaler as usual - puffs are automatically detected\n- **Check Stats**: View daily/weekly usage on OLED display\n- **Web Dashboard**: Access detailed analytics from any device\n- **Reminders**: Device will buzz/vibrate at medication times\n\n---\n\n## API Documentation\n\n### WebSocket Events\n\n#### Receive Events\n```javascript\n// Sensor Data Update\n{\n  \"type\": \"sensorData\",\n  \"temperature\": 25.5,\n  \"humidity\": 65,\n  \"airQuality\": 85,\n  \"pressure\": 1013,\n  \"totalPuffs\": 120,\n  \"dailyPuffs\": 4\n}\n\n// Puff Detected\n{\n  \"type\": \"puffDetected\",\n  \"totalPuffs\": 121,\n  \"timestamp\": \"14:23:45\"\n}\n```\n\n#### Send Commands\n```javascript\n// Set Reminder\n{\n  \"command\": \"setReminder\",\n  \"index\": 0,\n  \"hour\": 8,\n  \"minute\": 30,\n  \"label\": \"Morning dose\"\n}\n\n// Reset Counter\n{\n  \"command\": \"resetPuffs\"\n}\n\n// Get Usage History\n{\n  \"command\": \"getHistory\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinter1165%2Fdigital-inhaler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinter1165%2Fdigital-inhaler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinter1165%2Fdigital-inhaler/lists"}