Hard water is water that has high mineral content (in contrast with "soft water"). Hard water is formed when water percolates through deposits of limestone and chalk which are largely made up of calcium and magnesium carbonates.
Hard water poses critical problems in industrial settings, where water hardness is monitored to avoid costly breakdowns in boilers,cooling towers and other equipment that handles water. In domestic settings, hard water is often indicated by a lack of foam formation when soap is agitated in water, and by the formation of limescale in kettles and water heaters. Wherever water hardness is a concern, water softening is commonly used to reduce hard water's adverse effects.
With hard water, soap solutions form a white precipitate (soap scum) instead of producing lather, because the 2+ ions destroy the surfactant properties of the soap by forming a solid precipitate (the soap scum). A major component of such scum is calcium stearate, which arises from sodium stearate , the main component of soap: 2 C17H35COO- (aq) + Ca2+ (aq) ? (C17H35COO)2Ca (s)
Hard water also forms deposits that clog plumbing. These deposits, called "scale", are composed mainly of calcium carbonate (CaCO3), magnesium hydroxide (Mg(OH)2), and calcium sulphate (CaSO4).Calcium and magnesium carbonates tend to be deposited as off-white solids on the inside surfaces of pipes and heat exchangers. This precipitation (formation of an insoluble solid) is principally caused by thermal decomposition of bicarbonate ions but also happens in cases where the carbonate ion is at saturation concentration.The resulting build-up of scale restricts the flow of water in pipes. In boilers, the deposits impair the flow of heat into water, reducing the heating efficiency and allowing the metal boiler components to overheat. In a pressurized system, this overheating can lead to failure of the boiler.
A water softener is used to soften hard water by removing the minerals that cause the water to be hard. Water softeners are specific ion exchangers that are designed to remove ions, which are positively charged (mainly calcium (Ca2+) and magnesium (Mg2+).
Ion exchange resins are very small porous round plastic beads. The polymer structure of the resin bead contains a fixed negative ion that is permanently attached. This cannot be removed. Each negatively charged exchange site can hold a positively charged ion. In this case, sodium which has a positive charge is attached to the exchange site (negative and positive charges attract each other).
The calcium and magnesium ions present in hard water have a stronger positive charge than the sodium ion. As a result the calcium and magnesium have a passed through the resin beads, stronger attraction to the negatively charged resin bead than sodium does. Hence when hard water is the sodium ion is then 'kicked off the resin bead and the calcium and magnesium ions take its place and get attached to the bead). In simple terms we can say that the calcium and magnesium ions are exchanged for sodium ions. Hence the hard water turns into soft water since the water does not contain any calcium or magnesium ions.