My sensor has some problem i guess

idk why my ir sensor is just showing 1, in fact i tried all my sensor with their respective WORKING codes(previously)but now suddenly they don't work properly as well.Any help would be appreciated.
this is the ir sensor code:

int sensor = 7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
int data = digitalRead(sensor);
Serial.println(data);
delay(100);
}

Are we allowed to know what the name or specifications of this sensor are?

Please remember to use code tags when posting code

it is an IR proximity sensor

OK.
Get back to us when you find out some more about it

what more it is a proximity Sensor are used to detect objects and obstacles in front of sensor . Sensor keeps transmitting infrared light and when any object comes near, it is detected by the sensor by monitoring the reflected light from the object.

Yeah, I meant anything specific about the particular IR prox sensor sitting in front of you.

it worked yesterday

Please take a clear photo of your hardware setup, and post it.

Unless you have a time machine, the fact that it worked yesterday is not particularly helpful.

I see three requests for information about the sensor, still no useful response... except that I now know that it is the reflective type, but that isn't really helpful in itself.

Typically, I find when I run into it worked yesterday means that I did something between yesterday and now to frack things up. I then try to remember the last few things I did to the project and undo those things.

Without the code or a pic of the setup and with a vague issue description, most likely the issue is within the period of was the last few things done and only you know what that was, OP.

i suspect their is a problem in the uno

Did you try another Uno?

i don't have one more

I try to always keep a spare around, especially microcontrollers.

In the absence of any useful information about the sensor, would you care to share your reasons for suspecting the Uno?

FOUND IT the problem is in the 5v and 3.5v pins .

That certainly is a problem.

Enquiring minds want to know. What problem?

In both of them? Wow!

yeah its weird

Did you call in an exorcist?