How to Use OLED Display Arduino Module

251,694

185

95

About: We're a group of fun-loving, electronic DIY'ers with Smart-Prototyping.com. We hope to share useful guides and tutorials as well as the cool things we think up every-once-in-awhile. Enjoy!

Intro: How to Use OLED Display Arduino Module

Hello guys, this is the first time we(smart prototyping) post an instructable here, thanks for watching! We will keep on post funny instructable, hope we can help you a little and communicate with your guys!

Here is the 0.96 inch OLED display instructables for how to display chars and binary BMP picture.
This 0.96inch OLED display has 128x64 resolution, three kind of light color, blue light white light and blue/yellow light, I think the blue light has better display effect than the others. The display with small dimension, very suitable for smart watch, function cellphone, smart health device, now let's start using it to display chars and a Bentley logo picture.

No need to understand any code here, just following the step to do it, you will know how it work and you can control it whatever you like to display.

Here is our product page:

OLED 0.96inch 12864 display module

Dupont Wire Male to Male 40P 2.54mm 20cm

Step 1: ​Connecting the Module to Arduio, This OLED Module Have Six Pins,

Connecting the module to Arduio, this OLED module have six pins,
OLED-------Arduino

D0-----------10

D1-----------9

RST----------13

DC-----------11

VCC----------5V

GND----------GND

Step 2: Copy the Code in Arduino IDE, and Change the Chars in Function "LED_P8x16Str"

down load this Arduino code, and copy it to Arduino IDE.

Find below code in the bottom,

void loop()
{

LED_P8x16Str(23,0,"welcome to");

LED_P8x16Str(40,2,"Smart");

LED_P8x16Str(20,4,"Prototyping");

}

Here you can change the comment that you want to display in line 1, line two, line three. The first and second parameter is the starting x,y coordinate.

Step 3: Upload the Code

Upload the code, then you will see the text showing on display now!

Step 4: Now Start to Display a Bentley Logo

Here is the bentley logo picture here, transfer the picture to 128x64 pixel, save the picture.

if you don't know how to transfer the picture pixel, please download the 128x64 bmp here

Step 5: Transfer the Pic to Binary Code

Use the following soft transfer the BMP code to binary code,

Download bitmap_converter

save output to "logo.txt", open the logo.txt you will see the picture's binery code in
const unsigned char logo [] = {

...

};

Step 6: Copy the Binary Code in to Arduino IDE

Copy this example code(code-bmp.txt) to Arduino IDE

Instead the picture binary code in example code.

find the "

const unsigned char logo[]

"

and copy the code to this funtion. if you don't understand this step, you can just run the example code...

Step 7: Upload Code Done!

Now you can see it display on the OLED!

8 People Made This Project!

Recommendations

  • Plastics Contest

    Plastics Contest
  • Audio Contest 2018

    Audio Contest 2018
  • Electronics Tips & Tricks Challenge

    Electronics Tips & Tricks Challenge

95 Discussions

0
None
raspgraph

3 months ago

Struggled with this after the Adafruit_SSD1306 examples which said to attach CS to pin 12 on Arduino. Decided to attach it to GND instead (due to experience with other LED screens) and your sketches worked just fine. However to stop screen burn suggest the following lines added in void loop.

delay(5000);

LEDPIN_Init();

LED_Init();

delay(5000);

1 reply
0
None
Alex_churaspgraph

Reply 3 months ago

Hi Raspgraph, thanks for your contribution!

0
None
vergiliszta

8 months ago

Hey!
I ported it to STM32 on I2C, and it was a really big help to use your code. Thank's a lot! ;)

0
None
Rezak33

11 months ago

i use this code but my oled after a while become noisy!! any idea?

Untitled.png
2 replies
0
None
Alex_chuRezak33

Reply 11 months ago

Hi Rezak33,

I never met this, maybe you could try to change the power supply or the connection is stable or not. Thanks.

0
None
mbjrgk

Tip 8 months ago on Step 3

Do connect CS to Gnd

0
None
RahulH21

9 months ago

Dear sir i want display counter on screen. how will i display timer value over the screen.

0
None
Rezak33

11 months ago

I use the code for text but after a while OLED became noisy!! any idea what happened or whats wrong?

thank you

0
None
RomainM14

1 year ago

Hi is it possible to change the size of the text and the color even if I think I have a monochrome I could always thank thank you very much of your work is the only code that works for me

0
None
drchance

2 years ago

hmmm ... great code ... it seemed to verify/compile without warnings or errors. However ... on my display, which looks identical to the one in your images, the bitmap image looks like it has some "moving artifacts" ... it's probably better explained with a video (below). The text just says "TEST" bit it looks like it's trying to scroll or something. I've reduced the bitmap to a single letter and it still has that movement in the bitmap image ... weird ... I'll continue to test but I was hoping someone else may have some idea as to what is happening here. Thanks for any input.

http://www.screencast.com/t/PJUWSvSfQ

5 replies
0
None
TeamZ1drchance

Reply 2 years ago

If your oled has a 'cs' port try to ground it and reset the arduino

0
None
o_gardinerTeamZ1

Reply 1 year ago

Great tip, thanks, now the display is working. Could you explain (or refer to an explanation of) what the CS pin does and why it has to be connected to ground? Thanks!

0
None
SPLatManOzo_gardiner

Reply 1 year ago

I had the same problem, and fixed it by grounding CS.

CS means "chip select". It is a line used to select or activate one chip/module out of maybe several. In this module it should really be named CS- or CS*, meaning it is asserted when /low/.

If it is left open its state will be indeterminate, and very likely alternating between low and hi as it is affected by ambient electrical fields. Connecting it to ground makes the display permanently selected and respond properly to everything else.

0
None
o_gardinerSPLatManOz

Reply 1 year ago

Thank you, that's a really helpful explanation! It's always nice to know *why* something is working instead of some 'magic' that I can't explain...

0
None
jackb161drchance

Reply 2 years ago

try to put

delay(100);

at the end of the loop

0
None
roberto.petresco.1

1 year ago

Hi, first of all thank you for the tutorial.

I have a 6 pin 0.96 inch oled. I used SCL with D10 and SDA with D9

After compiling I saw the deprecated string conversion warnings and a

low memory available stability problems may occur.

However nothing appeared on oled it looked totally off.

Any hints of what may be wrong

0
None
Vickey98

1 year ago

dear i done it but

i want to send the text by android app via bluetooth pls can u help me how to send text by bluetooth

0
None
Shahid Khattak

1 year ago

My OLED have six pins

GND

VCC

CLK

MOSI

DC

CS

How to connect?

0
None
ShreejaD

2 years ago

I AM CONSTANTLY GETTING THIS ERROR:

exit status 1

invalid conversion from 'const char*' to 'unsigned char*' [-fpermissive]