My First Project:

Poly tone Generator:

This is my first project, I started to do something with my arduino duemilanove. I know this project is so simple and it doesn’t require any hard codes.

This project use of phototransistor, piezo buzzer and arduino (For programming). This circuit can be used for generating different polytonal sounds using any ordinary TV  remote. This can also be used to test your TV remote.

Circuit diagram :

Circuit Diagram

Connect the circuit and read the analog values using serial monitor.The values depend on surround light.If surrounding is so bright,then you have big value and for darker surrounding ,they have small value .Change the values in code according to your surrounding in the code.

Code:

  1. // Author : Abishek ram R
  2. int speaker = 12;
    int photocell = 0;
    void setup()
    {
    Serial.begin(9600);
    Serial.println();
    }
    void loop()
    {
    int reading = analogRead(photocell);
    int tones[] = {261, 277, 294, 311, 330, 349, 370, 392, 415, 440};
    Serial.print(pitch);
    Serial.println();
    int i=random(10);
    if(reading >100)
    {
    int pitch = tones[i]+(reading/50);
    tone(speaker, pitch);
    delay(100);
    }
    else
    {
    int pitch=0;
    tone(speaker, pitch);
    }
    }

Depend upon your  serial monitor value,change the value in if statement.

If your getting series of value 256,296,236,then put 300 in the place of 100 in if statement.

This video demonstrate the working of circuit.

How the circuit works:

The Photo transistor allows  some amount of current depending on the light.If more light ,more current is passed.Micro controller reads the amount of current.Depending upon the current, different polytones are generated in buzzer.

you can neglect the surrounding light by if statement.The light emitted by TV remote is read by sensor and poly tones are  generated.

This video shows the effect of TV remote on photo transistor and poly tones are generated.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s