user28154: I'm quite new with the electronics part of Arduino, but I thought that this was the basic way to get the DS18B20 temperature device hooked up. However, I can't detect it in my program using OneWire and DallasTemperature.
This is an image of my connections:

Basically my approach was like this:
Connect ground on ground on the DS18B20.
Connect 5V from the Arduino to both DQ from the DS18B20 and Port 2 on my Arduino (the two yellow cables).
Between the 5V and the two yellow cables, I connected a 4.7K resistor.
Vdd on the DS18B20 is not connected to anything.
Anyone have any idea why this is not working as expected for me?
Thanks in advance!

user10794: 
Vdd on the DS18B20 is not connected to anything.

According to the datasheet:

When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground



Connect 5V from the Arduino to both DQ from the DS18B20 and Port 2 on my Arduino (the two yellow cables).

That means port 2 would always be high, right?

According to Temperature Sensor DS18B20 this is the wiring for non-parasitic power:

If you want the two-wire version (parasitic power) it would be:


28154: <p>I'm quite new with the electronics part of Arduino, but I thought that this was the basic way to get the DS18B20 temperature device hooked up. However, I can't detect it in my program using OneWire and DallasTemperature.</p>

<p>This is an image of my connections:</p>

<p><a href="https://i.stack.imgur.com/KXrk0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KXrk0.jpg" alt="enter image description here"></a></p>

<p>Basically my approach was like this:</p>

<p>Connect ground on ground on the DS18B20.
Connect 5V from the Arduino to both DQ from the DS18B20 and Port 2 on my Arduino (the two yellow cables).
Between the 5V and the two yellow cables, I connected a 4.7K resistor.
Vdd on the DS18B20 is not connected to anything.</p>

<p>Anyone have any idea why this is not working as expected for me?</p>

<p>Thanks in advance!</p>
 10794: <blockquote>
  <p>Vdd on the DS18B20 is not connected to anything.</p>
</blockquote>

<p>According to the datasheet:</p>

<blockquote>
  <p>When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground</p>
</blockquote>

<hr>

<blockquote>
  <p>Connect 5V from the Arduino to both DQ from the DS18B20 and Port 2 on my Arduino (the two yellow cables).</p>
</blockquote>

<p>That means port 2 would always be high, right?</p>

<hr>

<p>According to <a href="https://arduino-info.wikispaces.com/Brick-Temperature-DS18B20?responseToken=b846613ae07121485e0bd622a9bcd111" rel="nofollow noreferrer">Temperature Sensor DS18B20</a> this is the wiring for non-parasitic power:</p>

<p><a href="https://i.stack.imgur.com/9JahP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9JahP.jpg" alt="Non parasitic power"></a></p>

<p>If you want the two-wire version (parasitic power) it would be:</p>

<p><a href="https://i.stack.imgur.com/irbaD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/irbaD.jpg" alt="Parasitic power"></a></p>
