This project explains the concept behind generating sound from the 8051 microcontroller (AT89C51). This concept can be used to generate sound with any MCU. It can be used to generate specific sounds or alarms. This circuit has wide applications like in cars to produce sound while reversing, in electronic piano to generate different tones, or in electronic toys to generate tones.
Sound is a function of frequency. This concept has been used to generate sound from the microcontroller. Different types of sounds can be produced by varying the frequency.
Frequencies are generated by using Timer1 of microcontroller. Timer is used to produce exact delays and by toggling the output pin we can generate the desired frequencies. These frequencies are then fed to a particular pin (here Pin 0 of port1) which is connected to speaker. The output can be heard on the speaker. By combining the different frequencies we can generate different tones and alarms.
Sound is a function of frequency. This concept has been used to generate sound from the microcontroller. Different types of sounds can be produced by varying the frequency.
Frequencies are generated by using Timer1 of microcontroller. Timer is used to produce exact delays and by toggling the output pin we can generate the desired frequencies. These frequencies are then fed to a particular pin (here Pin 0 of port1) which is connected to speaker. The output can be heard on the speaker. By combining the different frequencies we can generate different tones and alarms.
To download the code for this project click on below button