Multifunctional life assistant system based on ESP32
By designing a multi-functional life assistant system based on ESP32, using a low-power ink screen and touch screen to interact, the existing system's shortcomings in operation convenience, maintenance convenience and practicality are solved, and the system's low cost, low power consumption and portability are achieved.
Patent Information
- Application Number
- CN202510171204.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing life assistant system has shortcomings in terms of operation convenience, maintenance convenience, practicality, cost, power consumption and volume, and it is difficult to meet the long-term use needs of users.
A multi-functional life assistant system based on ESP32 is designed, using a low-power ink screen and a touch screen for human-computer interaction, integrating components such as temperature and humidity digital sensors, buzzer circuits, etc., and driving the touch screen and ink screen through I2C and SPI protocols, realizing the system's low cost, low power consumption, portability and flexibility.
It realizes the long-term stable operation of the system, extends the battery life of the device, provides a clear and intuitive interface and convenient interactive experience, meets the multifunctional needs of users, and reduces the power consumption and cost of the system.
Smart Images

Figure CN120066162A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent electronic devices, and more specifically, to a multi-functional life assistant system based on ESP32. Background Art
[0002] At present, most domestic life assistant systems are presented to users in the form of software APPs. The life assistant products that combine software and hardware mainly use STM32 single-chip microcomputers as the main control modules, and they have many external modules, which are not conducive to integration into small circuit boards.
[0003] In addition, the interface display of the existing life assistant systems is not clear enough and not intuitive enough, and the interaction experience is not convenient enough; some life assistant systems have high power consumption, the system cannot run stably for a long time, the battery life of the device is insufficient, and it cannot meet the needs of users for long-term use.
[0004] Therefore, how to provide a multi-functional life assistant system with convenient operation, easy maintenance, high practicability, low cost, low power consumption, small size, portable and flexible, is an urgent problem to be solved at present. Summary of the Invention
[0005] The purpose of the present invention is to provide a multi-functional life assistant system based on ESP32, which can reduce the power consumption, volume and cost of the multi-functional life assistant system, and improve its battery life, portability, economy, operation convenience, maintenance convenience and practicability.
[0006] The present invention provides a multi-functional life assistant system based on ESP32, including a minimum system module, a power supply module, a temperature and humidity digital sensor module, an e-ink screen, a touch screen, and a buzzer circuit; the minimum system circuit includes a processor, a memory and a peripheral interface; the temperature and humidity digital sensor module, the e-ink screen, the touch screen and the buzzer circuit are respectively electrically connected to the minimum system circuit, and the minimum system module is an ESP32 minimum system circuit.
[0007] Further, the above-mentioned minimum system module is configured to: initialize peripherals, run UI tasks, run parameter setting tasks, network status tasks and time management tasks.
[0008] Further, the initialization of the above-mentioned peripherals includes: initializing the interfaces of the e-ink screen and the touch screen, and initializing the temperature and humidity digital sensor module.
[0009] Further, the above-mentioned running UI tasks include: managing and updating the user interface of the device to ensure that users can intuitively view information and perform operations; confirming the touch press trigger, confirming that the current page is the weather page, and obtaining weather information; confirming that the current page is the clock page, and obtaining clock information and temperature and humidity data; confirming that the current page is the word page, and obtaining word information; confirming that the current page is the Pomodoro page, and displaying timing information; confirming that the current page is the prompt setting logo page, displaying the page, turning off the STA mode, and turning on the AP mode; confirming that the current page is not the home page and a side swipe is detected, and returning to the home page; confirming that the current page is the word page and a side swipe is detected, and performing word switching.
[0010] Further, the above-mentioned running parameter setting task, network status task, and time management task include: confirming that the touch is not triggered, confirming to return the AP connection setting parameters, confirming to enter the network parameters, exiting the AP mode, and entering the STA mode; confirming to enter the Pomodoro clock parameters and setting Pomodoro clock data; confirming the network status callback, updating the status when the network connection is successful, and reconnecting when the network connection is unsuccessful; confirming the timer callback, confirming the minute callback, and updating the clock; confirming the second callback, and updating the Pomodoro clock.
[0011] Further, the above-mentioned minimum system module is further configured to: determine the touch action through the interruption duration, and the touch action includes single click, long press, left swipe, and right swipe; initialize the GPIO pins of the touch screen; enable the touch interruption function; in response to the touch action, generate an interruption signal, call the interruption handler, and the interruption handler measures the interruption duration of the touch action by using a timer; obtain the touch action coordinates, and the touch action coordinates include the starting coordinate and the ending coordinate, confirm that the difference between the starting coordinate and the ending coordinate is greater than the preset coordinate difference, and generate a swipe action; confirm that the difference between the starting coordinate and the ending coordinate is not greater than the preset coordinate difference, confirm that the interruption duration is less than the first interruption duration, and generate a short press action; confirm that the interruption duration is not less than the first interruption duration, confirm that the interruption duration is greater than the second interruption duration, and generate a long press action.
[0012] Further, the above-mentioned first interruption duration is 1.5 seconds, the second interruption duration is 2 seconds, and the preset coordinate difference is 10.
[0013] Further, the above-mentioned minimum system module is electrically connected to the touch screen through the I2C bus; the minimum system module is further configured to: scan the status of the touch points of the touch screen by using the I2C bus, confirm that a touch point is pressed, read the coordinate data of the pressed touch point, enter the touch interruption function, and convert the touch point coordinate value into the actual position.
[0014] Further, the above-mentioned minimum system module is further configured to: initialize the IO ports of the SPI and the e-ink screen, pull down and then pull up the reset of the e-ink screen, set the starting coordinates X and Y of the display area of the e-ink screen, set the width and length of the display area of the e-ink screen, set the display content, update the e-ink screen display, and when not in use, set the e-ink screen to enter deep sleep.
[0015] The present invention also provides a method for reminding a life assistant, which is applied to the above-mentioned ESP32-based multi-functional life assistant system. The method includes: powering on the ESP32-based multi-functional life assistant system for the first time, swiping the touch screen to the right, connecting to an intelligent terminal using the AP mode of the ESP32-based multi-functional life assistant system, and using the intelligent terminal to select a city, set a tomato clock, and configure the network; returning to the main interface, and updating the network time and weather configuration information using the STA mode of the ESP32-based multi-functional life assistant system.
[0016] Implementing the ESP32-based multi-functional life assistant system provided by the present invention has the following beneficial effects: With the low-power consumption feature of the e-ink screen, the system can effectively extend the battery life of the device while ensuring long-term stable operation, meeting the needs of users for long-term use. This invention uses an e-ink screen for display, and a touch screen and buzzer as the means of human-computer interaction. It collects data through an SHT40 temperature and humidity sensor, can display time, weather, temperature and humidity information, has the functions of a word book and a tomato clock, and also supports Wi-Fi connection to achieve real-time synchronization of time and urban weather. Its software design is programmed through VSCode, and development tools such as git are built to meet the requirements in multiple aspects such as system interface design, data management, and communication protocols. The experimental results show that the multifunctional life assistant system designed in this paper can meet the basic functions and has the characteristics of low cost, low power consumption, portability and flexibility. The main program flow design involves multiple key tasks, including the initialization of peripherals, the design of different UI pages and the writing of programs for corresponding pages, parameter setting tasks, network status tasks, and time management tasks. In this invention, in the desktop small screen, the touch actions including single click, long press, left swipe, and right swipe are determined by the interruption duration. This invention uses the I2C half-duplex protocol to drive the touch screen. First, I2C is used to scan the status of the touch points on the touch screen to determine whether there is a touch point pressed. At the same time, the number of points is converted into a valid flag for the touch point pressed. If pressed, I2C continues to read the coordinate data of the corresponding touch point, that is, read the xy coordinate values. Otherwise, the flag bit is cleared first and then the loop is returned to read again. Finally, enter the touch interrupt function to convert the touch point coordinate values into the actual position. This invention selects an e-ink screen with 152*152 pixel points and uses the SPI protocol to drive the e-ink screen. Initialize the SPI and the IO ports of the e-ink screen, then pull down and then pull up the RES of the e-ink screen. And if the BUSY signal line is pulled high during the refresh, the MCU cannot perform read and write operations. When the idle signal is pulled low, read and write signals can be performed. Then set the starting coordinates X and Y of the entire display area of the e-ink screen to obtain the width and length of the screen, and display the screen content through the obtained arrays of pictures and texts. At this time, the e-ink screen updates the display. When not in use, the e-ink screen will enter deep sleep to reduce power consumption. This invention is a multifunctional life assistant system based on the ESP32 microcontroller with a desktop small screen as the carrier, and is designed in the form of a desktop small screen, providing users with a clear and intuitive interface display and a convenient interaction experience. The system is easy to operate, easy to maintain, small in size, and highly practical. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention will be further described below in conjunction with the drawings and embodiments. In the drawings: Figure 1 is the block diagram of the multifunctional life assistant system based on ESP32 provided by the present invention; Figure 2It is the initial setup flowchart provided by the present invention; Figure 3 It is the UI task flowchart provided by the present invention; Figure 4 It is the other task flowchart provided by the present invention; Figure 5 It is the touch action judgment flowchart provided by the present invention; Figure 6 It is the I2C bus physical topology diagram provided by the present invention; Figure 7 It is the I2C timing diagram provided by the present invention; Figure 8 It is the I2C-driven touch screen software flowchart provided by the present invention; Figure 9 It is the SPI bus physical topology diagram provided by the present invention; Figure 10 It is the timing diagram in SPI mode 0 provided by the present invention; Figure 11 It is the SPI-driven e-ink screen software flowchart provided by the present invention; Figure 12 It is the physical diagram of the main interface provided by the present invention; Figure 13 It is the physical diagram of the clock interface provided by the present invention, where Figure 13 the left figure in the middle is the physical diagram of the clock interface before networking, Figure 13 the left figure in the middle is the physical diagram of the clock interface after networking; Figure 14 It is the physical diagram of the weather interface provided by the present invention; Figure 15 It is the physical diagram of the word interface provided by the present invention; Figure 16 It is the physical diagram of the tomato clock interface provided by the present invention; Figure 17 It is the WIFI AP mode test diagram provided by the present invention; Figure 18 It is the WIFI STA mode test diagram provided by the present invention; Figure 19 It is the user parameter setting interface diagram provided by the present invention; Figure 20 It is the tomato clock setting test diagram provided by the present invention; Figure 21 It is the city setting test diagram provided by the present invention. Detailed implementation manners
[0018] For a clearer understanding of the technical features, objectives, and effects of the present invention, the detailed implementation manners of the present invention will now be described in detail with reference to the accompanying drawings.
[0019] Figure 1 Shows a schematic diagram of the multi-functional life assistant system based on ESP32 in this embodiment. In this embodiment, the multi-functional life assistant system includes a minimum system module, a power supply module, a temperature and humidity digital sensor module, an e-ink screen, a touch screen, and a buzzer circuit; the minimum system circuit includes a processor, a memory, and a peripheral interface; the temperature and humidity digital sensor module, the e-ink screen, the touch screen, and the buzzer circuit are respectively electrically connected to the minimum system circuit, and the minimum system module is an ESP32 minimum system circuit.
[0020] In an exemplary embodiment, the minimum system module is configured to: initialize peripherals, run UI tasks, run parameter setting tasks, network status tasks, and time management tasks; In an exemplary embodiment, the initialization of the peripherals includes: initializing the interfaces of the e-ink screen and the touch screen, and initializing the temperature and humidity digital sensor module; As an exemplary embodiment, the minimum system module is also used to configure GPIO pins to connect and control other hardware components; In an exemplary embodiment, the running of the UI tasks includes: managing and updating the user interface of the device to ensure that users can intuitively view information and perform operations; confirming the touch press trigger, confirming that the current page is the weather page, and obtaining weather information; confirming that the current page is the clock page, and obtaining clock information and temperature and humidity data; confirming that the current page is the word page, and obtaining word information; confirming that the current page is the pomodoro page, and displaying the timing information; confirming that the current page is the prompt setting logo page, displaying the page, turning off the STA mode, and turning on the AP mode; confirming that the current page is not the home page and detecting a side swipe, returning to the home page; confirming that the current page is the word page and detecting a side swipe, and performing word switching; As an exemplary embodiment, when running the UI tasks, the UI interface is dynamically updated according to the user's selection or the device's status, such as displaying the current time, weather information, etc.; processing the user's input and interaction, such as clicking a button, swiping the screen, etc., and responding to the corresponding operations; It should be noted that the AP mode and the STA mode are two common working modes of the WiFi module. They play different roles in the wireless network, with their respective functions and application scenarios. The AP mode (Access Point mode) is when the WiFi module works as an independent wireless access point. In this mode, the WiFi module can create its own wireless network, and other devices can connect to this network and communicate through the WiFi module. The AP mode is often used to create a wireless network in a local area network and provide wireless access services. The WiFi router at home is a typical example of the AP mode. It acts as a wireless hotspot, allowing other devices (such as mobile phones, computers, smart home devices, etc.) to connect to this network and access the Internet or other resources within the local area network through the router. In addition, some devices with WiFi functions (such as smartphones, tablets, etc.) are also working in the AP mode when the hotspot function is turned on. The STA mode (Station mode) is when the WiFi module connects to an existing wireless network as a client. In this mode, the WiFi module receives wireless signals from other devices or routers and accesses the Internet or other network resources through this wireless network. Devices such as computers, mobile phones, and smart home devices usually work in the STA mode when connecting to a WiFi router. These devices, as clients, access the Internet or other resources within the local area network by connecting to the wireless network of the router. In the STA mode, the WiFi module is a client connecting to other wireless networks, while in the AP mode, the WiFi module is a server providing wireless network access services. The STA mode is mainly used to access network resources, while the AP mode is used to create and provide wireless network access services. In an exemplary embodiment, the running parameter setting task, the network status task, and the time management task include: confirming that the touch is not triggered, confirming the return of the AP connection setting parameters, confirming the entry into the network parameters, exiting the AP mode, and entering the STA mode; confirming the entry into the Pomodoro clock parameters and setting the Pomodoro clock data; confirming the network status callback, updating the status when the network connection is successful, and reconnecting when the network connection is unsuccessful; confirming the timer callback, confirming the minute callback, and updating the clock; confirming the second callback and updating the Pomodoro clock. As an exemplary embodiment, when running parameter setting tasks, network status tasks, and time management tasks, the parameter setting task allows users to customize relevant parameters of the device, such as storing mobile hotspot information, changing cities, adjusting the tomato clock mode, etc.; users can modify different parameters and save the parameters set by the users to the storage space of the device so that the previous settings can be restored after restart; the network status task is responsible for monitoring the network connection status of the device and performing corresponding operations as needed; regularly check the network connection status of the device, and when the network connection changes, update the network status indicator on the UI interface; if online update or data synchronization is required, ensure that the relevant operations are performed when the network connection is normal; the time management task is mainly responsible for maintaining the global time variables of the system, such as year, month, day, hour, minute, and second; these variables are not only used to display the current time but may also be used to trigger time-related tomato clock functions and touch action determination functions; the timer callback is an important part of the time management task; when the timer reaches the specified time interval, a pre-defined callback function will be automatically called, and this callback function can perform any required operations; to maintain the accuracy of time, the system can also synchronize with the network time server, which can be achieved by connecting to the external network through the Wi-Fi of ESP32 to obtain accurate time information; the initial settings of the main program are as Figure 2 shown, and the UI task and other task flowcharts are as Figure 3 , Figure 4 shown; In an exemplary embodiment, the minimum system module is further configured to: determine touch actions by interrupt duration, where the touch actions include single click, long press, left swipe, and right swipe; initialize the GPIO pins of the touch screen; enable the touch interrupt function; in response to a touch action, generate an interrupt signal and call an interrupt handler, and the interrupt handler measures the interrupt duration of the touch action using a timer; obtain the touch action coordinates, where the touch action coordinates include the starting coordinate and the ending coordinate, confirm that the difference between the starting coordinate and the ending coordinate is greater than a preset coordinate difference, and generate a swipe action; confirm that the difference between the starting coordinate and the ending coordinate is not greater than the preset coordinate difference, confirm that the interrupt duration is less than the first interrupt duration, and generate a short press action; confirm that the interrupt duration is not less than the first interrupt duration and is greater than the second interrupt duration, and generate a long press action; In an exemplary embodiment, the first interrupt duration is 1.5 seconds, the second interrupt duration is 2 seconds, and the preset coordinate difference is 10; The touch action judgment is as Figure 5 shown; In an exemplary embodiment, the minimum system module is electrically connected to the touch screen via the I2C bus; the minimum system module is further configured to: scan the status of the touch points of the touch screen using the I2C bus, confirm that a touch point is pressed, read the coordinate data of the pressed touch point, enter the touch interrupt function, and convert the touch point coordinate value into an actual position; In an exemplary embodiment, the minimum system module is further configured to: initialize the SPI and the IO ports of the e-ink screen, pull down and then pull up the reset of the e-ink screen, set the starting coordinates X and Y of the display area of the e-ink screen, set the width and length of the display area of the e-ink screen, set the display content, update the e-ink screen display, and when not in use, set the e-ink screen to enter deep sleep.
[0021] This embodiment provides a method for reminding by a life assistant, which is applied to the above-mentioned multi-functional life assistant system based on ESP32. The method includes: powering on the multi-functional life assistant system based on ESP32 for the first time, swiping the touch screen to the right, connecting to the smart terminal using the AP mode of the multi-functional life assistant system based on ESP32, and using the smart terminal to select a city, set a tomato clock, and configure the network; returning to the main interface, and updating the network time and weather configuration information using the STA mode of the multi-functional life assistant system based on ESP32.
[0022] As an exemplary embodiment, the above-mentioned multi-functional life assistant system based on ESP32 can also be implemented in the following manner.
[0023] In this embodiment, the above-mentioned multi-functional life assistant system based on ESP32 includes system hardware and system software; Among them, the system hardware is designed as follows: The hardware part of this system uses a minimum system circuit with an ESP32 integrated with 2.4GHz Wi-Fi as the main control chip, that is, a minimum system module, which controls an external power supply module, a temperature and humidity digital sensor module, an e-ink screen, a TP touch screen, and a buzzer circuit to implement the system function design. As Figure 1The following is a block diagram of the system composition; when the system is powered on, the ESP32 first performs a power-on self-check and initialization. During this process, the ESP32 checks its internal hardware resources, including whether the dual-core processor, memory, peripheral interfaces, etc. are working properly; at the same time, it also initializes the system clock, configures the interrupt vector table, etc. to prepare for subsequent work; subsequently, the ESP32 initializes the e-ink screen and touch screen, including configuring parameters such as the resolution, color depth, and refresh rate of the display screen, as well as establishing a communication connection with the display screen; once the initialization is completed, the relevant content of the e-ink screen can be normally displayed; the main interface is displayed on the screen. At this time, the desktop small screen will be in AP mode and act as a router. Then open the mobile phone WIFI page, connect to the "desktop screen" hotspot. After the connection is successful, open the mobile phone browser and enter the URL 192.168.4.1 to enter the pre-designed page and configure information such as the city, tomato clock, network, etc.; the ESP32 will detect the user's operations in real time and perform corresponding processing according to preset rules; for example, the user can switch the display content, adjust the display brightness or perform other operations by touching the screen; the ESP32 will receive these operation signals and make corresponding responses; after all configurations are completed, swipe the screen to the right and at the same time accompanied by the sound of the buzzer, you can enter the main menu interface again. By clicking on the corresponding screen position, you can interact and enter different function pages: clock page, weather page, word page, tomato clock page; when the ESP32 is in STA mode, it can quickly connect to the mobile phone hotspot through the stored hotspot information. If a WIFI logo appears in the upper right corner of the main menu page, it means that the network connection is successful; at this time, the clock page can display the real-time time, indoor temperature and humidity; the weather page displays the weather of the city on the same day; the word page displays CET-4 / 6, TOEFL, IELTS or custom words or custom memos; click on the screen of the tomato clock page to start a countdown for the preset time; in order to maintain the stability and security of the system, a regular system maintenance and update mechanism is implemented accordingly; this includes checking the hardware status of the system, updating drivers or firmware, cleaning up memory, etc.; at the same time, a remote configuration function is provided to enable users to conveniently update the relevant content of their multifunctional life assistant system; The system software design is as follows: The main program flow design includes the initialization of peripherals, designing different UI pages and writing programs for corresponding pages, parameter setting tasks, network status tasks, and time management tasks; the initialization of peripherals is the primary task after the main program starts, which involves configuring and starting all peripherals connected to the ESP32, including initializing the e-ink screen and touch screen interfaces, temperature and humidity sensors, etc. Configure GPIO pins for connecting and controlling other hardware components; the UI task is responsible for managing and updating the user interface of the device to ensure that users can intuitively view information and perform operations; design and implement different UI interfaces; dynamically update the UI interface according to user selection or device status, such as displaying the current time, weather information, etc.; process user input and interactions, such as clicking buttons, swiping the screen, etc., and respond to corresponding operations; the parameter setting task allows users to customize relevant parameters of the device, such as storing mobile hotspot information, changing cities, adjusting the Pomodoro mode, etc.; users can modify different parameters and save the parameters set by users to the storage space of the device so that the previous settings can be restored after restart; the network status task is responsible for monitoring the network connection status of the device and performing corresponding operations as needed; regularly check the network connection status of the device, and update the network status indicator on the UI interface when the network connection changes; if online update or data synchronization is required, ensure that relevant operations are performed when the network connection is normal; the time management task is mainly responsible for maintaining the global time variables of the system, such as year, month, day, hour, minute, and second; these variables are not only used to display the current time but may also be used to trigger time-related Pomodoro clock functions and touch action determination functions; the timer callback is an important part of the time management task; when the timer reaches the specified time interval, a pre-defined callback function will be automatically called, and this callback function can perform any required operations; to maintain the accuracy of time, the system may need to synchronize with a network time server, which can be achieved by connecting to the external network through the Wi-Fi of the ESP32 to obtain accurate time information; the initial settings of the main program are as Figure 2 shown, and the flowcharts of the UI task and other tasks are as Figure 3 , Figure 4 shown; Among them, the touch action judgment is designed as follows: in the small desktop screen, the touch actions including single click, long press, left swipe, and right swipe are judged by the interruption duration; first, initialize the GPIO pins of the TP; next, enable the touch interruption function of the ESP32; when a touch event occurs, the ESP32 will generate an interruption signal, thereby calling the already written interruption handling program; in the interruption handling program, a timer is used to measure the interruption duration of the touch event. If it is less than 1.5s, it is judged as a short press action, and if it is greater than 2s, it is judged as a long press action; at the same time, obtain the coordinates. If the difference between the starting coordinate and the ending coordinate is greater than 10, it is judged as a swipe action; the touch action judgment is asFigure 5 as shown Among them, the software design of the I2C-driven touch screen is as follows: In the desktop small screen, the I2C protocol is used to drive the touch screen; the I2C protocol belongs to a half-duplex protocol, that is, either send data or read data at the same time, and only one-way communication can be carried out; I2C is a simple two-way two-wire synchronous serial bus, one is the serial data line SDA, and the other is the serial clock line SCL. Taking the sending of data as an example, its working principle is as follows: When idle, SDA and SCL are both default high levels. When SCL is at a high level, the master device controls SDA from 1 to 0, which is the start bit, and the slave device receives the start bit information; the master device sends the address bits in order from high to low, and the slave device receives them, so as to determine which specific slave device the master device communicates with; at this time, the SDA bit of the host remains at a high level. If the slave device correctly receives the data, it will pull down SDA, otherwise it will be at a high level; then the master device officially transmits the data bits. Finally, when SCL is at a high level, SDA goes from low to high, which is the stop bit. At this time, the data sending is completed, and the I2C protocol re-enters the idle state; its I2C bus physical topology diagram is as Figure 6 shown, and the timing diagram is as Figure 7 shown Regarding driving the touch screen, its software design idea is as follows: First, use I2C to scan the status of the touch points on the touch screen to determine whether there is a touch point pressed. At the same time, convert the number of points into a valid touch point press flag. If pressed, I2C continues to read the coordinate data of the corresponding touch point, that is, read the xy coordinate values. Otherwise, first clear the flag bit and then return to the loop to read again. Finally, enter the touch interrupt function to realize the conversion of the touch point coordinate values into the actual position; the software flow chart of the I2C-driven touch screen is as Figure 8 shown Among them, the software design for driving the e-ink screen with SPI is as follows: In the desktop small screen, the SPI protocol is used to drive the e-ink screen; SPI is a full-duplex, high-speed, and synchronous communication bus technology that has the ability to send and receive data at the same time, achieving efficient two-way communication; SPI has two modes, master and slave, usually consisting of a master module and one or more slave modules; When SPI communicates, generally 4 wires are required, including the chip select signal line CS / SS, the clock line SCK, the transmit signal line MOSI, and the receive signal line MISO; Due to different clock polarities in the idle state and different clock phases for sampling, there are four modes of SPI in total. In this embodiment, mode 0 is adopted, that is, the idle state is low level and the data is sampled at the rising edge; The SPI data communication can be divided into the following steps: First, the ESP32 initiates a signal, pulls down the CS connected to the e-ink screen to start the communication, and then the ESP32 sends a clock signal. After being triggered by the rising edge, the host sends data bit by bit on the MOSI line and receives data bit by bit on the MISO line, thus realizing the communication; Its SPI bus physical topology diagram is as Figure 9 shown, and the timing diagram is as Figure 10 shown; Regarding driving the e-ink screen, the e-ink screen selected in this embodiment has 152×152 pixel points; Since 1BYTE = 8BIT, in the software code, a two-dimensional array of 152×19 is constructed to store the position of each pixel point, and the corresponding array of pictures and texts can be obtained through the font extraction software; The software design idea is: Initialize the IO ports of SPI and the e-ink screen, then pull down and then pull up the RES of the e-ink screen. And if the BUSY signal line is pulled high during the refresh, the MCU cannot perform read and write operations. When the idle signal is pulled low, read and write signals can be performed; Then set the starting coordinates X and Y of the entire display area of the e-ink screen to obtain the width and length of the screen; Display the screen content through the obtained arrays of pictures and texts, etc. At this time, the e-ink screen updates the display. When not in use, the e-ink screen will enter deep sleep to reduce power consumption; The software flow chart for driving the e-ink screen with SPI is as Figure 11 shown.
[0024] In this embodiment, the effects after the implementation of the multi-functional life assistant system based on ESP32 are as follows: After the first power-on, the device will guide the user into the configuration interface. By swiping the screen to the right, the user can enter the main menu interface, and at this time, the ESP32 is in AP mode. Next, open the WIFI settings on the mobile phone and connect to the hotspot named "Desktop Screen". Once the connection is successful, start the browser on the mobile phone and enter 192.168.4.1 in the address bar. In this way, operations such as city selection, tomato clock setting, and network configuration can be carried out. After the configuration is completed and the user returns to the main interface, the ESP32 will enter STA mode. At this time, the multi-functional life assistant system can connect to the mobile phone hotspot, and the screen will display a connection success sign. Various control operations can be executed by swiping right, left, or clicking. It should be noted that the screen will enter the sleep mode within 6 minutes after power-on, but it can be awakened by simply clicking on the screen and will remain active for 1 minute. If you need to update the network time, just swipe down on the main interface after waking up, and the system will automatically update the network time, weather, and other configuration information in about 10 seconds. (1)Main interface display: The e-ink screen of the desktop small screen presents the main interface. It can be observed that the icon text is complete, clear, and there is no misalignment or blurring. Perform touch operations such as clicking, swiping, and long-pressing on the main interface to check for no false touch or delay. The physical diagram of the main interface is as Figure 12 shown; (2)Clock interface test: The clock interface correctly displays the hours and minutes, providing users with an accurate time reference. In addition to time display, the clock interface also integrates the function of displaying temperature and humidity, and the time and temperature / humidity data are updated in real time after connecting to the network. The physical diagram of the clock interface is as Figure 13 shown; (3)Weather interface test: The weather interface is designed to be intuitive and practical, and can display the current weather conditions of the city set by the user in real time. On the interface, key information such as temperature is clearly marked, and at the same time, vivid weather icons are provided, making it clear at a glance for users. When the device is connected to the network, users can easily modify the set city and obtain the local real-time weather information. The physical diagram of the weather interface is as Figure 14 shown; (4)Word interface test: The word interface can normally display words and their definitions, providing users with a convenient learning experience. Users can easily switch to the next word by swiping left, and after testing, there are no phenomena such as freezing, blurring, or delay. This design not only improves the interactivity of the interface but also allows users to browse and memorize words more smoothly during the learning process. The physical diagram of the word interface is as Figure 15 shown; (5)Tomato clock interface test: During the test, first pay attention to the overall layout and design of the interface to ensure that it is simple, clear, and easy to operate. At the same time, test the timing function of the clock by clicking on the screen, including whether operations such as start, pause, and reset respond quickly and accurately. The physical diagram of the tomato clock interface is as Figure 16 shown; (6)WIFI Test: During the test, the AP mode and STA mode of WIFI were examined. In the AP mode, by testing the connection of wireless devices at different distances and angles, it can be seen that the signal coverage and stability meet the expectations. At the same time, the stability of the AP mode when connecting multiple devices was tested. When attempting to connect multiple devices simultaneously, the network connection was disconnected a few times. In the STA mode, a mobility test was carried out. It was observed that during the movement at different locations, the STA mode remained relatively stable, and at the same time, the speed of connecting to other network devices in the STA mode was very fast. The test diagram of the WIFI module in the AP mode is as Figure 5 、 Figure 6 shown, and the test diagram of the WIFI module in the STA mode is as Figure 17 shown; Figure 18 is the test diagram of the WIFI STA mode provided by the present invention; (7)User Parameter Setting Test: When conducting the user parameter setting test, first, the ESP enters the AP mode to act as a router. Open the mobile browser and enter 192.168.4.1 to enter the setting page, which includes WIFI password setting, tomato clock setting, and weather city setting. After testing, the functions of switching the duration of the tomato clock and the rest duration, and switching cities to obtain the weather of different cities can be realized. The user parameter setting test is as Figure 19 、 Figure 20 、 Figure 21 shown.
[0025] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the purpose of the present invention and the scope protected by the claims. All of these fall within the protection scope of the present invention.
Claims
1. A multifunctional life assistant system based on ESP32, characterized in that: It includes a minimum system module, a power module, a temperature and humidity digital sensor module, an ink screen, a touch screen, and a buzzer circuit; the minimum system circuit includes a processor, a memory, and a peripheral interface; the temperature and humidity digital sensor module, the ink screen, the touch screen, and the buzzer circuit are electrically connected to the minimum system circuit respectively, and the minimum system module is an ESP32 minimum system circuit.
2. The multifunctional life assistant system based on ESP32 according to claim 1, characterized in that: The minimum system module is configured to initialize peripherals, run UI tasks, run parameter setting tasks, network status tasks and time management tasks.
3. The multifunctional life assistant system based on ESP32 according to claim 2, characterized in that: The initialization of the peripherals includes: initializing the interface of the ink screen and the touch screen, and initializing the temperature and humidity digital sensor module.
4. The multifunctional life assistant system based on ESP32 according to claim 2, characterized in that: The running UI task includes: managing and updating the user interface of the device to ensure that the user can view information and perform operations intuitively; confirming that the touch is pressed to start, confirming that the current page is a weather page, and obtaining weather information; confirming that the current page is a clock page, obtaining clock information and temperature and humidity data; confirming that the current page is a word page, and obtaining word information; confirming that the current page is a tomato timer page, and displaying timing information; confirming that the current page is a prompt setting logo page, displaying the page, turning off the STA mode, and turning on the AP mode; confirming that the current page is not the home page and a side slide is detected, returning to the home page; confirming that the current page is a word page and a side slide is detected, and switching words.
5. The multifunctional life assistant system based on ESP32 according to claim 2, characterized in that: The operation parameter setting task, network status task and time management task include: confirming that the touch is not triggered, confirming the return of AP connection setting parameters, confirming the entry of network parameters, exiting AP mode, and entering STA mode; confirming the entry of Tomato clock parameters and setting Tomato clock data; confirming the network status callback, when the network is successfully connected, updating the status, when the network is unsuccessful, reconnecting to the network; confirming the timer callback, confirming the minute callback, updating the clock; confirming the second callback, and updating the Tomato clock.
6. The multifunctional life assistant system based on ESP32 according to claim 1, characterized in that: The minimum system module is also configured to: determine a touch action by interruption duration, the touch action including single click, long press, left slide, and right slide; initialize the GPIO pin of the touch screen; enable the touch interrupt function; generate an interrupt signal in response to the touch action, call an interruption processing program, the interruption processing program uses a timer to measure the interruption duration of the touch action; obtain the touch action coordinates, the touch action coordinates include a starting coordinate and an ending coordinate, confirm that the difference between the starting coordinate and the ending coordinate is greater than a preset coordinate difference, and generate a sliding action; confirm that the difference between the starting coordinate and the ending coordinate is not greater than the preset coordinate difference, confirm that the interruption duration is less than the first interruption duration, and generate a short press action; It is confirmed that the interruption duration is not less than the first interruption duration, and it is confirmed that the interruption duration is greater than the second interruption duration, and a long press action is generated.
7. The multifunctional life assistant system based on ESP32 according to claim 6, characterized in that: The first interruption duration is 1.5 seconds, the second interruption duration is 2 seconds, and the preset coordinate difference is 10.
8. The multifunctional life assistant system based on ESP32 according to claim 1, characterized in that: The minimum system module is electrically connected to the touch screen via an I2C bus; the minimum system module is also configured to: use the I2C bus to scan the state of the touch point of the touch screen, confirm that a touch point is pressed, read the coordinate data of the pressed touch point, enter the touch interrupt function, and convert the touch point coordinate value into the actual position.
9. The multifunctional life assistant system based on ESP32 according to claim 1, characterized in that: The minimum system module is also configured to: initialize the SPI and the IO ports of the ink screen, pull the reset of the ink screen low and then high, set the starting coordinates X and Y of the display area of the ink screen, set the width and length of the display area of the ink screen, set the display content, update the ink screen display, and set the ink screen to enter deep sleep when not in use.
10. A life assistant reminder method, characterized in that: Applied to the multifunctional life assistant system based on ESP32 as described in any one of claims 1 to 9, the method comprises: powering on the multifunctional life assistant system based on ESP32 for the first time, sliding the touch screen to the right, connecting the smart terminal using the AP mode of the multifunctional life assistant system based on ESP32, and using the smart terminal to select a city, set the tomato clock, and configure the network; returning to the main interface, and updating the network time and weather configuration information using the STA mode of the multifunctional life assistant system based on ESP32.
Citation Information
Patent Citations
Multifunctional touch panel control method and device, equipment and storage medium
CN112181195A
Low-power-consumption schedule management system and schedule reminding method
CN115756145A
System for realizing automatic closed-loop test of touch screen
CN116775391A
Intelligent potting equipment based on embedded technology and use method thereof
CN117111502A