## 3 LOKA Scenario
### Hardware Specifications  
LOKA is in charge of commuting between the different power modes of each device of a sensor mote through the microcontroller to implement a duty-cycling mechanism. Thus, we need to know the connection topology of a sensor mote in order to know the energy consumption magnitude. In this regard, this section explains all electronic components that LOKA takes into consideration.  
Therefore, our choice to the radio module is the ZigBee module XB24-Z/WIT-004 (XB24) of Digi International whose diagram is in the Figure 2. XB24 allows distributed nodes in subnets of motes using an antenna of 2 mW and a sensitivity of 40 m in indoor environment and 120 m in outdoor environment. These modules consist of a memory and a microcontroller that implement the communication protocol, one GPIO to establish the communication between the module and the outside and a radio suited to provide emissions in 2.4 GHz non-licensed band of the industrial, scientific and medical (ISM) radio band standard.  
With regards to the XB24 connection, Figure 2 shows the basic socket diagram where it will be deployed. XB24 can receive the sleep or wake up order to change its power mode through SLEEPRQpin, and XB24 indicates its mode consumption (sleep or active) through SLEEPSEL pin. ZBDIN and ZBDOUT are the TxD/RxD UART protocol pins that implement the communication between an external microcontroller and the XB24.  
Outside the XB24, the Figure 3 shows the associated external microcontroller LPC824. This microcontroller controls the power mode of the XB24 module, takes samples from the associated sensors if necessary and execute the control of the information flow between the sensors and the XB24 achieving an effective use of the energy consumption by means of the LOKA.  
LPC824 is an 32-bit ARM Cortex M0+ core microcontroller of NXP Semiconductors. We have chosen it because, nowadays, Cortex M0+ is the most energy-efficient processor available: 9.4 \(\upmu\)W/MHz. Also, it implements various energy saving modes consumption that LOKA exploits to reduce the sensor mote power consumption.  
With regard to the support circuit of the sensor motes, Figure 3 shows the design of the LPC824 microcontroller circuit for our study case. It is composed of the LPC824 surface mount pad, capacitors C1, C2 and C3 recommended by the manufacturer and a reset protection circuit formed by diode D1, capacitor C4, resistor R1 and resistor R2. External clock has not been included in the circuit, instead we use the internal 12 MHz clock. The microcontroller has been connected to the XB24 by a UART and two digital pins to control it: SLEEPSEL and SLEEPRQ. Also the LPC824 can be connected to some sensors to take samples, for instance, by the pins number 1, 6 and 20. Finally, there is an In System Programing (ISP) wire bus connection to upload the control program. This configuration ensures that the LPC824 can do the three required operations: read sensors (by sensor pin connections), control the operation power mode of the XB24 (by SLEEPSEL and SLEEPRQ pins) and send data to the XB24 (using the UART).  
Finally, the hardware specifications for the collector mote are the same to the sensor mote except that the collector mote has no sensors attached nor digital pins to control the XB24, because its XB24 will always be in active mode since the collector mote matches with the network coordinator and it must control and manage the security of the WSN.  
Figure 2: XB24-Z7 WIT-004 socket.