SRF05 for distance measurement, but the major problem is that this module will not differ a very close object and no object. So its impossible to say whether is there a very close object (under 2cm, in other words the sensor is in touch with an object) or isn't there any object in front of the sensor. How can I solve this problem?
If you want to know anything about a piece of hardware you have. It's very common to check the datasheet of that specific device.
I have found a Datasheet on the SRF005, which seems to be the same device as which you are using.
Within this datasheet you can check the details. Within these details you will see that the minimal distance is 3CM.
You can't measure under 3CM.
If you move the ranger 3CM back, you can safely assume, that if the ranger measures 3CM, you are effectively touching the other object.
(If you measure 4CM, it will be 1CM away from the front of your thing.)