It is impossible for us to tell how you have wired up your part from the photo
as we cannot see where both ends of the wires are going. The photo is too close.
Because of this we can only guess which is not good. Please post another photo
taken at a further distance so we can see both ends of the wires so we can
see all the wire connections.
Also when referring to pin numbers always use the same pin numbers as the manufacturer's
datasheet. i.e. in your case pin 1 is gnd, pin 2 is data, pin 3 is Voltage.http://datasheets.maximintegrated.com/en/ds/DS18B20.pdf
One thing that appears incorrect in the photo is the pullup resistor.
The resistor goes between the data line and voltage not the data line and ground.
In your photo the 18B20 pin 1 is on the left, pin 2 is the middle, pin 3 is on the right.
In this case I will admit that the datasheets provided by Dallas Semiconductor & maxim
tend to be confusing (at least to me) as they show a flat bottom view of the part vs a perspective view.
I've actually gotten the pins backwards myself a few times and when backwards the part
will get smoking hot when using external power.
One time when I realized that the pins had been wired backwards
I touched the top of the part to see if was warm, and it severely burned my finger
and left a nice semi-circle blister that lasted for weeks until it healed.
Amazingly, the part still worked when wired correctly.
The part has two ways it can wired up for power.
- external power
While the example schematic that TheCoolest provided may work with parasitic power,
it is not the recommended way of hooking up the part as noted in the datasheet.
The datasheet recommends grounding the voltage input pin on the part (pin 3)
when using parasitic power.