An Arduino-controlled electromagnet turns a fidget spinner and measures RPM. Details and code on GitHub.