The Greeks discovered electricity in 600 BC by observing that rubbing fur and tree resin caused attraction. The first application of electricity was an electromagnet built in 1831 by Joseph Henry, which was used to lift heavy metals. Otto von Guericke invented the first electric machine in 1672, an electrostatic generator that produced sparks from a sulfur globe using energy from a piece of amber.