I know this is a very old topic but it's one that shows up well in Google seaches so I think a comment here is valuable for anyone else who might be searching on this issue.
I just wanted to add that how you configure the OLED can also contribute a lot to the amount of noise it produces on the powerline.
Most OLED offer all sorts of arcane commands to setup internal voltages and frequecies. Tweaking these values can make a lot of difference. Using less power and operating at lower frequencies alters the amount of noise in the circuit.
In my case my drum-machine project uses a waveshare 128x128px mono (4bit greyscale) OLED with a SSD1327 driver for its UI.
It's a great display, very easy to use and a nice step up from the typical 128x65 mono SSD1306 OLEDs.
however the default start up code from waveshare resulted in a fantasic amount of noise audible in the output. So much so that it drowned out the actual audio from the DAC. The noise was a mix of a strong fairly low frequency in the 100's of Hz range plus a lot of harmoics of higher frequencies.
As suggested by others in this thread (plus another thread over at mutable instruments) I added a large capacitor directly to the OLED board. In my case 330uF seemed to be the optimum for benefit/physical size of capacitor.
This seemed to reduce a lot of the higher frequency noise but still left a lot to be desired.
I also tried taking the display VDD supply from "the other side" of the VReg, ie. unregulated, directly from the VBat in which in my case is 3xAA batteries so around 3.6 to 4.5V. This further reduces the noise to a point where the system was usable but not nice when using headphones. That works as a bodge for now but will require a new board layout which I don't want to do right now.
So I thought I might have a bit of a play with the OLED config and see if there is anything to be gained there and it turns out that there is!
Now onto the config changes. Obviously these are specific to this display but the concept might carry over to other OLEDs.
Here's the
SSD1327 datasheetThe OLED offers a couple of interesting settings.
The first is "Set Front Clock Divider/Oscillator Frequency" Command
0xB3This essentially controls the refresh rate of the OLED a little bit like how a CRT electron beam scans the tube.
Bits
[7:4] set the internal RC oscillator freq between 535kHz and 655kHz , bits
[3:0] set a divider giving the resulting clock that governs the refresh rate.
The default in the datasheet is stated to be
0x00, so that's 535kHz with no divider.
Setting it to the lowest frequency and the highest divider
0x0f results in a very low refresh rate with visible scanning on the display. No good as a display but interestingly it drastically reduces the noise produced. It also clearly indicates that the noise frequecy is in part directly related to refresh rate. A low refresh rate produces low freq noise. A high refresh rate produces high freq noise.
My application is only updating the screen every 50ms (20Hz) so I don't need a very high refresh rate so I tweaked the it to be as low as possible without having any visual scanning. In my case this is a value of
0x01 so that's the lowest fOSC of 535kHz with a divider of 2. At this point most of the noise is now way down in the very low frequencies where it is almost inaudible.
The next improvement comes by reducing some of the voltage levels used internally.
Changing these result in the display becoming brighter or dimmer and can make lower greyscale values essentially black.
However it also appears that lowering the voltages reduces the amount of noice produced so worth playing with.
There are two commands here;
Set Pre-charge voltage
0xBC and Set COM deselect voltage
0xBE.
I found that leaving the VCom at the default value of
0x05 and lowering the Pre-charge value to
0x03 produced a good looking display but also reduced the noice level.
Finally turning off 2nd precharge removed some additional noise without seeming to make any visual difference.
That's command
0xd5 with a value of
0x60With all these changes combined I'm at the point where the noise is low enough to be acceptable.
For the next board revision I will re-route the power to the other side of the vReg after which it will be imperceptible.
Hope that helps someone else.