01
Introduction
The mercury switch is a sensor that utilizes the excellent conductivity and fluidity of mercury to control circuit switching. It consists of a glass tube, mercury, fixed electrodes, and leads.
02
Principle
Mercury
Mercury is a chemical element, element number 80 in the periodic table, commonly known as quicksilver. Its chemical symbol is Hg, and it is located in period 6, group IIB of the periodic table. It is the only metal that exists in liquid form at room temperature and pressure (strictly speaking, gallium (symbol Ga, element 31) and cesium (symbol Cs, element 55) also exist in liquid form at room temperature (29.76°C and 28.44°C)). Mercury is a silvery-white, shiny, heavy liquid with stable chemical properties, insoluble in acids and bases. Mercury can evaporate at room temperature, and mercury vapor and its compounds are often highly toxic (chronic). Mercury has good conductivity and fluidity. The use of mercury has a long history and a wide range of applications. In medieval alchemy, it was considered one of the three sacred elements along with sulfur and salt.
The structure of the mercury switch is quite simple. It consists of a sealed cylindrical insulating shell, approximately 30 mm long and 10 mm in diameter, containing about one-fifth of the mercury. At one end of the shell, two leads are fixed, extending from the inside. This is a mercury switch. Due to gravity, the mercury droplet flows to the lower part of the container, and if it simultaneously contacts both electrodes, the switch will close the circuit, turning it on and triggering subsequent circuit operations.
Features of the Mercury Switch
The mercury switch operates by the movement of mercury encapsulated in a glass or metal shell, thus it has many advantages compared to mechanical switches.
① It can be used in harsh environmental conditions. Since the mercury switch is sealed, the internal mercury is isolated from the outside, allowing it to be used in environments with oil, steam, dust, and corrosive gases.
② It requires little external force to operate. Mercury is the only metal that remains liquid at room temperature, with high surface tension and specific gravity. A slight external force to tilt the mercury switch is sufficient to move the mercury and operate the switch.
③ Mercury has good conductivity, and the contact resistance between the electrodes of the mercury switch is generally less than 100 mΩ.
④ The allowable current through the mercury switch depends on the material of the electrodes; the maximum allowable current for tungsten wire electrodes is 10A, while for general alloy wire, it is typically 1A.
⑤ Since the switching of the mercury switch is determined by the weight of the mercury, it can operate reliably for a long time.
⑥ The contact points of the electrodes are liquid contacts, producing no noise.
⑦ Because mercury can flow, as long as the acceleration exceeds a set value, the mercury switch can open or close, making it suitable as a sensitive element for vibrations.
⑧ It is small in size, available in various forms, and is a fully sealed device.
⑨ It has a simple structure and is inexpensive.
03
Wiring
- – : Power negative, connect to GND
- + : Power positive, connect to 3.3V
- S: Switch signal output, connect to P0
04
Program
Note
Mercury is toxic to both humans and the environment, so when using a mercury switch, it is essential to exercise caution to avoid breaking the glass tube and causing mercury leakage.
If the glass tube is accidentally broken, immediately open windows and doors for ventilation to prevent inhalation of mercury vapor. Do not use cloth or mops to clean up spilled mercury, as this may contaminate more areas. Instead, use paper or plastic.
Program Explanation: Continuously check the data on pin P0; if it equals 0, it indicates that the switch is closed, while other values indicate that the switch is open.