by using the electromagnet itself as sensor