Tuesday, 29 April 2014

Serial audio player with amplifier

A while back Steve used one of our wav playing boards inside a small, remote-controlled K9 toy. He took our audio output and ran it into another chip-based op-amp.  Unfortunately, he couldn't remember whether it was the amplified signal (through the 2N7000/BS170 fet) or the raw output from the PIC output pin that went into the op-amp. Nor which op-amp he used.

So, while pondering our LED glasses and waiting for the LEDs to arrive, we hit Farnell last night, and ordered some TL072 op-amps and some LM386 amplifiers to give them a side-by-side comparison.

Steve has asked for a couple more wav-playing boards, which can trigger sounds off an sd card via serial, so we thought we'd review the original design and see if we can't integrate a slightly better amp than the rather crude (though still quite effective) FET we're powering the speaker through.

While we're reviewing the design, we also added a low-pass filter on the audio output pin.
On the original design, sometimes (depending on the type of speaker used) an audible clicking can be heard at the start of the audio playback - this is part of the 125khz "carrier wave" coming through the speaker.



As we couldn't decide whether the audio output should be amplified through the original BS170/2N7000 fet before going into the op-amp, we have allowed this part of the circuit to be by-passed if necessary.
We've also added the low-pass filter before the input/volume pin entering the amp. It may be necessary, following testing, to put this filter on the "output side" of the amp - in theory we're taking out the input signal above 25khz, so it shouldn't really matter which side of the amp (input or output) the filter goes (though, thinking about it, it might be useful on the output side, to help reduce/eliminate noise).

According to an online RC low-pass filter calculator (sorry, no link, can't find it now!) a filter with a 68 ohm resistor and a 0.1uF (100nF) capacitor should filter out any frequencies above 25khz. With a bit of luck, that'll get rid of that audible clicking before the sound actually starts playing!

Hopefully tomorrow we'll have all the bits from Farnell to get etching, not one, but two, PCBs (we've also got some peelable solder mask coming to help make masking the boards for SMT soldering a little easier - those LED glasses have some tiny little 0.2mm traces which could otherwise be a nightmare to solder!)