This research paper introduces a sensor that utilizes a machine-learning model to predict water salinity. The sensor’s concept and design are established through a simulation software which enables accurate modeling and analysis. Operating on the principle of light transmission physics, the sensor employs data collected from the simulation software as input parameters to predict the salinity parameter, serving as the output. The results of the prediction model exhibit excellent performance, showcasing high accuracy with a coefficient of determination value of 0.999 and a mean absolute error of 0.074. These outcomes demonstrate the model’s ability, particularly the multi-layer perceptron model, to effectively predict salinity values for previously unseen input data. This performance underscores the model’s accuracy and its proficiency in handling unfamiliar input data, emphasizing its significance in practical applications.