Droplet microfluidics have found increasing applications across many fields. While droplet generation at a T-junction is a common method, its reliance on trial-and-error operation imposes undesirable constraints on its performance and applicability. In this study, we demonstrate a simple method for on-demand droplet formation at a T-junction with precise temporal control over individual droplet formation. Based on experimental observations, we also develop a physical model to describe the relationships among pressures, droplet generation, device geometry, and interfacial properties. Experimental validation demonstrates excellent performance of the model in predicting the pressure thresholds for switching droplet generation on and off. To address parameter uncertainties arising from real-world complexities, we show that monitoring droplet generation frequency provides a rapid, in situ approach for optimising experimental conditions. Our findings offer valuable guidelines for the design and automation of robust droplet-on-demand microfluidic systems, which can be readily implemented in conventional laboratories for a broad range of applications.