DS18S20 temperature sensor , reading problem.

damir27:
the sensor has 2 pins only

Then it probably isn't a DS18B20. Even if it is, get one with three pins. I'm sure you will then find things a lot easier, and well worth the expense.