Tag Archives: power supply

A standalone streaming media device based on Raspberry Pi and HiFiBerry DAC

This is the most advanced HiFiBerry DAC setup we have seen so far. A German user integrated not only the Raspberry Pi and the DAC in a nice enclosure, but also a switching power supply. Power is connected using the onboard header on the HiFiBerry DAC and a USB WiFi Dongle is used for wireless connectivity.

IMG_2336IMG_2334 IMG_2333 IMG_2332

Powering a Raspberry Pi from 12-18V


Our next project will use an external 12-18V power supply. It will be again a Raspberry Pi powered device. Having an additional 5V/1A power supply in addition to the main 18V power supply is not really a nice solution. Therefore we want to create this 5V power supply from the 18V supply. As the Raspberry draws 500-1000mA current, a simple linear regulator is not an option. It has to be a switching regulator. The LMR12010 from Texas Instruments (formerly National Semiconductors)  seems to be an interesting chip. It does not need many external components, but still has an acceptable efficiency. There are chips with better efficiency, however these usually need external switches.  Today we tested the chip using the Evaluation kit from TI. Interestingly, the Eval kit still has the National Semiconductor logo on it.  The result looks promising. The efficiency is good enough, no additional heat sinks or cooling for the switching regulator is needed.

Check out this 20V-powered Raspberry Pi:


HiFiBerry Mini – distortion and noise measurements

Here are some noise and distortion measurements of the HiFiBerry Mini DAC. Without the ethernet connected, noise is practically non-existing. But also distortions look good. D2 has the highest level and higher-order noise is decreasing with each order. This is really a nice chip.


At 1kHz we see 0.0037% THD+N (distortions alone only 0.003%). However, the measurement equipment itself (an EMU0404) itself has a THD+N level of 0.002% at this frequency (in- and output together). Therefore the real noise and distortion figure might even be a bit smaller.

We also did tests at other frequencies and they look similar:


Note, that these measurements are a bit flawed, because at higher frequencies there are less harmonics within the measurement frequency range than at lower frequencies. Therefore the distortions go down. Unfortunately I was not able the extract the D2 and D3 levels alone.

There are more good news. The voltage regulation on the board works great. Even with the worst power supply I could find (a Nokia charger), the figures did not change much. THD+N went up from 0.0037% to 0.004% at 1kHz. That means there is no urgent need to upgrade the power supply of your Raspberry Pi.

 Update 1.12.2013: We did some THD+N measurements of our production version. They were even lover than the values show here.

PCM5102 charge pump frequency

The PCM5102 is a nice I2S DAC. We use it in you HiFiBerry Mini DAC. It is easy to use, because it does not need a master clock and can run on a single 3.3V power supply. To generate a full 2Vrms signal, the chip uses an internal charge pump (with two external 2.2uF capacitors) to generate a negative power supply.

Unfortunately the datasheet gives no information about the switching frequency of the charge pump. But it’s not a secret. You can simply have a look on the voltage on the external capacitor. What do we see? Switching frequency is about 850kHz – way out of the audible frequency range.



Update 13.11.13: It seems, that the charge pump frequency depends on the sample rate. We’ve seen even charge pump frequencies above 1MHz.

Tracking down noise sources on a Raspberry Pi

I did some measurements of the HiFiBerry DAC for the Raspberry Pi. Compared to the DAC in standalone mode, there was noticeable more noise when I connected the DAC to the Raspberry Pi. Ok, that was expected. There is a lot of digital switching on the Raspberry, this is not good for audio circuits. But then I noticed an interesting fact: Even if the Raspberry Pi was powered off, there was still some noise.

rpi-noise-with-ethernetWhere did it come from? The only cable that was still connected was the network cable. Hmm, what happens if I remove this cable?


Wow! Silence! The 750Hz peak was a problem in our measurement setup.

But where does this noise come from? When you connect the Raspberry Pi do an ethernet network, the data connection is galvanically decoupled using a transformer. However, if you use shielded Ethernet patch cables (STP), the ground of the Raspberry Pi (and your audio equipment) is connected to the Ethernet network. This is where all the noise comes from. The solution is simple: You should use unshielded twisted pair cables (UTP) to connect your Raspberry Pi to en Ethernet network or use WLAN.


Voltage regulators in analog/digital circuits

There are many mixed analog/digital circuits today. Often the components like ADCs, DACs or codecs have separate power supply pins for analog and digital parts of the circuit. However, most modern opamp-based circuits have a very high power supply rejection ratio (PSSR). Does it really make sense to use separate power supplies for the analog and the digital part?

Let’s have a look at a specific example – our HiFiBerry USB. The PCM2906C from Texas Instruments used in this design can be powered completely from the USB bus. It has internal voltage regulators the create a 3.3V voltage supply from the USB bus voltage. But if you look in the datasheet, you will notice that Texas Instruments recommends an external REG-103 voltage regulator for high-quality audio.

Is there really a difference? Let’s see. For our tests we measure harmonic distortions of both the input and the output of this codec. Input and output are connected by a simple loopback cable. Input and output run at full swing (about 2Vpp).

We will start without an external voltage regulator. The chip is powered directly from the USB bus power.


0.01% harmonic distortion (D2) are not too bad. This chip is not the best codec available on the market. However, there is a lot of D6+ distortion peaking to 0.1%. That doesn’t look good. Where does it come from? Let’s see, what happens if we use a REG-103 voltage regulator for the analog supply of the circuit:


Much better! D2 and D3 are at about 0.005%, D4+ even much lower. This is a really nice-performing codec now.

There is also another interesting fact here: Even with the additional voltage regulator, the whole circuit is still powered via the USB bus voltage. With a high-quality voltage regulator there is no need for an external power supply, which is good news.



powerelectronicsWhile still many audio enthusiasts favor linear power supplies for their circuit, switching mode power supplies (SMPS) are used more and more. They have several advantages to linear power supplies. Not only are they usually more efficient, but also the switching frequency can be far outside of the audible frequency range. Even though you can use the circuit diagrams in the data sheets of available ICs, you might want to learn a bit more about this kind of circuits. In this case, the Coursera course “Introduction to Power electronics” is the right course for you. The course started today and you can attend for free.