Richard Trevithick (1771-1833), an English engineer, is credited with building the first functioning steam locomotive. He started as a mining engineer where low pressure steam engines were used to power pumps and elevators. After an acquaintance built a model of a steam powered car he got interested in the idea and decided to use a more dangerous high power steam engine to build a working prototype.
In 1801 he built his first steam carriage. Eventually, for use in the mines, he built a locomotive that ran on tracks for delivering heavy material to and from the mines. Although he had success selling his steam engines, he was poor businessman and ended up destitute.
The video below is of a replica of his locomotive in action.











