I’ve been thinking about elegant ways to improve the PSU filtering of the Wolfson card and to ensure that any switching noise from the relatively noisy power supplies Raspberry Pi’s are usually used with is effectively filtered.
There’s plenty of possible solutions here, involving various regulators or large capacitors, but all of these require a fair amount of space and I really wanted a solution that met the following goals: –
- Low cost
- As few components as possible
- Easy to implement given reasonable soldering skills
- Fits within the form factor of the existing card
- Effective filtering across the audio band and beyond
- Works within the existing PSU voltage limitations
Let’s start with the latter point – the Wolfson card receives a 5V PSU feed from the Raspberry Pi, via the 26 or 40-way GPIO header. Pins 2 and 4 provide +5V (via R36), with Pin 6 providing 0V.
This 5V feed then goes to the input of a 3.3V regulator (U13) a RT9167A-33CB low dropout linear regulator. Depending on the load on this regulator it has a dropout voltage of between 55mV and 750mV. The actual load from the Wolfson card is relatively low, so it ends up being a few hundred millivolts in reality.
This means any solution we come up with needs to work with the 5V incoming supply and maintain around 4.3V at its output. RC (or LC) filters are about the simplest solution, but have limitations at low frequencies unless large resistances or large capacitors are used. The former drops too much voltage, the latter becomes very bulky, which doesn’t align with our initial design goal.
The neatest solution seemed to be a capacitance multiplier, a simple circuit that uses the gain of an active device (transistor or op-amp) to multiply the filtering effect of a relatively small capacitor.
The circuit above increases the effective filtering of the RC network formed by R1 / C1 by the hFE of the NPN transistor.
The filtering effect is significant as is shown in the simulation below. Bear in mind the simulation is using ideal components, so the continuing attenuation at higher frequencies will drop off at some point owing to components parasitics such as lead inductance, capacitor construction etc.
It does demonstrate though, that even at 20Hz we can achieve some 35dB of attenuation, adding the additional output capacitor continues this filtering effect at HF, once the capacitance multiplier loses effectiveness. At 20kHz we have over 100dB of attenuation, good for removing the spikey HF noise from a switching supply.
Implementation of this is fairly straightforward but does require care, good eyes (or in my case a good microscope!) and some patience.
Start by removing R36, this isolates the incoming 5V supply from the Wolfson card. The circuit can then be implemented by soldering the components ‘dead bug’ style to the board. I took the 5V into Q1 collector direct from GPIO pin 2, with the emitter soldered to the vacated pad from R6 (this needs care – the pad is tiny!).
C1 -ve connects to 0V at GPIO pin 6, with the +ve leg formed to meet with the leg from Q1 base.
R1 is then connected between GPIO Pin 2 and Q1 base / C1 +ve. I fitted C2 across the 10u capacitor at the input of U13, the 3.3V regulator.
It’s not pretty, but the result looks like this
The effect is quite pronounced, here are a few oscilloscope videos showing the effect (apologies for the poor quality).
As can be seen, there’s a lot of noise on that trace and it’s load related, with large spikes as the Pi changes it’s PSU demands depending on the running processes.
Wow, this looks a lot cleaner, all the high-frequency noise and load related noise has gone.
Once the circuit settles the output voltage is around 4.3V, which is well within our allowable dropout for the 3.3V regulator that follows. The multiplier acts as a slow start circuit, with a time constant determined by R1 / C1, in this case that’s circa 0.5s.
For a more detailed look, we need to break out the spectrum analyser and look at the PSU noise.
The top two traces show the noise of the raw supply, the noise is load related so there are two plots showing the range of values seen.
The orange trace is the analogue noise floor of the Wolfson analogue outputs (Line Out / Headphone Out).
The green / blue trace shows the effectiveness of the capacitance multiplier, it’s providing significant filtering at LF and improving as frequency increases. At 100Hz the PSU noise is at similar levels to the analogue noise floor, by 1kHz it’s approaching the noise floor of the measurement system I’m using (as represented by the blue trace).
It’s quite hard to measure accurately at these levels, -165dBv, as represented by the blue trace is around 6nV!
The above shows how a simple and elegant circuit, that costs little doesn’t need much space can elegantly remove the noise present on a switching PSU, whilst allowing us to keep it’s efficiency and size benefits when compared to an equivalent linear PSU.
Let me know if you try this and how you think it sounds!