Iot-5,6,8
Iot-5,6,8
AIM:Design and implement of Arduino-Based Circuit for Generating Multiple tones using
single Piezo Buzzer.
Code:
void setup()
{
pinMode(7, OUTPUT);
void loop()
{
analogWrite(7, 20);
delay(1000); // Wait for 1000 millisecond(s)
analogWrite(7, 255);
delay(1000); // Wait for 1000 millisecond(
}
CONCLUSION:
In this experiment, an Arduino-based circuit was successfully implemented to generate multiple
tones using a single Piezo buzzer. The experiment demonstrated how an Arduino microcontroller
can efficiently control sound frequencies and durations to produce different tones, melodies, and
alerts.
PRACTICAL 6
Code:
void setup()
{
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
}
void loop()
{
analogWrite(4, 200);
analogWrite(3, 20);
analogWrite(2, 20);
delay(1000); // Wait for 1000 millisecond(s)
analogWrite(4, 100);
analogWrite(3, 255);
analogWrite(2, 0);
delay(1000); // Wait for 1000 millisecond(s)
analogWrite(4, 120);
analogWrite(3, 80);
analogWrite(2, 255);
delay(1000); // Wait for 1000 millisecond(
}
Hardware & Software stimulation
CONCLUSION:
The experiment successfully demonstrated how multiple Piezo buzzers can be used with
an Arduino to generate distinct and synchronized tones. This approach enhances the
potential applications of Piezo buzzers in various electronic and embedded systems.
PRACTICAL 8
AIM:To Control the color output of the RGB LED using Arduino Uno in
Tinkercad.
Code:
void setup() {
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(7, OUTPUT);
}
void loop(){
tone(7, 220, 100);
delay(200);
noTone(7);
delay(500);
for (int counter = 0; counter < 10; ++counter) {
tone(11, 523, 8000);
delay(407);
noTone(11);
tone(10, 831, 8000);
delay(407);
noTone(10);
tone(9, 4699, 8000);
delay(407);
noTone(9);
}
int counter;
}
Hardware & Software Stimulation.
CONCLUSION
In this experiment, an Arduino Uno was successfully used to control the color output of
an RGB LED in Tinkercad. By varying the intensity of the Red, Green, and Blue (RGB)
components through Pulse Width Modulation (PWM), different colors were generated.