This project was inspired by SMALL_DA's ESP32C3 e-ink display.
All code in this article is sourced from the internet and modified accordingly. Any copyright infringement will be immediately removed.
The hardware consists of
a three-color e-ink display with a resolution of 250x122 .
Two types of e-ink displays are available on Xianyu (a Chinese online marketplace):
one uses a UC8151c controller (the one used in this project)
, and the other uses an SSD1675B/SSD1680 controller; a common model is HINK-E0213A22.
To ensure correct display of black, white, red, and yellow colors, please use the driver from my GxEPD2 library: Zxis233/GxEPD2 at Modified_213_Driver.
For the UC8151c controller: `GxEPD2_3C display(GxEPD2_213_my(/*CS=5*/ 7, /*DC=*/4, /*RST=*/5, /*BUSY=*/6));`
For the SSD1675B/SSD1680 controller: `GxEPD2_3C display(GxEPD2_213_Z98c(/*CS=5*/ 7, /*DC=*/4, /*RST=*/5, /*BUSY=*/6));`
For the SSD1675B/SSD1680 controller, the border color setting only takes effect during screen initialization and cannot be changed in subsequent programs. Welcome to discuss the code with me and let's improve together.
For the UC8151c main controller, the bezel color setting is normal.

The purchased screen cable may be 24-pin or 26-pin. If it is the former, please purchase a 24-pin FPC socket for soldering; if it is the latter, you need to apply transparent tape to the back and cut the cable to a narrower width to insert it into the 26-pin FPC socket without it falling out.
It is recommended to use an FPC socket with a rear flip cover for better compatibility.
The driver
board's BOM is consistent with the original project, and the reference numbers and pin definitions have not been changed.
To ensure proper insertion and removal, it is recommended to choose a PCB thickness of 1.2mm.
The HeZhou ESP32-C3 development board
has been tested, and both the standard and simplified versions can be used. If you want to output logs via serial port, the standard version is recommended.
The simplified version can also print logs via serial port, but there is a probability of errors. Method: HeZhou ESP32-C3 simplified version uses serial port to print debugging information | Esing's small station
software
The following is based on VsCode + PlatformIO for development. The configuration process is not described here.
Please make sure to modify the pin definitions for ESP32-C3 in PlatformIO beforehand!
File location: "C:Usersyourusername.platformiopackagesframework-arduinoespressif32variantsAirM2M_CORE_ESP32C3pins_arduino.h"
static const uint8_t SDA = 4; // 8
static const uint8_t SCL = 5; // 9
static const uint8_t SS = 7;
static const uint8_t MOSI = 3; // 6
static const uint8_t MISO = 10; // 5
static const uint8_t SCK = 2; // 4
PlatformIO Project Configuration File
; platformio.ini
;
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags ;
Library options: dependencies, extra library storages ; https://docs.platformio.org/page/projectconf.html [env:airm2m_core_esp32c3] platform = espressif32 board = airm2m_core_esp32c3 framework = arduino board_build.f_cpu = 160000000L board_build.f_flash = 80000000L board_build.flash_mode = dio board_build.filesystem = littlefs board_build.partitions = my_no_ota.csv upload_speed = 921600 monitor_speed = 115200 monitor_filters = default ; Remove typical terminal control codes from input time ; Add timestamp with milliseconds for each new line colorize ; Log data to a file “platformio-device-monitor-*.log” located in the current working directory lib_extra_dirs = C:/Users/Zyx/Documents/Arduino/libraries build_flags= ; -D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
Custom partition table my_no_ota.csv
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x280000,
spiffs, data, spiffs, 0x290000,0x100000,
coredump, data, coredump,0x3A0000,0x60000,
Unzip the attached compressed file, open it with VS Code, and rename src/Config.h.example to Config.h. Fill in the configuration information and compile.
Want to customize the image?
This uses ImageToEPD software provided by Dalian Jiaxian:
ImageToEPD v4.2
requires an image resolution of 250x122.
After generating the character template, paste the content into the Myimg file, and then you can use it!
If your image is reversed horizontally, remember to flip the image vertically when generating the template!
For the Xinzhi Weather key
to obtain weather information normally, the microcontroller needs to be connected to WIFI:
Enter network configuration mode, check the local IP
address, access the microcontroller's IP address from your mobile phone
, fill in the Xinzhi Weather key, and submit.
Of course, you can also hardcode the key into the code.
Usage Instructions
: Zxis233/My213EPD: A 2.13-inch three-color e-ink screen ornament/keychain developed using ESP32C3.
The keychain mode
has a hole pre-drilled at the top of the PCB for threading a lanyard. To avoid damage to the components on the back, it is recommended to seal and protect them with epoxy resin/silicone rubber/conformal coating:

Image Preview



PDF_ESP32C3-based Tri-color E-ink Desktop Calendar.zip
Altium_ESP32C3-based Tri-color E-ink Desktop Calendar.zip
PADS_ESP32C3-based Tri-color E-ink Desktop Calendar.zip
BOM_ESP32C3-based Tri-color E-ink Desktop Calendar.xlsx
93500
STC Microcontroller Development Board Design Track
The STC15F microcontroller core board has all I/O pins brought out, making it suitable for use on breadboards to build circuit experiments with other modules.
The STC15F microcontroller core board has all I/O pins exposed; an external crystal oscillator can be soldered on the back if needed. It can be used on breadboards to build circuits with other modules for experiments. The
included
STC15F comes with a manual and a Keil LED blinking program for verification; please download and use it yourself.
STC15F.zip
PDF_STC Microcontroller Development Board Design Track.zip
Altium_STC Microcontroller Development Board Design Track.zip
PADS_STC Microcontroller Development Board Design Track.zip
BOM_STC Microcontroller Development Board Design Track.xlsx
93502
#9th LCSC Electronics Contest# Multifunctional Environmental Monitoring Instrument
This project utilizes the STM32G030K6T6 and the Sensirion SHT40 temperature and humidity sensor module to implement temperature and humidity detection. This desktop temperature and humidity meter achieves real-time detection and Bluetooth monitoring of current temperature and humidity; a timed stop mode ensures low-power operation of the chip.
1. Project Function Introduction
This project is based on the STM32G030K6T6 and utilizes the Sensirion SHT40 temperature and humidity sensor module to achieve temperature and humidity detection, realizing real-time temperature and humidity detection and Bluetooth monitoring. If the detector is not operated for a period of time, the chip will enter a stop mode to ensure low-power operation.
2. Hardware Design
The main control chip selected is the STM32G030K6T6.

Since all components are powered by 3.3V, and the power supply is two 3.7V 14500 batteries, the 7.4V power supply needs to be stepped down. The LM1117S is selected for step-down, and the power supply and step-down module circuit is as follows.


Considering that the chip needs to achieve low-power operation, the RTC needs to be enabled to ensure time accuracy; therefore, an external crystal oscillator is used, and its circuit is as follows

. Simultaneously, a wake-up button is needed to switch the chip from stop mode to run mode.

The SHT40 temperature and humidity sensor module circuit uses IIC communication with the MCU, where the SDA and SCL lines need to be connected to pull-up resistors.

To achieve program download, the SWD download and debugging interface circuit is as follows

. A user-defined button is provided, which I define here as page scrolling up and down, and confirm and cancel.

To store temperature and humidity data and character data, an EEPROM is required. Note that the EEPROM communicates with the MCU via IIC, therefore pull-up resistors are needed for the SDA and SCL lines.

A 1.8-inch TFT screen is used for the LCD, which communicates with the MCU via SPI. The circuit is as

follows: To allow the LCD to turn off in MCU stop mode, I added a latching switch between the power supply and the LCD's VCC pin. However, this was found to be unnecessary, as the screen can be turned on/off by changing the level of the backlight pin (BL). Therefore, the latching switch can be removed. During subsequent debugging, it was found that the LCD screen can still light up without VCC power, but the brightness is dim. Therefore, if the application scenario is at night and the screen brightness is a concern, the latching switch can be retained.

To enable communication with the mobile app, a Bluetooth module is added. The Bluetooth module used is a 6328A serial Bluetooth module, part number C20539408. Since there was no model in the EDA for this Bluetooth module, I used a 1x5pin header instead. Also, because the Bluetooth module uses a stamp-hole connection, the model in the EDA could be changed to a surface mount design, thus reducing the height of the Bluetooth module and allowing more height for the LCD screen, thereby reducing the overall thickness of the temperature and humidity sensor.


Finally, to test and monitor the MCU's operating status, an LED was added.

During the PCB design, to reduce electromagnetic interference and the impact of the manufacturing process, the copper plating at the bottom of the crystal oscillator and any sharp-shaped copper areas needed to be removed by setting forbidden areas

. The final circuit board and related components are shown in Figure

3. The software design
defines the chip pins as follows

. To ensure the RTC operates normally, the RCC needs to be configured first, and the LSE set to an external crystal oscillator

. Next, the RTC needs to be configured, including the time representation method (binary/BCD) and the initial time.

Other methods such as I2C, SPI, and USART can be implemented by referring to various tutorials.
It is particularly important to note that although the LCD screen uses SPI communication, it is actually level-controlled; therefore, the pins do not need to be defined as SPI mode.
The code writing section first needs to implement the page display, including the date, time, current temperature and humidity, Bluetooth status, and power supply voltage

. The date and time modification interface implements functions such as time modification and cursor blinking. The rules are: the last two digits of the year, month, date, hour, and minute can be changed. Pressing the UP/DOWN button without any operation will switch to page 0. The first press of the CONFIRM button locks the YEAR value; pressing the UP/DOWN button again will change the YEAR value. Pressing the CONFIRM button again will move the cursor to the next value. Press the CANCEL button to adjust the end date and time.

To further reduce MCU power consumption (the MCU current is in the mA range in sleep mode, while it is only in the uA range in stop mode), the MCU will enter stop mode after the detector has been inactive for 10 seconds. To exit stop mode, the MCU can be woken up by pressing the wake-up button. It is important to note that when the MCU enters stop mode, the chip's HSI clock will stop and switch to the LSE clock. Therefore, in addition to waking up the MCU, the RCC needs to be reconfigured to prevent timing errors in the tick timer.

Since Bluetooth is a serial Bluetooth, only the printf function needs to be redefined.

In addition, it is important to note that when using printf, please check "Use MicroLIB" in the magic wand; otherwise, printf will not work.

Bluetooth APP design uses MIT App Inventor, which is an APP design webpage with the URL http://app.gzjkw.net/.
Draw the APP interface

and write the APP backend code.

4. Physical demonstration
: Power on the temperature and humidity detector and get the following interface.

Press the left up and down keys to enter the date and time setting interface. Press the OK/Cancel key in the upper right corner and the left up and down keys to increase or decrease the time.


After setting, press the left up and down keys to switch to the temperature and humidity detection interface. You can see that the time has been successfully set.

Open the mobile Bluetooth APP

and select the Bluetooth device.

When Bluetooth is successfully connected, the Bluetooth module's connection indicator light will light up, and the data display interface will also show that Bluetooth is connected.


Click the query button to query the current temperature and humidity.

5. Attachment Descriptions
: MyProject.rar: Project source code files.
SPI LCD source code and HAL library project.rar: 1.8-inch LCD screen driver (including 51 microcontroller and STM32F1 series microcontrollers; other series can be ported using this).
base.apk: Bluetooth APP for this project.
83991-1.8-inch IPS+LCD module information.rar: 1.8-inch LCD screen driver and Chinese character encoding software.
6. Demo video:
https://www.bilibili.com/video/BV1AsezefEFf/?share_source=copy_web&vd_source=1cc6752786a7dd940c6c809a85212bba
MyProject.rar
SPI LCD source code and HAL library project.rar
base.apk
83991-1.8-inch IPS+LCD Module Datasheet.rar
PDF_#9th LCSC Electronics Design Contest# Multifunctional Environmental Detector.zip
Altium_#9th LCSC Electronics Contest# Multifunctional Environmental Detector.zip
PADS_#9th LCSC Electronics Contest# Multifunctional Environmental Detector.zip
BOM_#9th LCSC Electronics Design Contest# Multifunctional Environmental Detector.xlsx
93504
electronic