ESP8266 module with OLED screen (HW-364A)

I received a few of these modules. They come with the older ESP8266. No problem, there’s always a use for it.

A major plus is that the module has a built-in 0.91” 128x64 pixel OLED screen, which is connected via an SSD1306 controller.

You can also find ESP32s with OLEDs, though they are pricier.


Out of the box, the test firmware demonstrated its OLED display working perfectly. But when I tried the samples from the seller, I just got a black screen.

According to the documentation, the display is connected via software I2C with SDA on D6 and SCL on D5. However, when I uploaded a test project with these specified display settings, I got nothing. No signs of life on screen.

I started looking for something similar and found many analogous modules from Wemos or with the ESP32. But they all had completely different I2C display connections.

At some moment, while trying different libraries for the SSD1306, I made a mistake in the configuration. I set the pins in reverse: SDA - D5, SCL - D6. And yes, it works!


Snippet code code for U8g2:

#include "U8g2lib.h" 
 
U8G2_SSD1306_128X64_NONAME_F_SW_I2C 
    u8g2(U8G2_R0,/*clock*/D6,/*data*/D5,U8X8_PIN_NONE); 

... 
    u8g2.begin(); 
    u8g2.clearBuffer(); 
    u8g2.setFont(u8g2_font_7x14B_tr); 
    u8g2.drawStr(5,5,"DISPLAY..OK"); 
    u8g2.sendBuffer();

Comments

Popular posts from this blog

How to use SPIFFS for ESP32 with Platform.IO

Configuring LED Indicators on Orange Pi Zero 3