|An animation of the operation of the Newcomen engine (1712), showing how first steam, from the boiler, at right, is put into the piston and cylinder, above the boiler, which is then cooled, by a spray of cold water, at the point when the piston is at its highest position in the cylinder, which makes a vacuum in the cylinder, which thus forces, via atmospheric pressure, the the piston down; and the cycle repeats. The head of the piston is connected via a rod to a rocker arm, which thus imparts work in the form of reciprocating motion to a water pump on the other end of the rocker arm.|
The following are related quotes:
“Thomas Newcomen, ironmonger and preacher on occasion, completed his engine in 1712 after years of experimenting. His first engine was installed at Dudley Castle in Staffordshire to pump water from a mine. Newcomen's partner, John Calley or Cawley, a plumber and glazier of Dartmouth, provided the manual skill. Newcomen's contribution was an ingenious mixture of familiar devices with ideas of his own. He took the copper kettles and furnaces of brewers to supply the steam for the same kind of cylinder and piston which had been used for lifting water as far back as Roman times and condensed the steam below the piston within the cylinder to create there a partial vacuum which would allow the weight of the atmosphere above to force the piston down. Instead of using Savery's method of creating the vacuum by dashing cold water on the outside and thus condensing the steam, Newcomen sprayed water directly into his vertical cylinder. This condensed the steam, created the vacuum, and allowed the atmospheric pressure to force the piston down. To put this downward pull of the piston to work, he connected its rod by a chain to a horizontal and centrally pivoted working beam, or walking beam as it was later called, and fastened the other end of the beam by a chain and rod to the piston or plunger in the pump cylinder. As new steam was admitted below the first piston and the vacuum broken, this piston was raised again by the weight at the other end of the working beam, and the piston of the pump was lowered to its original position. Thus, the reciprocating motion, up and down, was complete.”— Richard Kirby (1956), Engineering in History (pgs. 162-64) 
1. Kirby, Richard; Withington, Sidney; Darling, Arthur; and Kilgour, Frederick. (1956). Engineering in History (pg. 42). Courier, 1990.
● Reciprocating motion – Wikipedia.