Arduino CapacitanceSensor problem

Hi everyone!
Im having a problem with my new project.
Im getting really good responed from the touch button and everything seems to go very good- untill:

after few minutes the values goes crazy! with no reason.
and my room light start blinking till i reset the arduino.

what could be the reason that it happens only after few minutes?

this is the code:

#include <CapacitiveSensorDue.h>

int inPin = 3;  // the number of the input pin (for me a push button)
int ledPin = 13; 
int touchdetect=0;
int current; //Current state of the button (LOW is pressed b/c i'm using the pullup resistors
int count;   // How long the button was held (secs)
byte previous = HIGH;
unsigned long firstTime;   // how long since the button was first pressed 
CapacitiveSensorDue cs_4_2 = CapacitiveSensorDue(4,2);	// 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired
CapacitiveSensorDue cs_4_6 = CapacitiveSensorDue(4,6);
//Let's say you have your push button on pin 2
int switchState = 0; // actual read value from pin2
int oldSwitchState = 0; // last read value from pin2
int readyled= 7;
int roomlight= 8;
int dudstatepin= 9;
int lightsOn = 0; // is the switch on = 1 or off = 0
void setup(){
  Serial.begin(9600);    // Use serial for debugging
  pinMode(ledPin, OUTPUT);
  digitalWrite(inPin, HIGH); //turn on 20k pullup resistors to simplify switch input
  pinMode(readyled , OUTPUT);
  pinMode(5 , OUTPUT);
  pinMode(roomlight , OUTPUT);
    pinMode(dudstatepin , OUTPUT);
         pinMode(10 , INPUT);
              pinMode(11 , OUTPUT);
    digitalWrite (readyled , LOW);
  digitalWrite (5 , LOW);
  digitalWrite (roomlight , HIGH);
  digitalWrite (9 , LOW);
}

void loop()
{
 	long total1 = cs_4_2.read(30);


Serial.println(total1);



if (total1 >= 110)
{
  touchdetect=LOW;

}
else
{
  touchdetect=HIGH;
}
  current = touchdetect;
  if (current == LOW && previous == HIGH && millis()- firstTime > 200){
    firstTime = millis();    // if the buttons becomes press remember the time 
  }

  if (current == LOW && ((millis() - firstTime) % 1000) < 20 && millis() - firstTime > 500){
    ledblink(1, 50, ledPin); // Each second the button is held blink the indicator led and
    count++;                // and 1 to the counter
  }

    // When the button is released if the counter is between the


      // toggle



  if (current == HIGH && previous == LOW && count >=0 && count < 1){
 
       lightsOn = !lightsOn;
       if(lightsOn)
  {
     digitalWrite(roomlight, HIGH);   // set the LED on
     delay(100);

   } else {
      digitalWrite(roomlight, LOW);   // set the LED off
delay(200);
    }

      //This is where you would put you differnt functions
  }      
  if (current == HIGH && previous == LOW && count >=1 && count < 2 ){


      //This is where you would put you differnt functions
  }    // with diffent time parameters
  if (current == HIGH && previous == LOW && count >=4 && count < 5){
  //This is where you would put you differnt functions

  }
    if (count ==2)
  {
    Serial.print("5 sec");
digitalWrite(readyled , LOW);;

}
else
{
  digitalWrite(readyled , HIGH);;
}
int state = digitalRead(10);
        if (current == HIGH && previous == LOW && count >=2 && count < 3 && state== LOW ){



      digitalWrite(dudstatepin , HIGH);;

  delay(50);
  digitalWrite(dudstatepin , LOW);;
}


        if (current == HIGH && previous == LOW && count >=2 && count < 3 && state== HIGH ){
 
    digitalWrite(11 , HIGH);;

  delay(50);
  digitalWrite(11 , LOW);;
  Serial.println("hdkjfhdshfladskjhflkdsjhflkdsaf");
        }


  
  if (current == HIGH){ // reset the counter if the button is not pressed
    count = 0;
  }

  previous = current;
}

void ledblink(int times, int lengthms, int pinnum){
  for (int x=0; x<times;x++){
    digitalWrite(pinnum, HIGH);
    delay (lengthms);
    digitalWrite(pinnum, LOW);
    delay(lengthms);
  }
}

I know its a mess but i dont think its the code fault.

Thanks!

I tryed to connect it with other pins (4-6) and it work for few hours.. Im really confused :(

Anybody? :sob: