OLED displaying garbage when circuit powered from wall USB charger....

Hi all,

I'm having the following problem.

I'm using a cheap OLED screen, namely that one: OLED screen

It is connected to the ATmega328P burned with Lilipad boot loader and running on its internal oscillator at 8MHz. There is also a HUT21D humidity sensor connected through I2C.

I'm using a LD1117 3.3V LDO regulator with 100nF capacitor connected to the input and 1500uF on its output to convert the inputs power to 3.3V.

I'm also having decoupling capacitors on both ATMega's Vcc and VREF inputs. The whole thing is currently built on a breadboard.

The circuit works just fine when I give 5V from the USB of my laptop (either run from Battery or from mains). But when I supply voltage from a USB charger (I tried iPhone's, HTC's, Blackberry's) the screen just displays garbage (like an analog TV-set not receiving any channel). Sometimes it will output the temperature and the humidity, among the garbage, or at least some part of the characters, but most of the time all i get is this "noise"

I'm wondering what is causig this behavior... I assume it has something to do with the power quality? I have tried adding large caps (1500uF) at the LDO's input to filter out the input power, but did not help.

I have yet to try getting an 8MHz crystal and try with that.. Will do so as soon as I get some time, but it seems weird that everything works ok when powering from a PC USB port.

Any ideas would be appreciated... Thank you in advance. Nikos

but it seems weird that everything works ok when powering from a PC USB port.

Which means either the power supply is poor which is unlikely as you have tried several. Or you have a mistake in wiring.

It is likely that this mistake is masked by the PC providing power so it might be some sort of grounding wiring fault.

Post schematics and photograph for more help.

1500uF is far more than you need on the output of the regulator. Try 33uF or so.

Just one thing, I feel I left unclear in my original post. The LD1117 regulator is present at both times, when the circuit is being powered from USB charger and when it is powered from PC USB port.

MarkT:
1500uF is far more than you need on the output of the regulator. Try 33uF or so.

I did try with smaller ones (and the 10uF that is recommended on the datasheet) but had no luck. But even so, the thing is working as is when powered from my laptop but not when powered from USB charger.

Did some more tests on the power source and here’s what I got till now:

  • Blackberry charger: not working
  • iPhone charger: not working
  • HTC charger: Not working
  • Lenovo thinpad USB port: Working
  • DELL Lattidute D630 USB Port:Not Working
  • Sony Ericsson proprietry 4.9V charger: Not Working
  • Desktop PC USB port: Working
  • Two cell LiPo battery: Working
  • One cell LiPo battery (fully charged, 4.1V): Working

Not really sure how to translate the results. Can it be some interference with the switched mode power? Maybe a choke or a low pass filter could help?

Grumpy_Mike:

It is likely that this mistake is masked by the PC providing power so it might be some sort of grounding wiring fault.

Post schematics and photograph for more help.

To be honest I do not trust breadboards and these jumper cables but have not got an alternative for now…

Attached is a photo of the circuit on the breadboard. A bit messy…

thank you both for your time and suggestions.

Without looking at the datasheet I can't be sure, but I know the lm317/337 regulators also need a ceramic bypass cap, about .1 to 1. uf on both input and outputs to bypass high frequency noise. Nor will it hurt to add those to the 117 just on general principles. note even with a sensitive DVM you'd be unlikely to be able to measure this noise because it is will outside the audio band AND will not read well on most meters. In some case even a scope will miss it!, IF you have a scope take a look at the output from the USB wallwart. Most likely these days it's a switched power supply and CAN be noisy. Another item to consider in that case is a simple ferrite bead ( well usually no longer a real bead, sort of a double half cylinder, snapped around the high side (only) of ISB supply's input to the arduino.

Oh, I forgot one point IF you have a scope it is unlikely to show much noise UNLESS the bandwidth is at least 100Mhz. However you could look critically at both input and output of the 117, for larger things... What is the dropout of the 117? If the input is less the output plus that dropout you will NOT get good regulation... checking lt117 datasheet now.

AH, you MUST have at least 1.5V difference between in and out, that at 0.02A, but for real world I would want the 2.5v difference. SO.. unless you are using it at no more than 3VDC out you MIGHT have issues. Personally I'd prefer a low dropout regulator over this one... even thought it IS lower than the 3vdc difference needed by the lm317

The first thing I notice is that you are not using ceramic decoupling capacitors. They must be 0.1uF ceramic or they will not filter out high frequencies.

You failed to mention it was a stand alone Arduino.

The description "not working" is not very helpful. Measure the voltage on the regulator's input and output pins to see if power is getting through.

Basically solder less bread boards are crap, I never use them, nor do I recommend their use.

chejkal: Oh, I forgot one point IF you have a scope it is unlikely to show much noise UNLESS the bandwidth is at least 100Mhz. However you could look critically at both input and output of the 117, for larger things... What is the dropout of the 117? If the input is less the output plus that dropout you will NOT get good regulation... checking lt117 datasheet now.

AH, you MUST have at least 1.5V difference between in and out, that at 0.02A, but for real world I would want the 2.5v difference. SO.. unless you are using it at no more than 3VDC out you MIGHT have issues. Personally I'd prefer a low dropout regulator over this one... even thought it IS lower than the 3vdc difference needed by the lm317

Well I happen to have one, but not really sure how do I get to see the noise... Its a 20MHz HAMEG which is laying around since my early school days... I connected the Power supply but do not get to see the noise, when on AC it shows 0V flat-line, when on DC it shows 5V flat-line. What settings do I need to put on the dials?

The datasheet for the LD1117v33 says that the dropout voltage is max 1.1V for 800mA, typical 1.05 for 500mA. It is supposed to be a low voltage dropout regulator. :confused:

Grumpy_Mike: The first thing I notice is that you are not using ceramic decoupling capacitors. They must be 0.1uF ceramic or they will not filter out high frequencies.

You failed to mention it was a stand alone Arduino.

The description "not working" is not very helpful. Measure the voltage on the regulator's input and output pins to see if power is getting through.

Basically solder less bread boards are crap, I never use them, nor do I recommend their use.

Well, I never mentioned Arduino either :) Sorry, indeed Not working means nothing. What I meant to say is that it is working but I get the same noise on the screen (as in the picture). Occasionally there appears something readable, like a digit or a letter from whatever there was supposed to be printed, which means that reading the I2C sensors works. Already measured voltage seems OK. Depending on the supply I use I get 3.350V - 3.365V output from the LDO.

Both mentioned ceramic caps. I did not know it could make a difference (I'm using some MKP ones I had from my audio experiments) I will try this to see...

I'm also going to try and have it tested with the normal Arduino @5V and see...

Oh, one thing I forgot to mention is that in order to eliminate any issues with my regulation, I bypassed it by using the Arduino UNO onboard regulator. So I connected the Arduino UNO to the USB port of the laptop and got the 3.3V output pin to power my breadboard (removing all regulation-related components). I do get the exact same behavior. When the UNO gets its power off of the USB charger the OLED displays garbage. When it gets it from the Thinkpad, everything is well. So any PSU noise does even get through the 3.3V regulator of the UNO.

Again, thank you all for your time and suggestions.

I'm using some MKP ones I had from my audio experiments

Great for audio totally useless for decoupling. You should also have some decoupling on the OLED display, like right on the pins.

got the 3.3V output pin to power my breadboard

There is very little current available from this pin.

Dumb question. CS, is that chip select. Shouldn't that be connected. The chip might float in/out of existence. Leo..

Wawa: Dumb question. CS, is that chip select. Shouldn't that be connected. The chip might float in/out of existence. Leo..

:blush: :blush: :blush: :blush: :blush: :blush:

I learned my lesson well, not to take Chinese people's tutorials for correct.

Was following this tutorial, as it was the closest to the actual board I purchased (and the seller refused to provide any info regarding what and how is connected). The guy on the tutorial did not connect the CS pin. So I did and since it was working on my original attempts, I never bothered to question myself why.

So there, thats is the end of this adventure. Thank you all for your thoughts on it, really learned a lot. And for what it matters, putting ceramic caps really-really made a difference to the circuit and it did improve the situation even with the CS pin floating....

Till next time, Nikos

you know there are oled modules that does not use CS? see this http://forum.arduino.cc/index.php?topic=217290.0 you can probably contact the library author directly.

The voltage regulator you use for the 5 Volts (the one with the heat sink) has 3 pins: VIN, GND, VOUT. From your photo it looks like you exchanged VOUT and GND.

The moral is always check the datasheet. In particular if it gives an example application circuit its usually a very good guide. But occasionally datasheets neglect decoupling caps, because people know these are always required for logic devices, so always assume decoupling is needed even if the datasheet circuit doesn't have it.

And the further morale is to check the date of the original post of this four year old thread.