In order to obtain high-accuracy measurements, traditional air quality monitoring and prediction systems adopt high-accuracy sensors. However, high-accuracy sensors are accompanied with high cost, which cannot be widely promoted in Internet of Things (IoT) with many sensor nodes. In this paper, we propose a low-cost air quality monitoring and real-time prediction system based on IoT and edge computing, which reduces IoT applications dependence on cloud computing. Raspberry Pi with computing power, as an edge device, runs the Kalman Filter (KF) algorithm, which improves the accuracy of low-cost sensors by 27% on the edge side. Based on the KF algorithm, our proposed system achieves the immediate prediction of the concentration of six air pollutants such as SO 2 , NO 2 and PM2.5 by combining the observations with errors. In the comparison experiments with three common predicted algorithms including Simple Moving Average, Exponentially Weighted Moving Average and Autoregressive Integrated Moving Average, the KF algorithm can obtain the optimal prediction results, and root-mean-square error decreases by 68.3% on average. Taken together, the results of the study indicate that our proposed system, combining edge computing and IoT, can be promoted in smart agriculture. of industry digitalization in agile connectivity, real-time business, data optimization, application intelligence, security and privacy protection, etc. Edge computing features are like human nerve endings, which can self-process simple stimuli and feedback the processed features to the cloud brain.Smart agriculture makes the application of IoT technology in traditional agricultural production more "intelligent" by using sensors and software to control agricultural production through mobile platforms or computer platforms. In smart agriculture, establishing a real-time monitoring and prediction system for air quality (AQ) is the most basic and most important solution [5]. The prediction for AQ is based on the analysis of the monitoring data. In other words, the accuracy of the monitoring data affects the accuracy of the prediction to a certain extent [6]. At the same time, the Environment Agency also has specified specific values for AQ [7]. Once current AQ exceeds the threshold, people should take appropriate countermeasures. However, when the prediction is inaccurate, it will lead to decision errors. In order to obtain high-precision monitoring data, many AQ monitoring schemes currently existing use high-precision sensors. However, high-precision sensors are often accompanied by higher costs. A complete system consists of multiple sets of sensors [8], so there is a trade-off between cost and accuracy. In addition, in a traditional IoT-based AQ monitoring system, the data collected by the sensing layer needs to be uploaded, analyzed and processed in the cloud computing platform at the network layer [9]. However, in China, most agricultural areas are in remote locations and harsh environments limited by bandwidth and network connectivity [10]. The timely ...