0,66 Oled Display Shield - EN
0,66 Oled Display Shield - EN
0,66 Oled Display Shield - EN
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 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
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.
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.
-7-
If the Arduino IDE is used on Windows, port names are as follows:
-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.
- 11 -
Library for Arduino IDE
- 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.
https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us
- 15 -