## 1 Introduction  
Wireless sensor networks (WSN) are part of a growing technology that has been designed to support a wide range of applications in wireless environments [1, 2]. Although sensor networks have been used in various different applications, environmental monitoring is a domain in which they have had a huge impact. Recent climate change-related catastrophes have illustrated the importance of a detailed understanding of the environment and its evolution for the wellbeing of human beings. The capacity of researchers to improve this knowledge is mainly limited by current data collection techniques, which are based on very expensive stations [3]. The recent development and research in wireless technologies and the advancements in wireless network services have made wireless communications a pervasive means for monitoring the natural environment. WSN's are particularly useful in remote or dangerous environments whose behaviors have rarely been studied due to their inaccessibility. Therefore, environmental monitoring is an important area for applying wireless sensor networks [4]. In our study we are using WSN Smart Grid for such harsh environments in Middle East region where the sun is present for at least 12 h per day which makes the climate very dry and hot. One of the biggest problems in the Middle East is the limitation of water resources. We need to measure the soil moisture regularly and very accurately to allow targeted irrigation techniques to be implemented. We are deploying WSN to detect when and where it is raining so that necessary irrigation control measures can be applied. Many research efforts have tried to deploy WSNs for such environments. But there are many issues with their solutions [3]. Hence in attempting to deploy a WSN successfully in these type of harsh environments and to ensure proper operation of sensor networks we need to resolve following issues. In order to deal with the harsh environment, it is necessary to build a system which has two main proprieties, i.e., event-driven and robustness. The sensor network should be reactive so that it can detect different events correctly, for example, the presence and the absence of rainfall and hence the changes in degree of moisture in the soil. After the event is detected, the affected nodes need to sample the environment at a much faster rate for example if the system is set to sample after every few minutes when it is not raining then it should sample at few seconds when it is raining. Hence the available bandwidth should be more at nodes affected by rain. Hence the required information is sent across as fast as possible and also accurately to the monitoring center or base station. Currently there is no such robust and event-based wireless routing protocol to react to such type of outdoor environments. Resource limitations of the sensor nodes and unreliability of low-power wireless links [5], in combination with various performance demands of different applications, impose many challenges in designing efficient communication protocols for wireless sensor networks [6]. In this paper, we discuss the shortcomings of popular routing protocols for our application and we exploit the advantages of the popular routing protocol \"Ad hoc On-Demand Multipath Distance Vector\" (AOMDV) and modify it to achieve the objectives. To achieve the robustness of wireless sensor network (WSN) this project will enhance the protocol to be an energy aware routing protocol to expand the life time of the nodes. We also discuss in detail the design of a smart grid network that can provide all necessary physical parameters to be used in soil moisture and rainfall monitoring algorithms. We implement an algorithm for monitoring and controlling soil moisture events and evaluate the network based on power used, throughput, etc. We deploy an outdoor WSN testbed for testing our algorithm. The rest of the paper is outlined as follows: Section 2 provides a literature review, Section 3 explores a solution approach.