Вы находитесь на странице: 1из 9

Ortile, Jastine Milert V.

BSCPE III-A

Cheap OLED Displays and Arduino

Let us talk a little more about what OLED displays are and why anyone would consider
using them in their projects. OLED stands for organic light emitting diode. On the microscopic level,
an OLED display is a matrix of organic LEDs that light up when they emit energy. Old LCD (Liquid
Crystal Display) technology uses electronically controlled polarizers to change the way light passes
or does not pass through them. This requires an external backlight the lights up the whole display
underneath. This uses a lot of energy because at the time the display is on, enough light for all pixels
must be provided. The new OLED technology only uses electricity per pixel. Because each pixel
creates its own light, only the pixels that are on use electricity. This makes OLED technology very
efficient; also, the way these types of OLEDs are built allows them to be very thin compared to LCD.
That is why all the new TVs that are coming out are super thin. There is more to OLED technology
but HowStuffWorks does a good job at explaining all the fine details of OLED technology.

After waiting almost a month, I opened up the OLED and went right to testing it out. The
link in the description pointed me to this website, which is a tutorial from Adafruit. Apparently,
Adafruit also makes small OLEDs displays that are very similar to the ones I received. After going
through the tutorial, adding the library, and setting up all connections, I load the Arduino example
file and get something like this.

Very useless however the image above shows a good example of the limitations of OLED
displays because Of the way theyre built OLEDs have s slower refresh rate which is seen as darker
lines on the OLED in the picture. At this point, I got very discouraged, set this OLED in my
electronics box, and forgot about it. A few months past and I gained some interest in making this
Here is what I did

1. Connect the OLED as follows:

O
Arduino
OLED

G
GND
ND

V
VCC
CC

S
pin 5
CL

S
pin 4
DA

R
pin 3
ST

D
pin 2
/C

C pin 10
S (optional)

To add CS (chip select) you have to solder a wire to the back of the OLED where it says chip
select.

2. Download the U8glib library from their website and place it into libraries folder of your Arduino.
3. Now here is the tricky part that will make your OLED work perfect:
Go into the libraries folder
Open U8glib library folder
Now open Utility folder
Scroll down till you find the file with the name u8g_dev_ssd1306_128x64
There are actually two of them One of them is bigger, open the BIGGER one. Right about line 186
you will see this:

1. 0x000, /* set lower 4 bit of the col adr to 0 */

Change it to this

1. 0x002, /* set lower 4 bit of the col adr to 0 */

4. Open Arduino IDE


5. In examples under U8glib, you will see a Hello World example Open it
6. Now if you look through the code you will see that in the beginning there is a lot of
commented out code that allows the user to select what display they want to use. Right under
all that add a new line and put this in. This tells the code how you connected your OLED.

1. U8GLIB_SSD1306_128X64 u8g(5, 4, 10, 2, 3);

7. Click upload and you are all set.

A so-called garbage OLED is not really garbage after all. The HelTec OLED that I got has
12864 pixels, which is not much, but you can actually play chess on it. Just look through the
examples in this library and find the cool things you can do with this small OLED that I got from
eBay. It was actually quite hard to get it to work for the first time because information about
making it work was found scattered around all over the internet; this small write-up combines it all
in one simple to read tutorial.

OLED work. Therefore, I started to do some research. I found a library that supports all
sorts of displays for Arduino, and it supports Adafruits OLED. I loaded it up and got it to turn on,
very exciting!

How to use OLED display arduino module: (Example)

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.
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...

code-BMP.txt Download this.

Step 7: Upload code done!

Now you can see it display on the OLED!

Вам также может понравиться