Is a resistor required between VCC and Data for my temperature sensor?

I'm using a TinyDuino with a Protoboard to measure temperature with a DS18B20 (here is the datesheet of ds18b20). I was following this tutorial but am not getting any valuable information back on the arduino when I try to read the value on the data port.

I just started reading around and it looks like most people put a resistor between VCC and Data. I'm fairly new to electronics, so 1) I don't know why the tutorial doesn't mention this and 2) I'm not sure what putting a resistor between those two would do?

Any help or explanation appreciated.

Edit Here's a schematic from a site which uses a resistor. The only difference is my board has VCC, one site said to connect VDD on the sensor to VCC, this one shows it connecting VDD to 5V. I'm not sure the difference

iceng3 months ago

Power the DS18B20 Vdd pin to +5V, Add a 4700 ohm 1/4 watt Resistor to the data DQ pin and to +5V

Click the pic to see the whole image...

DS18B20.bmp
iceng iceng3 months ago

While you are not actively talking to the DS18 you set your Duino pin to input and the resistor pulls the DQ pin high..

Should you pull the DQ pin low for 480us or longer the DS18 will be reset.

When you initially send a 33 Hex and listen the DS18 will respond with its 64 bit ID code which you have to store and use when addressing the DS18.

Downunder35m3 months ago

The only link I can see is for the datasheet...

To get any info to an input you need to supply a voltage to this input.
Depending on the type of Arduino this voltage needs to be between 3.3V and 5V at a max.
The sensor or whatever is used for the input needs the resistor to form a voltage divider.
With the sensor resistance low the input will then see a high voltage on the input or the other way around - depending how it is connected and what logic you need for your code.

I suggest to visit the Arduino Playground and to check some of the many examples for sensor inputs available there.
They all come circuits and code explanations so you should be able to get the required info quickly.

Of course there are also quite a few Instructables to the right of this page that should be able to answer your questions by examples.