Trouble wiring a Dalla 18B20 to Arduino D1 Mini
-
@hard-shovel It worked! I used pin 4 on the D1 Mini and did direct power and i'm reading temps now! Thank you so much! One final question about the pinouts. Is there some kind of guide that you know of to determine which pins to use? i.e. how did you know how to use pin 4 on the D1 Mini but keep 2 specified in the sketch? Please ELI5.
@sirzlimz There are lots of pinout diagrams on the web like below.
For the the arduino use the GPIO number as the pin number
ie
GPIO5 --- marked D1 in Arduino IDE use 5
GPIO13-marked D7
-
@sirzlimz I have just tried this circuit out myself on a D1 module and the using the library listed from milesburton it does not work on the ESP8266 in parasitic mode.
If you move the jumper over for powered mode it will work fine.Trying on an Arduino nano with the same device and breadboard it works fine in both modes.
So testing again and reading the data sheet on the DS18B20 and the section on "Powering the DS18B20" page 7 some insight can be obtained.
Anyway a quick fix is to put another 4.7K resistor in parallel with the first and the system should work with one sensor,
so two possible ways of connection are shown
Powered Mode with the Jumper to 5V, Recommended method, I always power my DS18B20's
This works with multiple devices, (I have just tried with 10 devices on the D1 [with multiple device sketch])

Parasitic Mode with two 4.7K resistors (this trick only works with one device on the bus)

@hard-shovel Parasitic power mode uses only two wires i.e. Data & GND, the sensor "parasitically" takes power from the Data line. In the second picture, VCC is connected as well so it might not be the parasitic power mode.
-
@hard-shovel Parasitic power mode uses only two wires i.e. Data & GND, the sensor "parasitically" takes power from the Data line. In the second picture, VCC is connected as well so it might not be the parasitic power mode.
@prakhar-birla Please explain how the DS18B20 will not be parasitic mode when it only has GND connected on pins 1 and 3 and data (with pull-up) on pin 2?