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

Arduino Lesson 10-Light Control Sound

This document outlines Arduino Lesson 10, which focuses on controlling sound with light using a photovaristor and a buzzer. It describes the connections required for the components and explains the experiment's theory, where the buzzer's sound intensity varies with light levels. The provided code demonstrates how to implement this functionality on an Arduino board.

Uploaded by

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

Arduino Lesson 10-Light Control Sound

This document outlines Arduino Lesson 10, which focuses on controlling sound with light using a photovaristor and a buzzer. It describes the connections required for the components and explains the experiment's theory, where the buzzer's sound intensity varies with light levels. The provided code demonstrates how to implement this functionality on an Arduino board.

Uploaded by

maisecinos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Arduino Lesson 10

Light Control Sound


Parts requried
Photovaristor x 1
Buzzer x 1
Jumper wires x 1 Bundle
Connect-it-up

One outlet of photovaristor accese to digital interface #6, the other


outlet access to anode of the buzzer, cathode of buzzer access to GND.

Experiment Theory
This program applies the previous lessons about reading the analog voltage value,
similar to buzzer experiment. When there is no light, sound is weak. When there is
light, the resistance reduced, so at the ends of the voltage will increase, buzzer make
stronger sounds. The stronger the light, the smaller the resistance, buzzer rang
harder.

void setup()
{
pinMode(6,OUTPUT);
}
void loop()
{
while(1)
{
char i,j;
while(1)
{
for(i=0;i<80;i++) //make sound by 1 frenquency
{
digitalWrite(6,HIGH);
delay(1);
digitalWrite(6,LOW);
delay(1);
}
for(i=0;i<100;i++) //make sound by other frequency
{
digitalWrite(6,HIGH);
delay(2);
digitalWrite(6,LOW);
delay(2);
}
}
}
}

Download the program to Arduino, use the flash light spot on the
photovaristor and you can hear the sound from buzzer.

You might also like