{"id":19923594,"url":"https://github.com/sukarnascience/serial2csv","last_synced_at":"2025-08-03T08:11:18.334Z","repository":{"id":194555400,"uuid":"691078778","full_name":"Sukarnascience/Serial2CSV","owner":"Sukarnascience","description":"This Python project is designed for collecting data from an Arduino device in CSV format through the Serial port, offering a convenient way to log and store the data directly on your computer. The entire process is managed through a Command Line Interface (CLI), making it user-friendly and accessible.","archived":false,"fork":false,"pushed_at":"2023-09-19T11:22:40.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T09:04:59.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Sukarnascience.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}},"created_at":"2023-09-13T13:08:08.000Z","updated_at":"2024-02-16T05:55:05.000Z","dependencies_parsed_at":"2025-03-01T10:20:45.616Z","dependency_job_id":"03eace81-882c-45ca-859f-eec027e0e43c","html_url":"https://github.com/Sukarnascience/Serial2CSV","commit_stats":null,"previous_names":["sukarnascience/serial2csv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sukarnascience/Serial2CSV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sukarnascience%2FSerial2CSV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sukarnascience%2FSerial2CSV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sukarnascience%2FSerial2CSV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sukarnascience%2FSerial2CSV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sukarnascience","download_url":"https://codeload.github.com/Sukarnascience/Serial2CSV/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sukarnascience%2FSerial2CSV/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512159,"owners_count":24261887,"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-08-03T02:00:12.545Z","response_time":2577,"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":[],"created_at":"2024-11-12T22:14:49.720Z","updated_at":"2025-08-03T08:11:18.295Z","avatar_url":"https://github.com/Sukarnascience.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serial2CSV\n\n**Author:** Sukarna Jana  \n**Version:** 0.0.1V  \n**Last Update:** 13-09-2023  \n\n## Introduction\n\nSerial2CSV is a Python-based tool designed to simplify the process of logging data from Arduino or other devices connected via a serial port and saving it into a CSV (Comma-Separated Values) file. This tool automates the data logging process and helps you organize and analyze your data more efficiently.\n\n## Prerequisites\n\nBefore using Serial2CSV, ensure you have the following prerequisites installed:\n\n1. **Python**: Serial2CSV is a Python script, so you need to have Python installed on your computer. You can download Python from the official website: [Python Downloads](https://www.python.org/downloads/).\n\n## Usage\n\n### Windows Users\n\nWindows users can set up Serial2CSV by following these steps:\n\n1. **Clone the Repository**: Start by cloning this repository to your local machine:\n\n    ```bash\n    git clone https://github.com/Sukarnascience/Serial2CSV.git\n    ```\n\n2. **Navigate to the Project Directory**: Change your current directory to the project directory:\n\n    ```bash\n    cd Serial2CSV\n    ```\n\n3. **Run the Setup Script**: Execute the setup script to check for Python, install required packages, and set up the environment for data logging:\n\n    ```bash\n    setup.bat\n    ```\n\n    The script will guide you through the process, ensuring that Python is installed and any potential errors are handled gracefully.\n\n### Linux and macOS Users\n\nFor users of Linux and macOS, follow these steps to set up Serial2CSV:\n\n1. **Clone the Repository**: Start by cloning this repository to your local machine:\n\n    ```bash\n    git clone https://github.com/Sukarnascience/Serial2CSV.git\n    ```\n\n2. **Navigate to the Project Directory**: Change your current directory to the project directory:\n\n    ```bash\n    cd Serial2CSV\n    ```\n\n3. **Install Required Packages**: Manually install the required Python packages using `pip`:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n### Logging Data\n\nOnce you've set up Serial2CSV, you can log data from your Arduino by running the following command:\n\n```bash\npython serial2csv.py -p COMX -b 9600 -f output.csv\n```\n\n* `-p` or `--port`: Specify the serial port to which your Arduino is connected (e.g., COM3).\n* `-b` or `--baud`: Set the baud rate (e.g., 9600) to match your Arduino's communication settings.\n* `-f` or `--filename`: Choose the name for the output CSV file.\n\nexample: \n* Windows\n    ```bash\n    python serial2csv.py -p COM3 -b 9600 -f output.csv\n    ```\n* Linux and macOS \n    ```bash\n    python3 serial2csv.py -p /dev/ttyACM0 -b 9600 -f output.csv\n    ```\n\n    \n* **Data Logging**: Serial2CSV will continuously log data from the serial port and save it into the specified CSV file.\n\n* **Stop Logging**: To stop data logging, press `Ctrl+C` in the terminal where Serial2CSV is running.\n\n* **Data Analysis**: Once data logging is complete, you can use tools like Microsoft Excel or Python's data analysis libraries to analyze and visualize your data from the CSV file.\n\n## Example Arduino Code\n\nHere's an example Arduino code snippet to send data to Serial2CSV:\n\n\n```arduino\nvoid setup() {\n    Serial.begin(9600);  // Set the baud rate to match Serial2CSV\n}\n\nvoid loop() {\n    // Your code to collect data\n    int sensorValue = analogRead(A0);\n    \n    // Send data over serial\n    Serial.print(sensorValue);\n    Serial.print(\",\");\n    \n    // Add more data if needed, separated by \",\"\n    \n    Serial.println();\n    // Delay if necessary to control data rate\n    delay(1000);\n}\n```\n\n\u003e Dummy Code to Upload on Arduino to test\n```c\nvoid setup() {\n  Serial.begin(9600);  // Set the baud rate to match your receiving device\n  randomSeed(analogRead(0));  // Initialize the random number generator with a seed\n}\n\nvoid loop() {\n  static int SNo = 0;  // Initialize the serial number counter\n\n  // Print SNo as the first value in the CSV format\n  Serial.print(SNo);\n\n  // Generate and print 8 random integers\n  for (int i = 0; i \u003c 8; i++) {\n    int randomValue = random(0, 101);  // Generate a random integer between 0 and 100 (adjust as needed)\n    \n    // Print a comma and the random integer value\n    Serial.print(\",\");\n    Serial.print(randomValue);\n  }\n\n  Serial.println();  // Print a newline character to indicate the end of the CSV line\n\n  SNo++;  // Increment the serial number counter\n  delay(1000);  // Delay for a second (adjust as needed for your desired data rate)\n}\n\n```\n\n# License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukarnascience%2Fserial2csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsukarnascience%2Fserial2csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsukarnascience%2Fserial2csv/lists"}