0

How can i use 2 temperature (ds18b20) sensors with raspberry pi? If I can, what gpio pins should I use and how? So what pin can i use instead of gpio 4...

Nicu Mih
  • 17
  • 1
  • 1
  • 5
  • Couple of things from a quick search here: (1) -- (2). I don't think they are direct answers to or duplicates of your question, but they do hopefully have some clues and implications. – goldilocks May 15 '16 at 17:11

1 Answers1

0

The Raspberry Pi supports one 1-wire bus (currently, in the future more may be supported).

Each 1-wire bus supports an arbitrary number of 1-wire sensors so you can add as many DS18B20 as you want.

By default the 1-wire bus is connected to GPIO 4 (pin 7).

You enable the 1-wire bus by adding the following line to /boot/config.txt.

dtoverlay=w1-gpio,gpiopin=4

If you want to use an alternate GPIO change 4 to the (Broadcom numbered) GPIO you want to use.

There are several examples of reading the DS18B20 if you use the site search engine.

joan
  • 71,014
  • 5
  • 73
  • 106