You are on page 1of 15

Welcome!

Thank you for purchasing our AZ-Delivery 0,66 OLED Display. On the
following pages, you will be introduced to how to use and set up this handy
device.
Have fun!
Table of Contents

Introduction....................................................................................................3
Specifications................................................................................................4
How to set-up Arduino IDE............................................................................5
The pinout.....................................................................................................9
Connecting the device with Atmega328p....................................................10
Library for Arduino IDE................................................................................12
Sketch example.......................................................................................14

-2-
Introduction

OLED stands for Organic Light Emitting Diodes. OLED screens are arrays
of LEDs stacked together in a matrix. The 0.66" OLED Display has 64x48
pixels (LEDs). To control these LEDs we need a driver circuit or a chip. The
display has a driver chip called SSD1306. The driver chip has an I2C
interface for communication with the main microcontroller.

The OLED screen and SSD1306 driver chip operate in the 3.3V range.

The performance of these displays is much better than traditional LCDs.


Simple I2C communication and low power consumption make them more
suited for a variety of applications.

The 0.66" OLED Display consists of a 0.66" OLED display which is mounted
and connected to the printed circuit board designed with the same pinout as
the D1 Mini microcontroler. Therefore, it can be used as a shield for the D1
Mini micro controller but also with other micro controllers such as
Atmega328p or Nano V3.0.

-3-
Specifications

Power supply voltage 3.3V


Display size 64x48 pixels (0.66” diagonal)
Driver chip SSD1306
Communication interface I2C
Pixel Color White
Operating temperature up to 40℃
Dimensions 25 x 28 x 10mm [0.9x1.1x0.4inch]

To extend the lifetime of the display screen, it is common to use a “Screen


saver”. It is recommended not to use constant information over a long
period of time, because that will shorten the lifespan of the screen and
increase the so called “Screen burn” effect.

The default I2C address of the display shield is 0x3C, but it can be changed
to 0x3D by changing connection to required position on the back of the
display board. This procedure requires desoldering previous two contacts
and soldering connections for the second I2C address.

-4-
How to set-up Arduino IDE

If the Arduino IDE is not installed, follow the link and download the
installation file for the operating system of choice. The Arduino IDE version
used for this eBook is 1.8.13.

For Windows users, double click on the downloaded .exe file and follow
the instructions in the installation window.

-5-
For Linux users, download a file with the extension .tar.xz, which has to
be extracted. When it is extracted, go to the extracted directory and open
the terminal in that directory. Two .sh scripts have to be executed, the first
called arduino-linux-setup.sh and the second called install.sh.

To run the first script in the terminal, open the terminal in the extracted
directory and run the following command:
sh arduino-linux-setup.sh user_name
user_name - is the name of a superuser in the Linux operating system. A
password for the superuser has to be entered when the command is
started. Wait for a few minutes for the script to complete everything.

The second script called install.sh script has to be used after


installation of the first script. Run the following command in the terminal
(extracted directory): sh install.sh

After the installation of these scripts, go to the All Apps, where the Arduino
IDE is installed.

-6-
Almost all operating systems come with a text editor preinstalled (for
example, Windows comes with Notepad, Linux Ubuntu comes with
Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text
editors are perfectly fine for the purpose of the eBook.

Next thing is to check if your PC can detect an Atmega328p board. Open


freshly installed Arduino IDE, and go to:
Tools > Board > {your board name here}
{your board name here} should be the Arduino/Genuino Uno, as it can
be seen on the following image:

The port to which the Atmega328p board is connected has to be selected.


Go to: Tools > Port > {port name goes here}
and when the Atmega328p board is connected to the USB port, the port
name can be seen in the drop-down menu on the previous image.

-7-
If the Arduino IDE is used on Windows, port names are as follows:

For Linux users, for example port name is /dev/ttyUSBx, where x


represents integer number between 0 and 9.

-8-
The pinout

The 0.66 OLED Display has 16 pins. The pinout is shown on the following
image:

The 0.66" OLED Display shield is designed mainly for the D1 Mini micro
controller and the pins on the board are the same as on the D1 Mini.

To use the 0.66" OLED Display with other micro controllers, only the four
pins are used for I2C and power supply connections.

-9-
Connecting the device with Atmega328p

Connect the 0.66" OLED display with the Atmega328p as shown on the
following connection diagram:

- 10 -
Mc pin TXS0108E pin Wire color
3.3V VA Orange wire
5V VB Red wire
GND GND Black wire
A4 B7 Blue wire
A5 B8 Green wire
TXS0108E pin OLED Shield pin
VA 3V3 Orange wire
A7 D2 (I2C - SCL) Blue wire
A8 D1 (I2C - SDA) Green wire
OE VA/3.3V (via 10k resistor) Orange wire
GND G (Ground) Black wire

Note: The 0.66" OLED display pins are working in 3.3V range. In order to
use the module with the Atmega328p, the Logic Level Converter must be
used. Otherwise introducing the signal from the Atmega328p pins to display
pins may cause damage to the display. For this purpose use the device
called TXS0108E 8ch Logic Level Converter that AZ-Delivery offers.

Warning: Do not connect 5V to the 0.66" OLED Display shield.

- 11 -
Library for Arduino IDE

To use the screen with an Atmega328p, it is recommended to download


external libraries. The libraries that are going to be used are called the
Adafruit_GFX and Adafruit_SSD1306_Wemos_Mini_OLED. To
download and install it, open Arduino IDE and go to: Tools > Manage
Libraries. When a new window opens, type Adafruit GFX and thereafter
Adafruit SSD1306 in the search box and install the libraries, as shown in the
following images:

To install this library, several dependencies have to be installed. After


clicking Install, the new window appears like on the following image:

Confirm the installation by clicking Install all.

- 12 -
Next, search the Adafruit SSD1306 Wemos Mini OLED library and install it
as on the following image:

Several sketch examples come with the library, to open one, go to:
File > Examples > Adafruit SSD1306 Wemos Mini OLED >
ssd1306_64x48_i2c

With this sketch example, the display can be tested. However, the code
used in the example is fairly complex. The sketch is modified to make a
more beginner-friendly version of the code.

- 13 -
Sketch example

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 0
Adafruit_SSD1306 display(OLED_RESET);

void setup() {
Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
delay(2000);
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.println("0.66 OLED");
display.setCursor(0, 9);
display.println("Shield by");
display.setCursor(0, 18);
display.println("AZ");
display.setCursor(0, 26);
display.println("Delivery");
display.display();
delay(2000);
display.clearDisplay();
}
void loop() {
display.invertDisplay(true);
delay(1000);
display.invertDisplay(false);
delay(1000);
display.clearDisplay();
}

- 14 -
Now it is the time to learn and make your own projects. You can do that with
the help of many example scripts and other tutorials, which can be found on
the Internet.

If you are looking for the high quality microelectronics and


accessories, AZ-Delivery Vertriebs GmbH is the right company to get
them from. You will be provided with numerous application examples,
full installation guides, eBooks, libraries and assistance from our
technical experts.

https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us

- 15 -

You might also like