## 3 Wireless Sensor Network and Wireless Sensor Node Deployment
### Rotation System  
Finally, we provided mobility to the node with the aim of increasing the viewing angle of the camera. It allows us to reduce the number of nodes required to monitor the area. There are different ways of implementing this system. However, we aim to implement an economical and simple low energy cost option, but 100% functional. Our system is based on the control of camera movement, using a stepper motor, which is controlled by a PIC that has a small program inside. Stepper motors are commonly used for the construction of mechanisms in applications that require precise movements. The system operation is very simple. The sensor node rotates on itself and it periodically captures images and processes them in order to determine if there is any unusual status of the leaves or not. The number of degrees, that the camera is able to rotate at every turn, can be as small as 0.72 \({}^{\circ}\), and up to 90 \({}^{\circ}\), depending on the selected motor. The number of times that the camera has moved (respect to its initial position) can be stored and sent when this information is required. As we can see in Figure 5, the information about the position of rotation is sent via RS-232 to the router, which is equipped with an RS-232 interface. The router is responsible for sending the alarm signal with this value. \begin{table}
\begin{tabular}{|c|c|c|c|c|} \hline
**Camera Model** & **Sensor** & **Resolution (pixels)** & **System Requirements** & **USB Version** \\ \hline Hercules Classic Webcam [44] & VGA & 1,280 \(\times\)960 & CPU Processor 500 MHz, 64 MB RAM Memory. & USB 1.1 and USB 2.0 \\ \hline ClickSmart 420 [45] & CMOS VGA & 640 \(\times\)480 (video) & CPU Processor 500 MHz, 1,280 \(\times\)960 (photography) & USB 1.1 and USB 2.0 \\ \hline QuickCam Cordless [45] & CMOS & 510 \(\times\)492 & CPU Processor 400 MHz, 64 MB RAM Memory. & USB 1.1 and USB 2.0 \\ \hline QuickCam for Notebooks Pro [45] & CCD VGA & 640 \(\times\)480 & CPU Processor 400 MHz, 64 MB RAM Memory. & USB 1.1 and USB 2.0 \\ \hline Creative WebCam NX Pro [46] & CMOS VGA & 1,024 \(\times\)768 & CPU Processor 233 MHz, 32 MB RAM Memory. & USB 1.1 and USB 2.0 \\ \hline Creative WebCam Instant [47] & CMOS VGA & 352 \(\times\)288 (video) 640 \(\times\)480 (photography) & CPU Processor 266 MHz, 64 MB RAM Memory. & USB 1.1 \\ \hline A4 tech PKS-635K [48] & CMOS VGA & 640 \(\times\)480 & CPU Processor 166 MHz, 32 MB RAM Memory. & USB 1.1 and USB 2.0 \\ \hline \end{tabular}
\end{table} 
Table 4: Camera comparison. \begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline
**Size (pixels)** & **80 dpi ( average** & **133 dpi** & **155 dpi** & **175 dpi** & **200 dpi** & **250 dpi** & **300 dpi** \\
**monitor quality**) & **(in cm)** & **(in cm)** & **(in cm)** & **(in cm)** & **(in cm)** & **(in cm)** \\ \hline
1280 \(\times\)960 & 30.4 \(\times\)40.6 & 18.3 \(\times\)24.4 & 16.3 \(\times\)21.7 & 13.9 \(\times\)18.6 & 12.2 \(\times\)16.3 & 9.8 \(\times\)13.0 & 8.1 \(\times\)10.8 \\ \hline \end{tabular}
\end{table} 
Table 5: Image size comparison. When the node detects a symptom in the processed image, it sends the position value jointly with the alarm signal. Thus, knowing which node has generated the alarm and the position of the camera, it is possible determine exactly, what field area is sick. Figure 6 shows a simplified program diagram that would perform this operation. In order to encode the position value, we must consider, first the type of motor that will be used. For our application we use a stepper motor, with rotation increments of 1.8. This means that we could go through 360 degrees in 200 steps of 1.8. Moreover, we note that signals that are sent through the serial port have a data field of 8 bits (without taking into account, start bit, stop bit, parity bit, _etc._). Therefore, we can identify each motor step with an 8-bit binary value, being \"00000000\" 0  and \"11000111\" would be 358.2 degrees. Figure 5: Stepper motor controller. Figure 6: Program diagram.