Pages: [1]   Go Down
Author Topic: Play Sound from EEPROM  (Read 699 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hy there guys i have a question is there any way to play sounds from internal arduino eeprom or from my sketch (simple sounds)
im intrested in  this ... for my arduino to play when something is happening... the best is to play midi ... but i'm satisfied with simple sound  u know a tutorial for this or something ...  it can be done??

thank you !
« Last Edit: October 07, 2013, 01:04:02 pm by hunt333r » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23662
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Read this thread
http://forum.arduino.cc/index.php?topic=179761.0
Shows how I created up to 13 notes at once using blink without delay style programmming.
Its simple sound.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4002
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Open your IDE and go to File->Examples->02.digital and look at the last 4 sketches in the menu, like toneMelody.

It says you need an 8-ohm speaker direct to pin 8. 8 ohms seems a bit low to me. Wouldn't I rather power that through a transistor and 2 resistors?
Logged

Examples can be found in your IDE.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23662
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino pin driving a resistor directly is bad news.
Put at least a 120 ohm resistor in series with it. Will be quiet.
Better would be to connect the output to a powered computer system:
You can hear that here:
http://www.youtube.com/watch?v=4c8idXN4Pg0&feature=youtu.be

Here's  how I hooked it up - output thru a cap, thru a potentiometer to not  overpower the input oft the amplified speaker:
http://forum.arduino.cc/index.php?topic=179761.0
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4002
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is that what they call matching impedances is about?
Logged

Examples can be found in your IDE.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23662
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, this is just straight current limiting, similar to an LED.
Need to keep current from pin under 40mA so it doesn't burn out.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pittsburgh, PA, USA
Offline Offline
Faraday Member
**
Karma: 58
Posts: 4002
I learn a bit every time I visit the forum.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pin sound is kind of fuzzy to my ears. In the early 70's we had an 80-in-1 Radio Shack Project Kit with a tone circuit that made nice clean tones. There weren't many parts but I forget and don't have that cookbook. Instead I see some that make clean sine waves using 2 opamps and I have quads, 2 tones per chip. I'm looking at digital pots but not so happy with what I see. Maybe a DAC would be simpler?.

Logged

Examples can be found in your IDE.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 437
Posts: 23662
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, digital output is just a square wave. You can filter it some to smooth the corners, make it more sinusoidal.
DAC could make any shape you want, justs needs more programming.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: