help  with ultrasonic sensor code

I am using the following ultrasonic sensor.
http://www.sunrom.com/index.php?main_page=product_info&cPath=55&products_id=710
I tried to program it using arduino atmega8. First what i did is for the 5v pin in ultrasonic sensor i powered it using the digitalpin. Then i read the serial port and converted the buffer to ascii. but the problem what i get is values remaining constant though obstacles placed at different positions.here is the code what ive used:
int ser=0;
char s;
char st[10];
int pin=2;
int a;
int i=0;
int range;
void setup()
{
pinMode(pin,OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(pin,HIGH);
delay(1000);
digitalWrite(pin,LOW);
delay(1000);
/* for(i=0;i<10;i++)
{
s*=Serial.read();*
_ range=(s[0]-0x30)100;// I also tried these lines as given in the datasheet._
_ range=range+(s[1]-0x30)10;_
_ range=range+(s[2]-0x30)1;_
_ Serial.println(s
);
_
_
}_
_}/_

* if(Serial.available())*
* {*
* s=Serial.read();*
* if(i<10&&s!=‘c’&&s!=‘m’)*
{
_ st*=s;
i++;
}
i=0;
int val=atoi(st);
Serial.println(val);
}
}*_