This study was conducted to develop a PID control algorithm considering viscosity for the planting depth control system of a rice transplanter using various hydraulic oils at different temperatures and to evaluate the performance of the control algorithm, and compare the performance of the PID control algorithm without considering viscosity and considering viscosity. In this study, the simulation model of the planting depth control system and a PID control algorithm were developed based on the power flow of the rice transplanter (ERP60DS). The primary PID coefficients were determined using the Ziegler–Nichols (Z–N) second method. Routh’s stability criteria were applied to optimize the coefficients. The pole and double zero points of the PID controller were also applied to minimize the sustained oscillations of the responses. The performance of the PID control algorithm was evaluated for three ISO (The International Organization for Standardization) standard viscosity grade (VG) hydraulic oils (VG 32, 46, and 68). The results show that the control algorithm considering viscosity is able to control the pressure of the proportional valve, which is associated with the actuator displacement for various types of hydraulic oils. It was noticed that the maximum pressure was 15.405 bars at 0, 20, 40, 60, 80, and 100 ℃ for all of the hydraulic oils. The settling time and steady-state errors were 0.45 s at 100 ℃ for VG 32, and 0% for all of the conditions. The maximum overshoots were found to be 17.50% at 100 ℃ for VG 32. On the other hand, the PID control algorithm without considering viscosity could not control the planting depth, because the response was slow and did not satisfy the boundary conditions. The PID control algorithm considering viscosity could sufficiently compensate for the nonlinearity of the hydraulic system and was able to perform for any of temperature-dependent viscosity of the hydraulic oils. In addition, the rice transplanter requires a faster response for accurately controlling and maintaining the planting depth. Planting depth is highly associated with actuator displacement. Finally, this control algorithm considering viscosity could be helpful in minimizing the tilting of the seedlings planted using the rice transplanter. Ultimately, it would improve the transplanter performance.