## 3 Proposal for Smart Energy Management
### Hardware Description  
Since the system has been designed for a broad range of applications, the hardware part is a control and monitoring system, based on a WSAN, which can be used in any application. Furthermore, these networks allow the connection between machinery and the Internet, which integrates the system into the IoT framework. The proposal represents the generic case in which the system is implemented independently of the pre-existing networks. In this case ZigBee(r) technology was selected for the development of the required WSAN. Besides its outstanding evolution along the past few years, this selection is justified by the relevance of the following features for the system being proposed:  
* The use of a frequency band that does not require an operating license: 2.4 GHz. * Low complexity (low memory request). * Low power consumption (devices can be powered by batteries). * Mesh networks (this feature is not found in the majority of standards for wireless networks): self-creation, self-reorganization, and multi-hop routing protocol. Initially, the system was designed with mains-powered nodes, but the deployment of additional battery powered nodes was found to be necessary to allow data collection in places without direct access to the general power grid. This is justified by the need for data collection on the environment, such as temperature and humidity conditions at specific points inside and outside refrigerated rooms, ovens or furnaces (measured with probes attached to nodes specifically located). It was also taken into account that the system normally operates indoors, although its performance would be better outdoors without walls and other obstacles producing signal attenuation. The wireless network consists of several nodes working as ZigBee routers. They have interconnection capabilities and are capable of managing network traffic, allowing the expansion of a previously established network, and/or adding redundancy. One of these nodes takes the role of network coordinator. Its main functions are: the network establishment and its interconnection with the user  
Figure 1: Structure and operation of the proposed system. interface. Each node creates a coverage area for communications with other nodes. To decrease manufacturing costs, all nodes share a common hardware. Router nodes and coordinator node differ in the firmware and in the use they make of the Universal Asynchronous Receiver-Transmitter (UART) interface, apart from the number and type of sensors (Figure 2). Nodes have been designed that can be supplied from several energy sources: directly from the grid (230 VAC), from a 5 VDC source or through a battery. An energy-harvesting module can also be included to charge the battery when collecting energy from sun or wind, as shown in Figure 3. The power supply stage provides the required 3.3 V at up to 500 mA. A linear Low Drop-Out (LDO) regulator was chosen, because it reduces the noise addition through the power signal. This is a very important consideration because the stability of the power supply is a key factor for the performance of the radio-frequency stage. The design of the power supply stage is completed with the inclusion of protection circuits, such as a voltage suppressor and current limiter. In order to simplify the PCB design, a module [43] was chosen that integrates a microcontroller (MCU) with a Radio-Frequency (RF) transceiver, compliant with IEEE 802.15.4 at 2.4 GHz, a Low Noise Amplifier (LNA), and a Power Amplifier (PA) to provide a wide coverage range (over 1 km with direct line of sight outdoors). Its main features are: high reception sensitivity (\(-\)104 dBm); high power of signal throughout the link (up to 124 dB); up to 20 dBm of output power for transmission; reduced power consumption: (<6 mA in standby, 23 mA in receive mode and 50 mA in transmission mode); and a wide range of analog and digital interfaces. Figure 3: View of the PCB and components of a node with energy harvesting. Figure 2: Block diagram of the coordinator/router nodes.