Air horn used as a warning device on trains
A train horn is an air horn used as an audible warning device on diesel and electric-powered trains. Its primary purpose is to alert persons and animals to an oncoming train, especially when approaching a level crossing. They are often extremely loud, allowing them to be heard from great distances. They are also used for acknowledging signals given by railroad employees, such as during switching operations. For steam locomotives, the equivalent device is a train whistle.
History and background.
Since trains move on fixed rails, they are uniquely susceptible to collision. This is exacerbated by the train's enormous weight and inertia, which make it difficult to quickly stop when encountering an obstacle. Also, trains generally do not stop at level crossings, instead relying on pedestrians and vehicles to clear the tracks when they pass. Therefore, from their beginnings, locomotives have been equipped with loud horns or bells to warn vehicles and pedestrians that they are coming. Steam locomotives had steam whistles, operated from steam produced by their boilers.
As diesel locomotives began to replace steam on most railroads during the mid-20th century, it was realized that the new locomotives were unable to utilize the steam whistles then in use. Early internal combustion locomotives were initially fitted with small truck horns or exhaust-powered whistles, but these were found to be unsuitable and hence the air horn design was scaled up and modified for railroad use. Early train horns often were tonally similar to the air horns still heard on road-going trucks today. It was found that this caused some confusion among people who were accustomed to steam locomotives and the sound of their whistles; when approaching a grade crossing, when some people heard an air horn they expected to see a truck, not a locomotive, and accidents happened. So, locomotive air horns were created that had a much higher, more musical note, tonally much more like a steam whistle. This is why most train horns have a unique sound, different from that of road going trucks, although many switch engines, which didn't see road service (service on the main lines), retained the deeper truck-like horns.
Strict regulations specific to each country specify how loud horns must be, and how far in advance of grade crossings and other locations locomotive engineers are required to sound their horns to give adequate time to clear the tracks. Standard signals consisting of different sequences of horn blasts must be given in different circumstances.
Due to the encroachment of development, some suburban dwellers have opposed railroad use of the air horn as a trackside warning device. 
Residents in some communities have attempted to establish "quiet zones", in which train crews are instructed not to sound their horns, except in case of emergency.
Recent years have seen an increase of horn theft from railroad property.
Operation.
Train horns are operated by compressed air, typically , and fed from a locomotive main air reservoir. When the engineer opens the horn valve, air flows through a supply line into the power chamber at the horn's base "(diagram, right)". It passes through a narrow opening between a nozzle and a circular diaphragm in the power chamber, then out through the flaring horn bell. The flow of air past the diaphragm causes it to vibrate or oscillate against the nozzle, producing sound.
When an air horn is not operating and has no fluid pressure flowing through it, the interior of the power chamber housing is completely airtight, as the diaphragm disc creates a full airtight seal against the nozzle surface. As this diagram illustrates, when a constant stream of pressurized fluid enters through the small bottom inlet, the pressure in the airtight power chamber increases. The pressure continues rising in Chamber 'A' until the pressure overcomes the diaphragm's spring tension. Once this occurs, the diaphragm is deflected back and is no longer sealed against the nozzle, causing the power chamber to lose its airtightness. The pressurized fluid then escapes out of the horn bell, at a much faster rate than it enters the power chamber, causing the pressure in the power chamber to drop rapidly and the diaphragm to re-seat itself against the nozzle surface. This entire process is one cycle of the diaphragm operating. In reality, it occurs much faster, in accordance to the frequency produced by the horn. The diaphragm's constant back-and-forth oscillation creates sound waves, which are amplified by the large flared horn bell. The horn bell's length, thickness and diameter contribute to the frequency of the note the horn produces.
When vibrated by the diaphragm, the column of air in the bell oscillates with standing waves. The bell's length determines the waves' wavelength, and thus the fundamental frequency (pitch) of the note produced by the horn (measured in hertz). The longer the bell, the lower the note.
North American diesel locomotives manufactured prior to the 1990s used an air valve actuated by the engineer through the manipulation of a lever or pull cord. This made possible a practice known as "feathering", where the engineer could affect the horn's modulation, and thus its volume, by changing the volume of air flowing into it.
Many locomotives manufactured during the 1990s have push-button horn controls. Several North American locomotives incorporated a sequencer pedal, built into the cab floor beneath the operator's position; when depressed, they sound the crossing sequence.
Locomotives of European origin have had push-button horn controls since the mid-1960s.
Current production locomotives from GE Transportation Systems and Electro-Motive Diesel use a lever-actuated solenoid valve.
Placement on trains.
As many individuals do with their personal vehicles, railroads order locomotives and cab cars with different options in order to suit their operating practices. Air horns are no exception, and railroad mechanical forces mount these on locomotives where they are deemed most effective at projecting sound, and for ease of maintenance.
Audio samples.
The following are samples of select air horns as used in North American railroad service:
Countries.
United States.
On April 27, 2005, the Federal Railroad Administration (FRA), which enforces rail safety regulations, published the final rule on the use of locomotive horns at highway-rail grade crossings. Effective June 24, 2005, the rule requires that locomotive horns be sounded at all public grade crossings at least 15 seconds, but not more than 20 seconds before entering a crossing. This rule applies when the train speed is below . At 45 mph or above, trains are still required to sound their horn at the designated location (usually denoted with a whistle post). The FRA regulations require train horns to be a minimum of 92 decibels (dB) and a maximum of 110 dB when measured from 100 feet forward of the locomotive in its direction of travel.
The pattern for blowing the horn remains two long, one short, and one long. This is to be repeated or prolonged as necessary until the lead locomotive fully occupies the crossing. Locomotive engineers retain the authority to vary this pattern as necessary for crossings in close proximity, and are allowed to sound the horn in emergency situations no matter where the location.
A ban on sounding locomotive horns in Florida was ordered removed by the FRA after it was shown that the accident rate doubled during the ban. The new ruling preempts any state or local laws regarding the use of the train horn at public crossings. This also provides public authorities the option to maintain or establish quiet zones provided certain supplemental or alternative safety measures are in place, "and the crossing accident rate meets government standards".
Common horn signals.
The following are the required horn signals listed in the operating rules of most North American railroads, along with their meanings. Signals are illustrated by an ;templatestyles src="Morse/styles.css"/ ;▄  for short sounds, and ;templatestyles src="Morse/styles.css"/ ;▄▄▄  for longer sounds. (Note that these signals and their indications are updated to reflect modern practice; in earlier times there were unique whistle signals for the engineer to, for example, send out and then later recall the brakeman/flagman riding in the caboose.) Those rules marked with an asterisk (✱) must be sounded when or where applicable. Those signals without an asterisk convey information to employees; they must be used when voice communication is not available.
Canada.
According to section 11 of Transport Canada's Locomotive Design Requirements, all Canadian-owned passenger train locomotives must be equipped with a dual-tone horn capable of producing a soft sound in normal operating mode and a loud sound in emergency situations. To comply with federal requirements, passenger railways use the Nathan K5CA-LS. This horn has two different air chambers, allowing the engineer to choose between sounding three chimes in "soft" mode or all five chimes in "loud" mode. The "loud" mode is intended for emergency situations, such as when a person or vehicle is on the tracks in front of an incoming train. The loud emergency mode produces a high-pitched and extremely discordant sound to get people's attention.
To maximize sound output, Transport Canada requires that all train horns be mounted facing the direction of travel, near the front of the roof, no further than behind the rear of the cab, and near the centerline of the locomotive in a location where it will not obstruct exhaust pipes in any direction.
Train horns must produce a minimum sound level of 96 decibels (dB) in a radius from the locomotive.
Horn warning signals.
According to the May 2018 version of the Canadian Rail Operating Rules (CROR), specific train horn warning signals must be sounded as per rule 14. Like the American Federal Railroad Administration, signals are illustrated using ;templatestyles src="Morse/styles.css"/ ; ▄  for short sounds, and ;templatestyles src="Morse/styles.css"/ ; ▄▄▄  for longer sounds. In the CROR, it states that warning signals "should be distinct, with intensity and duration proportionate to the distance the signal is to be conveyed". The following table lists the train horn warning signals required by Transport Canada. The signals marked with an asterisk (✱) must not be replaced with radio communication.
Noise from train horns.
Residents living in close proximity to train tracks may be disturbed by the sounding of train horn warning signals. However, train drivers are obligated to sound their horns at all times, which may lead to noise complaints. Transport Canada allows municipalities to pass bylaws that prohibit train horn sounding at train stations and level crossings, as long as Transport Canada grants approval to that municipality.
Germany.
Horn signals are regulated in the "Zp" category of the Eisenbahn-Bau- und Betriebsordnung. Their most common use today is when approaching a level crossing that lacks barriers, and for warning purposes.
Whistle posts are labeled with the letter "P" (for – "whistle").
Common signals are:
France.
Train horns are sounded where a whistle post (marked with the letter "S" for – "to whistle") is present. If the whistle post is labelled "J" (meaning – "day"), the horn is only to be sounded between 07:00 and 20:00. Horns must also be sounded when passing an oncoming train, and shortly before reaching the last car of the train.
Train horns must also be used upon entering into a tunnel: first horn shortly before the tunnel entrance, second horn when entering, third horn shortly before the tunnel's exit. 
India.
 ;templatestyles src="Morse/styles.css"/ ;▄  denotes a short blast on the horn; ;templatestyles src="Morse/styles.css"/ ;▄▄  denotes a comparatively long blast on the horn; ;templatestyles src="Morse/styles.css"/ ;▄▄▄  denotes a longer blast on the horn; and ;templatestyles src="Morse/styles.css"/ ;▄▄▄▄▄▄▄▄▄▄▄  denotes a very long blast on the horn.
The Indian Railways Fan Club FAQ lists the following:
United Kingdom.
UK diesel and electric locomotives are usually fitted with two-tone horns, sounded sequentially to distinguish them from the horns used on road vehicles, the tones being described as either 'high' or 'low'. In the past, both tones were routinely used. The basic rules from the early 1960s required that the horn should be clearly audible at a distance of from the source. However, because of noise complaints, new rules were introduced in 2007:
British train horns have two tones, high or low, and in some cases, a loud or soft setting. If the horn lacks a loud-or-soft setting then train drivers are to use the setting provided.
Manufacturers.
North America.
AirChime, Ltd..
AirChime, Ltd. traces their beginnings through the work of Robert Swanson in 1949. Prior to the early 1950s, locomotives were equipped with air horns that sounded a single note.
Swanson sought to develop an air horn which would mimic the sound of a classic steam whistle. Using ancient Chinese musical theory, Swanson