A magnet is a material that can attract ferromagnetic materials such as iron, nickel and cobalt and generate a magnetic field. In Arduino projects, it is often used with Reed relays or Hall effect sensors in applications such as door/window open-close detection, tachometer and proximity detection. Neodymium magnets are the most preferred type in electronic projects because they produce strong magnetic fields despite their small size.