Robert Foulis, a Scottish civil engineer and artist, invented the foghorn in 1854 while living in Saint John, New Brunswick. He was inspired by noticing that the lower notes of his daughter's piano carried further on a foggy night. Foulis designed a device to produce low-frequency sound as a warning system for boats. The original foghorn consisted of a metal horn mounted high atop structures. It was used to warn ships of dangers like rocks during foggy conditions but has since been replaced by lighthouses and other technologies.