There are six ways to generate electricity. Some are more widely used than others. Some are used just for specific applications.
FRICTION — Voltage is produced when you rub certain materials together, like a balloon on your sweater. This was the first kind of electricity humans recognized. A Van de Graaff generator produces millions of volts with friction. It is not a very practical way to generate useful voltage—right after the big $ZAP!$ the voltage disappears.
PRESSURE (piezoelectricity) — Voltage produced by squeezing crystals of certain substances like quartz or tourmaline. Pronounced “pee-ay’-zoe”. The microphone in a mobile phone is sensitive to sound pressure because it is made with a piezoelectric alloy called PZT, lead zirconate titanate.
HEAT (thermoelectricity) — Voltage is produced by heating the junction between two different metals that have been welded together. This device is called a thermocouple. It is used to sense temperature. The schematic symbol looks like this,
LIGHT (photoelectricity) — Voltage is produced when light hits a photosensitive (light sensitive) substance. Semiconductor materials like silicon are light sensitive. A photodiode is in a package with a window on top to allow light to hit the diode. The amount of light changes the conductivity of the diode.
CHEMICAL — Voltage can be created by a chemical reaction. We call this a battery. Chemical action generates voltages inside your nerve cells.
MAGNETISM — Voltage produced when the wire moves through a magnetic field, or a magnetic field moves past a conductor. This is how AC electricity is created in large-scale power plants, hydroelectric dams, and portable/emergency generators.
Navy Electricity and Electronics Training Series, NEETS, module 1, page 1-28.