Calcium, potassium, nitrogen, magnesium, and phosphorus, the main elements of the nutrient solution, are absorbed by plants and play an important role in plants. By measuring Ca2+, K+, Mg2+, NH4+, NO3−, HPO42−, the Artificial Neural Networks (ANNs) were used in this study to accurately calculate the concentrations of these elements. Firstly, the error sources of the calculating element concentration were analyzed based on the data of six-ion measurement experiments. Subsequently, various optimization algorithms were compared to optimize back propagation (BP) and radial basis function (RBF) ANNs. Finally, the results of mean relative errors (MREs) and recovery values show that ANNs can effectively reduce the measurement error of ion sensors. From the perspective of recovery values, the prediction error of all elements can be controlled within 15%. From the perspective of MRE, except for magnesium and phosphorus elements, the improved model prediction errors of other elements were also less than 10%.