by measuring the electrical resistance