OLED I2c Display With Arduino




About: Computer geek who stumbled upon arduino and electronics in general a while ago.

In this instructable I will show you how to connect and test a 0.96" i2c OLED display module to an arduino.


  • Breadboard and hookup wires
  • Arduino (using a nano v3 5v 16mhz clone in this case)
  • External power supply (regulated 5v)
  • The OLED i2c display

I bought my display around 6 months ago, and I can’t seem to find the exact display on ebay now, but searching for “0.96 ssd1306 i2c OLED” shows a whole lot of similar displays. Other sites, like adafruit, got the same displays if you prefer to shop there.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Connecting Your Display

The display is connected by utilizing the i2c pins on your arduino.

Which pins to use for this differs on some arduino models, but on the UNO and NANO you use pin A4 (SDA) and A5 (SCL). If you’re using another arduino, google the pinout and look for SDA and SCL pins. (For example, google “arduino mega pinout”, and check the images).

I first attempted to power my display from my arduinos 5v. This worked, but only halfway – the display fired up, and started cycling the demos in the sketch we will see later on, and then froze after a few seconds.

I then powered my display from my external 5v supply (with common ground to the arduino), which did the trick – the display is now working properly.

The connections from the display:

  • VCC to external 5v
  • GND to external GND
  • SCL to arduino pin A5 (or the SCL pin for your arduino)
  • SDA to arduino pin A4 (or the SDA pin for your arduino)
  • arduino GND pin to external psu GND

Arduino is connected to the computer via an USB cable. The USB powers the arduino.

Step 2: I2c Scanner

To start out, we need to find out the i2c address of the display. To
accomplish this, I use a quick i2c scanner uploaded to the arduino. The scanner code can be found on http://playground.arduino.cc/Main/I2cScanner.
Copy and paste the code into your arduino IDE, build and upload, and fire up your serial monitor. If your display are connected, powered and working, you will get an address back from the scanner (in serial monitor). My display shows up at address 0x3C.

Step 3: Libraries

In this instructable I am using the arduino IDE (http://arduino.cc) and libraries from adafruit downloaded via github.
Link to the libraries:

I will assume you know how to download and install libraries in your arduino IDE. If not, there are tons of nice tutorials/instructions out there on how to get started with the arduino IDE and libraries.

Both libraries below needs to be installed before you are able to continue with this instructable.

https://github.com/adafruit/Adafruit_SSD1306 (SSD1306 library)

https://github.com/adafruit/Adafruit-GFX-Library (GFX library)

Step 4: Test Sketch

Now that we know our displays i2c address, we can open the example sketch in our adafruit ssd1306 library.
In your arduino IDE, check your examples menu and locate the 128×64 i2c sketch found under Adafruit SSD1306 (as shown in the picture).
Change the address of the display to whatever the scanner told you, in my case 3x0C.

Compile and upload to your arduino, give it a second, and the display should fire up and show some different display modes.

The demo sketch ends with stars that continues to fall forever. You can copy-paste from the demo sketch to use the display modes that fits your needs.

First Time Author Contest

Participated in the
First Time Author Contest

35 People Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

100 Discussions


Reply 7 weeks ago

You are a life saver .. can you help me with this "every second line is blank... "

WhatsApp Image 2019-08-28 at 13.11.17.jpeg

Reply 10 months ago

Same here. I have no solution yet. Maybe someone has an idea what it could be?


5 months ago

There are a lot of comments about the usage of an external power supply. This usually won't be needed! There are a number of reasons that can be the case in my situation, and I haven't tried alternatives later.


On the positive side, this shows for those whom are new to it how to use two power supplies, with the required common ground and so forth ;)


Tip 8 months ago

There are many people that power the display with the internal power supply / power supply from the arduino. This is NO PROBLEM in most cases; in my case it was a problem, possibly caused by a number of variables.

Noting a couple of points that can be the cause:
* Faulty arduino-clone
* Faulty USB-port with regard to its power lines
* Problems powering directly from the FTDI/USB-chip (I belive was CH340 on this one)
* Missing pull-up resistors

Sorry if this is not clear enough in the instructions, but you can power it fine with most arduinos, especially original hardware has spesifications that should power it just fine.

On the other hand, with this setup, you can also quickly learn how to "bind" two power supplies in the same setup (commond ground).


3 years ago

You said: "I first attempted to power my display from my arduinos 5v. This
worked, but only halfway – the display fired up, and started cycling the
demos in the sketch we will see later on, and then froze after a few

I then powered my display from my external 5v supply
(with common ground to the arduino), which did the trick – the display
is now working properly".

This is somewhat strange ... some of the replyers have no problem with powering from the arduinos 5V?

7 replies

Reply 3 years ago

Maybe they are plugging into usb 3.0 while he is using USB 2.0 which only supplies half the current of 3.0


Reply 3 years ago

The display uses minimalistic current, and powering even from an arduino digital pin probably works, so naturally the 5V regulated or VCC would work perfect from USB 2.0.

I think Steven is correct and I'd suspect glitchy wiring if the screen froze. Probably lost the i2c mid process, and nothing to do with the power.

There's NO need to use external power for this OLED screen!


Reply 3 years ago

A faulty wire could certainly explain it, as well as a bugged clone can - might be both. Anyway, not stating you need an external supply, but I indeed did with this setup. Have you measured the current draw on the display?


Reply 1 year ago

A day (or 2 years) late and a dollar short, but I'm using a Nano purchased via Amazon that turned out to be a clone. Running the Adafruit demo, the display current tops out at 25.3mA, and the running current with the "snowflake" display is around 6mA. I initially powered it with a bench supply, but I later connected it to the "Nano"'s 5V output and it still seems to work fine. It's hanging off a powered USB 3.0 hub, so ymmv, however. The real Nano uses an LM1117IMPX-5.0 regulator, which TI's web site specs as capable of 800mA output at 5V, so I decided to give it a try. With a bench supply feeding the Nano via the Vin pin and ground, and the USB disconnected, everything seems to work okay. Nice instructable - saved me a lot of flailing around. Thanks!

Update: Someone commented that the display is supposed to run on 3.3V. I have not confirmed that, but it seems to be as happy on 3.3V as on 5V. The only thing of note is that the 3.3V on the Nano apparently comes from the FTDI USB chip, and "Up to 50mA can be drawn from
this pin to power external logic if required." Substantially less "headroom" that with the 5V supply...


Reply 3 years ago

I'm really not sure, but it might be related to the fact that I was using a nano clone (not genuine arduino), which might have a different voltage regulator, or maybe a partly broken one? I'm also considering if the lack of pull-up resistors on the i2c-line could be the reason, even thought when I changed PSU it worked fine.


Reply 3 years ago

The 0.08W claim for the OLED would mean it could take a maximum of around 25mA with 3.3V and less than 20mA with 5V.

I can't measure my OLED since it's soldered onto my arduino now, but I'm using SPI, which works without issues. I2C would be better, when having multiple devices, but you do need to use pull ups and set up addresses.

Pull up resistors might be the answer, for sure. Not sure if the OLED device has built in pull-ups, but you could try adding 10k ones, and see weather it makes a difference. Or if the 5V line is too noisy, add a small uF capacitor between the 5V and GND to keep the noise down.

It's quite difficult to make a crap arduino clone, so that's never been a problem for me. As long as you can run blink on it, it should pretty much do everything else too.

I'd like to know if you find the fix! =)


Reply 3 years ago

That might also be something to consider - when I changed power supply, I didn't power the display from USB anymore, which might explain the change in behaviour.


2 years ago


My OLED is a just white color I want to change to different color.

Is it possible?

Thank you and wish you a nice day.

3 replies

Reply 1 year ago

If it's white, I'd think you could put a square of colored acetate or some other transparent tinted plastic over the display to get whatever color you want. Assuming you mean you know it's a monochrome display and you're not wanting to change colors under program control.


Reply 2 years ago

I suppose, it is impossible. The colour is unchangeable, it defined by the used OLED type.


Reply 2 years ago

Is there different ROLES with the same controller but different color? because as you can see up there it's blue .