<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cognifront.com/docs/index.php?action=history&amp;feed=atom&amp;title=Buzzer_with_Arduino_Uno</id>
	<title>Buzzer with Arduino Uno - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.cognifront.com/docs/index.php?action=history&amp;feed=atom&amp;title=Buzzer_with_Arduino_Uno"/>
	<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=Buzzer_with_Arduino_Uno&amp;action=history"/>
	<updated>2026-11-17T00:35:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=Buzzer_with_Arduino_Uno&amp;diff=1400&amp;oldid=prev</id>
		<title>CogWikiEditor: /* Buzzer ON/OFF Control Program */</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=Buzzer_with_Arduino_Uno&amp;diff=1400&amp;oldid=prev"/>
		<updated>2026-11-14T11:09:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Buzzer ON/OFF Control Program&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:09, 14 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l156&quot;&gt;Line 156:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 156:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#define buz &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;4&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#define buz &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;D4&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void setup()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;void setup()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l167&quot;&gt;Line 167:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 167:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   digitalWrite(buz, HIGH);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   digitalWrite(buz, HIGH);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   delay(1000);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   delay(1000);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   digitalWrite(buz, LOW);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   digitalWrite(buz, LOW);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   delay(1000);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   delay(1000);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=Buzzer_with_Arduino_Uno&amp;diff=1399&amp;oldid=prev</id>
		<title>CogWikiEditor: Created page with &quot; == Interfacing Piezo Buzzer with Arduino UNO for Sound Generation ==  &#039;&#039;&#039;Interfacing Piezo Buzzer with Arduino UNO for Sound Generation&#039;&#039;&#039; demonstrates how a piezoelectric buzzer can be connected to an Arduino UNO board to generate sound using digital output signals.  A piezoelectric buzzer is an electronic device commonly used for producing sound and alert signals.  The Arduino UNO controls the buzzer by providing HIGH and LOW signals through a digital GPIO pin.  In th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=Buzzer_with_Arduino_Uno&amp;diff=1399&amp;oldid=prev"/>
		<updated>2026-11-14T11:09:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Interfacing Piezo Buzzer with Arduino UNO for Sound Generation ==  &amp;#039;&amp;#039;&amp;#039;Interfacing Piezo Buzzer with Arduino UNO for Sound Generation&amp;#039;&amp;#039;&amp;#039; demonstrates how a piezoelectric buzzer can be connected to an Arduino UNO board to generate sound using digital output signals.  A piezoelectric buzzer is an electronic device commonly used for producing sound and alert signals.  The Arduino UNO controls the buzzer by providing HIGH and LOW signals through a digital GPIO pin.  In th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Interfacing Piezo Buzzer with Arduino UNO for Sound Generation ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Interfacing Piezo Buzzer with Arduino UNO for Sound Generation&amp;#039;&amp;#039;&amp;#039; demonstrates how a piezoelectric buzzer can be connected to an Arduino UNO board to generate sound using digital output signals.&lt;br /&gt;
&lt;br /&gt;
A piezoelectric buzzer is an electronic device commonly used for producing sound and alert signals.&lt;br /&gt;
&lt;br /&gt;
The Arduino UNO controls the buzzer by providing HIGH and LOW signals through a digital GPIO pin.&lt;br /&gt;
&lt;br /&gt;
In this experiment, the buzzer is connected to digital pin 4 of the Arduino UNO. The buzzer is turned ON for 1 second and turned OFF for 1 second. This process is repeated continuously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Arduino UNO → Digital Pin 4 → Piezo Buzzer → Sound&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;piezoelectric buzzer&amp;#039;&amp;#039;&amp;#039; is an electronic device commonly used to produce sound.&lt;br /&gt;
&lt;br /&gt;
The piezoelectric buzzer works on the &amp;#039;&amp;#039;&amp;#039;inverse principle of piezoelectricity&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The buzzer contains a piezoelectric element and a diaphragm.&lt;br /&gt;
&lt;br /&gt;
When an alternating electrical signal is applied to the piezoelectric element, it produces mechanical vibrations. These vibrations cause the diaphragm to move, generating sound waves.&lt;br /&gt;
&lt;br /&gt;
A passive piezo buzzer requires an alternating electrical signal of a suitable frequency to produce a continuous audible tone.&lt;br /&gt;
&lt;br /&gt;
The Arduino UNO can control the buzzer using digital output signals.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HIGH (5V):&amp;#039;&amp;#039;&amp;#039; Applies a HIGH voltage to the buzzer signal pin.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;LOW (0V):&amp;#039;&amp;#039;&amp;#039; Applies a LOW voltage to the buzzer signal pin.&lt;br /&gt;
&lt;br /&gt;
By repeatedly changing the output state between HIGH and LOW, the Arduino UNO controls the buzzer operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Electrical Signal → Piezoelectric Element → Diaphragm Vibration → Sound&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Piezo Buzzer Pins ==&lt;br /&gt;
&lt;br /&gt;
The piezo buzzer has two pins:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Pin&lt;br /&gt;
! Connection&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
| +&lt;br /&gt;
| Arduino UNO Digital Pin 4&lt;br /&gt;
| Signal input&lt;br /&gt;
|-&lt;br /&gt;
| −&lt;br /&gt;
| GND&lt;br /&gt;
| Ground&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pin marked with &amp;#039;&amp;#039;&amp;#039;+&amp;#039;&amp;#039;&amp;#039; is the signal pin and is connected to digital pin 4 of the Arduino UNO.&lt;br /&gt;
&lt;br /&gt;
The pin marked with &amp;#039;&amp;#039;&amp;#039;−&amp;#039;&amp;#039;&amp;#039; is the ground pin and is connected to the &amp;#039;&amp;#039;&amp;#039;GND&amp;#039;&amp;#039;&amp;#039; pin of the Arduino UNO.&lt;br /&gt;
&lt;br /&gt;
== Sound Generation ==&lt;br /&gt;
&lt;br /&gt;
Sound is generated when an electrical signal is applied to the piezoelectric element.&lt;br /&gt;
&lt;br /&gt;
In this experiment, the Arduino UNO generates HIGH and LOW output signals using the &amp;#039;&amp;#039;&amp;#039;digitalWrite()&amp;#039;&amp;#039;&amp;#039; function.&lt;br /&gt;
&lt;br /&gt;
The buzzer is activated for 1000 milliseconds and deactivated for another 1000 milliseconds.&lt;br /&gt;
&lt;br /&gt;
This ON/OFF operation produces a repeated sound pattern.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; The reference program is suitable for an active buzzer that produces sound when a DC voltage is applied. A passive piezo buzzer generally requires a frequency-generating function such as &amp;#039;&amp;#039;&amp;#039;tone()&amp;#039;&amp;#039;&amp;#039; to produce a continuous audible tone.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
Piezoelectric buzzers are commonly used in:&lt;br /&gt;
&lt;br /&gt;
* Refrigerators&lt;br /&gt;
* Automotive instruments&lt;br /&gt;
* Security and alarm systems&lt;br /&gt;
* Electronic instruments&lt;br /&gt;
* Home appliances&lt;br /&gt;
* Notification systems&lt;br /&gt;
* Industrial warning systems&lt;br /&gt;
&lt;br /&gt;
== Connections ==&lt;br /&gt;
&lt;br /&gt;
The buzzer is connected to digital pin 4 of the Arduino UNO.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Device&lt;br /&gt;
! Pin&lt;br /&gt;
! Arduino UNO&lt;br /&gt;
! Function&lt;br /&gt;
|-&lt;br /&gt;
| Piezo Buzzer&lt;br /&gt;
| +&lt;br /&gt;
| Digital Pin 4&lt;br /&gt;
| Signal input&lt;br /&gt;
|-&lt;br /&gt;
| Piezo Buzzer&lt;br /&gt;
| −&lt;br /&gt;
| GND&lt;br /&gt;
| Ground&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; The buzzer signal pin is connected to digital pin 4, while the negative pin is connected to GND.&lt;br /&gt;
&lt;br /&gt;
== Algorithm ==&lt;br /&gt;
&lt;br /&gt;
The following algorithm is used for controlling the buzzer using digital output:&lt;br /&gt;
&lt;br /&gt;
# Start the Arduino IDE.&lt;br /&gt;
# Connect the Arduino UNO board to the computer using a USB cable.&lt;br /&gt;
# Declare a variable to assign digital pin 4 as the buzzer pin.&lt;br /&gt;
# In the &amp;#039;&amp;#039;&amp;#039;void setup()&amp;#039;&amp;#039;&amp;#039; function, configure the selected pin as &amp;#039;&amp;#039;&amp;#039;OUTPUT&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# In the &amp;#039;&amp;#039;&amp;#039;void loop()&amp;#039;&amp;#039;&amp;#039; function, make the selected pin &amp;#039;&amp;#039;&amp;#039;HIGH&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Keep the buzzer ON for 1000 milliseconds.&lt;br /&gt;
# Make the selected pin &amp;#039;&amp;#039;&amp;#039;LOW&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Keep the buzzer OFF for 1000 milliseconds.&lt;br /&gt;
# Repeat the process continuously.&lt;br /&gt;
&lt;br /&gt;
The overall operation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;GPIO HIGH → Buzzer ON → Delay 1000 ms → GPIO LOW → Buzzer OFF → Delay 1000 ms → Repeat&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working ==&lt;br /&gt;
&lt;br /&gt;
The Arduino UNO generates digital output signals on pin 4 connected to the buzzer.&lt;br /&gt;
&lt;br /&gt;
The working sequence is:&lt;br /&gt;
&lt;br /&gt;
# The Arduino UNO initializes digital pin 4 as OUTPUT.&lt;br /&gt;
# The digital pin is set to HIGH.&lt;br /&gt;
# The buzzer is activated and produces sound.&lt;br /&gt;
# The buzzer remains ON for 1000 milliseconds.&lt;br /&gt;
# The digital pin is set to LOW.&lt;br /&gt;
# The buzzer is deactivated.&lt;br /&gt;
# The buzzer remains OFF for 1000 milliseconds.&lt;br /&gt;
# The process repeats continuously.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Arduino UNO → Digital HIGH → Buzzer ON&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Arduino UNO → Digital LOW → Buzzer OFF&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Observation ==&lt;br /&gt;
&lt;br /&gt;
=== Buzzer ON/OFF Control Program ===&lt;br /&gt;
&lt;br /&gt;
The following program is used to control a buzzer connected to digital pin 4 of the Arduino UNO.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define buz 4&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  pinMode(buz, OUTPUT);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  digitalWrite(buz, HIGH);&lt;br /&gt;
  delay(1000);&lt;br /&gt;
&lt;br /&gt;
  digitalWrite(buz, LOW);&lt;br /&gt;
  delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Program Explanation ===&lt;br /&gt;
&lt;br /&gt;
* The buzzer pin is defined using the &amp;#039;&amp;#039;&amp;#039;#define&amp;#039;&amp;#039;&amp;#039; preprocessor directive.&lt;br /&gt;
* The variable &amp;#039;&amp;#039;&amp;#039;buz&amp;#039;&amp;#039;&amp;#039; is assigned to digital pin 4.&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;pinMode()&amp;#039;&amp;#039;&amp;#039; function configures digital pin 4 as OUTPUT.&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;digitalWrite(buz, HIGH)&amp;#039;&amp;#039;&amp;#039; function sets the buzzer pin HIGH and activates the buzzer.&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;delay(1000)&amp;#039;&amp;#039;&amp;#039; function keeps the buzzer ON for 1000 milliseconds (1 second).&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;digitalWrite(buz, LOW)&amp;#039;&amp;#039;&amp;#039; function sets the buzzer pin LOW and deactivates the buzzer.&lt;br /&gt;
* Another delay of 1000 milliseconds keeps the buzzer OFF for 1 second.&lt;br /&gt;
* The &amp;#039;&amp;#039;&amp;#039;loop()&amp;#039;&amp;#039;&amp;#039; function repeats this operation continuously.&lt;br /&gt;
&lt;br /&gt;
== Observation Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Step&lt;br /&gt;
! Arduino Output&lt;br /&gt;
! Buzzer State&lt;br /&gt;
! Duration&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| HIGH&lt;br /&gt;
| ON&lt;br /&gt;
| 1000 ms&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| LOW&lt;br /&gt;
| OFF&lt;br /&gt;
| 1000 ms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
The Arduino UNO successfully interfaces with the piezo buzzer using digital pin 4.&lt;br /&gt;
&lt;br /&gt;
The buzzer turns ON for 1000 milliseconds and OFF for 1000 milliseconds continuously.&lt;br /&gt;
&lt;br /&gt;
Thus, the buzzer is successfully controlled using digital HIGH and LOW output signals of the Arduino UNO.&lt;/div&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
</feed>