comparing DC or AC voltage with one threshold