Smart agriculture refers to combining modern science and technology and agricultural planting to realise unmanned, automated and intelligent management technology. Among them, monitoring cultivated soil in real-time is a more critical research topic. Through the real-time monitoring of soil temperature and humidity as well as nitrogen, phosphorus, potassium and other elements, we can analyse and track soil moisture and fertility to control agricultural farming and irrigation more accurately. However, traditional soil monitoring sensors have disadvantages such as a small monitoring range, inconvenient deployment, and difficult data transmission. Therefore, this project aims to develop a wireless sensor network based on 4G/5G communication, MQTT protocol, artificial intelligence and the Internet of things (IoT) to provide a more convenient and effective agricultural soil monitoring solution.