A self-powered wireless sensor network for dynamic management of queues at traffic lights