{"id":18744624,"url":"https://github.com/wollewald/ina226_we","last_synced_at":"2025-04-12T21:32:38.049Z","repository":{"id":53106329,"uuid":"272006620","full_name":"wollewald/INA226_WE","owner":"wollewald","description":"An Arduino library for the INA226 current and power sensor module.","archived":false,"fork":false,"pushed_at":"2024-12-28T19:54:50.000Z","size":1200,"stargazers_count":42,"open_issues_count":2,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T15:54:29.327Z","etag":null,"topics":["arduino-library","current-sensor","ina226","power-sensor"],"latest_commit_sha":null,"homepage":null,"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/wollewald.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":"2020-06-13T12:42:29.000Z","updated_at":"2025-02-05T11:53:13.000Z","dependencies_parsed_at":"2024-08-01T20:25:19.853Z","dependency_job_id":"e32df578-47ce-4dea-b2c4-a9131f6db7e6","html_url":"https://github.com/wollewald/INA226_WE","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wollewald%2FINA226_WE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wollewald%2FINA226_WE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wollewald%2FINA226_WE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wollewald%2FINA226_WE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wollewald","download_url":"https://codeload.github.com/wollewald/INA226_WE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636210,"owners_count":21137399,"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":["arduino-library","current-sensor","ina226","power-sensor"],"created_at":"2024-11-07T16:15:27.876Z","updated_at":"2025-04-12T21:32:38.038Z","avatar_url":"https://github.com/wollewald.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# INA226_WE\nAn Arduino library for the INA226 current and power sensor module using a shunt of 0.1 Ohm. You can also use it for the INA226 IC and a resistor of your choice (example: Continuous_With_Resistor_Value.ino).\n\nIt allows to set current ranges, number of samples per measurement, conversion ranges. You can chose between continous, triggered and power down mode. Conversion ready and limit alert modes are also implemented. \n\nI attached a list of public functions and a fritzing scheme for the example sketches.\n\nIf you work through the examples I recommend to do it in the order of Continous -\u003e Triggered -\u003e PowerDown -\u003e Continous_Alert_Controlled -\u003e Limit_Alert -\u003e Limit_And_Conversion_Alert \n\nYou find further details here:\n\nhttps://wolles-elektronikkiste.de/ina226  (German)\n\nhttps://wolles-elektronikkiste.de/en/ina226-current-and-power-sensor  (English)\n\n\u003ch2\u003eNew since version 1.2.8: compatibility mode\u003c/h2\u003e\n\u003cp\u003eWhen I developed the library I did not choose the best enum names for the measure modes. E.g. \"POWER_DOWN\" is also used in INA219_WE. If you have problems then uncomment the line:\n\u003ccode\u003e #define INA226_WE_COMPATIBILITY_MODE_ \u003c/code\u003e\nin INA226_WE_config.h and use \"INA226_POWER_DOWN\" instead of \"POWER_DOWN\". Do the same for \"CONTINUOUS\" (-\u003e INA226_CONTINUOUS) AND TRIGGERED (-\u003e INA226_TRIGGERED).\n\u003c/p\u003e\n\n\u003ch2\u003eQuality of small shunt INA226 modules\u003c/h2\u003e\n\u003cp\u003eI have made mixed experience with INA226 modules which have a shunt smaller than 0.1 ohms. I experienced significant deviations from expected values. The reason is that some modules have poor traces and connections which result in an unwanted extra resistance. The most extreme I tested had an R010 shunt (= 0.01 ohms), but showed a resistance of 0.021 ohms. Accordingly, the measured values were more than double compared to the real currents. I short-circuit the shunt (see photo below), so that, theoretically, I should not measure any shunt voltages anymore. But I still measured shunt voltages and currents and these represented exactly the deviations my experiments before I short-cut the shunt.\u003c/p\u003e\n\n![20220816_114858](https://user-images.githubusercontent.com/41305162/184959284-186a5e20-1ff5-4c46-a6d9-7c0c68575f14.jpg)\n\n\n\u003cp\u003eBut there are also good modules. The one below has a shunt of 0.002 ohms and the results of my measurements were very close to the expected values.\u003c/p\u003e\n\n![INA226_R002](https://user-images.githubusercontent.com/41305162/184960401-85d419fa-e6c0-47f7-8dfe-79863ef0cc8b.png)\n\nHowever, you should not use its small In+ and In- connectors. For reasons I don't understand between these connectors and the shunt, there are 4.7 ohm resistors. These will give you far too high shunt voltages! Here, you find an example circuit: https://github.com/wollewald/INA226_WE/blob/71398a4181f23730260464bc452802549d34b333/INA226_red_module_2mohm_shunt_wiring.png \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwollewald%2Fina226_we","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwollewald%2Fina226_we","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwollewald%2Fina226_we/lists"}