AMP for PWM tone generation (2014)
I have always missed sound feedback from my creations. A horn fits to cars, beep to distance measurement, etc. People react both to visual stimuli (LEDs) and sound. So, it was time to solve this problem.
I had some experience with PWM for piezo speakers (buzzers) from the previous platform. But the output signal was always rather faint. I decided to create a module for processing of the PWM sound signal which I generate using one of my own libraries.
The module consists of two parts – piezo speaker direct output from the processor and amplifier unit for stronger signal. I used LM386 as an amplifier. The advantages of this IO are simple assembly and minimum of necessary parts. Since I generate rectangular PWM signal, the gain of this IO is sufficient for my usage with reasonable power dissipation.
I prepared a small speaker and main theme from Flintstones for this module for both module and PWM tone library testing. If the output generates unpleasant background noise, it is for the best to remove the input trimmer. The hum than disapeare.
Pictures, schemes, videosClick the image to show it in higher resolution
Source codesClick the label to show the source code
Back to Robotics STM32.