Schematic diagram of a typical thermoelectric module. Small legs of n-type (red) and p-type (blue) materials are connected in series and then sandwiched between ceramic substrates. In the case of electrical generation, heat is applied to one side of the module, causing the charge carriers to diffuse across the module and generating an electrical current.