Voltage detector for testing switchgear and overhead lines