Arduino Uno, shutdown output's problem. SOLVED

Hi, I need help concerning a problem that I have with my arduino Uno.

I’m using a ds18b20 temperature sensor:

And the OneWire library.

Code just below:

#include <OneWire.h>

int SensorPin = 13; //Our sensor is connected to digital pin 10


//Initiate OneWire communication
OneWire ds(SensorPin);

void setup(void) {
//Initiate serial communication with our computer
  Serial.begin(9600);
  digitalWrite(8,HIGH);
}

void loop(void) {

float T = readT(); // call function to read from sensor
Serial.print("Temperature is: "); // print out results to us
Serial.print(T);
Serial.println(" deg.C"); // print out results to us
delay(750);

}

float readT(){
//returns the temperature from our sensor

byte data[12];
byte addr[8];

if ( !ds.search(addr)) {
ds.reset_search();
return -300; // if there is no sensor on OneWire Bus, return -300 value
}

ds.reset();
ds.select(addr);
ds.write(0x44,1); // tell sensor to start converting
ds.reset();
ds.select(addr);
ds.write(0xBE); // tell sensor to start sending data

for (int i = 0; i < 9; i++) { // we receive data in this loop
data[i] = ds.read();
}

ds.reset_search();

byte MSB = data[1];
byte LSB = data[0];

float raw = ((MSB << 8) | LSB); // move MSB left for 8 spaces, join that with LSB
float realTempC = raw / 16; // move decimal point left for 4 spaces, result our temperature
return realTempC;

}

When I connect the vdd on the +5V or +3.3V arduino’s pin, there’s no problem, I can read the temperature, but when I connect it to a high level output arduino’s pin, this output pin start oscillating ( syncro with the data.)
I tried to put a 10uA capacitor between the vdd and the ground, but the vdd shuts to a 1.75V.
I’ve done current measures and in the worse case the circuit consumes 1mA, and arduino’s output maximum rate’s 40 mA.

Thanks for reading and any help will be appreciated.

but when I connect it to a high level output arduino's pin,/quote]

Its always best to comment your code lines. Show us how the circuit is wired.

digitalWrite(8,HIGH); did you make 8 an o/p or are you using this as i/p with pullups?

Problem SOLVED.

pin 8 was the VDD.

The problem was that I forgot to write:

pinMode(8, OUTPUT);

Thanks.