comparing AC or DC current with one threshold