1

This is in reference to this thread where they are all using GPIO4. I've got A0 of an arduino going into an arduino nano (using firmata) and then into GPIO4 since it appears to be the only pin that'll work. I have tried other pins and noticed that other pins do not work and I was wondering if someone could explain why only GPIO4 works for this?

Thanks guys, Dave

closed as unclear what you're asking by Milliways, Patrick Cook, Jacobm001, Gene, Dmitry Grigoryev Feb 10 '17 at 14:16

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Please compose the question so that readers don't have to click and read something else to understand what you ask about. – techraf Jan 27 '17 at 5:49
  • Because that's the only pin providing GCLK signal. For the same reason you can only use GPIO11 as SPI clock. – Dmitry Grigoryev Feb 10 '17 at 14:15
2

The DS18B20 is a (Dallas) 1-wire bus temperature sensor. It uses one wire for control and data.

Early versions of Pi software only allowed for the 1-wire bus to be started on GPIO4. You are looking at old or incomplete tutorials.

Recent versions of Pi software allow the 1-wire bus to started on any spare GPIO. There is still the limit of just one bus though.

To configure the 1-wire bus use device tree.

See /boot/overlays/README for details.

Name:   w1-gpio Info:   Configures the w1-gpio Onewire interface module.
        Use this overlay if you *don't* need a GPIO to drive an external
        pullup.
Load:   dtoverlay=w1-gpio,<param>=<val>
Params: gpiopin                 GPIO for I/O (default "4")
        pullup                  Non-zero, "on", or "y" to enable the parasitic
                                power (2-wire, power-on-data) feature

E.g. to use GPIO12 (pin 32) use

dtoverlay=w1-gpio,gpiopin=12

Not the answer you're looking for? Browse other questions tagged or ask your own question.