Thursday 8 February 2018

The all-you-can-possibly-want ESP8266 dev board


All-in-one ESP8266 module

I did a very simple 5-minute example project with this board. The video will be available shortly.
The video is available here now!

Overview

The somewhat unwieldly name "Wemos® D1 Esp-Wroom-02 Motherboard ESP8266 Mini-WiFi NodeMCU Module ESP 8266+18650 Battery+0.96 OLED" betrays a very complete ESP8266 development module, that boasts a load of features:
  • USB2Serial bridge (Silicon Labs CP210x USB to UART Bridge)
    If your PC does not automatically detect the driver, you find it here.
  • Power switch
  • LiIon charge circuit
  • 18650 battery holder
    Beware: the holder is too short for my favourite protected 18650 cells. These INR cells should fit instead.
  • "Wemos" labelled ESP-12F ESP8266 module. It does not look like a WROOM-02, though.
  • SSD1306 OLED display
  • 4-way + push "joystick"

Bells and whistles
The Wemos product page does not list a module like that, so it might not be their product at all.
The advertised product name:
Wemos D1 Esp-Wroom-02 Motherboard ESP8266 Mini-WiFi NodeMCU Module ESP 8266+18650 Battery+0.96 OLED does not really fit in quite a few respects.
Leave a note in the comments, if you know more about that.

OLED details

The OLD display is white-ish in colour. It works with the usual SSD1306 library. The protocol is I2C.

No surprises here.

The PIN assignment is:
  • SDA=GPIO 5
  • SCL=GPIO 4 
The I2C Address ist 0x3c, as it is common for these modules.

4-way switch

To interact with the module, this is super handy.
The Pin assignment is:
  • UP = GPIO 12  (=D6)
  • DOWN = GPIO 13 (=D7)
  • LEFT = GPIO 0 (=D3, FLASH)
  • RIGHT = RESET (!)
  • SELECT = GPIO 14 (=D5)
The RIGHT pin is a bit of a questionable choice. Then again the module does not have a dedicated reset button.

Caveats

I could not get the module to power up without a battery inserted.
People have reported that some components heat up when charging the batteries. I haven't noticed that yet.

IDE selection

I use the Arduino IDE on Windows whenever possible and the bare bones Espressif build environment on Linux whenever necessary.
  • Set-up of the Arduino IDE for ESP8266 ist >>here<<
  • For the Linux build environment, see >>here<<
In the Arduino IDE, I used "WeMos D1" as board type. and 4M (3M SPIFFS) for this module and did not have any issues with it.

UPDATE 2022:

The module does not seem to be available any more. This might be a suitable replacement. Although I don't have one at this time.


13 comments:

  1. Hi, just received mine in the post yesterday. I figured out they have a bit of a nefarious background as a "WiFi Deauther Board" and am guessing there must be a few re-purpose efforts online. Looking forward to your video.

    ReplyDelete
    Replies
    1. Yes, that is exactly what will be in the video.

      Delete
  2. One question.. any luck locating the sample sketch that is running on the module (the little demo)? Would be great to see that code!

    ReplyDelete
    Replies
    1. // Include the correct display library
      // For a connection via I2C using Wire include
      //#include // Only needed for Arduino 1.6.5 and earlier
      #include "SSD1306.h" // alias for `#include "SSD1306Wire.h"`

      // Initialize the OLED display using Wire library
      SSD1306 display(0x3c, 5, 4);

      #define DEMO_DURATION 3000
      typedef void (*Demo)(void);

      int demoMode = 0;
      int counter = 1;

      void setup() {
      Serial.begin(115200);
      Serial.println();
      Serial.println();


      // Initialising the UI will init the display too.
      display.init();

      display.flipScreenVertically();
      display.setFont(ArialMT_Plain_10);

      }


      void drawTextFlowDemo() {
      display.setFont(ArialMT_Plain_10);
      display.setTextAlignment(TEXT_ALIGN_LEFT);
      display.drawStringMaxWidth(0, 0, 128,
      "Peter got it working!" );
      }

      void drawTextAlignmentDemo() {
      // Text alignment demo
      display.setFont(ArialMT_Plain_10);

      // The coordinates define the left starting point of the text
      display.setTextAlignment(TEXT_ALIGN_LEFT);
      display.drawString(0, 10, "Left aligned (0,10)");

      // The coordinates define the center of the text
      display.setTextAlignment(TEXT_ALIGN_CENTER);
      display.drawString(64, 22, "Center aligned (64,22)");

      // The coordinates define the right end of the text
      display.setTextAlignment(TEXT_ALIGN_RIGHT);
      display.drawString(128, 33, "Right aligned (128,33)");
      }

      void drawProgressBarDemo() {
      int progress = (counter / 5) % 100;
      // draw the progress bar
      display.drawProgressBar(0, 32, 120, 10, progress);

      // draw the percentage as String
      display.setTextAlignment(TEXT_ALIGN_CENTER);
      display.drawString(64, 15, String(progress) + "%");
      }

      Demo demos[] = {drawTextFlowDemo, drawTextAlignmentDemo, drawProgressBarDemo};
      int demoLength = (sizeof(demos) / sizeof(Demo));
      long timeSinceLastModeSwitch = 0;

      void loop() {
      // clear the display
      display.clear();
      // draw the current demo method
      demos[demoMode]();

      display.setTextAlignment(TEXT_ALIGN_RIGHT);
      display.drawString(10, 128, String(millis()));
      // write the buffer to the display
      display.display();

      if (millis() - timeSinceLastModeSwitch > DEMO_DURATION) {
      demoMode = (demoMode + 1) % demoLength;
      timeSinceLastModeSwitch = millis();
      }
      counter++;
      delay(10);
      }

      Delete
    2. Cheers Peter. It worked for me once I added another SDD1306 Library (I had the Adafruit one put that didn't work - don't really understand all this Library stuff)

      Delete
  3. I think it is this one:
    https://github.com/ThingPulse/esp8266-oled-ssd1306
    Haven't tried it, though. You may have to change the SDA/SCL pins.

    ReplyDelete
  4. Correct - this is the line you need to change for it to work:

    SSD1306Wire display(0x3c, D1, D2); // address, sda, scl

    ReplyDelete
  5. Hello could you please link me to the download for the files you flashed onto the module in the video.
    Thanks!

    ReplyDelete
  6. Hey I don't have the exact same board as you do, Mine doesn't have a 5-way on it. Somehow my screen is corrupted? Pictured is a 8266 and a WROOM-02 which for me behaved the same, and a WROOM-32 which would not flash the same as the other 2. 18650+Wroom-02 displays blue, and powers all 3 ESP's. 8266 displays are white all 3 same I2C address. same board, pins, and resolution settings (only the blue one has an address jumper.. set to 0x78).

    https://www.dropbox.com/s/qs8xpbk9q6kix24/ESP8266%20Equal%20WROOM-02%20But%20not%2032.jpg?dl=0

    ReplyDelete
    Replies
    1. Wow, interesting looking project. Do you have more info about it online? Looking at the screen corruption, the first thing that comes to mind is missing pull-up resistors on the I2C bus. But that would be very poor board design and rather unlikely.

      Delete
  7. there is posible to connect anther i2c sensor to this?, becouse the GPIO D4 and D5 its used and I can't identified anoder PIN to connect a sensor

    ReplyDelete
    Replies
    1. I2C is a bus, you can have more than one sensors on the bus.

      Delete
  8. Hey!

    Any luck getting battery information? Thus far I have:

    ```
    #include
    #include "SSD1306Wire.h"

    ADC_MODE(ADC_VCC); // read supply voltage

    // Initialize the OLED display using Wire library
    SSD1306Wire display(0x3c, 5, 4);

    void setup() {
    Serial.begin(115200);
    Serial.println();
    Serial.println();

    // Initialising the UI will init the display too.
    display.init();

    display.flipScreenVertically();
    display.setFont(ArialMT_Plain_10);
    }

    void displayVoltage()
    {
    display.setTextAlignment(TEXT_ALIGN_LEFT);
    display.setFont(ArialMT_Plain_10);

    char str[10];
    int rawValue = ESP.getVcc();
    float voltage = rawValue * 1.51 / 1023;
    float perc = map(voltage, 3.6, 4.2, 0, 100);

    sprintf(str, "Supply voltage: %.1f volts", rawValue/1024.0);
    display.drawString(0, 0, str);

    display.setFont(ArialMT_Plain_10);
    display.drawString(0, 20, "Voltage:");
    display.drawString(0, 30, String(voltage));
    display.drawString(0, 40, "Percentage:");
    display.drawString(0, 50, String(perc));
    }

    void loop() {
    display.clear();
    displayVoltage();
    display.display();

    delay(10);
    }
    ```

    ReplyDelete