8051 interfacing with a buzzer

By | June 28, 2015

In this post, let us see the interfacing of a buzzer with 8051 microcontroller.  Buzzer is a signalling device that can able to make buzzing noise on applying voltage.

 

8051 interfacing with a buzzer – block diagram

8051 interfacing with a buzzer - block diagram

 

8051 interfacing with a buzzer – Code

/* 
 * Project : Buzzer interfacing with 8051 Microcontroller
 * Description : In this project, I will be interfaceing 
 *               buzzer to a 8051 microcontroller.
 * Software : Keil uVison4
 * MCU : AT89S51/S52
 * Oscillator : 11.0592 Mhz
 * Date : 11-06-2015
 */   

#include <reg51.h>

sbit Buz  =  P1^0;
sbit PushButton = P2^0;

void main()
{
PushButton = 1;
    while(1) 
    {
	    Buz = 0;
        if(PushButton == 0)  
        { 
            Buz = 1;			   
            while(PushButton == 0); 
        }
    }
}

 

8051 interfacing with a buzzer – Circuit

8051 interfacing with a buzzer - Circuit

8051 interfacing with a buzzer – Board

8051 interfacing with a buzzer – Board

8051 interfacing with a buzzer – Video Demo

 

Leave a Reply

Your email address will not be published. Required fields are marked *