IR obstacle detection sensor not working

I bought an IR detection sensor to test it I used a code given on the internet, initially it worked fine it was showing that it has detected an obstacle or not. After that I interfaced this IR sensor and a Micro servo motor initially it worked well but when I powered it for the second time the IR sensor started false detecting. I removed the servo motor and tested the IR sensor again with the code which I initially found on the internet and now it is always detecting some obstacle ,the obstacle detected LED doesn't turn off. I've tried re-interfacing , moving its location but nothing seems to work. Did the IR obstacle detection sensor got burnt ,were there any consideration while interfacing with servo motor which I didn't take into account?

You will have to tell us which sensor and motor you bought (preferably links to the datasheets), show drawings how you connected everything (including GND and 5V and 3.3V lines, photo of hand drawn one is fine) and show your code.

Most important is the kind of IR sensor, next comes the kind of obstacle in front of the sensor. Please explain.