Victim of its success, Wemos is the subject of many clones (or fakes as some say!). After the Wemos 1d mini, it’s the turn of the LoLin32 to be copied. Today we are going to discover a rather nice clone of an unknown manufacturer (for the moment at least). This manufacturer has copied the best of Wemos by offering several expansion boards (shields) that made the success of the d1 mini. This LoLin32 built around the Espressif ESP32 (ESP-WROOM-32) features a very classic 0.96” (168×64 pixels) monochrome OLED display. The screen is controlled by an SSD1306 controller on the I2C bus.
Unpacking the clone of the Wemos LoLin32 with OLED display SSD1306
There are several shops on AliExpress that market clones of the Wemos LoLin32 with OLED screen. I ordered mine at Face-to-Face Electronic. The LoLin32 has been delivered in about 3 weeks, which is ok for a live delivery from China. It is delivered in a small plastic box with a bubble wrap. Nothing to say, the board is perfectly protected during transport. The board comes with a solder male connector set.
To integrate the OLED screen, the manufacturer to sacrifice multiple pins of the ESP32. For comparison, here is the location of some ESP32 development boards. The ESP32 has 38 pins. Each manufacturer exposes the pins he wants according to the compactness and functions he wants to put forward. The manufacturer of this clone wanted to keep the interface to add a touch screen (Touch 0 to 6). At the same time, there are 11 analog inputs which changes us from the only input of ESP8266 modules. The OLED display uses pins 4 (SDA) and 5 (SCL) to communicate on the I2C bus with the ESP32. We finally have 3 pins delivering a voltage of 3V3, 2 pins 5V and 2 pins GND. In total (counting the I2C bus), there are 19 inputs / outputs while the Arduino Uno offers 20.
Specifications of the ESP-WROOM-32 module
- ESP32 module: ESP-WROOM-32 from Espressif.
- Dual core microprocessor clocked at 240MHz equipped with 4MB flash memory SPI.
- Support up to 16MB of flash memory
- WiFi 802.11 b / g / n.
- WEP Security, WPA / WPA2 PSK / Enterprise.
- Integrated Cryptographic Chip Supporting AES / SHA2 / Elliptical Curve Cryptography / RSA-4096 Algortithms
- Maximum power for data transfer: 19.5 dBm @ 11b, 16.5 dBm @ 11g, 15.5 dBm @ 11n
- Max sensitivity reception: -97 dBm
- Bluetooth 4.0 LE
- WiFi 802.11 b / g / n.
- 32 Inputs / Outputs
- 26x Digital I / O (3.3V). All outputs can be PWM
- 18x analog inputs
- 3x UART
- 3x SPI
- 2x I2S
- 2x DAC
- 2x I2C
- Consumption in sleep mode (Deep Sleep mode): 5 μA
- Integrated sensors
- Hall Effect
- 10x inputs for capacitive touch interface
Testing the OLED SSD1306 I2C Display with Arduino Code
Let’s move on to the OLED screen test. I have already made several articles on monochrome OLED displays driven by the SSD1306.
- Unpacking Wemos ESP32 LoLin clone with 0.96” SSD1306 monochrome OLED display
- OLED display SSD1306 in MicroPython, example with a I2C digital barometer BME280 (or BMP180)
- Portable WiFi Scanner with OLED Display (ESP8266): signal strength, connection test to a server
- Domoticz: Lua script to create a remote OLED display with ESP Easy
- Connect an I2C SSD1306 OLED display and an ESP-01 (ESP8266)
- Jeedom, create an OLED SSD1306 remote display with ESP Easy and HTTP request
- ESP Easy: How to add OLED SSD1306 display to an IoT ESP8266 project
I took the opportunity to review the new libraries available from the Arduino IDE Manager. Since 2016, things have evolved a lot. Adafruit and Sparkfun have contributed a lot to the development of graphic libraries but things have evolved a lot since April 2016 and the first article on driving an OLED screen on an ESP-01.
If you do a search from the Aduino IDE library manager with the keyword SSD1306, you will find three new libraries that are very interesting:
- Ai_Ardulib_SSD1306 is developed by the Canadian manufacturer Acrobatic (https://acrobotic.com/). It is limited to SSD1306 screens. It supports Arduino, Arduino 101, AVR and ESP8266 boards. It is a very light library especially oriented to simple text poster.
- The SSD1306 library by Alexey Dynda comes with the code of a bonus game. It is supported by Attiny85, Attiny45, Atmega328p, Atmega168, Atmega2560, Digispark, ESP8266 and the new ESP32s. It supports i2c (128×64, 128×32), spi (128×64) and Nokia 5110 SPI PCD8544 84×48 screens.
- The ESP8266 Oled SSD1306 library developed by Daniel Eichhorn and Fabrice Weinbern of the Squix blog. It’s a very complete library. However, it is limited to SSD1306 displays on I2C buses on ESP8266 and ESP32. It is very simple to implement but very powerful.
- Finally the U8g2 library (and the light version to display only U8glib text) developed by Oliver Kraus. Currently, it’s the most complete library. It supports an impressive number of screen controllers (SSD1325, ST7565, ST7920, UC1608, UC1610, UC1701, PCD8544, PCF8812, KS0108, LC7981, SBN1661, SSD1306, SH1106, T6963, LD7032).
Install the ESP32 SDK on the Arduino IDE
Before you can use the LoLin32 OLED, you must install the Espressif ESP32 SDK on the Arduino IDE. For that, follow this tutorial for Windows, macOS or Linux.
Install the ESP8266 Oled SSD1306 library and test the display
From the library manager, install the ESP8266 Oled SSD1306 library. Then go to the Tools menu -> Select the Wemos LoLin32 board in the ESP32 section.
Now from the File -> Examples menu, open an example that came with the library. There are 4:
- Clock, a clock
- Drawing, to show the different primitives available
- OTADemo, an example showing how to display the update progress in WiFi
- UiDemo, an example with multiple display pages
Whatever the case, you need to change the I2C bus pins. The examples are delivered ready to use for an ESP8266. Find the line SSD1306 display (0x3c, D3, D5) and replace D3 for 5 and D5 by 4
SSD1306 display(0x3c, 5, 4);
The display is at 0x3c, as is often the case with 0.96 ” OLED displays. All you have to do is upload the code.
Test with MicroPython code
I also wanted to test the board and the screen with MicroPython code. The installation of the firmware MicroPython does not pose any problem. Just indicate that it is an ESP32 type board. You can use uPiCraft under Windows for example as we saw in the previous tutorial. I then tested the code of the previous tutorial by connecting a BME280 on the I2C bus. Unfortunately, either the bus scan hangs or no I2C hardware is detected. I tested the tip described by Alberto on Instructable without success. Until I find a solution, do not hesitate to share your solution in the comments.
To conclude, this clone of the Wemos LoLin32 is a good quality board. Only regret, it is not as narrow as the LoLin32 Lite. Only one row of pins is available when installed on a breadboard. It works wonderfully from the Arduino IDE. It comes with an example of the SSD1306 library written by our Swiss friends from Squix blog pre-installed. We will discover it in more detail in a future tutorial.
- Getting started Arduino. Receive commands from the serial port (ESP32 ESP8266 compatible)
- Getting started Arduino. Functions for combining, formatting variables to the serial port (ESP32, ESP8266 compatible)
- Getting started Arduino. Character string functions (ESP32 ESP8266 compatible)
- ESP32. How to connect to local WiFi network with Arduino code
- How to assign a fixed IP to an ESP32 ESP8266 or ESP01 project
- ESP32. How to use Timers and Alarms with Arduino Code