A WSN-based system for real-time electromagnetic monitoring