How to interface OLED
With I2C interface with Arduino, Node MCU, ESP32
OLEDs are solid-state devices composed of thin films of organic molecules that create light with the application of electricity. OLEDs can provide brighter, crisper displays on electronic devices and use less power than conventional light-emitting diodes (LEDs) or liquid crystal displays (LCDs) used today.
Like an LED, an OLED is a solid-state semiconductor device that is 100 to 500 nanometers thick or about 200 times smaller than a human hair. OLEDs can have either two layers or three layers of organic material; in the latter design, the third layer helps transport electrons from the cathode to the emissive layer. In this article, we’ll be focusing on the two-layer design.
An OLED consists of the following parts
Substrate (clear plastic, glass, foil) – The substrate supports the OLED.
Anode (transparent) – The anode removes electrons (adds electron “holes”) when a current flows through the device.
Organic layers – These layers are made of organic molecules or polymers.
Conducting layer – This layer is made of organic plastic molecules that transport “holes” from the anode. One conducting polymer used in OLEDs is polyaniline.
Emissive layer – This layer is made of organic plastic molecules (different ones from the conducting layer) that transport electrons from the cathode; this is where light is made. One polymer used in the emissive layer is polyfluorene.
Cathode (may or may not be transparent depending on the type of OLED) – The cathode injects electrons when a current flows through the device.
OLED product comes with two different types of interfaces I2C and SPI. Here we will discuss on interfacing OLED with Arduino, Node MCU and ESP32.
OLED with I2C interface connection to Arduino: OLED has four pin outs. VCC and GND are connected with 5 volts DC and ground pin of Arduino. SCL (Clock) and SDA (Data) are connected to SCL and SDA pins of Arduino or A4 and A5 pins of Arduino.
OLED with I2C interface connection to Node MCU: OLED has four pin outs. VCC and GND are connected with 3.3 volts DC and ground pin of Node MCU. SCL (Clock) and SDA (Data) are connected to SCL GPIO5 and SDA GPIO4 pins of Node MCU.
OLED with I2C interface connection to ESP32: OLED has four pin outs. VCC and GND are connected with 3.3 volts DC and ground pin of ESP32. SCL (Clock) and SDA (Data) are connected to SCL GPIO22 and SDA GPIO21 pins of ESP32.