Buzzer Interfacing with 8051 Controller

This article is based on Buzzer Interfacing with 8051 microcontroller, that belongs to Atmel family and scientific name is AT89C51.

What is Buzzer?

A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical, or piezoelectric (piezo for short). Buzzer is widely used for alarm devices such as fire alarms, lifts etc

Buzzer Interfacing
Buzzer Interfacing Components used:
  • Buzzer
  • 8051 Controller (AT89C51)
  • Power Supply
  • L293D
  • Crystal Oscillator (12mhz)
  • Ceramic Capacitor (33pf)
Software used:
Buzzer Interfacing Source Code:
//Program for Buzzer

#include // Header File

void delay(int time) // Delay Function
{
int i,j;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}

sbit pin_1 = P2^0; // Single bit define for pin 1

void main()
{
while(1)
{
pin_1 = 0; // on
delay(100);
pin_1 = 1; // off
delay(100);
}
}

Copy above code and create hex file, learn how to create hex file by watching below video…👇

Learn how to design circuit diagram and embedded programming file, by watching below video:

You may also like...

Leave a Reply