by measuring frequency of generated current of voltage