A piezoelectric speaker works on the principle of the piezoelectric effect, which is the ability of certain materials to generate an electric charge in response to applied mechanical stress. In a piezoelectric speaker, an electrical signal is applied to the piezoelectric material, causing it to vibrate at a specific frequency. These vibrations create sound waves that can be heard as sound by the human ear. This mechanism allows piezoelectric speakers to produce sound without the need for a traditional magnetic coil and diaphragm setup found in conventional speakers.