## 1 Introduction  
The raising need of energy, the diminution of the fossil resources and greenhouse effects imply the necessity to find complementary energy sources. A part of the solution is offered by renewable energies but their integration in the electrical distribution grid is still challenging. The classical power grid is based on large power plants and unidirectional flows toward the consumers. Renewable energies are inherently distributed (in opposition to centralized power plants) and this fact can modify the energy flow in the grid [1]. The integration of the distributed generation (DG) will affect the power quality (mainly by voltage dips induced by failures) and increase the voltage in the entire grid (by the injection of active power). The voltage can be brought back to the normal value by the absorption of reactive power. Those effects are linearly dependent on the level of penetration of DG. Smart Grids (SGs) are seen as the next-generation of the electrical power system that will be able to provide a reliable and secure grid as well as efficient and cost-effective energy generation, distribution, and consumption [2]. All these targets can be made possible only in the presence of an adapted communication infrastructure that will support data transfer and information exchange in the SG. The Smart Grid must be able to support a big part of the energy production from high variability renewable sources such as wind turbines and solar panels. Higher levels of stability and efficiency of the grid can be achieved by the management of the generation and also of the demand [3] and the storage. Grid operators will deal not only with large-scale power plants (at least some MW), but also with the increasing number of small installations (such as solar rooftop panels) that are locally distributed. The number of domestic appliances is also high enough to make difficult any attempt of centralized real time management procedures. A solution can be the implementation of virtual power plants that employ the communication opportunities offered by the Smart Grid or the development of microgrids (MGs) based on geographical proximity [4]. Both models can include small power generators, loads and energy storage systems. The SG will see the virtual power plant or the MG as an entity capable of supplying (selling) or absorbing (purchasing) electrical energy. The principal difference is the connection to the main grid. The elements of the virtual power plant can be connected anywhere on the grid, even at different voltage levels, offering thereby a higher flexibility. Inversely, all the elements composing the microgrid share the same connection to the main grid. Undoubtedly, this is a limitation for MGs but, in exchange, it makes possible the islanding capability. Virtual power plants will use the communication network of the SG, increasing unavoidably the data flow. On the other hand, MGs can use a cheaper local communication network for its own management purposes, reducing data load and congestion of the main network. The rest of this paper will survey the behavior and requirements of electrical MGs to become real actors that will transform the mains into an intelligent electrical grid. In this context, Wireless Sensor and Actuator Networks (WSANs) constitute a promising technology that will contribute to this evolution towards a Smart Grid scenario. As an example, Figure 1 shows a SG infrastructure including a MG and a WSAN, which transmits the necessary information to achieve a correct management of the whole system. This article is structured as follows. Section 2 deals with the different management techniques for MGs, including Demand Side Management (DSM), to illustrate the need for sensors and communication networks for a correct operation. In Section 3, a study of Wireless Sensor and Actuator Networks as an interesting option to achieve a Smart Electrical Grid, from generation to end customers including MGs, is carried out.