Who invented the telegraph machine?
Electrical telegraph
Hans Christian Ørsted discovered in 1820 that an electric current produces a magnetic field which will deflect a compass needle. In the same year Johann Schweigger invented the galvanometer, with a coil of wire around a compass, which could be used as a sensitive indicator for an electric current. In 1821, André-Marie Ampère suggested that telegraphy could be done by a system of galvanometers, with one wire per galvanometer to indicate each letter, and said he had experimented successfully with such a system. 
In 1824, Peter Barlow said that such a system only worked to a distance of about 200 feet (61m), and so was impractical.[4]