1-WIRE At Raspberry Pi GPIO Pinout
- 3v3 Power1
- GPIO 2 (I2C1 SDA)3
- GPIO 3 (I2C1 SCL)5
- GPIO 4 (Data)7
- Ground9
- GPIO 1711
- GPIO 2713
- GPIO 2215
- 3v3 Power17
- GPIO 10 (SPI0 MOSI)19
- GPIO 9 (SPI0 MISO)21
- GPIO 11 (SPI0 SCLK)23
- Ground25
- GPIO 0 (EEPROM SDA)27
- GPIO 529
- GPIO 631
- GPIO 13 (PWM1)33
- GPIO 19 (PCM FS)35
- GPIO 2637
- Ground39
- 5v Power2
- 5v Power4
- Ground6
- GPIO 14 (UART0 TX)8
- GPIO 15 (UART0 RX)10
- GPIO 18 (PCM CLK)12
- Ground14
- GPIO 2316
- GPIO 2418
- Ground20
- GPIO 2522
- GPIO 8 (SPI0 CE0)24
- GPIO 7 (SPI0 CE1)26
- GPIO 1 (EEPROM SCL)28
- Ground30
- GPIO 12 (PWM0)32
- Ground34
- GPIO 1636
- GPIO 20 (PCM DIN)38
- GPIO 21 (PCM DOUT)40
Legend
Orientate your Pi with the GPIO on the right and the HDMI port(s) on the left.
- GPIO (General Purpose IO)
- SPI (Serial Peripheral Interface)
- I2C (Inter-integrated Circuit)
- UART (Universal Asynchronous Receiver/Transmitter)
- PCM (Pulse Code Modulation)
- Ground
- 5v (Power)
- 3.3v (Power)
- 3v3 Power
- 5v Power
- Ground
- 1-WIRE
- DPI
- GPCLK
- I2C
- JTAG
- PCM
- PWM
- SDIO
- SPI
- UART
- WiringPi
Click here to browse pinouts for HATs & pHATs »
W1-GPIO - One-Wire InterfaceOne-wire is a single-wire communication bus typically used to connect sensors to the Pi.
The Raspberry Pi supports one-wire on any GPIO pin, but the default is GPIO 4.
Enable via config.txt
To enable the one-wire interface you need to add the following line to /boot/firmware/config.txt, before rebooting your Pi:
dtoverlay=w1-gpioor
dtoverlay=w1-gpio,gpiopin=xif you would like to use a custom pin (the default is GPIO 4)
Enable manually
Alternatively you can enable the one-wire interface on demand using raspi-config, or the following:
sudo modprobe w1-gpioNewer kernels (4.9.28 and later) allow you to use dynamic overlay loading instead, including creating multiple 1-Wire buses to be used at the same time:
sudo dtoverlay w1-gpio gpiopin=4 pullup=0 # header pin 7 sudo dtoverlay w1-gpio gpiopin=17 pullup=0 # header pin 11 sudo dtoverlay w1-gpio gpiopin=27 pullup=0 # header pin 13once any of the steps above have been performed, and discovery is complete you can list the devices that your Raspberry Pi has discovered via all 1-Wire buses (by default GPIO 4), like so:
ls /sys/bus/w1/devices/Using w1-gpio on the Raspberry Pi typically needs a 4.7 kΩ pull-up resistor connected between the GPIO pin and a 3.3v supply (e.g. header pin 1 or 17). Other means of connecting 1-Wire devices to the Raspberry Pi are also possible, such as using i2c to 1-Wire bridge chips.
Details
|
Từ khóa » W1-gpio Documentation
-
Kernel Driver W1-gpio
-
Pstolarz/w1-gpio-cl: Command Line Configured Kernel Mode ... - GitHub
-
W1-gpio.txt - Documentation - Elixir Bootlin
-
[PDF] Linux W1 Documentation
-
1-wire Master Drivers — The Linux Kernel Documentation
-
[38/54] Dt-bindings: W1: Convert 1-Wire GPIO Binding To A Schema
-
Raspberry Pi Tutorial Series: 1-Wire DS18B20 Sensor - Waveshare
-
[OpenWrt Wiki] 1-wire Bus
-
1-wire Bus Since Version 21.02.0 - OpenWrt Forum
-
Communicating With One-Wire Devices
-
[v4,1/5] Dt-bindings: W1: Document Generic Onewire Bindings
-
[PATCH] W1: W1-gpio: Convert To Use GPIO Descriptors
-
How To Use The 1-WIRE Bus On Acqua SOM - Acme Systems