2
1

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.

Raspberry Pi GPIO端子配列の確認方法

2
Posted at

Raspberry PiのGPIOピンを理解する

この記事は、GPIOピンの基本的な役割、種類、そして混乱しやすいピンの命名規則についてのメモです


GPIOピンとは何か?

GPIOは「General Purpose Input/Output(汎用入出力)」の略です。Raspberry Piと外部の電子部品(LED、センサー、モーターなど)を繋ぎ、制御するための端子(ピン)。

GPIOピンでできること

  • デジタル出力:LEDを点灯させたり、リレーを動かしたりする
  • デジタル入力:スイッチやセンサーからの信号を読み取る
  • 通信:I2C、SPI、UARTなどの通信プロトコルを使って外部デバイスとデータをやり取り

GPIOピンの種類

Raspberry PiのGPIOピンヘッダーには、以下のようなピンがある

  • 3.3V電源ピン:3.3Vの電圧を供給
  • 5V電源ピン:5Vの電圧を供給
  • GND(グラウンド)ピン:電源の基準点
  • GPIOピン:入出力に使う汎用ピン

ピンの命名規則:BCMとBOARD

GPIOピンの番号をプログラムで指定する際、**「BCM」と「BOARD」**という2つの命名規則がある。

BCM(Broadcom)番号

  • Raspberry PiのSoC上のGPIO番号に基づく
  • Pythonなどのソフトウェアで標準的に使用
  • 物理的なピン位置とは一致しない

BOARD番号

  • Raspberry Piの物理的なピンの並び順に基づく
  • ブレッドボードでの配線に便利
  • 直感的にピン位置を把握できる

Raspberry Pi Zero2W のGPIO端子配列を確認する

コマンド

pinout

次のように表示される
"()"内は BOARD番号(物理ピン)、GBIO17はBCM番号

Description        : Raspberry Pi Zero2W rev 1.0
Revision           : 902120
SoC                : BCM2837
RAM                : 512MB
Storage            : MicroSD
USB ports          : 1 (of which 0 USB3)
Ethernet ports     : 0 (0Mbps max. speed)
Wi-fi              : True
Bluetooth          : True
Camera ports (CSI) : 1
Display ports (DSI): 0

,--oooooooooooooooooooo---.
|  1ooooooooooooooooooo J8|
---+     +---+  PiZero2W  c|
 sd|     |SoC|   Wi V1.0  s|
---+     +---+   Fi       i|
| hdmi            usb pwr |
`-|  |------------| |-| |-'


J8:
   3V3  (1) (2)  5V    
 GPIO2  (3) (4)  5V    
 GPIO3  (5) (6)  GND   
 GPIO4  (7) (8)  GPIO14
   GND  (9) (10) GPIO15
GPIO17 (11) (12) GPIO18
GPIO27 (13) (14) GND   
GPIO22 (15) (16) GPIO23
   3V3 (17) (18) GPIO24
GPIO10 (19) (20) GND   
 GPIO9 (21) (22) GPIO25
GPIO11 (23) (24) GPIO8 
   GND (25) (26) GPIO7 
 GPIO0 (27) (28) GPIO1 
 GPIO5 (29) (30) GND   
 GPIO6 (31) (32) GPIO12
GPIO13 (33) (34) GND   
GPIO19 (35) (36) GPIO16
GPIO26 (37) (38) GPIO20
   GND (39) (40) GPIO21

For further information, please refer to https://pinout.xyz/
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?