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

Rasberry Pi 3B+ で LED を点灯

Last updated at Posted at 2019-10-20

はじめに

Rasberry Pi 3B+ でLED を点灯・消灯させるようにするが、まずはRasberry Pi 3B+ の端子に出力される電流や LED に流せる電流がどれぐらいなのかを見てみる。

用意するもの

  • Raspberry Pi 一式
  • LED(何色でもよい)
  • 抵抗(300Ω~1kΩ)
  • ジャンパーワイヤー(オスメス型2本)

LED の確認

アマゾネスから、『3mm 砲弾型の安いヤツ』を買ったので、どれぐらいの電流を通していいのかよくわからん。

LED にあまり大きな電気を通すと、LEDが劣化する。劣化するぐらいならいいけど、焼けて溶けて危ないwww
ということで、まずは LED にどれぐらい流していいのか、ググってみる。

なるほど、標準電流は 20mA、最大電流は 30mA なのね。
そして、電圧は 2.1V と記載している。

Raspberry Pi の出力

Raspberry Pi 3B+ の 3.3V 端子から電源を取るので、あと1.1V が必要となる
そして、Raspberry Pi 3B+ はどれぐらいの電流が流れるのかはいかに記載があった。

なるほど。 16mA と記載があった。(GPIO 全体で 50mA)

抵抗の計算

これで、どれぐらいの抵抗が必要かだせるね!
中学生で習った電気の公式に当てはめる。

V=v1 + v2 + ....

なので、抵抗部分は 1.1V となる。

E=IR

1.2 = 0.016(16mA) * R
R = 75

答えは 75 Ω

image.png

ぎりぎりいっぱいを攻めなくてもいいし、そんな抵抗持っていないから、持っている抵抗で「470Ω」を使う。

image.png

ちなみに簡単な回路図を書くのであれば、「 https://www.lucidchart.com/ 」が便利。

回路作成

上記の回路図を作るだけ。
以下のようになっている

image.png

黒色の配線がグランド、白色が3.3Vに接続している。

image.png

image.png

「Raspberry Pi の 端子配列」 は公式ページに掲載されている。

Raspberry Pi に電源を入れると、ぴかーーーー

image.png

0
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
0
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?