# YANP (Yet Another Noob Post) DS18B20 1Wire Probe

**URL:** <https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508>\
**Category:** Sensors\
**Created:** [February 10, 2025, 6:05pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508 "2025-02-10T18:05:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackmtl71](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jackmtl71/32/1195390_2.png) [@jackmtl71](https://forum.arduino.cc/u/jackmtl71)\
**Post date:** [February 10, 2025, 6:05pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/1 "2025-02-10T18:05:41Z")

</div>

Hi everyone, post #1 here (obviously).

I am seeking help for a problem which is likely very simple but I keep missing it for some reason.

I have spent most of my career in IT on the network and infrastructure side of things, and just recently got into Home Automation, IoT, SBCs, etc. which takes me here on my journey.

I have an ambitious (for me) project of automating Aquarium maintenance based on the output of several sensors (pH, temperature, TDS, water level, etc.)

I have to start somewhere so trying to set up the Water temperature sensor.

My HW:

- Arduino MKR WiFi 1010 Board
- DS18B20 Waterproof 1wire temperature probe
- 4.7kOhm resistor
- Breadboard and jumper wires

SW enviroment

- Arduino IDE 2.3.4 on Win11
- Latest Onewire library
- Latest DallasTemperature library
- Board firmware upgraded to 2.0

I have everything wired up as per examples and recommendations, yet, no dice­.

I am powering up the probe with 3.3V from the board, GND is connected, DataPin also connected to the board, 4.7kOhm pull-up resistor between 3.3V and Data (DQ) pin.

Using a multimeter, I can measure up 3.3V between power and GND pins on the probe, and between DQ and GND. I can measure the 4.7kOhm resistance between DQ and PWR pins as well.

The board does not seem to detect the probe and the reading is a consistent -127C. Also querying the wire for the number of connected probes returns 0.

I have tried switching wires for Data pin (and update the code appropriately), changing physical probes, solidifying connections and contacts, yet it just won't work.

I've been at it to make it work for some time now and thought I`d seek help before giving up and just crawling into a hole.

Here is the code I am using. (DQ connected to pin 5 and VCC on pin 8)

```arduino
#include <OneWire.h>
#include <DallasTemperature.h>
int numberOfDevices = 1;
// Broche DQ du capteur = 5, DC 3V3 = 8
#define ONE_WIRE_BUS 5
const int BrocheVCC = 8;

// Créer un objet OneWire
OneWire oneWire(ONE_WIRE_BUS);

// Passer l'objet OneWire à Dallas Temperature. 
DallasTemperature sonde(&oneWire);

void setup() {
  // Initialiser la communication série
  Serial.begin(9600);

  // Démarrer la librairie de température
  sonde.begin();

  // Alimenter la sonde
  pinMode(BrocheVCC, OUTPUT);
  digitalWrite(BrocheVCC, HIGH);

  
}

void loop() {
  // Demander aux capteurs de mesurer la température
  sonde.requestTemperatures(); 

  // Afficher la température en degrés Celsius
  Serial.print("Temperature : ");
  Serial.print(sonde.getTempCByIndex(0)); 
  Serial.println(" °C");
// Grab a count of devices on the wire
  numberOfDevices = sonde.getDeviceCount();
  Serial.print(numberOfDevices);
  Serial.println(" devices found"); 
  
  delay(1000); 
}

```

I appreciate any help anyone can provide.

Thanks,

Hugo

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [February 10, 2025, 6:18pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/2 "2025-02-10T18:18:35Z")

</div>

Hi Hugo,

Did you try an example sketch from the Dallas Temperature library?

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [February 10, 2025, 6:21pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/3 "2025-02-10T18:21:12Z")

</div>

> [@jackmtl71](#):
>
> -127C.

That is an error code

```cpp
#define DEVICE_DISCONNECTED_C -127

```

1. recheck your wires
2. connect the DS18B20 to a real 3.3V pin as the IO pin might not be able to provide enough current?

---

<div class="post-metadata">

**Author:** ![jackmtl71](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jackmtl71/32/1195390_2.png) [@jackmtl71](https://forum.arduino.cc/u/jackmtl71)\
**Post date:** [February 10, 2025, 7:27pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/4 "2025-02-10T19:27:20Z")

</div>

I will try that. Though I am getting 3.3V reading on the multimeter.

Téléchargez [Outlook pour iOS](https://aka.ms/o0ukef)

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [February 10, 2025, 7:33pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/5 "2025-02-10T19:33:12Z")

</div>

> [@jackmtl71](#):
>
> Though I am getting 3.3V reading on the multimeter.

Be aware the current may peak when conversion starts.

---

<div class="post-metadata">

**Author:** ![jackmtl71](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jackmtl71/32/1195390_2.png) [@jackmtl71](https://forum.arduino.cc/u/jackmtl71)\
**Post date:** [February 10, 2025, 9:46pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/6 "2025-02-10T21:46:52Z")

</div>

Hi Paul, yes I did, same results. Leaning towards unstable wiring, especially around the threaded probe wires and the resistance/breadboard.

What is generally recommended for parts like these? Alligator clips?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [February 10, 2025, 9:56pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/7 "2025-02-10T21:56:53Z")

</div>

[![](https://europe1.discourse-cdn.com/arduino/original/4X/a/f/e/afe52ddb44175d29d18cd4328d1454a48bda22ac.jpeg "How to use our pin crimpers with our servo plugs and pins") ](https://www.youtube.com/watch?v=oSAD4ME0uXQ)

You can also get male crimp pins which are ideal for breadboard use.

 ![10fc1cb1-e805-452d-ae6a-f4137245aadf_600c6b41-1506-4834-b01e-0c9db587fb0c_774x774](https://europe1.discourse-cdn.com/arduino/original/4X/a/2/8/a285c6e4c64c228225cb403733b995ffd78f0f87.jpeg)

---

<div class="post-metadata">

**Author:** ![jackmtl71](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jackmtl71/32/1195390_2.png) [@jackmtl71](https://forum.arduino.cc/u/jackmtl71)\
**Post date:** [February 10, 2025, 10:04pm UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/8 "2025-02-10T22:04:14Z")

</div>

Awesome tip!!! Thanks Paul!

---

<div class="post-metadata">

**Author:** ![jackmtl71](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jackmtl71/32/1195390_2.png) [@jackmtl71](https://forum.arduino.cc/u/jackmtl71)\
**Post date:** [February 11, 2025, 12:03am UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/9 "2025-02-11T00:03:46Z")

</div>

Well thanks for giving me the confidence to push forward. I redid all of the connections, secured the resistor, was still getting the same results.

I moved the power to the 5V pin and instantly started getting temperature readings.

I’ll have to dig deeper into why that isn’t working but for now, at least I can push forward on my project.

Thanks guys.

Hugo

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [February 11, 2025, 6:21am UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/10 "2025-02-11T06:21:54Z")

</div>

have a look at [DS18B20 Temperature Sensor Module Kit](https://www.amazon.co.uk/dp/B09G2C3JJ9?ref=ppx_yo2ov_dt_b_fed_asin_title) which include an adapter with onboard pullup resistor  
works OK with ESP32 microcontrollers and the DallasTemperature library  
EDIT: powered from 3.3V

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [February 11, 2025, 6:29am UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/11 "2025-02-11T06:29:38Z")

</div>

> [@jackmtl71](#):
>
> moved the power to the 5V pin and instantly started getting temperature readings.

DS18B20 should work fine at 3.3V:

 ![Screenshot_20250211-062739-815](https://europe1.discourse-cdn.com/arduino/original/4X/f/5/7/f57e92c2fb95c966202cc00d894fbc542d049c9b.png)

I suspect you have a clone/fake sensor which doesn't meet the official specs.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 10, 2025, 6:30am UTC](https://forum.arduino.cc/t/yanp-yet-another-noob-post-ds18b20-1wire-probe/1352508/12 "2025-08-10T06:30:21Z")

</div>

Closed on August 10, 2025, 6:30am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
