RU   EN
ESP8266 (USB) ESP8266 (Battery) ESP32 Components & prices

The diagram shows a universal pinout for connecting an E-INK display to the ESP8266 that does not interfere with initialization signals and leaves the I2C pins available for
connecting a sensor (tested for 4.2' displays from Waveshare, WeAct, and should be compatible with some other manufacturers using the same controller - SSD1683 or UC8176).
This pinout is used in all schematic variants and can be used as reference, or for recheck yourself
The remaining free pin D4 should not be in a LOW state when the device starts, but it can still be used for something.

Schematic for USB-Powered Version

Components:

In case of using additional I2C sensors (e.g. air quality sensor, CO2), the connection is made to the same pins (SDA, SCL, 3.3V, GND), according to the pin designations on the sensor itself.

Note on Flashing the USB-Powered Version

Flashing can be done via USB without any special considerations. If settings are lost or there are issues initializing specific parameters, you can reset through the control panel at http://[device IP address] (Device Management -> Reset Settings).

Firmware updates can be performed over the air via http://[device IP address]/update.
The firmware file after compilation in PlatformIO is usually saved in the project directory .pio\build\esp12e\firmware.bin.

Common example of connect multiple sensors

In case of using additional I2C sensors (e.g. air quality sensor, CO2), the connection is made to the same pins (SDA, SCL, 3.3V, GND), according to the pin designations on the sensor itself.

The diagram shows a universal pinout for connecting an E-INK display to the ESP8266 that does not interfere with initialization signals and leaves the I2C pins available for
connecting a sensor (tested for 4.2' displays from Waveshare, WeAct, and should be compatible with some other manufacturers using the same controller - SSD1683 or UC8176).
This pinout is used in all schematic variants and can be used as reference, or for recheck yourself
The remaining free pin D4 should not be in a LOW state when the device starts, but it can still be used for something.

Schematic for standalone version with TP4056 charging module and battery

Components:

In case of using additional I2C sensors (e.g. air quality sensor, CO2), the connection is made to the same pins (SDA, SCL, 3.3V, GND), according to the pin designations on the sensor itself.

Always turn off the device ("Power switch" on scheme) or remove battery before flashing via USB

- If you plan to use additional sensors (such as the SCD41), you can include a circuit to cut off power to the I2C line in order to save battery life — Additional components and circuits

- By default, the standalone version reads input voltage on A0 pin (BAT_SENSOR), and if BAT_SENSOR switch is off, enables constant operation mode - connects to the WiFi network and obtains an IP address for remote access and further configuration/direct control. The IP address will be displayed on the screen.

- If you are using an ESP8266 version other than the D1 Mini, internal protective resistors may have different values. If necessary, you can adjust the variables in the Env.cpp -> readBatteryV() method.

Note on flashing the Battery-Powered version

Firmware updates can be performed by web-panel http://[device IP address]/update
Simply switch the device to constant mode (disconnect pin A0 and reboot). The firmware file after compilation in PlatformIO is usually saved in the project directory .pio\build\esp12e\firmware.bin.

In the case of flashing via USB, make sure to avoid connecting two power sources simultaneously (for example, USB to both the 4056 and the ESP at the same time)

In case when connecting to a computer / powering the ESP8266 via USB, the 4056 module has a battery protection chip, which should detect an "overcharge" of the battery if the "Power switch" is not turned off while the ESP is powered via USB, and instantly disconnect B- from GND, thereby automatically protecting the battery. If you need to frequently reflash the ESP8266 during development and want to avoid potential issues with the battery / charging circuit, you can expose the RX / TX / GND pins and connect the device to the computer via them, using a separate USB-COM converter (USB to TTL). In this case, to put the ESP8266 into flashing mode, you need to connect the D3 pin to GND during flashing, press RESET, or turn the power off and on again, then proceed with firmware uploading through PlatformIO.

Additional protective measures can be considered, such as adding protection using two 1N5817 diodes as implemented in the SlimeVR project

In case if a 1N5817 protection diode is added as shown in the diagram, it will protect the battery if the "Power switch" was not turned off during flashing / powering via USB. Long-term testing in this mode has not been conducted.

Scheme from bottom - version that allow power/charging directly from the ESP. In this case, the battery and power circuit will be completely isolated. In such a scheme, it is possible to charge and work via UART simultaneously, as the ESP will be powered from USB.
This option has not been used, but if you plan to develop this approach, you should also protect the device from possible simultaneous connection of two power sources (choose the ESP as the base and route the USB-C port with DATA pins and power to the device's body).

Alternatively, if the device is to be powered continuously from the mains, you might not need a battery at all. In the event of a power outage, the ESP8266 will simply reboot and continue working. However, if for some reason you prefer to use the device continuously from the mains while having a battery backup, it's better to look for charging modules designed for constant connection to the mains. For example, searching for "Lithium battery charger ups power supply 5v 18650" yields many cheap ready-made solutions designed for continuous power from the mains with battery backup. The board will be slightly larger, so you'll need to adjust the case accordingly. In practice, this hasn't been a major concern yet, as the device, even with a regular battery, lasts for several months if it's working in normal mode with sleep transitions.

Common example of connect multiple sensors

In case of using additional I2C sensors (e.g. air quality sensor, CO2), the connection is made to the same pins (SDA, SCL, 3.3V, GND), according to the pin designations on the sensor itself.

Example Circuit for ESP32

Any board with an ESP32 microcontroller model will work. The most optimal option at the moment is the ESP32 S3 Super Mini (ready profile in firmware - platformio.esp32s3zero.ini) with a built-in battery charging controller (you can connect the battery directly to the ESP32 board without needing additional charging control modules, which simplifies the circuit).

Components:

* The SLEEP_ON_READ_LOW switch is not required when using constant power supply

Defines for UserDefines.h according to this scheme

#define DEFAULT_I2C_SCL 5

#define DEFAULT_I2C_SDA 6

#define SLEEP_SWITCH_PIN 2 // set -1 for Non bat version

#define BATTERY_SENSOR_PIN 7 // set -1 for Non bat version

#define EPD_BUSY_PIN 8

#define EPD_RST_PIN 9

#define EPD_DC_PIN 10

#define EPD_CS_PIN -1

#define EPD_CLK_PIN 12

#define EPD_DIN_PIN 13

Notes for the battery-powered version

- If you plan to use additional sensors (such as the SCD41), you can include a circuit to cut off power to the I2C line in order to save battery life — Additional components and circuits

The SLEEP_ON_READ_LOW switch is used only in configurations with a battery and serves to toggle between deep sleep mode and continuous operation (the device will remain accessible via IP).

Check the voltage divider before soldering the entire circuit!


If when connecting the ESP32 S3 SuperMini via USB without a battery the BAT LED on the board stays constantly on — this is a false trigger caused by the voltage divider. In this case, increase the resistor values (during testing, resistors of 200kOm+ did not cause false triggering, while values below 100kOm sometimes did).
The BAT LED without a connected battery, but with USB power present, should only blink, not stay constantly lit. No components should heat up in this state either.

Example of a voltage divider soldered to the board (BATTERY_SENSOR_PIN = 14) and the BAT indicator LED:

If a different ESP32 board is used, when connecting a battery, the voltage divider should be selected based on the upper voltage threshold of the analog input (BAT_SENSOR) of your ESP32 and the maximum power source voltage (the fully charged Li-Ion battery at 3.7V can reach up to 4.2V).

Board modelInput voltage threshold (V) (ADC Pin)
ESP32 S3 SuperMini3.1V
ESP32 S2 Mini2.6V
ESP32 C3 Zero2.5V

A voltage divider of 200kOm / 200kOm is suitable in most cases, but you can try adjusting the resistor values as long as the input voltage to the GPIO remains within safe limits (calculate the voltage divider). During testing, some boards powered by batteries showed a voltage drop of 0.1–0.2V (which can be compensated via BATTERY_OFFSETV).

Common example of connect multiple sensors

In case of using additional I2C sensors (e.g. air quality sensor, CO2), the connection is made to the same pins (SDA, SCL, 3.3V, GND), according to the pin designations on the sensor itself.

Pages of modules and elements on marketplaces with exact names

Pages of those components that I used in the assembly, with some comments. Prices are current as of 05.08.24, screenshots are given for the exact names of products

Compatible displays

Microcontroller - ESP8266

Microcontroller - ESP32 optimal analog

Microcontroller - ESP32 S2 Mini

Also used in tests without problems

Temp & Humidity sensor

Air quality, CO2 sensor (optional)

Other

USB-C connector for stand version of case

See also

X