{"id":2074,"date":"2016-01-30T23:27:20","date_gmt":"2016-01-30T14:27:20","guid":{"rendered":"https:\/\/hack.gpl.jp\/?p=2074"},"modified":"2016-01-30T23:27:20","modified_gmt":"2016-01-30T14:27:20","slug":"post-2074","status":"publish","type":"post","link":"https:\/\/hack.gpl.jp\/2016\/01\/30\/post-2074.html","title":{"rendered":"INA226 \u3092 arduino nano \u3067"},"content":{"rendered":"

\u3082\u30461\u6708\u3082\u7d42\u308f\u308a\u3067\u3059\u306d\u3002\u306a\u3093\u3060\u304b\u901f\u304f\u6708\u65e5\u304c\u7d4c\u3064\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n

\u3055\u3066\u3001\u4eca\u65e5\u306f \u5148\u65e5\u4f5c\u3063\u305f INA226 \u306e\u96fb\u6d41\u96fb\u5727\u30bb\u30f3\u30b5\u30fc\u3092 I2C \u3067 arduino nano \u30af\u30ed\u30fc\u30f3\u306b\u3066\u8a08\u6e2c\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n

\u524d\u56de\u306e\u8abf\u67fb\u3067\u898b\u3064\u3051\u305f\u3001\u30dd\u30fc\u30e9\u30f3\u30c9\u306e\u30b5\u30a4\u30c8\u306b\u3044\u3044\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n

\n

Korneliusz Jarz\u0119bski\u306e\u30b5\u30a4\u30c8
Dwukierunkowy cyfrowy czujnik pr\u0105du\/mocy INA226<\/a><\/p>\n

github
Arduino-INA226
https:\/\/github.com\/jarzebski\/Arduino-INA226<\/a><\/p>\n<\/blockquote>\n

\u3053\u306eGitHub \u306esimple \u306e\u30bd\u30fc\u30b9\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u914d\u7f6e\u3057\u3001<\/p>\n

.\/INA226_simple\n\u251c\u2500\u2500 INA226.cpp\n\u251c\u2500\u2500 INA226.h\n\u2514\u2500\u2500 INA226_simple.ino<\/pre>\n

INA226.cpp \u306e\u8a18\u8ff0\u3092\u4ee5\u4e0b\u306b\u5909\u66f4\u300225mR \u306e\u30b7\u30e3\u30f3\u30c8\u62b5\u6297\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n

#include "INA226.h"\n::\nvoid setup() \n{\n::\n  \/\/ Calibrate INA226. Rshunt = 0.025 ohm, Max excepted current = 4A\n  ina.calibrate(0.025, 1);\n::<\/pre>\n

\u914d\u7dda\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002\u3061\u3087\u3063\u3068\u308f\u304b\u308a\u306b\u304f\u3044\u3067\u3059\u304c\u3001Arduino \u306e A5(SCL) \u3068 A4(SDA) \u3092\u3064\u306a\u3044\u3067\u3001GND \u3068 3.3V \u3092 VSS \u306b\u5165\u308c\u307e\u3059\u3002\u3042\u3068\u306f\u3001\u8ca0\u8377\u3092\u96fb\u6d41\u8a08\u6e2c\u306b\u30cf\u30a4\u30b5\u30a4\u30c9\u5074\u306b\u4ed8\u3051\u308b\u611f\u3058\u3067\u3059\u3002<\/p>\n

\"arduino_ina226\"<\/a> <\/p>\n

\u30b7\u30ea\u30a2\u30eb\u901a\u4fe1\u3092\u958b\u304f\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n

Initialize INA226\n-----------------------------------------------\nMode:                  Shunt and Bus, Continuous\nSamples average:       1 sample\nBus conversion time:   1.100ms\nShunt conversion time: 1.100ms\nMax possible current:  3.28 A\nMax current:           3.28 A\nMax shunt voltage:     0.08 V\nMax power:             117.96 W\n-----------------------------------------------\nBus voltage:   4.67875 V\nBus power:     0.01250 W\nShunt voltage: 0.00007 V\nShunt current: 0.00300 A\n\nBus voltage:   4.68125 V\nBus power:     0.01250 W\nShunt voltage: 0.00007 V\nShunt current: 0.00300 A\n\nBus voltage:   4.67750 V\nBus power:     0.01250 W\nShunt voltage: 0.00007 V\nShunt current: 0.00300 A<\/pre>\n

PC \u304b\u3089\u306eUSB \u96fb\u5727\u306f4.67V \u7a0b\u5ea6\u306e\u3088\u3046\u3067\u3059\u30023mA \u306712.5mW \u3068\u3044\u3046\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002\u3061\u3083\u3093\u3068\u8a08\u6e2c\u3067\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u306d\u3002<\/p>\n

arduino \u3060\u3068\u88c5\u5099\u304b\u3089LCD\u306a\u3069\u306b\u51fa\u3059\u7528\u9014\u3067\u4f7f\u3048\u305d\u3046\u3067\u3059\u306d\u3002\u30c7\u30fc\u30bf\u3092\u3069\u3053\u304b\u306b\u98db\u3070\u3059\u3082\u306e\u3067\u3042\u308c\u3070\u3001ESP8266 \u304c\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n

 <\/p>\n

IC \u56de\u8def\u306e\u96fb\u5727\u306f3.3V \u3067\u30825V \u3067\u3082OK\u3067\u3059\u3002LED\u306e\u8ca0\u8377\u3092 arduino \u306e 3.3V \u304b\u3089\u53d6\u3063\u3066\u8a08\u6e2c\u3057\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n

Initialize INA226\n-----------------------------------------------\nMode:                  Shunt and Bus, Continuous\nSamples average:       1 sample\nBus conversion time:   1.100ms\nShunt conversion time: 1.100ms\nMax possible current:  3.28 A\nMax current:           3.28 A\nMax shunt voltage:     0.08 V\nMax power:             117.96 W\n-----------------------------------------------\nBus voltage:   3.26875 V\nBus power:     0.00500 W\nShunt voltage: 0.00004 V\nShunt current: 0.00150 A\n\nBus voltage:   3.27000 V\nBus power:     0.00500 W\nShunt voltage: 0.00004 V\nShunt current: 0.00150 A\n\nBus voltage:   3.26875 V\nBus power:     0.00500 W\nShunt voltage: 0.00004 V\nShunt current: 0.00160 A<\/pre>\n

 <\/p>\n

\u3061\u3087\u3063\u3068\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3001\u30ec\u30b8\u30b9\u30bf\u30fc\u306e\u5024\u3092\u53d6\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n

Initialize INA226\n-----------------------------------------------\nMode:                  Shunt and Bus, Continuous\nSamples average:       1 sample\nBus conversion time:   1.100ms\nShunt conversion time: 1.100ms\nMax possible current:  3.28 A\nMax current:           3.28 A\nMax shunt voltage:     0.08 V\nMax power:             117.96 W\n-----------------------------------------------\nINA226_REG_CONFIG          (0x00):16679 ---\nINA226_REG_SHUNTVOLTAGE    (0x01):30 ---\nINA226_REG_BUSVOLTAGE      (0x02):3749 ---\nINA226_REG_POWER           (0x03):5 ---\nINA226_REG_CURRENT         (0x04):30 ---\nINA226_REG_CALIBRATION     (0x05):2048 ---\n-----------------------------------------------\nBus voltage:   4.68250 V\nBus power:     0.01250 W\nShunt voltage: 0.00007 V\nShunt current: 0.00300 A<\/pre>\n

\u30ec\u30b8\u30b9\u30bf\u30fc\u5024\u306f10\u9032\u3067\u3059\u3002\u30a2\u30d9\u30ec\u30fc\u30b8\u306e\u56de\u6570\u3068\u304b\u3082\u5b9a\u6570\u304c\u3042\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u306d\u3002
\n
\u7cbe\u5ea6\u306f\u30010.1mA  \u306e\u3088\u3046\u3067\u3059\u306d\u3002PCB \u306e\u3042\u307e\u308a\u90e8\u5206\u3067\u4f5c\u3063\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3082\u7d50\u69cb\u904a\u3079\u307e\u3057\u305f\u3002\u3042\u3068\u3001\u5c0f\u3055\u306a\u30d1\u30fc\u30c4\u306e\u534a\u7530\u4ed8\u3051\u306e\u7df4\u7fd2\u306b\u3082\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n

 <\/p>\n

\u25bc\u53c2\u8003\u30b5\u30a4\u30c8<\/p>\n

http:\/\/denshi-kousaku.fan.coocan.jp\/report030.html<\/a><\/p>\n

 <\/p>\n

\u25bc\u307e\u3068\u3081<\/p>\n

\u30fb\u30e9\u30a4\u30d6\u30e9\u30ea\u4fbf\u5229\uff01<\/p>\n

\u30fbINA226 \u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001arduino \u3067 i2c \u306b\u3066\u96fb\u6d41\u96fb\u5727\u3092\u7c21\u5358\u306b\u53d6\u308c\u308b<\/p>\n

\u30fb\u7cbe\u5ea6\u306f\u3001\u30b7\u30e3\u30f3\u30c8\u62b5\u6297\u6b21\u7b2c\u3067\u30010.025R \u3060\u30680.1mA\uff08100\u03bcA\uff09 \u306e\u7cbe\u5ea6\u306b\u306a\u308b\u3088\u3046\u3067\u3059<\/p>\n

\u30fbGND \u306fIC\u56de\u8def\u3068\u5171\u901a\u3067\u6e2c\u5b9a\u3067\u3001\u96fb\u5727\u3092\u6e2c\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001IC \u306e VBUS \uff18pin \u306b\u8a08\u6e2c\u96fb\u5727\u3092\u304b\u3051\u308b<\/p>\n

\u30fbLSB \u3068\u306f\u4e00\u822c\u7684\u306b\u306f\u3001\u6700\u4e0b\u4f4d\u30d3\u30c3\u30c8\u306e\u3053\u3068\u3067\u3001least significant bit \u306e\u982d\u6587\u5b57\u3002<\/p>\n

\u30fb\u3053\u308c\u306e\u5206\u89e3\u80fd\u529b\u306f16\u30d3\u30c3\u30c8\u306a\u306e\u3067\u30010.025R \u3060\u3068\u96fb\u6d41\u306f0.1mA \u3067\u96fb\u5727\u306f 1.25mV<\/p>\n

\u30fb\u3068\u308a\u3042\u3048\u305a\u3001\u5341\u5206\u306a\u7cbe\u5ea6\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u3082\u30461\u6708\u3082\u7d42\u308f\u308a\u3067\u3059\u306d\u3002\u306a\u3093\u3060\u304b\u901f\u304f\u6708\u65e5\u304c\u7d4c\u3064\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002 \u3055\u3066\u3001\u4eca\u65e5\u306f \u5148\u65e5\u4f5c\u3063\u305f INA226 \u306e\u96fb\u6d41\u96fb\u5727\u30bb\u30f3\u30b5\u30fc\u3092 I2C \u3067 arduino nano \u30af\u30ed\u30fc\u30f3\u306b\u3066\u8a08\u6e2c\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u524d\u56de\u306e\u8abf\u67fb\u3067\u898b\u3064\u3051\u305f\u3001 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[9,17,40,64],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":0,"uagb_excerpt":"\u3082\u30461\u6708\u3082\u7d42\u308f\u308a\u3067\u3059\u306d\u3002\u306a\u3093\u3060\u304b\u901f\u304f\u6708\u65e5\u304c\u7d4c\u3064\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002 \u3055\u3066\u3001\u4eca\u65e5\u306f \u5148\u65e5\u4f5c\u3063\u305f INA226 \u306e\u96fb…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/2074"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=2074"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/2074\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=2074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=2074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=2074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}