Windmills were invented in Iraq, and were common in what is now Iraq, and Afganistan in the 7th Century. That land needed windmills because there were not many streams to power water wheels, and power was needed for grinding corn and wheat. The Arab windmill had a veritcal shaft, and was housed inside a cylindrical house. The house had funnel shaped openings in the walls that directed wind onto cloth "sails" that turned the shaft. Grinding stones, one attached to the shaft and one stationary, were placed on top of the shaft. Crusaders took the concept back to Europe, and windmills first appeared in England in 1137 AD. They were adapted to have horizontal shafts, and were used by the Dutch to pump water off of land reclaimed from the sea.
In 1854 Daniel Halliday, a New England machinist, obtained the first American windmill patent, Pat No. 11,629. His windmill had four wooden blades that pivoted and would self adjust according to wind speed. It had a tail which caused it to turn into the wind. His windmill was designed to pump water, and was a Godsend to farmers, ranchers, and the railroad in the arid West after the Civil War, where wind was plentiful, but water could be in short supply.