It is a crucial issue to realize real-time piston correction in the area of sparse aperture imaging. This paper introduces an optical diffractive neural network-based piston sensing method, which can achieve light-speed sensing. By using detectable intensity to represent pistons, the proposed method is capable of converting complex amplitude distribution of the imaging optical field into piston values directly. Differing from the electrical neural network, the way of intensity representation enables the method to obtain the predicted pistons without imaging acquisition and electrical processing process. The simulations demonstrate the feasibility of the method for point source, and high accuracies are achieved for both monochromatic light and broadband light. This method can greatly improve the real-time performance of piston sensing and contribute to the development of the sparse aperture system.