RU   EN

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.

Firmware and Setup instructions

USB-powered version Battery-Powered version with Sleep Mode Components names & prices

Schematic for USB-Powered Version

Components:

In case of using additional I2S 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.

Schematic for standalone version with TP4056 charging module and battery

Components:

In case of using additional I2S 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

- 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.

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

Temp & Humidity sensor

Air quality, CO2 sensor (optional)

Other

USB-C connector for stand version of case

X