Infrared photoelectric sensor module

Hi all
i've recently bought this Arduino UNO compatible module because i'd like to build a simple RPM counter: Imgur: The magic of the Internet It has 3 pins: GND, OUT, +5V.

I did some research on the internet but i don't understand how does it work. Do the output float from an Higher value from a Lower value when an obstacle passes and deny the IR beam? Is it right to connect it like if was a led? ("int ledPin = 13;")

Right now on the display i only see random numbers, that change every loop although no obstacle passes.

This is my actual circuit: Imgur: The magic of the Internet

This is the code:

// include the library code:
#include <LiquidCrystal.h>

int ledPin = 13;                // IR LED connected to digital pin 13
volatile byte rpmcount;
unsigned int rpm;
unsigned long timeold;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void rpm_fun(){
   //Each rotation, this interrupt function is run twice, so take that into consideration for 
   //calculating RPM
   //Update count
      rpmcount++;
 }

void setup() {
  lcd.begin(16, 2);// set up the LCD's number of columns and rows: 
  
   //Interrupt 0 is digital pin 2, so that is where the IR detector is connected
   //Triggers on FALLING (change from HIGH to LOW)
   attachInterrupt(0, rpm_fun, FALLING);

   //Turn on IR LED
   pinMode(ledPin, OUTPUT);
   digitalWrite(ledPin, HIGH);

   rpmcount = 0;
   rpm = 0;
   timeold = 0;
}

void loop(){
  //Update RPM every second
   delay(1000);
   //Don't process interrupts during calculations
   detachInterrupt(0);
   //Note that this would be 60*1000/(millis() - timeold)*rpmcount if the interrupt
   //happened once per revolution instead of twice. Other multiples could be used
   //for multi-bladed propellers or fans
   rpm = 60*1000/(millis() - timeold)*rpmcount;
   timeold = millis();
   rpmcount = 0;

   //Print out result to lcd
   lcd.clear();
   lcd.print("RPM: ");
   lcd.print(rpm);

   //Restart the interrupt processing
   attachInterrupt(0, rpm_fun, FALLING);
}

A picture of the device doesn't help much.

Let's assume it is a simple optical interrupter. Connect the OUT of the device to an INPUT pin. Let's use Pin 2 so you can still use the LED output. Then run this sketch to see how the LED reacts to the device:

void setup(){
    pinMode(2, INPUT);  // Connect this to the OUT pin of the optical interrupter
    pinMode(13, OUTPUT);  // This goes to the built-in LED marked 'L'
}
void loop(){
    digitalWrite(13, digitalRead(2));
}

Thank you for the tip, i modified the circuit and this line: LiquidCrystal lcd(12, 11, 9, 8, 7, 6); so now i have the pin 2 free.
I connected the 2th pin to the output of the sensor module and now when an obstacle passes trought the sensor the on board led turn off, viceversa it turns on when no obstacle passes. I have to test the counter if the values are real. I think i am close to the solution. the problem was that this function attachInterrupt(0, rpm_fun, FALLING); works only on arduino's pin 2, if i am correct.

EcoIV:
the problem was that this function attachInterrupt(0, rpm_fun, FALLING); works only on arduino's pin 2, if i am correct.

That is correct. Interrupt 0 is Pin 2. Interrupt 1 is Pin 3.