Is the speaker connected to the PWN pin? I see you need your computer, but can you put the music on, for exemple a separated memory? I wanna do an electronic drum with a pic or an AVR but I don't understand how to play music with it. I've heard some "Happy birthday" on a pwm, and it's not what I'm looking for.. I ean I don't wanna have a bad sound for the drum sounds..
@mikoro1 WOW I see that i've many things to learn about microcontroller.. I know that an electronic drum is not very easy but I have this idea in my head ..
I did something very similar to this. I was wondering about your electrical connections: Am I seeing wrong, or are you driving the speaker directly from the AVR I/O pin without a transistor. If so, are you sure the pin is not sourcing too much current?
AVR models I know are rated at 40 mA per I/O and a speaker this size is typically 8 ohm/0.5W. With these numbers, even at 2.7V, you are outside specifications for both (338 mA, 0.9W)...
Yeah, you're right. But it worked, at least for the few hours a played with it. I later did a version with an op-amp in between which had much better sound output. And the controller didn't heat up as much... :)
Be careful though. The power supply of the STK500 itself seems to be rated at 500mA (see User Guide pp. 3-14, second paragraph). Risking making nice smoke with an AVR chip is one thing, but I'm sure you don't want to break your board :)
If you are working at 5V and your speaker is 8 ohm, you are over 500mA (625mA) just for the speaker, not counting the microcontroller itself.
Looks like the Transistor is on the breadboard. Either way, looks like a neat little use for an AVR. I always thought you needed a lot more parts than this.
hurray for 8-bit music!
ZouloumOSX 8 months ago
sounds decent. what's the PWM frequency? clock divider
DanFrederiksen 9 months ago
Is the speaker connected to the PWN pin? I see you need your computer, but can you put the music on, for exemple a separated memory? I wanna do an electronic drum with a pic or an AVR but I don't understand how to play music with it. I've heard some "Happy birthday" on a pwm, and it's not what I'm looking for.. I ean I don't wanna have a bad sound for the drum sounds..
(I'm french..)
Thx
killthebetrayer 1 year ago
@killthebetrayer Bonjour, yes it is. You can definitely put the music on an external memory. Check out the video response by Peterlsza for example.
mikoro1 1 year ago
@mikoro1 WOW I see that i've many things to learn about microcontroller.. I know that an electronic drum is not very easy but I have this idea in my head ..
killthebetrayer 1 year ago
does it work with arduino?
robot797 1 year ago
@robot797 Can't see any reason why it shouldn't work
mikoro1 1 year ago
@mikoro1 nice what could i do to do that :P
robot797 1 year ago
Good job on the avr dude it works amazingly well
how exactly does youtube know the name of the song if it was IN the video?
they must have a pretty good sound recognition software,
Ronnie51026 1 year ago
Cool project, even with the low transfer rate :D
redtails 2 years ago
find some other music...fuck
ladams00 2 years ago
You mind posting the code? I've had no success at this.
linuxrobotdude 2 years ago
nice project - gay sound
xcape77 2 years ago 17
@xcape77 On every sound project you find a music geek complaining about the music being played -.-
vdub350 2 years ago
@xcape77 ignorant fuck is ignorant
vdub350 1 year ago
I did something very similar to this. I was wondering about your electrical connections: Am I seeing wrong, or are you driving the speaker directly from the AVR I/O pin without a transistor. If so, are you sure the pin is not sourcing too much current?
AVR models I know are rated at 40 mA per I/O and a speaker this size is typically 8 ohm/0.5W. With these numbers, even at 2.7V, you are outside specifications for both (338 mA, 0.9W)...
phaub 2 years ago
Yeah, you're right. But it worked, at least for the few hours a played with it. I later did a version with an op-amp in between which had much better sound output. And the controller didn't heat up as much... :)
mikoro1 2 years ago
hehe :)
Be careful though. The power supply of the STK500 itself seems to be rated at 500mA (see User Guide pp. 3-14, second paragraph). Risking making nice smoke with an AVR chip is one thing, but I'm sure you don't want to break your board :)
If you are working at 5V and your speaker is 8 ohm, you are over 500mA (625mA) just for the speaker, not counting the microcontroller itself.
phaub 2 years ago
Looks like the Transistor is on the breadboard. Either way, looks like a neat little use for an AVR. I always thought you needed a lot more parts than this.
DarkStar851 2 years ago
how come there are just 2 wires coming from the speaker? shouldn't there be 3? (GND, VCC, and data)
bobsonenzo 2 years ago
A speaker is basically just a coil, not a digital item.
nrdesign1991 2 years ago
you have no idea how a speaker works do you? It's ANALOG. Look-it-up.
AndrewFaulds 2 years ago
I am totally new to microcontroller and stuff. Any particular topic I should start from?
youngnewtonian 2 years ago
Hi, check the AVRFreaks site - especially the forums and its tutorial section.
mikoro1 2 years ago
Nice project, dude!
seemantadutta 2 years ago
Comment removed
ewnklr 3 years ago
i guess you use the UART receive interrupt to assign the received value directly to the OCRx.
GrafKrolock82 3 years ago
Yep, the audio file's sample rate matches the UART clock. There's basically just the UART init code and a one liner interrupt.
mikoro1 3 years ago
line in and out;p
dyresioju 3 years ago
lol!!! very nice...
How... Do you have a web page?
TrickyNekro 3 years ago