-->
Page 1 of 2

PCM with an harware filter - need help

PostPosted: Sat Oct 01, 2016 12:50 pm
by vcch
Hi !

I wanted to use the PCM filter, but it is not working. https://nodemcu.readthedocs.io/en/maste ... dules/pcm/

1) When i connect directly the Wemos D1 pin to a speaker with a transistor as amplifier, it works very well
2) What i'm doing is using the schematic hereunder, making some asumptions
a) The 33-68 nf mention means "any capacitor between 33 & 68 nF (using a 33 Nf - E333K - 246 which doesnt seem to have a polarity).
For the other capacitor i'm using a 50V 10uF capacitor which have a polarity - i tried putting it in both direction, with no result
b) The arrow at the bottom is the wemos' ground
c) I'm connecting the "Audio" of this schematic to the base of the transistor

It doesnt work - no sound and no visible signal when using an oscilloscope. This is beyond my knowledge of these kind of stuff. Any idea ???

V

Re: PCM with an harware filter - need help

PostPosted: Sat Oct 01, 2016 9:28 pm
by rudy
The base of the transistor is not an appropriate load for this circuit. I'm assuming that you are using an NPN transistor and the emitter is connected to ground. If you were using an amplifier with a high impedance input the circuit would work. As far as the polarity of the 10uF capacitor, the plus side would be connected towards the ESP8266 side of the circuit. That will work for most circuits but there are exceptions I'm not going to bother explaining.

If you only have a transistor available as an amplifier then you can do the following. Modify the circuit by leaving out the 150 Ohm resistor. Connect the base of the transistor directly to the junction of the 270 Ohm resistor and the capacitor. Connect the Collector of the transistor to the 3.3 Volt supply. The emitter of the transistor goes to one side of the speaker and the other side of the speaker goes to ground/common/negative of the circuit.

This circuit is the closest I could find. Just include the capacitor from the resistor and base junction to ground.
Image

This will work but it is not that good because there will be dc current going through the speaker. An improvement would be to put a 270 Ohm resistor in place of the speaker. The resistor connected to the emitter and then to ground. A 100uF - 470uF capacitor plus side connects to the emitter resistor junction. The negative side of the capacitor goes to the speaker. The other end of the speaker goes to ground.

What you really need though is a better amplifier circuit than just single transistor.

Re: PCM with an harware filter - need help

PostPosted: Sun Oct 02, 2016 1:58 am
by vcch
Thanks, better like this. I wanted to keep the circuit simple - this in 8KhZ PCM, it wont be hifi anyways and it only makes sense if the harware stays small & cheap. Would you recommend using an amp module like this one ?

https://www.aliexpress.com/item/PAM8403 ... 0.0.uzXbUC

Will it "smooth" the PCM high frequencies ?

Re: PCM with an harware filter - need help

PostPosted: Sun Oct 02, 2016 9:06 am
by rudy
I have one of those but I have never got around to try it. It should be fine.

One thing I wonder about is the amount of filtering that the circuit in the link you provided has. But give it a try. If you don't get the results you want then post another message on it.