Generators are typically used to create electricity when the power is down. They are good in emergency situations when a building still needs electricity to function during poor weather conditions or when lightning has hit a power poll. But how does the generator work? How does it create electricity?
Energy comes in both kinetic and potential forms. A generator takes mechanical energy, which is a form of kinetic, and converts it to electric energy, which is also kinetic.
The generator will usually have an engine that will create a force of mechanical energy similar to how a car engine or a water pump creates energy. This mechanical energy is then sent through a device that causes electromagnetic induction and converts the energy to be used as electricity, powering whatever is attached to the generator.
The engine on the generator will need some type of fuel to create the mechanical energy. This is usually something like diesel fuel, regular gasoline or kerosene, depending on the device. The engine will be whatever size is needed for the output required. Some generators have massive engines, others have equivalent to a lawn mower.
A generator is set up similar to a car. The engine is hooked up to an alternator that will create the electric energy, and that is then passed through the voltage regulator. The regulator makes sure that there aren't any surges in the current and that it runs at a steady rate. From there, the current is passed on to whatever is hooked up to it.
These generators are not designed for continuous use, but for emergency situations, although they are getting more and more sophisticated and less dependent on fuel as time goes on.