1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RaspberryPiとINA219で電流・電圧・電力を測定する

Posted at

Outline

INA219を用いて電流電圧電力を測定する。

Hardware setup

Raspberry-pi 配線 INA219
01 3.3V <-> VIN
03 SDA <-> SDA
05 SCL <-> SCL
09 GND <-> GND

Vin+ : 電源側の+端子
Vin- : 負荷側の+端子

GNDの接続
 ラズパイのGNDと計測したい負荷のGNDを接続しておく。

※コード内のゲイン調整等はOFFにしておく。

ディレクトリ構成

home/Current_measure_INA219
├ current_ina219_mp.py  #マルチプロセス化
├ current_ina219_mp2.py  #マルチプロセス化+グラフ化
├ ina219_simpletest.py #Adafruit_CircuitPython_INA219 サンプルコード
└iv_test.py #ブログ掲載のコード

install

sudo pip3 install pi-ina219

run

cd Current_measure_INA219
python3 current_ina219_mp.py

output sample

current_ina219_mp.pyの出力
Voltage (VIN+) :  9.229   V
Voltage (VIN-) :  9.224   V
Shunt Voltage  :  0.00535 V
Shunt Current  :  0.0535  A
Power Calc.    :  0.49348 W
Power Register :  0.538   W

Voltage (VIN+) :  9.253   V
Voltage (VIN-) :  9.248   V
Shunt Voltage  :  0.00539 V
Shunt Current  :  0.0539  A
Power Calc.    :  0.49847 W
Power Register :  0.498   W

以上

参考記事

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?