Note
Hello, welcome to the SunFounder Raspberry Pi & Arduino & ESP32 Enthusiasts Community on Facebook! Dive deeper into Raspberry Pi, Arduino, and ESP32 with fellow enthusiasts.
Why Join?
Expert Support: Solve post-sale issues and technical challenges with help from our community and team.
Learn & Share: Exchange tips and tutorials to enhance your skills.
Exclusive Previews: Get early access to new product announcements and sneak peeks.
Special Discounts: Enjoy exclusive discounts on our newest products.
Festive Promotions and Giveaways: Take part in giveaways and holiday promotions.
👉 Ready to explore and create with us? Click [here] and join today!
Reed Switch

The Reed Switch is an electrical switch that operates in response to an applied magnetic field. It was invented by Walter B. Ellwood of Bell Telephone Laboratories in 1936 and patented in the United States on June 27, 1940, under patent number 2264746.
Principle of Operation
The reed switch operates on a straightforward principle. Two metal reeds, typically made of iron and nickel, are sealed within a glass tube, overlapping at their endpoints but separated by a small gap of just a few microns. The glass tube is filled with a high-purity inert gas, such as nitrogen, or, in some cases, is vacuum-sealed to enhance high-voltage performance.
The reeds function as magnetic flux conductors. When no magnetic field is applied, the reeds remain separated. When exposed to a magnetic field generated by a permanent magnet or an electromagnetic coil, the magnetic flux induces opposite polarities at the reeds’ endpoints. If the magnetic force exceeds the natural spring tension of the reeds, they come into contact, closing the circuit. Once the magnetic field weakens or disappears, the reeds’ inherent elasticity causes them to separate, opening the circuit again.
This simple yet effective mechanism makes the reed switch highly reliable for various applications requiring magnetic field-triggered switching.

Example
2.9 Feel the Magnetism (For MicroPython User)
2.9 Feel the Magnetism (For Arduino User)