{"id":30891160,"url":"https://github.com/arvinnotdev/smart_water_meter","last_synced_at":"2025-09-08T18:04:11.078Z","repository":{"id":312720523,"uuid":"1048255406","full_name":"ArvinNotDev/smart_water_meter","owner":"ArvinNotDev","description":"This is a field-ready water usage monitor that combines low-level hardware efficiency with user-friendly remote control.","archived":false,"fork":false,"pushed_at":"2025-09-01T14:43:00.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-01T16:37:17.541Z","etag":null,"topics":["arduino","esp32","esp32-arduino","live","smart","smart-home","smarthome","water","watermeter","websocket"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArvinNotDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-01T07:03:01.000Z","updated_at":"2025-09-01T15:05:39.000Z","dependencies_parsed_at":"2025-09-01T16:37:20.093Z","dependency_job_id":"1b0174eb-74d6-4d53-9809-b2a3f34c492a","html_url":"https://github.com/ArvinNotDev/smart_water_meter","commit_stats":null,"previous_names":["arvinnotdev/smart_water_meter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ArvinNotDev/smart_water_meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArvinNotDev%2Fsmart_water_meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArvinNotDev%2Fsmart_water_meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArvinNotDev%2Fsmart_water_meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArvinNotDev%2Fsmart_water_meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArvinNotDev","download_url":"https://codeload.github.com/ArvinNotDev/smart_water_meter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArvinNotDev%2Fsmart_water_meter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274225612,"owners_count":25244544,"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","esp32","esp32-arduino","live","smart","smart-home","smarthome","water","watermeter","websocket"],"created_at":"2025-09-08T18:03:28.232Z","updated_at":"2025-09-08T18:04:11.059Z","avatar_url":"https://github.com/ArvinNotDev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚰 Water Flow Meter with SMS Alerts \u0026 EEPROM Logging\n\nThis project measures water flow, counts liters, and provides remote monitoring via SMS commands.  \nIt uses an **Arduino + flow sensor + GSM module + 24C256 I²C EEPROM** to create a robust, low-power, field-ready solution.\n\n---\n\n## ✨ Features\n\n### Accurate Water Flow Measurement\n- Interrupt-driven pulse counter for precise flow tracking.  \n\n### SMS Control \u0026 Monitoring\n- Send **`GET`** → receive the total liters used.  \n- Send **`RESET`** → reset the counter.  \n\n### Persistent Storage (24C256 EEPROM)\n- Stores the water usage counter even after power loss.  \n- Sequence-numbered entries ensure the latest record is always found.  \n- Optimized page writes for endurance.  \n\n### Non-blocking SMS Sending\n- No more 5-second freezes when sending SMS.  \n\n### Robust SMS Parsing \u0026 Deletion\n- Reads only new messages.  \n- Deletes them after processing.  \n\n### Data Safety\n- Wraps counter updates in `noInterrupts()` for atomic operations.  \n\n---\n\n## 🛠️ Hardware Requirements\n- Arduino Uno / Nano / Mega  \n- Water Flow Sensor (Hall-effect type, e.g., **YF-S201**)  \n- SIM800L / SIM900 GSM module  \n- 24C256 I²C EEPROM (**AT24C256N** or equivalent)  \n- Jumper wires, breadboard, stable power supply  \n\n---\n\n## ⚡ Wiring\n\n### EEPROM (AT24C256N, I²C)\n\n| Pin (EEPROM) | Arduino |\n|--------------|---------|\n| VCC          | 5V      |\n| GND          | GND     |\n| SDA          | A4      |\n| SCL          | A5      |\n| WP           | GND     |\n\n### Flow Sensor\n\n| Pin   | Arduino |\n|-------|---------|\n| VCC   | 5V      |\n| GND   | GND     |\n| Signal| D2 (INT0)|\n\n### GSM Module (SIM800L/SIM900)\n\n| Pin | Arduino              |\n|-----|----------------------|\n| VCC | 4V–5V (separate PSU recommended) |\n| GND | GND                  |\n| TX  | D8 (SoftwareSerial RX) |\n| RX  | D9 (SoftwareSerial TX) |\n\n---\n\n## 📂 EEPROM Data Layout\n\nEach record = **6 bytes**:\n- `sequence` (4 bytes, uint32_t)  \n- `liters` (2 bytes, uint16_t)  \n\nWith 32 KB total:  \nThat’s **~5,461 saves** → with one save per liter, you get **years of retention**.\n\n---\n\n## 📲 SMS Commands\n\n- **GET** → returns the current water usage in liters.  \n- **RESET** → resets the counter to zero and saves it.    \n\n---\n\n## 🚦 How It Works\n\n1. Flow sensor pulses are counted in an interrupt.  \n2. Every time the counter updates, it’s stored in EEPROM with a sequence number.  \n3. On startup → only the **latest EEPROM entry** is loaded.  \n4. GSM module listens for incoming SMS:  \n   - Parses and executes commands.  \n   - Sends back results using **non-blocking SMS sending**.  \n   - Deletes messages after processing.  \n\n---\n\n## ⚙️ Software Highlights\n- **EEPROM_Manager** → handles sequence tracking, page writes, safe loads.  \n- **FlowCounter ISR** → atomic counting with `noInterrupts()`.  \n- **SMSHandler** → parses messages, deletes after processing.  \n- **NonBlockingSMS** → allows loop to run while SMS is sending.  \n\n---\n\n## 🚀 Getting Started\n\n1. Clone this repo:\n   ```bash\n   git clone https://github.com/yourname/water-flow-sms-meter.git\n   cd water-flow-sms-meter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvinnotdev%2Fsmart_water_meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farvinnotdev%2Fsmart_water_meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farvinnotdev%2Fsmart_water_meter/lists"}