Cooperative sensor networks for voltage quality monitoring in smart grids