supremeOne

Weather ink screen-add clock chip

 
Overview
  1. A variety of cool cases (transparent back, frosted back, solid back, water stickers can be applied, and the battery can be hidden)
  2. Newly added functions such as countdown, B fans, random playback of pictures, etc. Click to download
  3. The clock chip is compatible with BL8025T and RX8025T. It only costs a few cents to disassemble the TB machine. It is compatible with firmware V013-12 and is backward compatible.
  4. 16MB has been successfully tested ( Bilibili News ), Anxinke’s burning tool can be burned, and the DoNotChgBin option needs to be checked.
  5. Civilian-level PCB color printing tutorial
  6. ESD needs to be replaced by SMS05C, ch340 no longer consumes power, and the sleep current is reduced to 0.02ma
  7. If the serial port is constantly disconnected, change the magnetic bead to a 0R resistor.

 
 
 
  • Compatible hardware

  •  
  • 1.This project

  • Since it is imported from KICAD, there may be omissions. If you use Lichuang EDA to export, you need to check clearly. It is best to use the pattern making file I provided to make the pattern.
  • Compatible with the front light ink screen - Dalian Jiaxian T5D, you can use an ordinary ink screen without soldering the front light drive circuit (the front light housing has been uploaded)
  • Add a transparent acrylic back cover (uploaded, including acrylic size)
  • Optimize CH340 leakage phenomenon (ESD chip problem), the whole machine sleeps as low as 0.02ma
  • Temperature and humidity chip- SHT30
  • ESD chip - SMS05C
    • SRV05-4 is bidirectional and is not suitable for this circuit, nor are other bidirectional ESD chips.
    • Because the bidirectional ESD chip will leak electricity to the switch MOS of ch340 when the USB is not plugged in, causing ch340 to waste electricity when working.
  • Better performance and smaller package LDO- ME6210A33M3G
  • MLCC capacitor array
  • Extended solder pads, reasonable spacing between objects, no more cumbersome hands
  • The battery must be inserted and the toggle switch must be turned on to perform the burning process. USB & lithium battery switching power supply is not supported.
  • When the front light brightness is adjusted to the brightest, it will slightly interfere with the screen refresh. At other times, it is normal. There is no need for front light and no welding will affect it.
  • The 3D printed shell suitable for this project - the regular version has been released
  • The 3D printed shell suitable for this project - regular version - transparent back shell has been released
  • Some hardware references include HalfSweet and DUCK, thank you!

 

  2.HalfSweet (with temperature and humidity chip)

  3.DUCK (without temperature and humidity chip )

  •  

 

introduce

 

Function introduction

  • weather patterns
    • Live weather, weather for the next 2 days
    • UV intensity, outdoor ambient humidity, wind level
    • A sentence is displayed in the middle, obtained from the network or customized
    • Battery display, voltage or percentage
    • Indoor temperature and humidity display (hardware required to support sht30 chip)
    • Custom not updating/updating at night
  • reading mode
    • Up to 2.8MB of usage space, can store up to 3 books
    • Use the index method to accurately calculate the number of pages, jump to any page, and go back infinitely
    • Memory function, automatically restores the last book and page number read
    • Power display
    • Display time (under construction)
  • clock mode
    • Super large digital display, no longer blinded
    • Custom display mode, date/concise
    • Custom calibration intervals (completed, published)
    • Customize whether to enable forced calibration (completed, released)
    • Custom offline calibration compensation
  • Distribution network mode
    • Automatic and manual selection and configuration of the network
    • Configure weather KEY and city
    • file manager
    • Rich setting items
    • Screen real-time message return prompt
    • Reserve OTA interface
  • Custom picture mode
    • To display customized bmp pictures, you need to enable it in the configuration network-file manager.
  • Countdown of days ( completed, published )
  • Station B fans display ( completed, released )

 

Button operation logic

  • The front view from left to right is button 1, button 2, button 3 (button 3-GPIO5, button 2-GPIO0)
  • Press and hold button 3, and then press the reset button (button 1) to enter the mode selection interface
  • The key operation logic of all interfaces is:
    • Short press alone to switch options
    • The combination of buttons is to confirm the operation or call up the menu: first press button 3 and then press button 2 briefly. At this time, button 3 must be released to take effect.
    • The new version has changed the long press button 3 to confirm the operation
  • Button 2 cannot be pressed too fast or while the screen is refreshing, otherwise the screen will freeze. The reason is that button 2 and screen refresh share the same IO port.

 

Note, please read it patiently

  • To obtain the weather, you need to know the weather private key (20 times/minute). You need to apply for it yourself and then enter it on the network configuration interface.
  • The original U8g2_for_Adafruit_GFX library cannot use the large font library, so I made modifications to the library and download it from the code cloud or group.
  • Other libraries can be downloaded from the library manager.
  • If you are unable to connect to wifi, it may be blocked by the router or the network is poor. There needs to be clear space near the antenna without flying wires. The battery may also block the antenna.
  • Unable to obtain weather information, please check whether the city name is correct. Free users can only view prefecture-level cities.
  • If you mistakenly enter low-voltage hibernation, please check whether the battery measurement circuit is normal and whether the battery voltage is greater than 3.2V (the player who built the board added a voltage dividing circuit to A0 and connected it to 5V. The divided voltage cannot exceed 1V, otherwise the ADC will be burned)
  • MOS tubes (near the wiring) that are not part of this project can be replaced by cj3400 if they become too hot during use. ME6210A33PG or ME6209A33PG can be used for LDO (the lower the pressure drop, the better).
  • If you cannot connect to 8266's hotspot or cannot open the configuration webpage, please check whether the smart network selection mode is turned on on your phone.
  • When the voltage is lower than 3.45V, uploading files and needing to scan surrounding network modes may get stuck (my hardware voltage can still perform network operations as low as 3.3V)
  • Batteries can be used: 303450-500mah (adapted to the back-transparent casing that hides the battery in this project), 602650-650mah (adapted to the casing of this project), 601550-450mah (adapted to the back-transparent casing of this project), 902030-500mah (DUCK& half sugar crust)

 

Libraries used

 

Currently known bugs
  • When the battery is low, there is a chance of restarting after entering the network distribution mode. Just try a few times.
  • When the battery is low, it may freeze when uploading files or scanning surrounding networks.    (My hardware voltage is as low as 3.3V and can still operate the network)
  • There is a very small chance that the system will be restarted when loading data in weather mode. EXCCAUSE Code(3). Is there an internal physical address or data error in the processor during loading or storage?
  • If the WIFI connection is invalid on the network configuration page, it will be stuck for a period of time and there will be a corresponding prompt. It may be a hardware problem and the STA and AP cannot transmit and receive at the same time? Wait for the prompt that the connection failed and then proceed with other operations.
  • After changing the city on the distribution network interface, the weather data cannot be refreshed immediately, which does not affect the normal use of the weather mode. https get data fails, and we are currently unable to solve it. (solved)


 
 

Some data sources noted

1. According to Article 25 of the Meteorological Law of the People's Republic of China, when you use Xinzhiwei's data services or products, you must indicate the source of the data service.
2. Yiyan service  is provided by hitokoto.cn

Please do not use it for large-scale commercial purposes

 

~~~~~~~~~~~~~~~~~~~~~~~~~~ Split, you don’t need to look at it~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

8266How to read TXT files

Many people ask me how I can read novels on the ink screen.

Here I will only briefly talk about how to use 8266 to read TXT files in FLASH (UTF-8 only), without doing the ink screen test.

 

Required pre-knowledge

ASCIII encoding, UTF-8 encoding, Arduino 8266 development basics, file system basics

 

Required hardware

8266 module with serial port and FLASH, unlimited capacity.

 

principle

First we need to understand the encoding knowledge and the encoding type used by the file. Only by knowing these can we process the file accordingly. Here we take UTF-8 (3 bytes) TXT text as an example.

A byte consists of 8 binary bits

ASCIII, range 0-127, that is, 00000000 to 01111111

ASCIII extension, range 128-255, that is, 1000000 to 11111111

 

UTF-8 encoding rules:

If it is a byte, then the first bit of this 8-bit byte is 0, which is all ASCIII, 0000 0000 to 0111 1111 (0-127)

If it is two bytes, then the first 4 bits of the first byte are 1100

If it is three bytes, then the first 4 bits of the first byte are 1110

 

From the Unicode character set, 0x4E00 represents the Chinese character one . The decimal value of 4E00 is 19968 and the binary value is 100 1110 0000 0000. According to the encoding rules of UTF-8, Chinese requires three bytes to be stored. The conversion result is 11100100 10111000 10000000.

 

Chinese is three bytes 1110XXXX XXXXXXXX XXXXXXXX, which starts with 1110 XXXX

ASCIII extension and other two bytes are 1100XXXX XXXXXXXX, which starts with 1100 XXXX

ASCIII is 0-127, >=0&&<=127just judge it directly

So as long as you determine what the first byte read is, you can know whether it is Chinese or ASCIII.

So we use the file system to read the first byte of each character in the file, and then determine what type the byte is, Chinese? ASCIII extension or other two bytes? ASCIII?

 

The core code is as follows, and the complete sample code is attached at the end.

  Serial.println("************ Single character output********* ");
  String zf = ""; //Single character output
  uint16_t zf_count = 0; //Statistical characters Number
  txtFile = LittleFS.open("txt_test.txt", "r"); //Open txt file
  if (txtFile != 1) Serial.println("txt_test.txt file does not exist");
  while (txtFile.available ())//Start reading
  {
    zf_count++;
    char c = txtFile.read();//Read a byte
    byte a = B11100000;
    byte b = c & a;
   if (b == B11100000)//Chinese, etc. 3 byte characters
    {
      zf += c; //The first byte
      zf += txtFile.read(); //The second byte
      zf += txtFile.read(); //The third byte
    }
    else if (b == B11000000) //ascii extension or other 2-byte characters
    {
      zf += c; // first byte
      zf += txtFile.read(); // second byte
    }
    else if (c >= 0 && c <= 127) //ascii characters
    {
      zf += c; //first byte
    }
    Serial.print("th" + String(zf_count) + "characters: ") ;
    Serial.println(zf);
    zf = "";
  }
  txtFile.close(); //Close the file

 

 

Expand

Let’s talk about the principle of displaying to the ink screen. Since the operation methods of each library are different, here we take the GXEPD2 library and U8g2_for_Adafruit_GFX as examples.

From the above code, we know how to deal with UTF-8 characters. We only need to add up each character, and then break the line after adding one line.

The specific number of lines that can be divided is determined by the width of the screen.

The number of words displayed in one line is determined by the length of the screen

For example, in 2.9-inch landscape mode, the length is 296 and the width is 128

If you use a 14*14 font, you can divide it into 128/14. Rounding is 9 lines, and each line is 296/14. Rounding is 21 Chinese characters.

 

If they are all in Chinese, you can change the line every 21 characters. Just use String[] to save it. When 9 lines are saved, it will start displaying.

 

If there are numbers, English, symbols and other characters other than 14 pixels, you have to make another judgment.

The specific operation method is to calculate the length of each character obtained and accumulate the length. If the upcoming character exceeds 296 after the accumulated length is added, then the line can be changed and the character will be placed on the next line.

~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-02 15:28:09

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号