EE-SPY411 Reflective Photomicrosensor

Good day, Masters!

I need to determine the RPM of the exhaust fan using a reflective photomicrosensor connected to an arduino.

Here's the link for the datasheet http://www.ia.omron.com/data_pdf/data_sheet/ee-spy31_41_dsheet_csm479.pdf
and here's the output circuit of the sensor

I connected it like this

and uploaded a simple code on my arduino

int x;
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  x = analogRead(A0);
  Serial.println(x);
}

I want to proceed on the RPM reading part but the sensor is not working. The value displayed [1023] in the serial COMport never change; when I place it above a paper or a shiny background.

Why are you using the analog input ? It's a digital sensor isn't it ?
Where did you find that schematic you are using ?

The data sheet says it is supposed to read a reflection from a mirror ("glass with aluminum deposition " is the technical name for a mirror)

I tried using digitalRead() but it's stuck to 0.
I just copied the schematic here (Arduino Your Home & Environment: Reflective Optical Sensor with Transistor Output). He used a reflective optical sensor. At first, I connected the sensor directly to the arduino but then I got scared and tried to put a pull up resistor and then I found the the TCRT5000 schematic and copied it anyways.

The shiny thing I mentioned earlier was a metal ruler.
Don't worry I got a mirror and tested it but its still not working.

Did you ever connect it to power WITHOUT the 180 ohm resistor in series with the diode ?
Do you know how to use a multimeter on diode scale?

I removed the 180 and it's stuck to 1.

<<Modified! >>
I checked with a multimeter and,
When connected to the circuit with supply-- no voltage on forward bias while there's 0.675V during reverse bias
When connected to the circuit without supply-- both have 0.7 V during forward and reverse bias
When disconnected from the circuit-- both have no voltage during forward and reverse bias
Is it broken?

Did you ever connect it to power WITHOUT the 180 ohm resistor in series with the diode ?

THIS IS A QUESTION, NOT AN INSTRUCTION
I NEVER SAID TO REMOVE THE RESISTOR !
I simply ASKED you if you had EVER connected it WITHOUT the resistor because I wanted to find out if you had damaged it by connecting it WITHOUT the resistor which would certainly DAMAGE the device. I am sorry you misunderstood my question but I did not suggest you remove it . I simply ASKED if you ever had. If never occurred to me that you would do that without at least asking for clarification of my question.

This is not going well,
ALSO,

When connected to the circuit with supply-- no voltage on forward bias while there's 0.675V during reverse bias
When connected to the circuit without supply-- both have 0.7 V during forward and reverse bias
When disconnected from the circuit-- both have no voltage during forward and reverse bias
Is it broken?

Do you know how to use a multimeter on diode scale?

This is also a question.

When disconnected from the circuit-- both have no voltage during forward and reverse bias

So just to confirm, with the black meter lead on the CATHODE of the diode and the red lead on the anode of the diode, with the device removed from the circuit , you DO NOT get about 0.7V on the meter on diode scale ?

When connected to the circuit without supply-- both have 0.7 V during forward and reverse bias

This seems confusing. You can't really test the transistor out of the circuit because there is no base lead.

tcrt5000.PNG