0% found this document useful (0 votes)
12 views2 pages

Text Note

This document describes an experiment using pulse width modulation to control a buzzer with an Arduino board. The experiment uses PWM to vary the duty cycle of a signal to the buzzer, producing different tones. The circuit and Arduino code are provided to demonstrate how PWM can control an output like a buzzer or motor.

Uploaded by

nge78063
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Text Note

This document describes an experiment using pulse width modulation to control a buzzer with an Arduino board. The experiment uses PWM to vary the duty cycle of a signal to the buzzer, producing different tones. The circuit and Arduino code are provided to demonstrate how PWM can control an output like a buzzer or motor.

Uploaded by

nge78063
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT- 8

PWM WITH BUZZER USING ARDUINO


Aim
To study the operation of buzzer by using pulse width modulation on board.

Electrical Components and Software


1. Arduino board
2. Buzzer
3. Proteus Software
4. Arduino IDE

Theory
Pulse Width Modulation (PWM) generates square-wave pulses of different widths. The width
of the pulse, sometimes called pulse width offset, is commonly proportional to the amplitude
of the input signal. PWM is used to control motors or to power LEDs. The main reason for
using PWM is that it allows for controlling the average amount of power delivered to a load or
the output. They are also used for voltage regulation and modulation in communications.

(a) (b)
Figure 1. (a) and (b) Pulse Width Modulation(PWM)

void setup() {
pinMode(11, OUTPUT);}
void loop()
Reset

{ USB
PB5/SCK
13
12
for (int sound=0; sound<=255; sound PB4/MISO
~ PB3/MOSI/OC2A
11 BUZZER
ARDUINO

10
++){ ~ PB2/OC1B
~ PB1/OC1A
9
8
analogWrite(11,sound);
ATMEGA328P-PU

PB0/ICP1/CLKO
1121

7
delay(8);} PD7/AIN1
6
A0 ~ PD7/AIN1 5
for (int sound=255; sound>=0; sound A1
PC0/ADC0
PC1/ADC1
~ PD5/T1/OC0B
PD4/T0/XCK
4
A2 3
++){ A3
PC2/ADC2
PC3/ADC3
~ PD3/INT1/OC2B
PD2/INT0
2
A4 1
analogWrite(11,sound); A5
PC4/ADC4/SDA
PC5/ADC5/SCL
PD1/TXD
PD0/RXD
0

delay(8);} by TEP

delay(500); ARDUINO UNO V3


}
Figure 2. Source Code Figure 3. Circuit diagram
Procedure
1. To download and installed Arduino IDE software which write C programming language.
2. To download and installed Proteus software which simulate the hardware components.
3. To add Arduino Library to Proteus software.
4. To draw circuit diagram on Proteus software.
5. To write the source code on Arduino IDE software.
6. To verify the source code and add hex file to upload hex file on Proteus software.
7. To run the connecting components.
8. To investigate the circuit how to stimulate the system.

You might also like