Thermal expansion coefficients (TEC) of some metallic samples and rocks, along with one sample of amorphous silica, were determined by means of a standard X-ray diffractometer without any modification to the equipment. Only the sample holder was modified in order to fix the sample within the standard goniometer and avoid heat dispersion into the chamber during heating of the sample. The latter was achieved by the Joule effect through a thermo-coaxial wire coil wrapped directly around the bulk sample. A thin metal foil, aluminium in our case, was placed on the flat surface of the cylinder sample. The variations in Al peak position recorded at various sample temperatures were related directly to the dilatation of the material supporting the thin foil.