A chime doorbell uses a specialized sort of electromagnet called a solenoid. A solenoid is just an electromagnet where the coiled wire surrounds a metal piston. The piston contains magnetically conductive metal, so it can be moved backward or forward by the electromagnetic field.
The common chime design uses a solenoid to hit two tone bars in sequence.
In many instances, the solenoid piston consists of an iron core mounted to a non-magnetic metal bar. When there is no power to the electromagnet, a spring pushes the piston to the left, and the iron core extends outside of the wire coil. When you turn the electromagnet on (by pressing the doorbell button), the iron core is drawn to the magnetic field, so it slides into the center of the coiled wire.
As the iron core slides to the right, the end of the piston strikes the right-hand tone bar. The tone bar vibrates, producing a particular note. This is the "ding" sound.
As long as you hold the doorbell button, current will flow through the electromagnet and the piston will remain in this position. But when you release the button, the current will stop flowing through the electromagnet and the magnetic field will collapse. The spring snaps the piston back to the left, where it hits the tone bar on the other side. The second tone bar produces the "dong" sound.
You can make more elaborate tone sequences by adding more solenoids and tone bars. Some variations on this design produce a different tone pattern when someone rings the back doorbell than when someone rings the front doorbell. Each doorbell button closes a separate circuit, connected to separate solenoids in the doorbell mechanism. In the simplest design, one of the solenoids hits a bumper instead of the second tone bar. In this way, one doorbell button will trigger a "ding-dong" tone and the other button will trigger only a "ding" tone.
In recent years, more and more people have been installing electronic doorbells in their homes. An electronic doorbell doesn't have any electromagnets or tone bars. Instead, it has an integrated circuit (IC) that registers when the button has been pressed. The IC triggers a digitally recorded song or message. A lot of electronic doorbells have a wireless control system so the doorbell mechanism doesn't have to be specially wired.
Electronic doorbells are growing in popularity, but most homes still use conventional electromagnet doorbells. This classic design may not play elaborate songs or messages, but it is so simple and sturdy that it should be around for a long time to come.
For more information on doorbells, including tips for repairing a broken doorbell mechanism, check out the links below.