The reed switch is an electrical switch operated by an applied magnetic field. It consists of a pair of contacts on ferrous metal reeds in a hermetically sealed glass envelope. They are often used in alarm systems, on bicycles for wheel speed measurement and in many other devices. Here we will say few words about reed switch and show you very interesting video how they are made
Reed switches are much more common than you realize. Almost every bicycle nave small magnet mounted on wheel and reed relay on bicycle front fork. The switch may be actuated by a coil, making a reed relay, or by bringing a magnet near to the switch. Once the magnet is pulled away from the switch, the reed switch will go back to its original position. On bicycle it is used for speed and distance measurement. As mentioned above most of alarm sensors for opened window are small reed switches. Another interesting place where they can be found is inside modern digital electrical power meters. It is well known that old electrical power meters can be abused so they measure less power flow than there is in reality by putting strong magnets close to it. This is not suggestion for you to do it! :)
Modern digital electrical power meters also measure electrical current by measuring electromagnetic field using hall sensors. Hall sensors are king of semiconductor reed switches that can measure electromagnetic field strength and in this way measure current flow. This is why modern electrical power meters would also have problems measuring if strong magnetic field is introduced. This is why they have multiple reed switches on several places on PCB inside box and their readout is logged. So if you try to cheat your electrical energy provider for smaller bill you will be caught.
Reed switches are often used because of their small price, availability and reliable operation. Their interface with microcontroller is very simple. Use them as you would use any other switch or pushbutton. On video below you can see how they are made. Although their construction looks very simple, production process is not.