I have an electromagnet that I wish to use to pull a neodyne magnet closer.
I'm thinking of having the electromagnet sensing when the magnet is close, but when the magnet is running I'm pushing 12 volts through it and I don't want to fry my Arduino. How can I do the wiring to achieve this?
I only have to be able to use the magnet as a sensor while it's turned off.