Design and optimization of PID controller for Arduino Uno-based DC motor with encoder feedback and signal conditioning using LM324 op-amp. The method used is Ziegler–Nichols (ZN) to obtain the initial parameters Kp, Ki, and Kd from the measurement of ultimate gain (Ku) and oscillation period (Pu). The plant model uses a digital implementation of a DC motor including anti-windup, first-order filtered derivatives, and PWM voltage limiting. The test data in the form of step response, disturbance rejection, and sensitivity to noise are analyzed using rise time, overshoot, settling time, IAE, and ISE indicators. The analysis results of Ku≈11.3 and Pu≈0.3 s produce Kp≈6.80, Ki≈45.31, Kd≈0.25, with fast response and acceptable overshoot; fine-tuning reduces oscillation and accelerates steady-state time. The conclusion is that the LM324 encoder improves feedback accuracy, while ZN is effective as a starting point for tuning for stable and robust performance. Highlights: Accurate tuning using Ziegler–Nichols method provides effective initial PID parameters. LM324 signal conditioning enhances encoder feedback precision. Optimized response achieves fast rise time with minimal overshoot and stable steady-state. Keywords: PID, Ziegler–Nichols, motor DC, encoder, LM324