Moderators: Dave Moll, Andrew Davie, Steve Anderson
Steve Anderson wrote:Another thought...I'm assuming you're feeding the amp direct from the PWM output either with or without my suggested little filter (I do strongly suggest you use it though). I'm also assuming that the PWM waveform switches between 0V and 5V at the 180kHz frequency. With no sound modulating the PWM the output will be a 50% duty-cycle waveform at 180-odd kHz. This has an average DC component of 2.5V, pro-rata for other supply voltages. If the audio amp has no input coupling capacitor (possible to save component costs) that could upset the amp and cause all sorts of havoc.
Steve Anderson wrote:The amp is expecting audio AC with no DC offset and no remnants of PWM, get rid of them and you may have a fighting chance. To be sure place a 1uF non-electrolytic capacitor between the output of my little filter and the input of the amp. Anything around 1uF should be fine, it's not critical.
Steve Anderson wrote:You may also find that you'll need to attenuate the resulting audio as at full output the voltage will be 5V p-p (or whatever supply is used) around 1.8V RMS. Being a consumer product there's a chance that this will well and truly overdrive the amp. Yes you can turn the volume down but as Klaas pointed out you'll be losing resolution...severely I would guess.
Steve Anderson wrote:I've downloaded the datasheet for the active device and Texas Instruments recommends an input capacitor of 1uF for this sort of application, whether that's already on the board...who knows? You could use a 100nF (0.1uF) capacitor, there's no way a 10cm speaker will reproduce frequencies much below 200Hz whatever the makers claim.
Steve Anderson wrote:First off I suggest hooking up the amp and loudspeaker and driving it from a known analogue source, say an iPod or PC output. Once confirmed working then try the Ardin...whatever the thing's called, with filter and cap.
I'm surprised the speaker read zero ohms...try touching a 1.5V battery across the terminals, you should hear a thump or crackle as you do so, this should not fry the speaker. A couple of tries over a second or two will confirm if the speaker is OK or not. Shorts in speakers are rare, they usually go open. Basically the fine wire in the voice-coil acts as a fuse, once blown, that's it.
Steve A.
Steve Anderson wrote:7.7 Ohms looks OK for an el-cheapo loudspeaker, so that should be fine. Start off with minimum gains and minimum levels everywhere. If you have a file with just a 1kHz tone on it you could look at the PWM waveform after the filter on a 'scope and confirm it's correct (before hooking up the amp). Even some music or speech should be recognisable - view on scope from iPod/whatever if you have no idea what music or speech should look like. It's generally very 'peaky'.
Steve Anderson wrote:I suggest also setting the PWM module to produce a 50% output duty-cycle as part of the initialisation process as well as when a file comes to a halt or you stop/pause it. If a file has no sound data the PWM should also continue to output silence at a 50% duty-cycle. For 8-bit audio as you say you're using that's either 0x7F or 0x80.
Klaas Robers wrote:Andrew, a loudspeaker needs a baffle to give some sound. A baffle is a stiff board of wood or whatever, about 1...2 cm thick, with a hole in the center, where you fix the loudspeaker in a way that the distance through the air from the front to the back is as long as possible. Make the baffle at least 50 x 50 cm, but the larger the better. You can place it in a corner of the room, or even better, hang it against the ceiling in a corner of the room. That is what I had in my students time.
A different solution is to place the speaker in the wall of a closed box, at least 30 x 30 x 30 cm. See that the walls are stiff and not resonating. The box / baffle can be part of the enclosure of your Telvisor.
If the speaker is not mounted in a baffle / box, it will give no low and no mid tones, only some highs. The lows and the mids will though produce heat in the LS-coil. Somtime it helps a little bit to place it at the edge of the table, with a small sector over that edge, but tha is not a permanent solution.
And then: place a low pass fiter between the PWM output and tthe input of the amplifier. It might be that the amplifier dislikes to be fed directly with PWM signals and/or the speaker doesn't like them. Then you can kill a speaker or amplifier without that you hear any sound.
Steve Anderson wrote:Now that I've actually watched the video and seen the lash-up the noise does NOT surprise me at all! Tidy it up, make it compact and get rid of all those long trailing wires, the breadboard and bolt things to ground where need be with nice fat cable.
Return to Andrew Davie's Arduino Televisor
Users browsing this forum: No registered users and 1 guest