In science fiction series and movies like Star Trek, Star Wars, The war of the worlds, Independence Day (1996) , Macross (1982) , spaceships and/or robots use force fields to protect the mechas from being damaged. The concept is very popular and widely used in many stories. But where does this concept come from? Which was the first story to use the idea of a force field or energy field?
It appears that the earliest may in fact be 1887 in Rondah, or Thirty-Three Years in a Star. I will add some quotes when I have a chance to type them out, but "the wall in the air" seems to have the expected properties of a force field.
The "wall" is an invisible, impenetrable barrier that encloses Sun Island in the story. The barrier physically blocks access by land, water or air; a flying craft that runs into it is smashed. Attempts to breach it are blocked or rebounded back, and it blocks radiation outside the visible spectrum (specifically heat) as well.
It is not, however, an actual physical object, since it is occasionally turned off.
All in, it's fairly close to what would be understood as a "force field", lacking only the name.
There are conceptual precursors which would now be classed as force fields although not originally described as such. In William Hope Hodgson's The Night Land: A Love Story (1912; cut 1921), humanity's Last Redoubt is defended by the "Electric Circle" which generates the "Air Clog ... an Invisible Wall of Safety." Some kind of force-field Technology (though here more akin to the Tractor Beam) seems to underlie the invisible "flying loop" which provides action-at-a-distance effects in Rudyard Kipling's "As Easy as A.B.C." (March-April 1912 The London Magazine). Everett F Bleiler's Science Fiction: The Early Years: A Full Description of More Than 3,000 Science-Fiction Stories from Earliest Times to the Appearance of the Genre Magazines in 1930 with Author, Title, and Motif Indexes (dated 1990 but 1991) lists further examples including Florence Carpenter Dieudonné's Rondah, or Thirty-Three Years in a Star (1887) – perhaps the earliest use of the concept in Proto SF – and John Mastin's Through the Sun in an Airship (1909).
(These aren't specifically called "force fields," but may qualify as answers to the question since it seeks the first use of the idea of a force field.)
Actually, Wikipedia seems to have an answer:
The concept of a force field goes back at least as far as the 1920s, in the works of E.E. 'Doc' Smith and others; in William Hope Hodgson's The Night Land (1912) the Last Redoubt, the fortress of the remnants of a far-future humanity, is kept safe by something very like a force field.
Importantly, Wells does not seem to have supplied the alien invaders with these although it would not be a huge stretch (and Wells seemed amazing at forecasting the future -- I believe he coined the term "atomic bomb" 30 years before fission was discovered) since "fields" of static electricity could be created by Tesla by the 1890s and perhaps this could have, but apparently didn't, inspire protecting the tripods with them. It was in Pal's 1953 WoW that force fields show up.
According to this site here: http://www.technovelgy.com/ct/content.asp?Bnum=7901
The earliest uses of the term force-field include two from 1931, John W. Campbell's Islands of Space and E.E. Smith's Spacehounds of IPC.
Thus the use of force fields in science fiction may date to 1931 or earlier.