OLED Interfaced to NodeMCU Using Arduino

OLED Interfaced to NodeMCU (1)

OLED!! What is an OLED?

OLED ( Organic Light Emitting Diodes ) is a flat light emitting technology, made by placing a series of organic thin films between two conductors. When electrical current is applied, a bright light is emitted. OLEDs can be used to make displays and lighting. Because OLEDs emit light they do not require a backlight and so are thinner and more efficient than LCD displays(which do require a white backlight).OLED Interfaced to NodeMCU (1)

Step 1: Need to Be Collectedthings needed

Here is the list of components required to get started with the Instructable,

Hardware Components

  • NodeMCU
  • 0.96” SSD1306 OLED
  • Bread Board
  • Jumper Wires
  • Micro USB Cable

Software Components

  • Arduino IDE

Step 2: ConnectionsConnections 1 (2)

Create an instance for the SSD1306 OLED display in SPI mode.

Connection scheme:

1. CS – D1

2. DC – D2

3. Reset – D0

4. SDA – D4

5. SCL – D3

6. VDD – 3.3v

7. GND – GND

Check the schematic and pin configuration to make connections.

Step 3: Library Download

Before you download library you need Arduino IDE to get started.

To download Arduino IDE and for NodeMCU setup, you can check my previous instructacle.

Interface Servo Motor with NodeMCU

Here’s the library you need for this project:

OLED can be easily coded with a library file called Ug8lib.

Ug8lib is a graphics library with support for many different monochrome displays.

The library file can be downloaded by following steps

  1. Go to Sketch
  2. Include Library
  3. Manage Library
  4. Download U8glib library file.

Step 4: Time to Play With OLEDOLED (1)


#include <U8glib.h>
U8GLIB_SSD1306_128X64 u8g(5, 4, 16, 2, 0);
void setup() {
  /* nothing to do here */
void loop() {
  /* Keep looping until finished drawing screen */
   u8g.drawStr(30, 20, "Hello"); //(horizontal spacing,vertical spacing,"string")
   u8g.drawStr(20, 50, "Makers!");
  } while(u8g.nextPage());

Download the “OLED_NodeMCU.ino” file and open it up in the Arduino IDE.

Then Create a new sketch and paste the code below in the Arduino IDE and hit Upload. You can tinker with it if you like based on the application, or just use it as it is.

Step 5: OutputOUTPUT 2 (1)


That’s all makers!
I hope you found this instructable most useful. You have successfully completed one more NodeMCU Instructable.

Read more: OLED Interfaced to NodeMCU

Leave a Comment

Your email address will not be published. Required fields are marked *