Buzzer is an electronic device which runs on +5V DC supply. Buzzer needs minimum of 50mA of current to generate the sound. As the 8051 microcontroller can sink or source maximum of 10mA current on any of the port pin, we need the driver circuit to boost the current level from 10mA to 50mA. For this, we can use the transistor circuit. If we want to control the sound level of the buzzer then we can go for PWM technique due to which we make the 8051 microcontroller to invest more time in generating the PWM pulses.
We can turn the Buzzer ON by applying Logic ‘1’ and turn the Buzzer OFF by applying Logic ‘0’ at the Base of the transistor BC547.