loading

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!

<p>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</p>
Very smart idea! Good jub :)
<p>yeah,Thanks,you can find more useful moudle in Smart-prototyping.</p>
<p>Hello.</p><p>I have &quot;universal&quot; module which could be used as 4SPI (ssems to be set to this mode), 3SPI and I2C. (See images).</p><p>On back side of the module is written which resistor should be solderd for each mode. Now I see R3 and R4 but not R2 and R8 - seems 4SPI</p><p>R2 R3 means 3SPI</p><p>R1, R4, R6, R7, R8 is marked as IIC.</p><p>I would like to chcnge it to IIC,</p><p>So i think that I have to unsolder R3 and R5 and solder them to R1 and R8 respectively \Am I right?</p><p>Then I will have problem with signal identification.</p><p>Module has 7 pins:</p><p>GND, VCC - which is clear</p><p>D0, D1, RES, DC, CS.</p><p>I2C modules have only 4 pins VCC, GND, SCL, SDA</p><p>So which pins from my display after modification will be SCL and which SDA?</p><p>This module is quite popular so i belive that somebody played with this modification.</p><p>Please advice.</p>
<p>I have found this datasheet with the especification of the Interface selection: http://www.rhydolabz.com/documents/SSD1306.pdf (Page 16 Point 8.1)</p>
<p>i've tried it but couldn't be successful. It works only in SPI mode :(</p>
<p>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 &quot;moving artifacts&quot; ... it's probably better explained with a video (below). The text just says &quot;TEST&quot; 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.</p><p>http://www.screencast.com/t/PJUWSvSfQ</p>
<p>If your oled has a 'cs' port try to ground it and reset the arduino</p>
<p>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!</p>
<p>I had the same problem, and fixed it by grounding CS.</p><p>CS means &quot;chip select&quot;. 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/.</p><p>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.</p>
<p>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...</p>
<p>try to put </p><p>delay(100);</p><p>at the end of the loop </p>
<p>Hi, first of all thank you for the tutorial.</p><p>I have a 6 pin 0.96 inch oled. I used SCL with D10 and SDA with D9</p><p>After compiling I saw the deprecated string conversion warnings and a</p><p>low memory available stability problems may occur.</p><p>However nothing appeared on oled it looked totally off.</p><p>Any hints of what may be wrong </p>
great tutorial! thank you very much
<p>Hi,</p><p>How you change the color? in above code I cant find any section or function for set color.</p>
<p>Hi SaeedV3,</p><p>it's just the first line that is always yellow. you can't change the color, just move the text to the yellow upper area or down in the white area. Is still a monochromatic display</p><p>Regards</p>
<p>You have non color version of the LCD</p>
<p>dear i done it but</p><p>i want to send the text by android app via bluetooth pls can u help me how to send text by bluetooth</p>
<p>My OLED have six pins </p><p>GND</p><p>VCC</p><p>CLK</p><p>MOSI</p><p>DC</p><p>CS</p><p>How to connect?</p>
<p>I AM CONSTANTLY GETTING THIS ERROR:</p><p>exit status 1</p><p>invalid conversion from 'const char*' to 'unsigned char*' [-fpermissive]</p>
<p>Hi, how could I learn to make a voltage meter up to 50.4v? Thanks!</p>
<p>Hi,</p><p>Cannot download the code. Please help.</p>
<p>Hi Kolitham, sorry for the truoble, I just update the code link, you can download it now.</p><p>Best, Alex Chu</p>
<p>Thanks Alex</p>
Mine has 8 pins :<br>Vcc<br>Gnd<br>NC<br>Din<br>CLK<br>CS<br>D/C<br>RES<br><br>What should I do ??
<p>CLK is our D0 port, </p><p>Din is our D1 port,</p><p>ignore your NC and CS port, try it again, if not worked you can try to plug CS to GND or VCC, good luck!</p>
<p>For 8 pins. It worked Perfectly. Connect CS to GND. </p>
<p>thenks. very importent information.</p>
<p>Hi,</p><p>My OLED has 16 pins as it is able to use different modes. What pins would I use?</p>
<p>nice...........</p>
<p>nice...........</p>
<p>hi to all,</p><p>i am mothiram, using NHD-2.7-128X64UCY3 OLED Display with SPI interface.</p><p>here am facing one problem while writing byte data to display through write_data, can any one help me out with related example.</p><p>thanks.</p>
<p>Hi Alex I have just received my very first Arduino Duo together with this very display. I'm new to Arduino's and am trying to learn the programming. I have experimented with Blink and using a potentiometer to read values serially all worked great.</p><p>This is going to be a total newbie question but I just down loaded the code and tried to make a new sketch then verify it but is keeps coming back with so many errors I'm not sure I'm doing it correctly. Can you you please walk a total newbie through the sequence correctly? </p>
<p>Hi I got it working and removed the line</p><p>can you tell me how to set a delay and then print something else like a valeu from a sensor?</p>
I changed mine to hello world but it still has a line on one side ? Help please
<p>I know this is old but I had the same problem with my display.Try changing the bold numbers below from 128 to 130. This fixed my problem.</p><p>void LED_Fill(unsigned char bmp_data)<br>{<br> unsigned char y,x;<br> <br> for(y=0;y&lt;8;y++)<br> {<br> LED_WrCmd(0xb0+y); <br> LED_WrCmd(0x00); <br> LED_WrCmd(0x10); <br> for(x=0;x&lt;<strong>128</strong>;x++)<br> LED_WrDat(bmp_data);<br> }<br>} <br><br><br><br>void LED_CLS(void) <br>{<br> unsigned char y,x; <br> for(y=0;y&lt;8;y++)<br> {<br> LED_WrCmd(0xb0+y);<br> LED_WrCmd(0x00);<br> LED_WrCmd(0x10); <br> for(x=0;x&lt;<strong>128</strong>;x++)<br> LED_WrDat(0);<br> }<br>}</p>
<p>my display has only 4 pins</p><p>VCC</p><p>GND</p><p>SCL</p><p>SDA</p>
<p>Hello Alex, firstly i would like to thank you for all the informations and steps provided and really appreciated it. I would like to used the OLED display vertically and could you give me sample of coding to display vertically.</p>
Dear frinds i want to programming of rtc interfacing with 8051 my mail id is rammrg007@gmail.com mobile no. 9042816495
Dear frinds i want to programming of rtc interfacing with 8051 my mail id is rammrg007@gmail.com mobile no. 9042816495
Dear frinds i want to progarmming of oled interface with arduino
<p>Hello Dear, it is possible write The text by 90 degree rotated? I Just want to use The lcd in vertical position...</p>
Hollw sir i want programme for interface oled with arduino my mail id is rammrg007@gmail.com
<p>Beware of OLED burn in. If you leave a bitmapped image on for several hours, the phosphors will leave a ghost image. I now get to see Mr. Bentley 24-7. hehe</p><p><a href="https://www.instructables.com/id/Temp-Humid-and-Time-Date-on-OLED-Display/step6/Beware-of-Burn-in-on-the-OLED/" rel="nofollow">https://www.instructables.com/id/Temp-Humid-and-Tim...</a></p>
<p>hello :) thanks for your AWESOME instructable but can you help me with this one ? i have 1 oled display but i have no idea how to connect it to my adruino nano here are the pins on my dispay<br>vcc<br>gnd<br>clk<br>mosi<br>cs<br>d/c </p>
<p>CLK--------D10</p><p>MOSI------D9</p><p>D/C---------D11</p><p>VCC--------3.3v</p><p>GND--------GND</p><p>Ignore CS first, If not work,try to connect CS to GND or 3.3V</p>
<p>Hmm, are you describing the SPI mode? But the code in you link seems to use I2C? </p><p>Here:</p><p>int SCL_PIN=10;//D0<br>int SDA_PIN=9; //D1</p><p>Plus, I am confused since according to the SSD1306 spec, they use some weird wiring for the I2C mode, two SDA?! This is really confusing. </p><p>Also, the code you attached doesn't seem to be using either hardware SPI or hardware I2C. Some sort of bitbanging? So which is it? SPI or I2C or really neither? </p>
<p>You can also use the Adafruit_SSD1306 library with spi in either hardware or software mode. The i2c mode won't work as far as I can tell. The best performance will be with the hardware spi. I spent a day figuring this out for the teensy 3.1, hope it helps.</p>
<p>Hello Alex. thank you for your code. I need to change font size and I use MikroElektronika.and I don't have idea to change in &quot;void LED_P8x16Str(unsigned char x,unsigned char y,char ch[])&quot;. Can you advice me.</p>
<p>We have two fonts in code,you just need to use LED_P6x8Str(unsigned char x,unsigned char y,char ch[]) to display.</p>

About This Instructable

193,923views

161favorites

License:

More by Alex_chu:WS2812B LED Cube 96 for arduino magic colorful How to use E-ink display module on the stm32(Compatible with arduino 3.3V) Colorful LED Christmas tree automaticlly flashing 
Add instructable to: