OLED Screen
This article shows how to use the SH1106 1.3 inch I2C OLED display with the Arduino. We’ll show you some features of the OLED display, how to connect it to the Arduino board, and how to write text, draw shapes and display bitmap images. Lastly, we’ll build a project example that displays temperature and humidity readings.
The organic light-emitting diode (OLED) display that we’ll use in this tutorial is the SH1106 model: a monocolor, 1.3-inch display with 128×64 pixels as shown in the following figure.
The OLED display doesn’t require backlight, which results in a very nice contrast in dark environments. Additionally, its pixels consume energy only when they are on, so the OLED display consumes less power when compared with other displays.
The model we’re using here has only four pins and communicates with the Arduino using I2C communication protocol. There are models that come with an extra RESET pin. There are also other OLED displays that communicate using SPI communication.
Pin Wiring to Arduino Uno
Vin 5V
GND GND
SCL A5
SDA A4
To control the OLED display you need the adafruit_SSD1306.h , adafruit_SH1106.h the adafruit_GFX.h libraries. Follow the next instructions to install those libraries.
1. Open your Arduino IDE and go to Sketch > Include Library > Manage Libraries. The Library Manager should open.
2. Type “SSD1306” in the search box and install the SSD1306 library from Adafruit.
How to Install Libraries in Arduino IDE
https://www.youtube.com/watch?v=LWlq25J2hFI
Download Libraries
After installing Libraries and making Proper connections load I2C scanner code on arduino to get I2C address of the screen you are using.
then go to files>examples > Adafruit_SSD1306>128x32 / 128x64 ino code.
(if you are using SSD1306 OLED)
else if you are using SH1106 OLED screen then go to
files>examples > Adafruit_SSD1106>128x64 i2c code.
(if you are using SH1106 OLED)
No comments:
Post a Comment