|Left: Ctesibius’ aeolipile (c.250BC), shown hooked up to a weight raising device, the earliest known type of steam-making type of heat engine. Right: the Papin engine (1690), the prototype of all modern day “steam engines”, and forerunner to the combustion engine.|
A steam-engine is now generally understood an engine in which the elasticity or volume expansion-force of steam is used as the moving-power or motive power; just as the weight or impulse of water is in the water-wheel, or the pressure of the wind in a windmill. In some of the earlier engines of this kind, it was really the pressure of the atmosphere that was the motive-power, steam being employed merely as a means of producing a vacuum through its rapid condensation, and thus allowing the pressure of the atmosphere to come into play. 
See main: History of the steam engineIn 235BC, Archimedes, according to da Vinci (c.1500), invented a architronito, or steam-powered cannon that throws 70lb iron balls, via the action of “great noise and fury”, at the enemy, by the action of heat derived from burning coals; diagrams of which are found in da Vinci’s notebooks; the gist of which is diagrammed as follows: 
In 230BC, Ctesibius invented the a water-filled metal sphere, that could be made to rotate when heated or put in contact with water. This device came to be known as the ‘aeolipile’, named after Aeolus, the Greek god of wind, as later described by both Roman architect Vitruvius (15BC). 
In 50AD, Hero gave a detailed account of the aeolipile (fig 1) and also his solar boiler device (fig 2), shown below: 
Owing to the fact that Hero was the first to give a detailed account on how to make an aeolipile, the device has since come to be known as Hero's engine or the aeolipile of Hero.
In 1543, Spanish captain Blasco de Garay is said to have demonstrated a steamboat of his own invention in the harbor of Barcelona. It has been argued that Garay's engine was an aeolipile type of engine, in which steam produces rotatory motion by issuing from orifices, as water does in Barker's mill. 
In 1551, Arabian engineer Taqi al-Din, who described a method for rotating a spit by means of a jet of steam playing on rotary vanes around the periphery of a wheel.
|A depiction of the temple door steam engine built by Greek engineer Hero of Alexandria, in circa 50AD, the first working heat engine.|
In 1606, Giovanni Porta published a translation of Hero's work, in which After which, he added an illustrated modified variant of his own, similar to a combination of the above two devices; as shown below, wherein wherein, a fire is put under flask a, filled with water, which makes steam, that enters closed container b, filled with cold water, which forces the water to shoot out of tube c: 
In 1606, Jeronimo de Ayanz (1553-1613) (Ѻ) obtained a patent for some type of steam-powered water pump for draining water from mines; and by 1611, the machine was said to have been in operation in a silver mine in Guadalcanal, near Seville. (Ѻ)
In 1615, Salomon de Caus, in his The Reason for Moving Forces, stated that there, historically, have been five main methods of elevating water above its level, which he recounts as follows: 
1. Siphon, which he says is older than Hero.
2. Operation by capillary attraction.
3. By the aid of fire.
4. Action of compressed air, as illustrated by Hero's fountain, and ascribed to Hero.
5. Animal labor applied to machinery, such as the screw of Archimedes, or the pump of Ctesibius.
Caus, in respect to method #3, says that there are many types of devices, and gives the following device as an example, which is similar to that made or diagrammed by Giovanni Porta (c.1601):
The operation is such that globe a is filled with water, which has a valve b attached, for adding water, and a tube c soldered into the upper part of the bulb, with a valve, the operation of which being such that, when fire is put under the globe, water shoots out of the tube c, like a fountain.
In 1629, Italian engineer Giovanni Branca invented a sort of steam-powered windmill, which he used for grinding his drugs, variations of which shown below, in which the steam being generated in a boiler was directed by a spout against the flat vanea of a wheel, which was thus set in motion: 
In 1647, Nathaniel Nye, an English mathematician, in his The Art of Gunnery, proposed to "charge a piece of ordinance without gunpowder, by using water, in stead of gunpowder".
In 1648, John Wilkins described a a device for a steam driven rotating a spit.
In 1655, Edward Somerset, aka Marquis of Worcester, in his Century of Inventions, describes a steam-apparatus by which he raised a column of water to the height of 40 feet. This, with the exception of Blasco's, was said to have been the first really useful application of steam; the others had been mere toys.
In 1659, R. D’Acres, in his The Elements of Water Drawing, described a heat engine, of some sort, in detail.
In 1683, Samuel Morland submitted a project to Louis XIV for raising water by means of steam, accompanying it with ingenious calculations and tables.
Piston and cylinder steam engine
Parmenides's 485BC postulate that nature abhors a vacuum (horror vacui), German engineer Otto Guericke invented (or began to use) a piston and cylinder (1645), vacuum pump (1647), and the Magdeburg hemispheres (1654); and with these instruments, Guericke showed that it was possible, manually, to create a vacuum or to remove the air from a sealed volume.
Guericke’s vacuum pump was first described in the book 1657 book Mechanical Hydraulic Pneumatics by German scientist Gaspar Schott, a correspondent of Guericke. Two thinkers who took great interest in this publication were Dutch mathematical physicist Christiaan Huygens and English physicist and chemist Robert Boyle who read the book. Boyle assigned his assistant and his assistant Robert Hooke the job of making an improved Guericke's air vacuum design, which he did in 1658, albeit one that also functioned as a pump.
In the decades to follow, Huygens began working with French engineer Denis Papin to make various piston and cylinder gunpowder engines, with various amounts of success. The biggest hurdle to these gunpowder engines was that they became fouled quickly and failed to make a so-called "perfect vacuum", but instead would only make a partial vacuum, yielding a limited amount of work.
Out of this effort, in 1679 Papin made a pressure cooker or bone digester, which could turn almost anything solid into the liquid state and then into the gaseous state. Early designs exploded, after which a pressure release valve was introduced. It is said that by watching this pressure release valve bob up and down that Papin conceived of the steam engine.
In 1690, Papin in his memoir "A New Method to Obtain Very Great Motive Powers at Small Cost", outlined with illustration the modern piston and cylinder steam engine as we now know it, in which a liquid put inside of the cylinder was first put in contact with a hot body (fire) and made to expand, then put in contact with a cold body (stream of river water), a quickly made vacuum would be created that would drive the piston down in such a manner that if the process was repeated, in a cyclical manner, useful work could be obtain.
In the years to follow, so it is said, English engineer Thomas Savery learned of Papin's designs, e.g. Papin's engine designs were published in the Royal Society notes in 1697, and in 1698 Savery obtained a patent what became to be known as the Miner's friend, a sort of sump pump, that was the first working modern steam engine. In 1699, Savery exhibited a working model of his invention before the Royal Society. Savery, in pumping mines, made use of the condensation of steam in a close vessel to produce a vacuum, and thus raise the water to a certain height, after which the elasticity of steam pressing upon its surface was made to raise it still further in a second vessel.
|A diagram of a comparison of the Papin engine, Newcomen engine, and Watt engine. |
In the latter half of the 18th century, Scottish engineer James Watt add on a number of inventions and design improvements to the functionality of the steam engine, including: separate condenser (1765), sun and planet gear (1781), the fly-ball governor (1788), the indicator (1796) and "indicator diagram", made with his employee John Southern, which tracked the changes in volume of the piston, the definition of "pony power" (or horse power).
The essential difference between the Papin engine, Newcomen engine, and Watt engine, each of which operating via rapid condensation of steam to make a vacuum, is summarized as follows, as illustrated adjacent:
“Papin had a piston in a cylinder in which he boiled his water, afterwards condensing the steam slowly in the same vessel. Newcomen generated his steam in a vessel separate from the cylinder, but still condensed the steam rapidly in the cylinder itself. Watt made use of a boiler and a cylinder like Newcomen, but condensed the steam rapidly in an entirely separate vessel.”— Henry Dickinson (1939), A Short History of the Steam Engine (pg. 67)
The physics underlying the operation of the steam engine, specifically the understanding of how fire (or heat) creates cyclical mechanical movement (up and down piston movement), through its actions on an intermediate substance (water), is the basic science of thermo-dynamics, initiated with the 1824 publication Reflections on the Motive Power of Fire by French physicist Sadi Carnot.
The “veritable creators” of the steam engine, starting with Savery and Newcomen, according to Carnot, are English engineer John Smeaton, who made an improved Newcomen engine (1775), Scottish engineer James Watt, who made a number of improvements to the Newcomen engine, such as the separate condenser (1765), sun and planet gear (1781), centrifugal governor (1788), and indicator diagram (1796), English engineer Arthur Woolf, who designed an improved boiler for producing high pressure steam (1803) and invented a compound steam engine (1805), and English engineer Richard Trevithick who built the first steam engine automobiles (1801).
In each of these various heat engines, Carnot presumed that the key to their operation was the "re-establishment of equilibrium in the caloric". The theory was later proven false by German physicist Rudolf Clausius who, beginning in 1850, corrected this supposition with the mathematical argument of "increase in entropy" in the cycle. 
1. Carnot, Sadi. (1824). Reflections on the Motive Power of Fire: and on Machines Fitted to Develop that Power. Paris: Chez Bachelier, Libraire, Quai Des Augustins, No. 55.
2. Galloway, Robert L. (1881). The Steam Engine and its Inventors. London: MacMillan and Co.
3. Savery, Thomas. (1702). The Miner's Friend – or an Engine to Raise Water by Fire, [URL]. London.
4. Clausius, R. (1865). The Mechanical Theory of Heat – with its Applications to the Steam Engine and to Physical Properties of Bodies. (Google Books). London: John van Voorst, 1 Paternoster Row. MDCCCLXVII.
5. Anon. (1868). Chamber’s Encyclopedia: a Dictionary of Universal Knowledge, Volume 9 (section: Steam engine, 99-103). Publisher.
6. (a) Vitruvius. (15BC). On Architecture, Chapter VI (paragraph 2). Publisher.
(b) Hero. (date). Pneumatica (aeolipile). Alexandria: Publisher.
(c) Ctesibius – Wikipedia.
7. (a) Gale, Leonard. (1838). Elements of Natural Philosophy (Barker’s mill, pg. 89). Collins, Keese, & Co.
(b) Barker’s mill – Britannica.
8. Saussaye, L. La and Paean, A. (1869). The Life and Works of Denis Papin (La vie et les ouvrages de Denis Papin) (Open Library). Publisher.
9. (a) Da Vinci, Leonardo. (c.1518). The Notebooks of Leonardo Da Vinci (pgs. 142-43). Arcturus, 2017.
(b) Architonnerre – Wikipedia.
10. Anon. (1829). “On the Early History of the Steam Engine” (Ѻ), Journal of the Franklin Institute, 4(8):319-27.
11. (a) Anon. (1829). “On the Early History of the Steam Engine” (Ѻ), Journal of the Franklin Institute, 4(8):319-27.
(b) Thurston, Robert Henry (1878). A History of the Growth of the Steam-Engine (pg. #). D. Appleton and Company.
12. Dickinson, Henry W. (1939). A Short History of the Steam Engine (pg. 67). Cambridge University Press.
● Lardner, Dionysius. (1840). The Steam Engine: Explained and Illustrated – With an Account of its Invention and Progressive Improvement and its Application to Navigation and Railways; also Including a Memoir of Watt. Taylor and Walton.
● LeVan, William B. (1889). The Steam Engine and the Indicator: Their Origin and Progressive Development. H.C. Baird & Co.
● Steam engine – Wikipedia.