Sir Ernest William Moir (9 June 1862 – 14 June 1933) was a British civil engineer and the first Moir baronet. He is credited with inventing the first medical airlock while working on the Hudson River Tunnel in New York in 1889.
The son of Alexander Mitchell Moir and of Scottish descent, he was born in London and was educated at University College School. At a young age he showed a great interest in mechanics and became expert in mechanical and engineering work while in college. Aged about 15, Moir joined the engineering works of Messrs. Robert Napier and Sons in Glasgow where he served an apprenticeship as a mechanical engineer. He studied engineering at University College London before joining the firm of William Arrol in Glasgow where he started in the drawing office. In his early career he also came into close contact with John Fowler, Benjamin Baker and John Wolfe Barry.
Moir was the assistant to James Henry Greathead (1844–96) on the building of the London (City) & Southwark Subway, later the City & South London Railway (and now part of the Northern line) in the late 1880s. He was also involved in the construction of the southern cantilevers of the Forth Bridge.
After British consulting engineering expertise was required at the Hudson River Tunnel in New York, Sir Benjamin Baker provided a report which facilitated $1.5 million of British investment, and in 1889 construction resumed with a contract let to British contractor S. Pearson & Son; Moir was originally resident engineer working for Sir William Arrol and designed an 80-ton steel tunnelling shield for each tunnel at Baker's directions. Moir became contractor’s agent (for S. Pearson & Son) in January 1890, working there until British engineering efforts were suspended in 1891. While in New York from May 1890 Moir invented an airlock chamber for treating decompression sickness when he noticed that about 25% of the workforce digging the Hudson River Tunnel were dying and was surprised to note that "nobody has seemed to care anything about it." He realised that the solution was recompression and his airlock was quickly applied throughout the industry. While Moir's treatment was effective it was too fast by modern standards but he began the process which would lead to the effective treatment of decompression sickness.