1
0

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 3 years have passed since last update.

Jetsonでお部屋の温度、湿度、気圧を測定

Last updated at Posted at 2021-01-24

はじめに

Jetson AGX XavierとAmazonで購入できる800円程度の気象センサを使って、温度、湿度、気圧を測ってみました。

前提

IMG_1304.png

ハードウェア接続

基板 Pin 機能 Jetson Pin
VCC 電源3.3V 電源3.3V
GND GND GND
SCL クロック入力 5
SDA データ入力 3
CSB チップセレクト 電源3.3V
SDO データ出力 GND

インストール

$ sudo apt install -y python-pip
$ pip install smbus2
$ git clone https://github.com/SWITCHSCIENCE/BME280
$ cd BME280/Python27

動作確認

$ vi bme280_sample.py
...
bus_number = 8 # 書き換える
...
$ python2 bme280_sample.py
temp : 23.21 ℃
pressure : 1008.06 hPa
hum :  38.78 %

それっぽい値が読めています。

補足

アドレスは0x76(SDO=GNDの場合)で、Bus 8に接続されていますが、下記のようにSMBus Quick Commandがサポートされていないので、
i2cdetect -y 8としても見つかりません。

$ i2cdetect -F 8

Functionalities implemented by /dev/i2c-8:
I2C                              yes
SMBus Quick Command              no
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

以下のコマンドでReadできれば正常に接続されているでしょう(内容未確認)。

$ i2cdump -y 8 0x76
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 94 50 89 52 60 41 b9 06 50 6f c8 67 32 00 2b 8e    ?P?R`A??Po?g2.+?
90: 1a d6 d0 0b 39 20 ab ff f9 ff ac 26 0a d8 bd 10    ????9 ?.?.?&????
a0: 00 4b e5 00 00 00 00 00 00 00 00 00 33 00 00 c0    .K?.........3..?
b0: 00 54 00 00 00 00 60 02 00 01 ff ff 1f 4e 08 00    .T....`?.?..?N?.
c0: 00 40 27 ff 00 00 00 00 01 00 00 00 00 00 00 00    .@'.....?.......
d0: 60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    `...............
e0: 00 71 01 00 12 2f 03 1e 3f 41 ff ff ff ff ff ff    .q?.?/???A......
f0: ff 00 01 0c 27 00 00 4f fd 00 81 78 00 67 07 80    ..??'..O?.?x.g??
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?