WeMos ESP8266 board with OLED and 18650
This board is equipped with:
- ESP8266-12 module
- OLED display based on the SSD1306 chip
- A „joystick“ type of button that can be used as input and hardware reset.
- A standard 18650 li-ion battery holder attached to the back
- Charging chip for charging through the USB port
- A power switch that separates all power consumption from the battery
Arduino Board Configuration
The Arduino Board Manager supports this board by installing the esp8266 by ESP8266 Community
package.
It can be used with the following settings:
- Board: NodeMCU (ESP-12E Module)
- CPU Frequency: 80 MHz
- VTables: Flash
- C++ Exception: Disabled
- Stack Protection: Disabled
- SSL Support: AllSSL Ciphers (most compatible)
- MMU: 32kB cache + 32kB
- IRAM (balanced)* Upload Speed: 921600
- Non-32-Bit Access: Use pgm_read macros for IRAM/PROGMEM
- Flash Size: 4MByte (FS:2MB OTA:~1019kB)
- Builtin Led: 2+
- IwIP Variant: v2 Lower Memory
- Debug port: Serial
- Debug level: None
- Erase Flash: All Flash Contents on first upload, then Only Sketch
- Upload Speed: 921600
This setting is identical to the standard NodeMCU settongs. However the features on the board are extended and not all signals are available to connectors.
OLED Display
The display is using the OLED technology and the chip is attached using the internal I2C bus and is supported by the SSD1306 Element and Display adapter.
The display resolution is 128x64 pixels.
The display can be used by configuring the DisplaySSD1306 Element.
The full configuration is provided below.
Joystick
The joystick button is connected to 4 input pins and to the reset pin as well this makes this button almost useless for games and menu selection functionality because it will happen by accident that the reset direction (move to the right) is activated.
Joystick | Pin |
---|---|
Right | Reset |
Left | GPIO0(D3) |
Up | GPIO12(D6) |
Down | GPIO13(D7) |
Press | GPIO14(D5) |
Onboard LED
There is a green LED at GPIO16(D0).
The green LED at GPIO16(D0) only can be used when there is no need for deep sleep functionality and only can be switched on and off.
In cannot be dimmed using by PWM because GPIO16 is not supporting this.
The blue LED on the ESP-12 can also be used GPIO2(D4).
I2C / WIRE Bus
The internally used I2C Bus for the connection with the OLED is not available at a connector. Therefore it is difficult to add more I2C bus devices to this bus.
Also the board doesn’t use the common and default pins that are defined by SCL=GPIO5(D1) and SDA=GPIO4(D2).
The board uses
SCL
=GPIO4
(D2
) (yellow) andSDA
=GPIO5
(D1
) (blue)
Board configuration
The display configuration is defined in env.json
together with the system button and led for configuration.
When pressing the joystick while the LED is blinking the device switches to config mode.
{
"device": {
"0": {
"name": "wemos18650",
"reboottime": "24h",
"i2c-sda": "D1",
"i2c-scl": "D2",
"logfile": 1,
"led": "D0",
"button": "D5",
"description": "ESP8266 board with OLED and 18650"
}
},
"ota": { "0": {} },
"diag": { "0": {} },
"ssdp": { "0": { } },
"DisplaySSD1306": {
"0": {
"address": "60",
"height": 64
}
}
}
These are the basic element configurations for the joystick button and the 2 onboard LEDs.
{
"digitalin": {
"up": { "pin": "D6", "title": "Button Up", "invert": "true", "pullup": "true", "onvalue": "displaytext/up?value=$v" },
"down": { "pin": "D7", "title": "Button Down", "invert": "true", "pullup": "true", "onvalue": "displaytext/down?value=$v" },
"left": { "pin": "D3", "title": "Button Left", "invert": "true", "pullup": "true", "onvalue": "displaytext/left?value=$v" },
"press": { "pin": "D5", "title": "Button Press", "invert": "true", "pullup": "true", "onvalue": "displaytext/press?value=$v" }
},
"displaytext": {
"up": { "prefix": "up" , "x": 4, "y": 20 },
"down": { "prefix": "down" , "x": 4, "y": 30 },
"left": { "prefix": "left" , "x": 4, "y": 40 },
"press": { "prefix": "press" , "x": 4, "y": 50 }
},
"digitalout": {
"led": {
"pin": "D0",
"invert": "true",
"value": "0",
"description": "Builtin LED is on Port D0 = GPIO16"
}
},
"pwmout": {
"led": {
"pin": "D4",
"range": 255,
"value": 10,
"invert": "true",
"description": "Build-in LED on module"
}
}
}