Review of OLED Shield for Wemos D1 Mini (SSD1306 64×48 px) with ESP Easy and Adafruit_SSD1306

shield wemos dht22 oled display 64x48pixels battery lipo esp easy r147
Table of Contents

Today, I propose to test the OLED shield for the Wemos D1 Mini. This shield is equipped with an OLED screen of 64 x 48 pixels. It uses the usual SSD1306 microcontroller already presented in several articles.


It is a small screen size ideal for adding a miniature display to the Wemos. It is very easily found direct from China less than €5.

Unpacking the OLED shield for Wemos D1 Mini

I was surprised by the quality of the packaging. The screen is delivered in a small transparent case. The shield comes with the usual 3-dimensional pin set. The OLED screen is directly soldered to the PCB. The manufacturing quality is impeccable. Small small weak point to note however, the screen is held in place by a self-adhesive foam. The screen can be turned slightly. It may have been positioned at the time of bonding, or the foam deforms during storage. It’s not very annoying, just take it off gently and reposition it properly.

shield wemos d1 mini oled display 64x48 pixels

Arduino code with the modified Adafruit_SSD1306 library

The Adafruit_SSD1306 library is quite simple and very powerful. It allows you to draw simple shapes, write text, display bitboards, write text and make small animations (scrolling …). The resolution of this screen is not supported directly by this library. Mike Causer made an adaptation of the library. It is available on Github here. Mc Causer also made an adaptation of the Adraduit demo program here.

If you are developing other projects using the official Adafruit_SSD1306 library, it is best to add the 2 modified files directly to your project. Download the ZIP file from Github. After decompression, place the 2 files Adafruit_SSD1306.cpp and Adafruit_SSD1306.h in the directory of your project. Close and reload the project to take into account the 2 libraries

To learn more about this library, read this article

You must modify the declaration of the library at the beginning of the program to call the local library. This is especially the case if you already use the Adafruit official library for other projects.

#include <Adafruit_SSD1306.h>


#include "Adafruit_SSD1306.h"
Note that if the library is not in the same directory as the Arduino program, it will also be necessary to specify the path. 

The change simply takes into account the resolution of the shield’s OLED screen. The programming remains exactly the same. Here is a small (minimal) code example that displays a Hello World on the first line of the screen.

DHT22 tester: temperature and humidity display

To test the screen, here is a small quick assembly which allows to measure and then to display the temperature and the humidity measured with the shield DHT22. The Shield Wemos DHT22 has already been presented in this test. You can make this small temperature probe autonomous by running it on battery thanks to Shield LiPo which will be the subject of a test.

esp8266 Wemos D1 mini ESP8266 Wemos D1 Mini board

From €2,90€ to €4,90€

wemos d1 mini shield batterie lipo LiPo battery charger with micro USB connector.

About €2,20

wemos d1 mini oled shield I2C SSD1306 monochrome OLED Display 64×48 pixels.

About €4,40

wemos d1 mini dht22 shield DHT22: temperature / humidity sensor.

About €6,40

Upload the Arduino code

This small program thus recovers the temperature measurement (in Celcius) as well as the moisture content.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_SSD1306.h"
#include <DHT.h>
#define OLED_RESET 0  // GPIO0
Adafruit_SSD1306 display(OLED_RESET);
#define DHTPIN D4
#define DHTTYPE DHT22  
void setup()   
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 64x48)
void loop() 

  // Efface l'écran et positionne le curseur dans le coin supérieur gauche - clear display and set cursor on the top left corner

  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float f = dht.readTemperature(true);
  float bat = ESP.getVcc();// / 1024;
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
  // Température en Celcius - Temperature in Celcius
  display.println(" c");
  // Humidité en % - Humidity in % 
  display.println(" %");

The OLED shield can display up to 6 lines of text. With the Adafruit_SSD1306 library, there are 10 characters with size 1.

shield wemos dht22 oled display 64x48pixels battery lipo arduino code

Using the Shield OLED with ESP Easy

The Wemos shield is only supported from the R147 RC8 version of ESP Easy. Click on this link to download it or go to to retrieve a newer version. Install the ESP Easy firmware as usual.

Run a scan of the I2C bus for the address of the screen.

shield oled wemos d1 mini espeasy 64x48 scan bus i2c

Create a device for the DHT22. Compared to the R120 version, the pins have a double marking. The Arduino GPIOx tagging and ESP8266 (Dx) matching. On the DHT shield, the DHT22 (or DHT11) is welded to the D4 pin. Configure the settings like this:

  • Delay Choose a refresh rate. Here 1 second
  • IDX a number other than 0
  • GPIO the DHT22 is connected to the D4
  • Type choose your model (DHT11, DHT21 or DHT22)
  • Register with submit

shield oled wemos d1 mini espeasy dht22 shield

Add a new device for the OLED screen and configure it

  • Delay 1 second for example
  • I2C</span class=”diyhl diyinfo”> choose the I2C address on which the screen is located
  • Rotation</span class=”diyhl diyinfo”> If you only have 4 lines to display, you can change the orientation. Version 147 RC8 has a display bug that does not display the last 2 lines
  • Display Size choose 64×48
  • Line The value of a probe in brackets is called. For example, to display the temperature returned by the DHT22 device, [DHT22 # temperature] will be done. The case is not considered.
  • Register with submit

Other remarks:

  • The code has a second bug. The last line overflows on the first line (or more)
  • Each line can not contain more than 8 characters. This is less than with the Adafruit_SSD1306 library

shield oled wemos d1 mini esp easy

And here is the display

shield wemos dht22 oled display 64x48pixels battery lipo esp easy r147

Wemos nos proposes here a Shield of good quality which comes to be stacked on top of other Shields. The resolution is a bit constraining but the usual libraries have been adapted and allow to program quite simply a display.

Click to rate this post!
[Total: 1 Average: 4]

Thanks for your reading

Did you like this project ? Don't miss any more projects by subscribing to our weekly newsletter!

Are you having a problem with this topic?

Maybe someone has already found the solution, visit the forum before asking your question
  1. could you please update the links to the modified OLED libraries?

  2. Adafruit library was rather slow when displaying plain text on SSD1306 128×64 via I2C (and they still hasn’t fixed the hard-coded mode which forces you to modify the library source for your needs), so I’d vote for another one which is also free – SSD1306Ascii (it is small and fast enough).

  3. No links… makes this kind of irrevalent.

  4. Links to the modified oled libraries.

Leave a Reply

Read more
DIY Projects
DIY Projects
%d bloggers like this: