Pages are not fully translated for the English language.

Latest posts

AMP for PWM tone generation (2014)

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, videos

Click the image to show it in higher resolution
Amplifier for sound outputs
Speaker with connector
Speaker and AMP module
Connection with processor
PCB from the components view

Source codes

Click the label to show the source code
LibPWMTone_demo.c - demo

Back to Robotics STM32.