树莓派蜂鸣器连接图
时间: 2023-07-08 19:14:43 浏览: 183
树莓派系统有源蜂鸣器模块
树莓派蜂鸣器连接图如下:
```
+-----+-----+---------+------+---+ Model B+ ---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5V | | |
| | | GND | | | 5 || 6 | | | 0v | | |
| 3 | 9 | SCL.1 | OUT | 1 | 7 || 8 | 1 | OUT | TxD | | |
| | | GND | | | 9 || 10 | 1 | OUT | RxD | | |
| 4 | 7 | GPIO. 7 | OUT | 1 | 11 || 12 | 1 | OUT | GPIO. 1 | 1 | 17 |
| | | GND | | | 13 || 14 | | | 0v | | |
| 5 | 21 | GPIO.21 | OUT | 0 | 15 || 16 | 1 | OUT | GPIO.22 | 22 | 6 |
| 6 | 22 | GPIO.22 | OUT | 0 | 17 || 18 | | | 3.3v | | |
| 7 | 11 | GPIO.11 | OUT | 0 | 19 || 20 | | | GPIO.27 | 27 | 13 |
| | | GND | | | 21 || 22 | | | GPIO.28 | 28 | 19 |
| 8 | 10 | GPIO.10 | OUT | 0 | 23 || 24 | 1 | OUT | GPIO.23 | 23 | 11 |
| | | GND | | | 25 || 26 | 1 | OUT | GPIO.24 | 24 | 9 |
| 9 | 13 | GPIO.13 | OUT | 0 | 27 || 28 | | | GPIO.29 | 29 | 5 |
| 10 | 12 | GPIO.12 | OUT | 0 | 29 || 30 | | | 0v | | |
| 11 | 14 | GPIO.14 | OUT | 0 | 31 || 32 | | | GPIO.26 | 26 | 15 |
| 12 | 15 | GPIO.15 | OUT | 0 | 33 || 34 | | | 0v | | |
| 13 | 28 | GPIO.28 | IN | 0 | 35 || 36 | | | GPIO.27 | 27 | 13 |
| 14 | 29 | GPIO.29 | IN | 0 | 37 || 38 | | | GPIO.28 | 28 | 19 |
| | | GND | | | 39 || 40 | | | GPIO.30 | 30 | 16 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+ Model B+ ---+------+---------+-----+-----+
```
假设我们将蜂鸣器连接到树莓派的 GPIO4 引脚上,连接方式如下:
- 将蜂鸣器的一个引脚连接到树莓派的 GPIO4 引脚上;
- 将蜂鸣器的另一个引脚连接到树莓派的 GND 引脚上。
接线图示意图如下:
```
+--------------------------+
| |
| Raspberry Pi |
| |
| +-----+ |
| | | |
| | | |
| | | |
| | | |
| | | |
| +-----+ |
| | | |
| | | |
| | | |
| | | |
| | | |
| +-----+ |
| 3V3 | |
| GND | |
| GPIO4|----[Buzzer]------|
| ... | |
| | |
+--------------------------+
```
注意:连接蜂鸣器时,需要注意蜂鸣器的极性,如果不正确,可能会导致蜂鸣器发不出声音。
阅读全文