Arduino-based WeChat applet intelligent timer control system
Through the combination of Arduino smart hardware and WeChat applets, the automated control and data recording of board game timers is realized, which solves the problems of cumbersome operations, high labor costs and accuracy dependence, improves the flexibility and fairness of the timers, and is suitable for Various board game scenes.
Patent Information
- Application Number
- CN202410909617.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-11-01
AI Technical Summary
The existing board game timers are cumbersome to operate, have single functions, high labor costs, rely on manual labor, and are unable to deal with emergencies in a timely manner, which affects the fairness of the game environment.
Design a WeChat applet intelligent timer control system based on Arduino. Through WeChat applets, communicate with the Arduino intelligent hardware module with firmware to realize the automatic control, data recording and broadcast of the timer, and adopt Bluetooth wireless communication and CRC8 verification. and multiple display modules to reduce manual intervention and improve timing accuracy and flexibility.
It reduces manual operation and training costs, improves the accuracy and flexibility of the timer, can respond to emergencies in the game in a timely manner, enhances the fairness and competitiveness of the game environment, and is suitable for various offline board game scenarios.
Smart Images

Figure CN118890375A_ABST
Abstract
Description
Technical field:
[0001] The present invention relates to the field of intelligent control of the Internet of Things, and more particularly to an Arduino-based WeChat applet intelligent timer control system. Background technology:
[0002] Timers are widely used in the field of games. For example, timers can be used to control the logic and progress of games. In real-time multiplayer games, they are used to synchronize the actions and events of different players. With the development of offline board games, the use of timers in various game links has increased. And there are higher requirements for the convenience and flexibility of its performance. Existing timers may have problems such as cumbersome operation and single function. In order to meet the intelligent needs of timers in the field of games, this paper uses the Internet of Things technology to provide an intelligent timer based on Arduino WeChat applet.
[0003] Currently, the main problems with traditional timers used for board games are: (1) Operational complexity: The operation steps are complicated and require manual operations such as starting, stopping and recording the timing, which consumes human resources. The data generated also needs to be manually collected, sorted and analyzed. (2) High labor costs: Staff need to receive special training to ensure the correct use and understanding of the application of traditional timers in games, which also increases labor costs and training costs. (3) Accuracy dependence: The data generated by traditional timers may be affected by human factors, and their accuracy may require more manual supervision and calibration. In addition, this process is also accompanied by errors that will lead to inaccurate counting results, which not only requires frequent operations and maintenance, but is also not conducive to the fairness of the game environment. (4) Difficulty in human-computer interaction: Traditional timers cannot respond in a timely manner according to the on-site environment and have defects in handling emergencies in the game. Summary of the invention:
[0004] This application example discloses a WeChat applet intelligent timer control system based on Arduino, which can intelligently control the timer and send specific data packets according to relevant protocols through the WeChat applet to control the timer to execute timing, reset, and pause functions in real time. Reduce the labor cost of timer application in the game field,
[0005] To achieve the purpose of the above invention, the first aspect of the present invention provides a hardware control system of a WeChat applet smart timer based on Arduino, the system comprising a WeChat applet module and an Arduino smart hardware module with firmware. The WeChat applet module and the Arduino smart hardware module with firmware are connected to establish communication between the systems. When the hardware control system of the WeChat applet smart timer based on Arduino as claimed in claim 1 is working, the operation method comprises the following steps:
[0006] First, choose to enter the AI Judge or AI Judge PLUS interface;
[0007] Choose a good format and establish a communication connection;
[0008] The corresponding data packets are sent by the upper layer, and the Arduino smart hardware with firmware decodes the data packet information to control the output module to perform timing operations. If the decoded information is pause, the timing is paused. If not, the current game environment is judged to be night or day;
[0009] If it is night and you click Start, the countdown request data packet is sent to the Arduino smart hardware with firmware through the serial port, and the Arduino smart hardware with firmware parses the data packet and counts down;
[0010] If the logic is updated, i.e. the data packet is retransmitted, the countdown will be restarted according to the newly sent time;
[0012] When no retransmitted data packet is received, the countdown remains unchanged after being cleared. ;
[0013] If it is daytime and you click Start, a data packet requesting positive timing is sent to the Arduino smart hardware with firmware through the serial port, and the Arduino smart hardware with firmware parses the data packet and performs positive timing;
[0014] If the logic is updated, i.e. the data packet is retransmitted (click the next bit), the positive timing will restart from 0;
[0015] Click Pause to send a data packet requesting a pause to the Arduino smart hardware with firmware through the serial port. The Arduino smart hardware with firmware parses the data packet and pauses the counting.
[0016] When no retransmitted data packet is received, the positive timer continues to count;
[0017] The WeChat applet "Heylis" includes: Confident Wolf, Customization, Blood Moon Demon Hunter, Psychic Mechanical Wolf, Mirror Shadow, Pure White Night Shadow, Bear Trainer, Miracle Merchant, Awakening Wolf King, Seeking Fragrance to Know Fate, Masquerade, Pre-Hunter White, Wolf King Guard, Wolf Beauty Knight, Wolf King Dream Catcher, White Wolf King Guard, Gargoyle Gravekeeper, Nightmare Shadow, Pre-Hunter Guard, Nightmare Guard, multiple game versions, multiple background music and judge's timbre. Create a more advanced game atmosphere and liberate the traditional artificial judge.
[0018] As a limitation of Arduino smart hardware with firmware, it includes: A first control module based on Arduino smart hardware with firmware, the first control module serving as a control center, having multiple control ports capable of connecting different modules; A first display module for displaying the counting time, wherein the SCLK terminal of the first display module is connected to the synchronous clock of the first control module, and the DIO input terminal receives the serial data of the first control module; A first communication module for joint debugging with the WeChat applet, wherein the TXD data output terminal of the first communication module is connected to the serial port RXD input terminal of the first control module, and the RXD data input terminal is connected to the serial port output terminal of the first control module; The first power supply module for providing electric energy adopts a power supply module of a DC voltage-stabilized power supply, uses an external DC power supply to provide a stable voltage, and the power signal output end of the first power supply module is connected to the first control module.
[0019] As a further limitation of the Arduino smart hardware with firmware, the first display module also includes the remaining three sub-display modules for displaying timing information in multiple directions. The signal control input terminals thereof are connected in series with the first display module and are all connected to the first control module.
[0020] Due to the adoption of the above technical solution, the present invention has the following technical advances compared with the prior art: (1) The game information broadcasting and recording of traditional board games require staff to receive special training to ensure the correct use and understanding of the application of traditional timers in the game, which increases manpower and training costs. The present invention uses the WeChat applet "Hey Lisi", which can broadcast information by playing audio and automatically generate the information that needs to be recorded and reviewed in the game. (2) The traditional timer for board games has complicated operation steps, and requires manual operations such as starting, stopping and recording the timing, which is not flexible enough. The Arduino smart hardware with firmware in the present invention can not only automatically control the timing behavior directly through the WeChat applet, but also customize the timing time. (3) The data generated by the traditional timer may be affected by human factors, and its accuracy may require more manual supervision and calibration. The present invention uses the hardware resource timer and serial port of the Arduino smart hardware with firmware, which can automatically perform accurate timing through the WeChat applet to ensure the accuracy of timing. (4) Traditional timers cannot respond in time according to the on-site environment, and have defects in handling emergencies in the game. The present invention uses the WeChat applet "Heylis" to communicate with the Arduino smart hardware with firmware, and realizes real-time control of the timer behavior through "Heylis". Make timely responses to emergencies. (5) Traditional timers for board games mostly use infrared communication, which requires them to be in a specific area without any obstructions, which limits communication. The present invention uses Bluetooth communication for wireless communication, which has a stable connection and can control timing behavior at any location in space. (6) The traditional timer for board games has no core control board, which results in simple functions, poor flexibility, low precision and difficulty in expansion. The present invention uses the main control module Arduino Uno, which can communicate with the host flexibly and accurately control the timing, and is relatively inexpensive. Good scalability makes it easy to connect other hardware modules and expand more functions. (7) In setting the timing time, the present invention not only does not require the user to operate the hardware device separately, but the hardware device will be directly synchronized with the AI judge of the WeChat applet, and the timing time can also be customized through the upper level. The operation is more convenient and labor-saving. The information synchronization speed is faster, and the fairness of the game environment is improved; (8) The present invention is provided with multiple display modules, so that each player in the board game can check the timing time clearly at any time, realizing all-round observation; (9) The present invention adopts a hexadecimal communication method in communication, which can store a large amount of information, facilitate type conversion between data, and can also represent a wider range of values; (10) The present invention selects CRC8 verification mode for data packet verification. The algorithm is simple and has strong error detection capability, which can effectively detect errors in the data transmission process, thereby ensuring the accuracy of data transmission; (11) The present invention is widely applicable to various offline table games and has multiple applicable scenarios in the game to improve the quality and competitiveness of the game.
[0021] In summary, the present invention has a simple structure, strong practicability, and can intelligently control the timer quickly, conveniently and accurately.
[0022] The present invention is applicable to any scenario requiring timing in the field of games. Description of the drawings:
[0023] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] Figure 1 This is a schematic diagram of the overall system of a WeChat applet intelligent timer control system based on Arduino in the present invention; Figure 2 This is an overall system operation flow chart of a WeChat applet intelligent timer control system based on Arduino in the present invention; Figure 3 A circuit schematic diagram of an Arduino smart hardware with firmware in a smart timer based on an Arduino WeChat applet of the present invention; Figure 4 A circuit schematic diagram of a first control module of an Arduino smart hardware with firmware in an intelligent timer control system based on an Arduino WeChat applet of the present invention; Figure 5 A circuit schematic diagram of a first display module and a sub-display module of an Arduino smart hardware with firmware in an intelligent timer control system based on an Arduino WeChat applet of the present invention; Figure 6 A circuit schematic diagram of a Bluetooth module of a first communication module of an Arduino smart hardware with firmware in an intelligent timer control system based on an Arduino WeChat applet of the present invention; Figure 7 A circuit schematic diagram of a first power module of an Arduino smart hardware with firmware in an intelligent timer control system based on an Arduino WeChat applet of the present invention; Figure 8 An oscillating circuit of an Arduino smart hardware with firmware in an intelligent timer control system based on an Arduino WeChat applet of the present invention; Fig. 9 An operational amplifier circuit of Arduino smart hardware with firmware in an intelligent timer control system based on Arduino WeChat applet of the present invention; Specific implementation method:
[0025] The technical solutions in the embodiments of the present application are clearly and completely described below in conjunction with the drawings in the examples of the present application.
[0026] This embodiment provides a control system for a WeChat applet smart timer based on Arduino. The system flow is as follows Figure 1 As shown; includes the WeChat applet Heylis and an Arduino smart hardware with firmware
[0027] In this embodiment, the main control device uses Arduino smart hardware with firmware to receive and decode data packets sent by the WeChat applet and control related peripherals to perform related operations. The schematic diagram of the Arduino smart hardware with firmware is as follows: Figure 3 As shown, it includes the main control module as Figure 4 As shown, the display module is as follows Figure 5 As shown, the communication module is as follows Figure 6 As shown, the power supply module is as follows Figure 7 It includes: (1) First power module A first power supply module for providing electric energy such as Figure 7 As shown, the power signal output end of the first power module is connected to all peripheral devices to provide power for the controller and the peripherals. (2) Other peripheral interfaces A power interface is provided to provide power to the controller and peripherals, a Bluetooth interface is provided to communicate with the WeChat applet through the Bluetooth of the first communication module, and external interrupts are provided, which can be used as input for the display device. (3) Other hardware resources Oscillator circuits used to generate clock signals and implement timing functions, such as Figure 8 As shown, it provides an accurate time base for the microcontroller to ensure that various operations are carried out in rhythm; precise time control and timing are performed. Operational amplifier circuits used for signal amplification, calculation, conditioning and comparison, such as Fig. 9 As shown, it can amplify weak input signals for subsequent processing and detection; implement operations such as addition, subtraction, integration, and differentiation; perform processing such as filtering and shaping on signals to improve signal quality; and be used to compare the sizes of two signals.
[0028] The display module of this embodiment is as follows Figure 4 As shown. It is used to display the timing time of the timer. The GND and VCC of the display module are connected to the GND and 5V power supply of the main control module respectively. The SCLK of the display module is used to receive the synchronous clock sent by the main control module, the RCLK is used to control the data output of the display module, and the DIO is used to receive the serial data input sent by the main control module.
[0029] This embodiment adopts Bluetooth communication as the communication protocol.
[0030] The first communication module of this embodiment is Bluetooth communication. Wireless communication with WeChat applet. Wireless data transmission is carried out through the Dx-BT24 Bluetooth module. It is small in size, adopts low power consumption design, and has a high transmission rate. It facilitates the connection with hardware devices and ensures the reliability and stability of data transmission.
[0031] The BT24 Bluetooth module has a 5.1 Bluetooth protocol and a built-in standard serial port protocol. It can interact with mobile devices, PCs, and host devices through the module serial port, and can use AT commands to configure and modify module parameters. The module also supports BLE transparent transmission.
[0032] Wireless connection, through Bluetooth technology to achieve wireless communication between devices, get rid of the constraints of wires.
[0034] Among them, the module serial port default parameters are: 9600bps / 8 / n / 1 (baud rate / data bit / no parity / stop bit).
[0035] Among them, Bluetooth communication follows the serial communication protocol and specifications, baud rate: 9600, data bits 15 bits, check bit 1 bit, stop bit.
[0036] Among them, the data bits of the communication protocol include: 1 leading frame, 1 game number, 1 version number, 1 command type, 1 status bit, 2 auxiliary bits, 6 data bits, and 2 reserved bits.
[0037] 1-bit leading frame: 0XAA, identifies the start of data. Distinguishes data from other signals. Helps the receiver synchronize the start of data and determine the starting point of data.
[0038] 1-digit game number: 0X01, indicating that the current game is Werewolf. This digit is convenient for the application of the invention in other games in the future.
[0039] 1-bit version number: 0X01, indicating that the current version is 1.0. This bit is used to record the version number of the current invention, and the invention will be continuously improved, developed, and updated with new functions in the future.
[0040] 1-bit command type: 0X01, indicating counting up; 0X02, indicating counting down; 0X03, indicating timing pause. This bit is used to control what kind of operation the current timer should perform.
[0041] 1 status bit: 0X01 means the first day of day; 0X11 means the first night of night... This bit is used to record the current game status.
[0042] 2 auxiliary bits: 0X000X3C, indicating that the current countdown starts from 60s; 0X010X00, indicating that the current countdown starts from 256s... This bit is used to convey where the required countdown time starts.
[0043] The 2 auxiliary bits are transmitted in hexadecimal format, and the main control device converts them into decimal numbers and transmits them to the display module.
[0044] Among them, the hexadecimal number that combines two auxiliary digits uses the left shift operator "<<" to make the first auxiliary digit a higher digit. The bitwise OR operator "|" is used to combine the two auxiliary digits.
[0045] 6 data bits: used to record the player's identity information, so as to facilitate the expansion and improvement of the invention's functions in future versions.
[0046] 2 reserved bits: to facilitate the expansion and modification of the invention in future versions to adapt to new requirements or functions and ensure the scalability and flexibility of the communication protocol.
[0047] Communication protocol check bit: 1 bit, using CRC8 check method, used to detect errors in data transmission. If the data is wrong, the data is resent. CRC8 check is simple and efficient, with strong error detection capability and high reliability.
[0048] Among them, when implementing CRC8 verification, the following steps need to be followed: 1. Determine the generating polynomial; 2. Initialize the verification register; 3. Process the data bits one by one; 4. Complete the calculation of the verification value.
[0049] Among them, the Bluetooth module minimum system connects RX, TX, GND, and VCC modules to communicate normally. Among them, RX is connected to TX, and RX is connected to TX.
[0050] First connect the module to the USB to TTL converter and then to the computer, disconnect one power cord, and long press the module button to power on.
[0051] At this time, the module enters AT mode, open the serial port assistant, enter the AT command and press Enter to send the AT command.
[0052] It should be noted that, for the sending of AT commands, in addition to the two characters AT, the maximum length that can be received is 1056 characters (including the final null character).
[0053] Using Dx-BT24 Bluetooth module Figure 5 As shown: the GND and VCC of the second communication module are respectively connected to the GND and 5V power supply of the main control module, the TXD data output terminal of the second communication module is connected to the RXD input terminal of the main control module, and the RXD data input terminal is connected to the TXD output terminal of the main control module.
[0054] Serial port transparent transmission can transparently transmit serial port data and simplify the complex Bluetooth protocol into "serial port transparent transmission", without the need for complex protocol processing.
[0055] Among them, communication with the WeChat applet is carried out through BLU transparent transmission.
[0056] The above is a detailed introduction to an Arduino-based WeChat applet smart timer and related products disclosed in this embodiment. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the methods and core ideas of the present application; at the same time, for general technicians in this field, there may be changes in the specific implementation methods and application scope based on the ideas of the present application. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A WeChat applet smart timer based on Arduino, characterized by: It is based on an Arduino-based WeChat applet intelligent timer control system, which includes a WeChat applet "Hey Lisi" and an Arduino smart hardware with firmware.
2. The WeChat applet according to claim 1 includes 20 game versions, including custom version, pre-female hunter guard, nightmare guard, miracle merchant, pre-female hunter white, wolf king guard, wolf beauty knight, nightmare shadow, etc., and a variety of background music and judge's timbre. It is characterized by Recording and review of in-game information can be automatically generated.
3. According to the custom version of claim 1 or 2, players can determine the number of players and the type of characters in the version by themselves.
4. The Arduino intelligent hardware with firmware according to claim 1 comprises: ①The first control module based on Arduino smart hardware with firmware The first control module serves as a control center, and has multiple control ports capable of connecting different modules; ②The first display module for displaying the counting time The SCLK terminal of the first display module is connected to the synchronous clock of the first control module, and the DIO input terminal receives the serial data of the first control module; ③The first communication module used for joint debugging with WeChat applet The TXD data output terminal of the second communication module is connected to the serial port RXD input terminal of the first control module, and the RXD data input terminal is connected to A serial port output end of the first control module; ④The first power supply module for providing electric energy A power supply module using a DC stabilized power supply is used. An external DC stabilized power supply is used to provide a stable voltage, and the power signal output end of the first power supply module is connected to the first control module.
5. The first display module according to claim 1 or 4, characterized in that The remaining three sub-display modules are also included, which are used to display timing information in multiple directions. The signal control input ends of the sub-display modules are connected in series with the first display module and are all connected to the first control module.
6. The first communication module according to claim 1 or 4, characterized in that The communication protocol data format uses hexadecimal.
7. The communication protocol according to claim 1 or 6 is characterized in that: The timing value can be passed via specific bytes of the data packet.
8. The communication protocol according to claim 1 or 6 is characterized in that Select CRC8 as the verification method.
9. The hardware control method of the WeChat applet intelligent timer based on Arduino according to claim 2 can realize intelligent positive timing countdown and pause functions.
10. The hardware control system of the WeChat applet intelligent timer based on Arduino according to claim 1 comprises the following steps: -First, enter the AI Judge PLUS interface, select the layout mode and establish a communication connection; -The corresponding data packets are sent by the upper bit, and the Arduino microcontroller decodes the data packet information to control the output module to perform timing operations; - If the decoded information is pause, pause the timing; - If not, determine whether the current game environment is day or night. If it is day, count up, and if it is night, count down; - If the data packet is retransmitted, the forward timing (daytime) will restart from 0, and the countdown (nighttime) will start from the value of the specific byte in the parsed data packet; - If there is no retransmission of the data packet, the positive timer continues to count down, and the countdown remains unchanged after being cleared.
