Pulsein function, getting inaccurate data

hi guys,

I used the below code (part of the program) and try to obtain rc signal from my RC receiver.

if(sensor_update == true && ((timeNow-timer)>=20))
  {
      ch1 = pulseIn(5,HIGH,20000);
      Serial.println(ch1);
      sensor_update = false;
      
  }

the joy stick of the transmitter is static but I got my output as follow

1132
1132
1
1132
1132
1
1126
1132
614
1132
1
1
1126
1132
1
1132
1
1132
131
1
1132
965
1132
1132
1132
1132
831
1132
1
5
1132
1126
1
1

Can anyone explain to me why is this happening, and how can I solve this?
thanks a lot!

Jack

How is the joystick connected to the Arduino ?
Seeing your whole code would also be helpful