## 4 Radio Design, Number of Devices Needed and Channel Distribution Plan  
In order to design the wireless sensor network we have studied the signal loss during its path in a rural or forest environment. We need to know how far the Wireless IP camera and the wireless sensor could be from the access point to receive enough signal power. To calculate this parameter we use the power balance formula (given by equation 1). This equation states that the received signal power, in dBm, is equal to the transmitted power plus the transmitter and receiver gain, minus the basic loss and minus other losses produced by objects (such as trees or humidity) [18]. \[P_{rx}(dBm)=P_{tx}(dBm)+G_{tx}(dB)+G_{rx}(dB)-10\cdot n\cdot\log d-L_{rain}( dB)-L_{vegetation}(dB) \tag{1}\]  
Where n is the attenuation variation index. \(n\)=2 for air medium and \(d\) is the distance between the transmitter and the receiver. We have considered rain loss, which depends on the place where the wireless system is installed, and vegetation loss that depends on the number of trees closer to the signal path between the transmitter and the receiver. None of the works that we have found in the literature about WLAN design have taken into account all the parameters that we have considered in our study [19-21]. The value of these losses can be obtained from references [22] and [23]. So, in our environment, the coverage distance is given by equation 2. More details about the steps followed are given in a previous work from the same authors [24]  
\[d=10^{P_{tx}+G_{tx}+G_{rx}-L_{rain}-L_{vegetation}-P_{rx}} \tag{2}\]  
In order to calculate the distance between devices, but bearing in mind the vegetation, we are going to fix some parameters. On the one hand, theoretical transmitted power is -40.2 dBm for an 802.11 g WLAN device at 1 meter, and we estimate -80 dBm threshold power for the far-away IP camera and sensor to have enough quality of signal, so our received power must be greater than or equal to this mark. Let's use a 20 dBi omnidirectional antenna for the access point (_Gtx_), 12 dBi directional yagi antennas for all wireless IP cameras (_Grxcamera_) and 7 dBi omnidirectional antennas for the sensors (_Grxsensor_). On the other hand, this study has been done in Spain, which has two main hydrometric areas: the H area and the K area [25], so losses due to rain, in the worst case, have a value of 0,026 dB for two kilometers. In order to know the losses because of the vegetation, we have used the recommendation given in reference [26], so we can assume a loss of 1.2 dB/m. Equation 3 shows the formula needed to design our WLAN:  
\[d=10^{\frac{59.77+Grx-1.2\cdot m}{20}} \tag{3}\]  
Where \(m\) is the number of meters of vegetation and _Grx_ is the gain of the antenna of the device (the IP camera or the sensor). Figure 3 shows the coverage distance (the distance between access points and the wireless IP cameras and the sensors) as a function of the meters of vegetation through the light of sight path. We can see that around 34 meters of vegetation is allowed in the case of an IP camera and approximately 30 meters of vegetation for the sensors. The radio coverage of the devices depends on the leafiness of the forest. In order to know the number of devices needed for a given area, we have studied the mean coverage area of every device used in our system. The forest density can vary from 40.000 to 200.000 trees per square kilometer (it means a tree every 50 meters in the first case and a tree every 5 meters in the second case). On the one hand, let us suppose that we are measuring a forest where the trees have an average diameter of 3 meters at a height of 3 meters from the ground (the place where the sensors are placed). We also suppose that a regular forest in Spain has a tree every 10 meters.