go_away

Author Topic: Cheapo sound playback  (Read 2091 times)

0 Members and 1 Guest are viewing this topic.

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Cheapo sound playback
« on: October 07, 2010, 12:24:23 PM »
I've been searching SoR for general information on sound playback for robots. Everything I found dealt with some costly circuit, hacking an mp3 player and more costly options. I'm thinking of implementing some sound into my robot and I don't need it to sound perfect, or even nice. I have toys around my house that cost less than $3 and play recorded voices and music, so there has to be a cheap way to build sound into a circuit. Any ideas? (btw, I'm totally new at electronics, so please excuse anything obvious I haven't thought of. Thanks

Offline KurtEck

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 12
Re: Cheapo sound playback
« Reply #1 on: October 07, 2010, 12:47:52 PM »
On a couple of my robots that don't have sound on them, I have simply used a cheap speaker from radioshack part number 273-092.  Make sure to not get a buzzer as they just buzz all the time when power is connected... I have one of these on an Arc32 based processor and another one on an Arduino Mega based board.

On the Arduino I wrote some quick and dirty functions to output some sound which worked well enough for me.  I simply wanted some beeps to know when I choose a command and the like.

I can post the code if you would like...

Offline cyberfish

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Cheapo sound playback
« Reply #2 on: October 07, 2010, 01:39:15 PM »
Something like this?
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=668-1128-ND

You'll also need a DAC (digital to analog converter) for your microcontroller to output analog voltage, and an audio amplifier (something like http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-3991-5-ND) to drive the speaker.

(I didn't actually research those components. I just randomly picked them in 30 seconds. You'll want to actually research into them).

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Cheapo sound playback
« Reply #3 on: October 07, 2010, 01:41:30 PM »
On a couple of my robots that don't have sound on them, I have simply used a cheap speaker from radioshack part number 273-092.  Make sure to not get a buzzer as they just buzz all the time when power is connected... I have one of these on an Arc32 based processor and another one on an Arduino Mega based board.

On the Arduino I wrote some quick and dirty functions to output some sound which worked well enough for me.  I simply wanted some beeps to know when I choose a command and the like.

I can post the code if you would like...

Definately, thanks. I think I want more exact sounds, like sound effects or even music, but I guess I need to learn how the speaker works. What's the cheapest way to play any kind of sound file from an atmega mcu?

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Cheapo sound playback
« Reply #4 on: October 07, 2010, 01:58:11 PM »
Ladyada has the wave shield that plays WAV files, SparkFun has the MP3 trigger. Both are ~$20.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Cheapo sound playback
« Reply #5 on: October 07, 2010, 04:44:16 PM »
Theres a big difference between playing a single/short/sampled sound effect such as a 'bang', 'crash', 'beep' vs playing complete MP3 music files.

The former is easy enough to do in software with the sound samples stored in EEPROM say.

But the MP3 option is more complex as you need a codex etc etc. However: its still very do-able with extra hardware and I support the SOMO14D from inside webbotlib see http://webbot.org.uk/WebbotLibDocs/41472.html
Its a nice bit of kit and allows you to store around 500 different sound files.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Cheapo sound playback
« Reply #6 on: October 08, 2010, 01:27:37 PM »

Theres a big difference between playing a single/short/sampled sound effect such as a 'bang', 'crash', 'beep' vs playing complete MP3 music files.


I'm really looking for a cheaper option. It was a toy that I bought for my son that got me interested in adding sound to my bot. The toy is a small car < $5. The car has 2 sound effect buttons, and one button that plays about 20 seconds of a song. (Sounds like midi quality.) Before, I was thinking that sound was too expensive to play with, but it has to be possible to make it for less if this toy can be bought after a markup for that price. I don't mind the challenge. I welcome it. I just need to know where to get started. I'm not opening my son's toy, but I might go buy another one for myself and see if I can reverse engineer it. I was just hoping to find the info online. Thanks for all the replies everyone, and keep 'em coming! If this forum does not return the answer I want, I will try my best to figure it out and post it here.

Offline cyberfish

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Cheapo sound playback
« Reply #7 on: October 08, 2010, 02:12:48 PM »
First, read up on general sound theory. Frequency vs pitch, amplitude vs volume.

Then, think about how you can generate it from the MCU, through a DAC.

That will get you almost there. We can work on the amplifier + speaker then.

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Cheapo sound playback
« Reply #8 on: October 08, 2010, 04:34:02 PM »
First, read up on general sound theory. Frequency vs pitch, amplitude vs volume.
Thanks. Do you know of any good tutorials or reading?

Offline arachne

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
Re: Cheapo sound playback
« Reply #9 on: October 08, 2010, 07:22:24 PM »
Mass production make it cheap.
Popular voice storage chip: ISD 1420 / Wt1420 and other ISD xxxx
the price for one pcs is above $10, i guess

Offline macdad-

  • Robot Overlord
  • ****
  • Posts: 131
  • Helpful? 5
Re: Cheapo sound playback
« Reply #10 on: October 08, 2010, 08:04:14 PM »
APR9600, digital interface to record/playback up to 8 messages, with varying sampling rate(Note:The higher the sampling rate the lower the recording time, lowest sampling rate =  about a minute for each message).

You'll have to record it by microphone though. And I think these chips are out of production, so you'll have to check ebay.

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Cheapo sound playback
« Reply #11 on: October 09, 2010, 02:23:14 PM »
ok, mass production does make items cheap, but not to the point where an entire circuit, plastic body, buttons, packaging, shipping to the store, store maintenance costs, employee pay, AND ~10% markup after all of this are cheaper than one SINGLE component of all of this. I'm sure that the ic's described on this post can do much more than the ic's in the toy, but I only want VERY simple sounds, and I'm honestly just curious more than anything else. If there is no way to produce the sounds I want for less than the price of the toy, I guess I'll just attempt to hack one of the toys to produce the sounds I want by replacing the chip on it's board with an atmega or something.

Offline knossos

  • Robot Overlord
  • ****
  • Posts: 278
  • Helpful? 14
Re: Cheapo sound playback
« Reply #12 on: October 09, 2010, 05:27:30 PM »
Sound Expression Greetings sells chips for about 3 to 5 $ ea that are recordable.  They range from 10 to 30 seconds.  Only problem is minimum order is 20 or you can get 9 samples for $45.
"Never regret thy fall,
O Icarus of the fearless flight
For the greatest tragedy of them all
Is never to feel the burning light."
 
— Oscar Wilde

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: Cheapo sound playback
« Reply #13 on: October 09, 2010, 05:47:54 PM »
Just hack the toy. Stuff from china is real cheap.

Offline Ro-Bot-X

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,431
  • Helpful? 25
  • Store: RoBotXDesigns.ca
Re: Cheapo sound playback
« Reply #14 on: October 09, 2010, 07:31:23 PM »
Webbot just added the Tone to the WebbotLib. You can use a piezo speaker on any pin and select a Timer to play beeps or RTTL tunes. He even has a sample Star Wars tune in his docs. All you need is a compatible atmega chip and a piezo speaker. Make sure the speaker has a resistance greater than 150 ohms (usually they have). If not, add a series resistor to protect your atmega pin, as in WebbotLib docs specifications.
Check out the uBotino robot controller!

Offline cyberfish

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Cheapo sound playback
« Reply #15 on: October 10, 2010, 01:50:24 AM »
To make a REAL simple sound (one pitch, one volume, on/off), you can use a 555 timer with a filter (capacitor + resistor) and an audio amp.

You can probably make it for something like $1?

Or just use a piezo-electric buzzer.

If you want something more complicated, what EXACTLY do you want?

Offline cyberfish

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Cheapo sound playback
« Reply #16 on: October 10, 2010, 01:55:29 AM »
Quote
Thanks. Do you know of any good tutorials or reading?

http://en.wikipedia.org/wiki/Sound

The 30 seconds version -
Sound is a sinusoidal (sine/cosine) wave (or sums of sinusoidal waves). Frequency determines pitch. High frequency = high pitch, low frequency = low pitch. Amplitude determines volume. Higher amplitude = higher volume.

Human hearing range is ~20Hz - 20KHz. Many animals go a lot higher. Humans have bad ears (but good eyes to make up for it) by comparison.

So you need to find a way to produce this wave. The easiest way is probably to use a DAC.

Offline greywanderer012345Topic starter

  • Robot Overlord
  • ****
  • Posts: 133
  • Helpful? 2
Re: Cheapo sound playback
« Reply #17 on: October 10, 2010, 09:34:59 AM »
Webbot just added the Tone to the WebbotLib. You can use a piezo speaker on any pin and select a Timer to play beeps or RTTL tunes. He even has a sample Star Wars tune in his docs. All you need is a compatible atmega chip and a piezo speaker. Make sure the speaker has a resistance greater than 150 ohms (usually they have). If not, add a series resistor to protect your atmega pin, as in WebbotLib docs specifications.

To make a REAL simple sound (one pitch, one volume, on/off), you can use a 555 timer with a filter (capacitor + resistor) and an audio amp.

You can probably make it for something like $1?

Or just use a piezo-electric buzzer.

If you want something more complicated, what EXACTLY do you want?

These are ABOUT what I'm looking for. I would definately be interested in adding some basic R2D2 style beeps, squeals, and maybe little tunes. STILL this toy I'm describing, and many like it, are super cheap and have vocal sound that sounds cheap but can be understood, and is not being synthesized(because the song segment is from a real song. I don't have a youtube account, but I think I'll make one and post a link to a video of what kind of sound capabilities I'm looking for. Thanks for all the great feedback, everyone!

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: Cheapo sound playback
« Reply #18 on: October 10, 2010, 02:27:23 PM »
Quote
have vocal sound that sounds cheap but can be understood, and is not being synthesized(because the song segment is from a real song


If its digitised/sampled sound then you need to think where you are going to store it. Sampling 5 seconds of sound at several kHz is going to require a reasonable amount of storage (for a microcontroller). This means looking at other storage devices like SPI EEPROM, I2C EEPROM or sdCards. You wont be able to store it on the microcontroller itself as its too big.  These toys are mass produced and so you could probably buy the same storage at the same price if you bought 100,000 or more of them !

So the next step is to look at chips like SpeakJet http://www.speechchips.com/shop/category.aspx?catid=3
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Cheapo sound playback
« Reply #19 on: October 13, 2010, 07:18:59 PM »
Hi,

ok, mass production does make items cheap, but not to the point where an entire circuit, plastic body, buttons, packaging, shipping to the store, store maintenance costs, employee pay, AND ~10% markup after all of this are cheaper than one SINGLE component of all of this.

Well, yes!
For several reasons.
1) It is very expensive, in man hours, to deal with single components.
2) Chips in toys are usually of the COB type (Chip On Board, where the entire chip is glued down and bonded directly to the PCB, then covered in a blob of epoxy - much cheaper than a single physical chip on a lead frame.
3) The Chinese government finances a large percentage of goods you buy, just to get $$ into China.
4) Toy manufacturers buys millions at a time, you wanna buy one, so (reviewing #1) it may be close to millions of times more time consuming.

They may pay only a few cents for a COB for which you'd pay $10 or more in a DIP housing.
Two very different worlds.


I'm sure that the ic's described on this post can do much more than the ic's in the toy, but I only want VERY simple sounds, and I'm honestly just curious more than anything else. If there is no way to produce the sounds I want for less than the price of the toy, I guess I'll just attempt to hack one of the toys to produce the sounds I want by replacing the chip on it's board with an atmega or something.

You'll get absolutely nothing from trying to hack into a toy, so save your money towards a solution instead.
Simple sound effects can be made easily by algorithms (I had a demo program for my first PC-AT that could play a (tinny) voice from the PC speaker (i.e. by square waves).

A better method is using Roman Blacks 1-bit code
Free encoder software and quite some info
The underlying theory (read it all).
You can use this for speech, just don't expect CD quality ;)
The bias is on PIC chips of course, but it can just as easily be used with AVR's or whatever.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here

data_list