I’m currently working on a simple audio project using tmrpcm library. I’m getting sounds for same duration of the song it supposed to be playing, but it’s unrecognizable. Please help suggest additional hardware that I need, in order for the sound to come out properly
Here’s my current set up, Arduino Uno, Micro SDcard Adapter, an earphone. The earphone is connected directly to pin9 and ground, without any additional resistor. The code is attached.
I have browsed through other similar projects. They used either 8ohms or 16 ohms speaker connected with a transistor and a resistor. As I said, right now I have my earphone connected directly to the Arduino without these components. Is this why I’m getting loud, yet unrecognizable sound? Should my set up be any different since I’m using an earphone not a speaker? and what type/size of transistor and/or resistor should I use?
From what I can gather with a quick squint through, the output will be a pwm signal. It will have a dc component. Try adding a capacitor (100uF?) in series with your earphone to remove it
Thanks, I'll try it. Do you mind explaining why do I need the capacitor for earphones but not for speakers? Do speakers usually have one built in already?
Do you mind explaining why do I need the capacitor for earphones but not for speakers?
You need them for both.
Do speakers usually have one built in already?
No.
You could also do with a reconstruction filter, that is after the capacitor a series resistor of 1K5 to the ear phone and a capacitor of 10nF across the ear phone to ground.
the 100 microFarad capacitor in series with the earphone
the 100 microFarad capacitor in series with 1k Ohm resistor. Both are then in series with the earphone. And a 10 nanoFarad capacitor across the earphone.
Both set up still give me the monotonic crackle for the length of the song. The reason why I asked if I would need the capacitor if I were to use a speaker instead is, I found a similar project which didn’t seem to use capacitor at https://diyhacking.com/arduino-audio-player/
Anyway, if you have any further suggestion on how I can get the sound to work properly please let me know. Thanks a lot for your effort so far
the 100 microFarad capacitor in series with 1k Ohm resistor. Both are then in series with the earphone. And a 10 nanoFarad capacitor across the earphone.
How about posting a schematic so we can check that your interpretation of those words match ours.
I found a similar project which didn’t seem to use capacitor at …
Hey, there is a lot of crap on the internet. Just because a particular design worked for one person doesn’t make it a good design that will work for everyone.
I would be very suspicious of any web page that does not post a schematic, it implies the author is a rank beginner.
I have removed the code from the loop(). Please see the new code attached, if you want to confirm. I’ve also tried various datarates(300, and 115200). But there is still no change in the sound.
I’ve made a schematic of what I have. Please let me know if I understand you guys correctly