DS18S20 temperature sensor , reading problem.

Gee, I thought OP said, with extraordinary clarity

the sensor has 2 pins only

Where is the guessing with that?
The fact that the three pin device can be wired as a two pin device seems to be just a silly red herring when your "sensor has two pins only"