Problem AMN31111 IR Sensor with arduino uno

Hi everybody, i recently start to work with arduino and i have some trouble in an installation.

I need to send osc message to a pure data program when the sensor change his position.
The sensor need to capt an human presence in front of a showcase.

The problem is when i remove myself from the sensor, it took beetween 20 and 30 second to come back to his initial state.

If someone already had this probleme, know this sensor, know is not the good one or see something wrong in my code, i apreciate if you help me.

Thanks

Here is the code :

#include <SPI.h>
#include <Ethernet.h>
#include <ArdOSC.h>
#include <Wire.h>



////////////////////TCP/IP///////////////////////
byte myMac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte myIp[]  = { 192, 168, 2, 178 };
int  serverPort  = 10000;
int destPort = 8000;
byte destIp[]  = { 255, 255, 255, 255 };
const char * addrosc[] = {"/sensor1", "/sensor2", "/sensor3", "/sensor4", "/sensor5", "/sensor6", "/sensor7" };

//////////////////////////////////////////////

OSCClient client;
OSCServer server;
OSCMessage global_mes;




//////////////////////SETUP////////////////////
int input[]  =   {2, 3, 5, 6, 7, 8, 9 }; // input pin
int pin = 6;
//////////////////////////////////////////////

void sendosc(int v1, int v2) {

  OSCMessage loacal_mes;
  loacal_mes.setAddress(destIp, destPort);
  loacal_mes.beginMessage(addrosc[v1]);
  loacal_mes.addArgInt32(v2);
  client.send(&loacal_mes);
  delay(50);

}


void setup() {

  Serial.begin(19200);
  Ethernet.begin(myMac , myIp);
  server.begin(serverPort);

  for (int i = 0; i <= pin; i++) {
    pinMode(input[i], INPUT);
  }
  delay(500);
  for (int i = 0; i <= pin; i++) {
    sendosc(i, 1);
    delay(300);
  }
  delay(500);
  for (int i = 0; i <= pin; i++) {
    sendosc(i, 0);
    delay(300);
  }
  delay(500);
}//setup



void loop() {
  for (int i = 0; i <= pin; i++) {
    sendosc(i, digitalRead(input[i]));
    delay(70);
  }
}//loop