{"id":20195463,"url":"https://github.com/charkster/ina219","last_synced_at":"2026-04-11T20:07:49.877Z","repository":{"id":158988108,"uuid":"166907732","full_name":"charkster/INA219","owner":"charkster","description":"INA219 Log Battery Voltage and Charge Current to file","archived":false,"fork":false,"pushed_at":"2022-10-22T23:19:16.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T19:27:22.195Z","etag":null,"topics":["adc","ina219","raspberry-pi"],"latest_commit_sha":null,"homepage":"","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/charkster.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":"2019-01-22T01:45:21.000Z","updated_at":"2022-04-08T03:25:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"5921f9db-9a16-4cef-a95b-d508d3a97fc5","html_url":"https://github.com/charkster/INA219","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FINA219","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FINA219/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FINA219/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charkster%2FINA219/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charkster","download_url":"https://codeload.github.com/charkster/INA219/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629773,"owners_count":19993710,"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":["adc","ina219","raspberry-pi"],"created_at":"2024-11-14T04:17:29.576Z","updated_at":"2026-04-11T20:07:44.856Z","avatar_url":"https://github.com/charkster.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![picture](https://cdn-learn.adafruit.com/assets/assets/000/002/452/medium800/adafruit_products_ID904_LRG.jpg)\n\nINA219 Log Battery Voltage and Charge Current to file\n\nThese 3 python files will allow you to use a INA219 board (like the ones on adafruit and amazon) to log voltage and current to both the screen and a file once every second.\nI use this to monitor my batteries as they charge.\n\nINA219.py          \u003c- this is the python class to communicate with the INA219 board\n\nrpi_i2c_new.py     \u003c- this is the raspberry pi I2C that adds additional debugging and has bit field operations\n\nina219_example2.py \u003c- this is the top-level script that initializes the INA219 board and defines the file to log to\n\nI replace the sense resistor on my INA219 boards with a 10milli ohm resistor as to not have a large voltage drop when charge currents reach 2-3amps.\n\nTo obtain the needed calibration value (see the cal_device routine) I use a 40 Ohm 2W resistor and use a 5V power supply. I modify the calibration code until I see the proper 125milli amp result.\nManual calibration allows you to get the best calibration code for your specific sample resistor.\n\nTo stop the logging just press control-c.\n\nFor measuring charge current for a phone I cut a usb c type cable to put the VBUS wires through the INA219 terminal. A connection to GND is needed for the voltage measurement.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fina219","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharkster%2Fina219","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharkster%2Fina219/lists"}