{"id":29204678,"url":"https://github.com/jpcodes44/sen0344_lib","last_synced_at":"2025-07-26T23:35:57.269Z","repository":{"id":301062965,"uuid":"1008044760","full_name":"JPCodes44/SEN0344_lib","owner":"JPCodes44","description":"🩸 Lightweight Arduino library for interfacing with the DFRobot SEN0344 SpO₂ sensor (MAX30102) via I²C. Stream real-time Red \u0026 IR data and compute oxygen saturation ratios effortlessly.","archived":false,"fork":false,"pushed_at":"2025-06-25T00:19:55.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T01:28:56.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/JPCodes44.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}},"created_at":"2025-06-25T00:10:43.000Z","updated_at":"2025-06-25T00:20:52.000Z","dependencies_parsed_at":"2025-06-25T01:29:33.160Z","dependency_job_id":"b4d3812c-7f01-4089-aa9e-595db2e90706","html_url":"https://github.com/JPCodes44/SEN0344_lib","commit_stats":null,"previous_names":["jpcodes44/sen0344_lib"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JPCodes44/SEN0344_lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPCodes44%2FSEN0344_lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPCodes44%2FSEN0344_lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPCodes44%2FSEN0344_lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPCodes44%2FSEN0344_lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JPCodes44","download_url":"https://codeload.github.com/JPCodes44/SEN0344_lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JPCodes44%2FSEN0344_lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263163163,"owners_count":23423495,"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","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":[],"created_at":"2025-07-02T15:06:24.583Z","updated_at":"2025-07-02T15:06:27.225Z","avatar_url":"https://github.com/JPCodes44.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 📦 `SEN0344` Arduino Library\n\nA lightweight and efficient Arduino library for reading SpO₂ (blood oxygen saturation) data from the **DFRobot SEN0344** sensor over I²C.\nSupports continuous data streaming with **Red** and **Infrared** photodiodes.\n\n---\n\n## ⚙️ Features\n\n* 📡 Communicates via **I²C**\n* ❤️ Retrieves **Red/IR data pairs** from sensor FIFO\n* 🔁 Enables **FIFO rollover** for continuous data capture\n* 🧠 Outputs **raw ratio** (`Red / IR`) for SpO₂ calculation\n\n---\n\n## 🛠️ Installation\n\n### 🔧 Option 1: Manually\n\n1. 📁 Copy both files into your Arduino project:\n\n   * [`SEN0344.cpp`](./SEN0344.cpp)\n   * [`SEN0344.h`](./SEN0344.h)\n\n2. At the top of your `.ino` sketch, include the library:\n\n```cpp\n#include \"SEN0344.h\"\n```\n\n### 🔧 Option 2: Create a Library Folder\n\n1. In your Arduino `libraries/` directory, create a new folder called `SEN0344`.\n2. Drop `SEN0344.cpp` and `SEN0344.h` into that folder.\n3. Restart the Arduino IDE.\n\n---\n\n## 🧪 Example Usage\n\n```cpp\n#include \u003cWire.h\u003e\n#include \"SEN0344.h\"\n\nSEN0344 sensor(0x47); // 0x47 or 0x48 based on your hardware config\n\nvoid setup() {\n  Serial.begin(9600);\n  Wire.begin();\n  \n  if (sensor.begin()) {\n    Serial.println(\"SEN0344 initialized ✅\");\n  } else {\n    Serial.println(\"SEN0344 failed to initialize ❌\");\n  }\n}\n\nvoid loop() {\n  float ratio = sensor.readSpo2();\n  Serial.print(\"SpO2 Ratio: \");\n  Serial.println(ratio, 4); // Optional: multiply by coefficient if calibrating to %\n  delay(500);\n}\n```\n\n---\n\n## 🔍 How It Works\n\n### 🔧 `begin()`\n\n* Sets FIFO rollover\n* Enables SpO₂ mode with Red \u0026 IR LEDs\n* Configures 3200 samples/sec for high responsiveness\n\n### 📤 `readSpo2()`\n\n* Reads 6 bytes from FIFO (3 bytes per channel)\n* Extracts raw 24-bit values for:\n\n  * Red LED\n  * Infrared LED\n* Returns the **Red / IR ratio** (float)\n\n### 🧱 Low-Level I²C Tools\n\n* `i2c_write(addr, byte, deviceID)`\n* `i2c_read(addr, deviceID)`\n\n---\n\n## 🧼 Tips\n\n* Make sure `Wire.begin()` is called in `setup()`\n* Sensor I²C address is **usually 0x47** but can be **0x48** — check your device\n* To convert the Red/IR ratio into a real SpO₂ %, you'll need to apply a calibration curve (device/skin dependent)\n\n---\n\n## 🧪 Tested On\n\n* ✅ Arduino Uno\n* ✅ Arduino Nano\n* ✅ ESP32 (with 3.3V logic)\n* ✅ DFRobot SEN0344 (MAX30102)\n\n---\n\n## 📄 License\n\nMIT License — free to use, modify, and distribute.\nGo build something awesome. 🚀\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcodes44%2Fsen0344_lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpcodes44%2Fsen0344_lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcodes44%2Fsen0344_lib/lists"}