Make ir sensor work.

I bought an it obstacle detector sensor which has 3 pins, V, out, gnd. How can I program it? I only know that v pin goes in 5V, gnd in ground and out pin in a pmw pin. Please help.

First you need to tell us what model of sensor it is, preferably with a link to its datasheet.

"http://www.amazon.in/gp/aw/d/B00MBXTA0A/ref=mp_s_a_1_1?qid=1423064946&sr=8-1&pi=SX200_QL40&keywords=ir+obstacle+sensor&dpPl=1&dpID=41%2BmKpSF8VL&ref=plSrch". Here is the link.

Ok well that doesn't say much.

But it seems you just need to digitalRead the pin to which you connect the output. It will change as the object gets close.

I see it says you can configure it to be high when the object's near or low when it's near, whichever is more convenient for you. (AH or AL = active high or active low)

I'd be inclined to go for active low, set the Arduino pin's pullup resistor and then look for the pin to go low with digitalRead. This tutorial should get you going.....

(No need to worry about PWM as in your first post: that's for analog outputs.)

Thanks mate!