A foghorn is a fog signal that uses sound to warn vehicles of navigational hazards like rocky coastlines, or boats of the presence of other vessels, in foggy conditions. The term is most often used in relation to marine transport. When visual navigation aids such as lighthouses are obscured, foghorns provide an audible warning of rock outcrops, shoals, headlands, or other dangers to shipping.
All foghorns use a vibrating column of air to create an audible tone, but the method of setting up this vibration differs. Some horns, like the Daboll trumpet, used vibrating plates or metal reeds, a similar principle to a modern electric car horn. Others used air forced through holes in a revolving cylinder or disk, in the same manner as a siren. Semi-automatic operation of foghorns was achieved by using a clockwork mechanism (or "coder") to sequentially open the valves admitting air to the horns; each horn was given its own timing characteristics to help mariners identify them.
At some lighthouses, a small cannon was let off periodically to warn away ships, but this had the obvious disadvantage of having to be fired manually throughout the whole period the fog persisted (which could be for several days). Lighthouse windows and lighting apparatus were susceptible to damage depending on the proximity of the explosion. One incident of lax handling of explosives nearby resulted in a concussion that propelled the lighthouse keeper at Fort Amherst, who was seated, to the other end of the room. In the United States, whistles were also used where a source of steam power was available, though Trinity House, the British lighthouse authority, did not employ them, preferring an explosive signal.
Throughout the 19th century efforts were made to automate the signalling process. Trinity House eventually developed a system (the "Signal, Fog, Mk I") for firing a gun-cotton charge electrically. However, the charge had to be manually replaced after each signal. At Portland Bill, for example, which had a five-minute interval between fog-signals, this meant the horns had to be lowered, the two new charges inserted, and the horns raised again every five minutes during foggy periods. Clockwork systems were also developed for striking bells.
The first automated steam-powered foghorn was invented by Robert Foulis, a Scotsman who emigrated to Saint John, New Brunswick, Canada. Foulis is said to have heard his daughter playing the piano in the distance on a foggy night, and noticed the low notes were more audible than the higher notes: he then designed a device to produce a low-frequency sound, as well as a code system for use with it. Foulis repeatedly presented his concept to the Commissioners of Light Houses for the Bay of Fundy for installation on Partridge Island. While the Commissioners initially rejected Foulis's plan, one commissioner eventually encouraged Foulis to submit detailed plans to the Commission. For reasons unknown, the plans were given to another Canadian engineer, T. T. Vernon Smith, who officially submitted them to the Commissioners as his own. The foghorn was constructed at Partridge Island in 1859 as the Vernon-Smith horn. After protest by Foulis and a legislative inquiry, Foulis was credited as the true inventor, but he never patented or profited from his invention.
The development of fog signal technology continued apace at the end of the 19th century. During the same period an inventor, Celadon Leeds Daboll, developed a coal-powered foghorn called the Daboll trumpet for the American lighthouse service, though it was not universally adopted. A few Daboll trumpets remained in use until the mid-20th century.
In the United Kingdom, experiments to develop more effective foghorns were carried out by John Tyndall and Lord Rayleigh, amongst others. The latter's ongoing research for Trinity House culminated in a design for a siren with a large trumpet designed to achieve maximum sound propagation (see reference for details of the Trials of Fog Signals), installed in Trevose Head Lighthouse, Cornwall in 1913.
One of the first automated fog bells was the Stevens Automatic Bell Striker.
Some later fog bells were placed under water, particularly in especially dangerous areas, so that their sound (which would be a predictable code, such as the number "23") would be carried further and reverberate through the ship's hull. For example, this technique was used at White Shoal Light (Michigan). This was an earlier precursor to RACON.
From the early 20th century an improved device called the diaphone, originally invented as an organ stop by Robert Hope-Jones, and developed as a fog signal by John Northey of Toronto, became the standard foghorn apparatus for new installations.[where?] Diaphones were powered by compressed air and could emit extremely powerful low-frequency notes.
In 1982, the Dutch broadcaster VPRO aired a live foghorn concert on national radio, relaying the sound of the foghorns in Emden, Calais, Nieuwpoort, Scheveningen, Den Helder, Lelystad, Urk, Marken and Kornwerderzand, mixed with studio music by sound artist Alvin Curran. 
Since automation of lighthouses became common in the 1960s and 1970s, most older foghorn installations have been removed to avoid the need to run the complex machinery associated with them, and have been replaced with electrically powered diaphragm or compressed air horns. Activation is completely automated: a laser or photo beam is shot out to sea, and if the beam reflects back to the source (i.e. the laser beam is visible due to the fog), the sensor sends a signal to activate the foghorn. In many cases, modern navigational aids have rendered large, long-range foghorns completely unnecessary, according to the International Association of Lighthouse Authorities.
Fog signals have also been used on railway lines since the middle of the 19th century to indicate to the driver of a moving train that a broken down train, a work party, or some other unforeseen hazard is on the line ahead. Small explosive detonators or torpedoes are placed on the track, and detonated by the pressure of the wheels of the oncoming train. The loud report of the explosion provides the indication to the driver, that in most cases requires the train to be stopped immediately. During World War II, these devices were modified to detonate demolition charges during railroad sabotage operations.
Captain Newton also claimed to be the inventor of fog signalling by the interchange and repetition [sic] of loud and low notes.