How to interface OLED with SPI 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 SPI interface connection to Arduino: OLED has Seven pin outs. VCC and GND are connected with 5 volts DC and ground pin of Arduino. SCL (Clock), SDA (Data), CS are connected to Pins 12, 11 and 10 respectively.
OLED with SPI interface connection to Node MCU: OLED has Seven pin outs. VCC and GND are connected with 3.3 volts DC and ground pin of Node MCU. SCL (Clock), SDA (Data) and CS are connected to SCLK GPIO14 and MOSI GPIO13 and CS GPIO15 pins of Node MCU respectively.
OLED with SPI interface connection to ESP32: OLED has Seven pin outs. VCC and GND are connected with 3.3 volts DC and ground pin of ESP32. SCL (Clock), SDA (Data) and CS (chip select) are connected to SCK GPIO18, MOSI GPIO23 and SS GPIO5 pins of ESP32.