CN110147058B - Borrow singlechip timing chip of wiFi module - Google Patents

Borrow singlechip timing chip of wiFi module Download PDF

Info

Publication number
CN110147058B
CN110147058B CN201910410187.5A CN201910410187A CN110147058B CN 110147058 B CN110147058 B CN 110147058B CN 201910410187 A CN201910410187 A CN 201910410187A CN 110147058 B CN110147058 B CN 110147058B
Authority
CN
China
Prior art keywords
timing
module
chip microcomputer
computer
esp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201910410187.5A
Other languages
Chinese (zh)
Other versions
CN110147058A (en
Inventor
金隐华
贾春燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201910410187.5A priority Critical patent/CN110147058B/en
Publication of CN110147058A publication Critical patent/CN110147058A/en
Application granted granted Critical
Publication of CN110147058B publication Critical patent/CN110147058B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Automation & Control Theory (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a single-chip microcomputer timing chip with a WiFi module, which is connected with an ESP-12WiFi module through an I2C two-wire interface in addition to timing control of the single-chip microcomputer, and the ESP-12WiFi module can be wirelessly connected with a mobile phone or a computer to realize convenient and visual various timing settings. The WiFi module can be designed into a universal module (one WiFi module can be used for setting the timing of various single-chip microcomputers), and the WiFi module is only connected when being set or checked and confirmed at the timing, and is not used at ordinary times. The single chip microcomputer does not need a clock setting component (a display screen and a key set are omitted) in timing, so that the structure is simple, and the cost is reduced. And emphasizes the relevant technical data of the open script program, so that the single chip timing chip becomes a universal chip, and a user can arrange a setting interface by himself.

Description

Borrow singlechip timing chip of wiFi module
Technical Field
The invention relates to the technical field of automatic control of electric appliances, in particular to a single-chip microcomputer timing chip with a WiFi module.
Background
Although the internet of things is shown in an exaggerated way by businesses, the internet of things promotes the development of network technology to be concise and fine, and also benefits the non-internet field, and the invention tries to use the internet technology for directly connecting the 'mini server ESP-12'. For micro-control electric appliances and typical single-chip microcomputer applications, in order to realize more convenient and visual setting (conventional time setting operation, because display screens are simple, key functions are overlapped, and editing keyboards such as digital time formats are lacked, the user can easily forget) or man-machine interaction, the single-chip microcomputer application and WiFi are connected with a mobile phone or a computer, so that the display screens and key groups with high cost and occupied volume are removed, the shell is reduced, and the design is simplified. The ideal scheme is not practical, because the technical difficulty of connecting the WiFi with the mobile phone or the computer is far higher than the technical content of typical application of the single chip microcomputer, however, the situation does not exist along with the popularization of an ESP-12WiFi single chip microcomputer (ESP8266) module, a new single chip microcomputer + WiFi application mode comes, and the invention throws bricks and leads jade, and starts from typical timing application.
Disclosure of Invention
Based on the background technology, the invention provides a single-chip timing chip with a WiFi module.
The technical scheme adopted by the invention is as follows: a timing chip of a single chip microcomputer with a WiFi module is characterized in that the timing chip of the single chip microcomputer is used for setting a timing control function through a matched WiFi connection module by means of a mobile phone or a computer before being used;
the single-chip microcomputer timing chip is a timing control chip realized by single-chip microcomputer programming, is provided with an I2C (slave) two-wire serial bus interface and is used for connecting a matched WiFi connection module and realizing the setting of a timing function, the confirmation of timing inspection, the calling-out viewing or the modification resetting by a mobile phone or a computer;
the matched WiFi connection module is an ESP-12WiFi module which is programmed to define a two-wire serial bus interface with I2C (master) and an I2C (slave) interface for connecting the singlechip timing chip;
the data in the singlechip is actively transmitted to a mobile phone or a computer by adopting an SSE server pushing technology of (I2C) informing ESP-12 and HTML5+ JS of the interruption of an SCL (edge interrupt);
at different times, one WiFi connecting module can be respectively connected with a plurality of single chip microcomputer timing chips, the single chip microcomputer timing chips are connected only when the set timing function needs to be changed or the timing check is confirmed, and the WiFi connecting module is not used when the single chip microcomputer timing chips work at ordinary times;
when the timing chip of the single chip microcomputer is separated from the WiFi connection module to work, only one starting key and one or more working state indicating LEDs are needed; the starting key operation comprises short pressing (shorter than 0.5 second), long pressing (longer than 0.5 second) or successive short pressing combined with the working state indication LED, so that multifunctional selective starting is realized; the IO ports of the singlechip timing chip are respectively connected with the start key and the working state indicating LED;
the single chip timing chip is provided with a flash EEPROM (electrically erasable programmable read-only memory) with the voltage of more than 1K and is used for storing the set start-stop time, the set cycle period, the set start time and the set remote control infrared code record, and the single chip timing chip is not lost when power is off; a battery is not kept by a built-in clock, the time on the mobile phone or the computer can be synchronized to a singlechip timing chip only by connecting the mobile phone or the computer before timing start, or the mobile phone or the computer is started at the set time as a time starting point, so that more applications do not need a real-time clock and only need to delay after starting;
the ESP-12WiFi module is programmed by NODEMCU firmware and LUA scripting language, is published in an open source, provides an SSE program example comprising HTML5+ JS and a program example that an I2C (master) two-wire serial bus interface triggers starting of read bytes in an SCL (interrupt mode), and is used for enabling a user to rewrite a more applicable operation interface (HTML5) by using the scripting language;
the mobile phone or computer WiFi is connected with the ESP-12 module by adopting a WiFi direct (AP/STATION) mode, the ESP-12WiFi module comprises HTTP service, the mobile phone or computer does not need to download and install the APP, and only a browser accesses 196.168.4.1 or 196.168.x.x, wherein 196.168.x.x is set or designated by a wireless router DHCP; third-party network service is not involved, and external network connection is not needed;
the method for connecting the ESP-12 module with the WiFi of the mobile phone or the computer comprises the following steps:
before the timing chip of the single chip microcomputer works and starts, a mobile phone or a computer is used for setting time or a timing function, so that a matched WiFi connection module needs to be connected; if the connection is carried out for the first time, the mobile phone or the computer finds the ESP-12 and the password or 12345678 in the wireless network setting, WIFI connection is carried out, after the connection is successful, the browser access 196.168.4.1 is opened, and the time or timing function setting can be carried out after the operation interface is entered; then, the local wireless router WIFI connection name and the password are placed into a matched WiFi connection module, so that the local WIFI can be automatically connected after the matched WiFi connection module is connected each time; after the setting is successful, recording the used (DHCP) IP address (196.168.x.x), and then connecting the mobile phone or the computer with the original local WIFI without entering a wireless network for finding ESP-12 connection, wherein when the mobile phone or the computer needs to be set online, only the browser is needed to access the recorded used (DHCP) IP address 196.168. x.x;
the mobile phone or the computer enters a setting interface and has dynamic operation prompts, including direct test effect or setting confirmation; after the setting is satisfied, the WiFi connection module is removed, and the start-stop work in the later use only needs to press a start key connected with the single chip microcomputer and observe the LED working state indication;
the mobile phone or the computer sets time or regularly has HTML5 standard time control, and only needs to select: a certain number in the month, day, hour, minute and week, or directly input numbers.
Further, the timing settings include the following exemplary formats:
[ [ date ] [ time ] ] function 1: duration 1[ function 2: duration 2] [ function 3: duration 3] … [ off-time ] …
Or
Date on time 1-off time 1 function/parameter 1
[ date ] on time 2-off time 2[ function/parameter 2]
[] The representation can be defaulted, and defaults with common values; the function/parameter may comprise a plurality of values.
Further, the I2C (master) two-wire serial bus interface of the WiFi connection module includes a plug part designed with a four-core socket, and specifies the arrangement of the four-core socket: +, SCL, SDA, -; in addition, a USB connection interface which is used for programming the ESP-12 and is connected with a computer is additionally arranged through an RS serial port of the ESP-12;
aiming at micro current single-chip microcomputer control, an ESP-12WiFi module is driven by power supply below 5V and is not driven, and the WiFi connection module comprises a 3.7V lithium battery power supply and a charging port or a power plug;
considering that the user can not immediately unplug the WiFi connection module, the WiFi connection module also enters an extremely low power consumption mode without operation delay, or sets the ESP-12 in the WiFi connection module to enter the extremely low power consumption mode by using a mobile phone or a computer, and wakes up the ESP-12 to be plugged in after being plugged out.
Furthermore, the singlechip adopts STC15 series singlechip, and comprises 8-pin packaged, wherein two pins P3.3(SDA) and P3.4(SCL) are used as I2C slave communication ESP-12WiFi connection modules, the two pins P3.0 and P3.1 are connected with a computer when programming is reserved, at ordinary times, P3.0 is used as a starting key on a timer, P3.1 is used as a working state indicating LED on the timer, and P3.2 and P3.5 control output or P3.2 infrared code sending learning record is carried out.
Further, if the single chip microcomputer timing chip is used as a timing ultrasonic micropore atomization humidifying device, the driving of a related ultrasonic micropore atomization sheet, the humidity detection and the driving of a low-voltage direct current fan are realized by an STC15W104 type 8-pin single chip microcomputer in the following connection mode: a port P3.1 series current limiting resistor R1 of the singlechip for outputting 110KHz PWM rectangular waves is connected with a grid G of an MOS tube MOS1, a source S of the MOS tube MOS1 is grounded, a drain D of the MOS tube MOS1 is connected with one end of a primary side of a high-frequency boosting transformer B, the other end of the primary side of the high-frequency boosting transformer B is connected with +12V, and two ends of a secondary side of the high-frequency boosting transformer B are connected with two ends of an ultrasonic micropore atomizing sheet W in parallel;
the humidity detection adopts a DHT11 bus interface digital humidity sensor, a singlechip port P3.2 is connected with only one data line of DHT11, the other two pins of the DHT11 are grounded one by one, and the other pin of the DHT11 is connected with a singlechip power supply (3.3V) + end;
the output port P3.0 of the single chip microcomputer is connected with a current-limiting resistor R2 in series and is connected with a grid G of an MOS tube MOS2, a source S of the MOS tube MOS2 is grounded, a drain D of the MOS tube MOS2 is connected with a negative electrode of a direct current fan F, and a positive electrode of the direct current fan F is connected with + 12V;
if the single chip microcomputer timing chip is used as a timing infrared remote controller and a learning type coding record, the connection mode realized by the STC15W104 type 8-pin single chip microcomputer is as follows: the output port P3.5 of the single chip microcomputer is connected with the negative end of an infrared emission LED in series, and the positive end of the infrared emission LED is connected with the positive end of a power supply of the single chip microcomputer; the output end of the infrared receiving head (HS0038) is connected with the port P3.2 of the single chip microcomputer, the other two pins of the infrared receiving head are grounded one by one, and the other pin is connected with the power supply (3.3V) + end of the single chip microcomputer.
The invention has the beneficial effects that: the typical singlechip timing application is connected with a mobile phone or a computer by WiFi to realize various timing settings, the operation is convenient and visual, and the singlechip system can also remove a display screen and a key set which have high cost and occupy volume, so that the shell is reduced and the design is simplified. The singlechip timing chip can realize various timing settings by a mobile phone or a computer, has universality and avoids singlechip programming of a user. And the user can also rewrite a more applicable operation interface (HTML5) by himself using the script language.
Drawings
Fig. 1 is a connection diagram of an ESP-12WiFi connection module and an STC15 series single chip microcomputer timing chip.
FIG. 2 shows the driving of the timing ultrasonic micropore atomization plate, the driving of the low-voltage direct current fan and the humidity detection which are realized by the MOS tube for the single chip microcomputer.
Detailed Description
The singlechip timing control application is connected with a mobile phone or a computer by WiFi to realize personalized setting, and the specific technical route (figure 1): the ESP-12WiFi module can realize WiFi connection with a mobile phone or a computer, and the single chip microcomputer is in bidirectional (byte) communication with the ESP-12WiFi module through an I2C two-wire interface.
The STC15 series single chip microcomputer is a domestic microcontroller MCU with extremely high cost performance, particularly an 8-pin package including a patch package, and is low in cost and does not occupy space. For an STC15 series 8-pin single chip microcomputer, the recommended connection method is as follows: the pins P3.3(SDA) and P3.4(SCL) are used as an I2C slave (slave) communication ESP-12WiFi module, the two pins P3.0 and P3.1 are connected with a computer when a program is reserved, the P3.0 is used as a starting button on the micro-control timing electrical appliance at ordinary times, the P3.1 is used as an LED working state indicator lamp on the micro-control timing electrical appliance, and the P3.2 and P3.5 control outputs or a P3.2 infrared code sending learning record.
An STC15 series single chip microcomputer and an ESP-12WiFi module are selected, the STC15 series single chip microcomputer works at ordinary times, and the ESP-12WiFi module is only used when a mobile phone or a computer needs to be connected.
For some users which are rarely set, the ESP-12WiFi module is connected with the single chip microcomputer by only one four-core connecting line; for most of the devices which need to be personalized, the ESP-12WiFi module is usually made into a plug-in small plug-in (abbreviated as WiFi plug-in module) alone, and it has a four-core socket: two I2C communications, two positive and negative power supplies, arranged: +, SCL, SDA-many off-the-shelf quad jacks (e.g., USB). For convenient programming, a USB (universal serial bus) connecting interface (RS serial port of the ESP-12, also can comprise RS-USB conversion) which is used for programming the ESP-12 and is connected with a computer is additionally arranged through an RS serial port of the ESP-12. The WiFi plug-in module is usually sold together with a matched programmed singlechip timing chip.
The WiFi plug-in module (at different time) can be universal for a plurality of applications, wherein the ESP-12 comprises a plurality of timing application matched setting programs (which is selected by a menu on a mobile phone screen), and set parameters are directly written into an STC singlechip EEPROM and also stored in a connected mobile phone or a connected computer (HTML5 is stored locally) so as to call and check the setting at the time.
By adopting I2C communication, the RS serial port is reserved as ESP-12 which is more convenient to be online adjusted with a computer, and then, the STC 8-pin singlechip does not have the RS serial port.
The I2C communication protocol is divided into a master (master) -slave (slave) machine, an ESP-12 module provides a master machine I2C, an STC single chip microcomputer just has pins which can trigger interruption along the upper edge and the lower edge, and the slave machine I2C (slave) is conveniently realized by programming. However, unlike the RS serial port for duplex communication, the single chip cannot actively (randomly) send information to the ESP-12 module via the slave I2C (slave), and therefore, an important mechanism is introduced, that is, when the single chip sends information to the ESP-12 module, an interrupt request is sent first; and on the other end, the ESP-12 module defines I2C, and then defines that the SCL pin therein has an up-edge interrupt triggering function, once (when the SCL pin is pulled up first when the single chip sends information to the ESP-12 module), the SCL pin of the ESP-12 module is pulled up to interrupt and respond, the interrupt function of the SCL pin is immediately disabled, the host I2C (master) reading process is started, and the single chip end is usually in a slave I2C (slave) state and can cooperatively send SDA data serial bits according to the SCL clock pulse.
Similarly, because of the HTTP network communication protocol, the ESP-12 module (using WiFi direct connection ultra-micro HTTP server) cannot actively (randomly) send information to (browser of) mobile phone or computer, and for this purpose, the SSE (server push) technology of HTML5+ JS is used.
The two communication protocols realize the two-way transmission of data between the singlechip and the mobile phone or the computer, the ESP-12 module finally realizes the connection of the plug-in interface of only four wires with the singlechip control system, and the power supply and the plug-in fixation of the ESP-12 module are also included.
The single chip microcomputer (timing chip) system can be simplified to only leave one starting key and one or two working state indicating LEDs. For the multi-function selection starting, the status indicating LED can be seen to press the wheel in short time or press the wheel in long time.
The single chip timing chip is used for driving an ultrasonic micropore atomizing sheet, detecting humidity and driving a low-voltage direct current fan (the driving is typical), and the single chip timing chip can be compactly realized for an STC15W104 class 8-pin single chip: (in figure 2) a port P3.1 series current limiting resistor R1 of a PWM rectangular wave with 108KHz output by a microcontroller MCU is connected with a grid G of an MOS tube MOS1, a source S of the MOS tube MOS1 is grounded, a drain D of the MOS tube MOS1 is connected with one end of a primary side of a high-frequency boosting transformer B, the other end of the primary side of the B is connected with +12V, and two ends of a secondary side of the high-frequency boosting transformer B are connected with two ends of an ultrasonic micropore atomization sheet W in parallel (some are connected with a capacitor C in parallel for resonance compensation or are connected with an inductor L in series for weakening coupling with.
A DHT11 bus interface digital humidity sensor is adopted for humidity detection, a microcontroller MCU port P3.2 is connected with only one data line (P3.2 has the functions of upper and lower edge interruption and is suitable for being used as bus interface drive) of the DHT11, and the other two pins of the DHT11 are grounded one by one and are connected with a microcontroller power supply (3.3V) + end one by one.
The output port P3.0 of the microcontroller MCU is connected with a current-limiting resistor R2 in series and connected with a grid G of an MOS tube MOS2, a source S of the MOS tube MOS2 is grounded, a drain D of the MOS tube MOS2 is connected with a cathode of a direct current fan F, and an anode of the direct current fan F is connected with +12V (the direct current motor fan is also connected with a capacitor in parallel or a reverse diode for absorbing reverse high voltage).
Ultrasonic micropore atomization, temperature (DHT11 has temperature detection at the same time) humidity detection and a fan are put together, because the three functions are combined together to play an important role in seed germination and seedling raising, and a germination/seedling raising humidifying experimental box can be formed.
P3.3 (upper falling edge interrupt) for SDA and P3.4 (only falling edge interrupt) for SCL of STC15W104 are connected to I2C (Slave) four-core jacks.
Except that the serial current limiting resistor is connected with the grid electrode of the MOS tube, the P3.0 and the P3.1 of the STC15W104 still do not influence the connection of a computer burning program (the grid electrode of the MOS tube is high-resistance and is also connected with the serial resistor).
The single chip timing chip is used as an infrared remote controller and a learning type coding record: an output port P3.5 of the microcontroller MCU is connected with the negative end of the infrared emission LED in series, and the positive end of the infrared emission LED is connected with the plus end of the microcontroller power supply; the output end of the infrared receiving head (HS0038, PC838, etc.) is connected with the port P3.2, the other two pins of the infrared receiving head are grounded one by one and connected with the power supply (3.3V) + end of the microcontroller one by one, and the circuit is similar to that of figure 2 (two MOS tubes are removed).
Description of the operation:
the method for connecting the ESP-12 module with the WiFi of the mobile phone or the computer comprises the following steps:
before the timing chip of the single chip microcomputer works and starts, a mobile phone or a computer is used for setting time or timing functions, and therefore a matched WiFi connection module needs to be connected. If the connection is carried out for the first time, the mobile phone or the computer finds the ESP-12 and the password-free or 12345678 in the wireless network setting, WIFI connection is carried out, after the connection is successful, a browser is opened to access 196.168.4.1 (IP of AP mode is connected to WIFI of the ESP-12), and time or timing function setting can be carried out after an operation interface is entered. Then, a common practice is to put the local wireless router WIFI connection name and password into a matching WIFI connection module (ESP-12 WIFI connection status mode), so that the local wireless router (WIFI) is automatically connected after each connection; after the setting is successful, the used (DHCP) IP address (such as 196.168.0.103) is recorded, and then the mobile phone or the computer can still connect with the original local WIFI without entering a wireless network setting to find ESP-12 connection, and when the mobile phone or the computer needs to be set online, the mobile phone or the computer only needs to access 196.168.0.103 by a browser. Note that: here, the AP and STATION modes of the ESP-12 module connected to WIFI are referred to as WIFI direct connection modes (no need to access an external network, no need of a third party service, and no influence on the access of a mobile phone or a computer to the external network).
The WiFi connection module is connected, and the timing function of the single chip microcomputer is set through WiFi connection of a mobile phone or a computer, namely connection for short. When online, dynamic operation prompts including direct test effect or setting confirmation are provided; after the setting is satisfied, the WiFi connection module is removed, and later use (namely, the singlechip which is disconnected from the on-line works at ordinary times, namely, the on-off of the timing function) can be realized only by pressing a start key connected with the singlechip (timing chip). To the selection start that is equipped with multiple functions, through pressing the start button in succession for a short time to observe pilot lamp LED state.
The mobile phone or the computer sets time or regularly has HTML5 standard time control, and only needs to select: a certain number in the month, day, hour, minute and week, or directly input numbers.
Time is started and generally cannot be powered off unless the time is delayed type timing without real-time, and the power can be powered off before the time is started. Some may change the settings online using a start at a set time as a time starting point, such as a 12 pm or 10 pm start.
For some long-time timing control, the timing can be confirmed to be in normal operation in the midway, the timing can be known in detail through a mobile phone or a computer, and the LED indicator lamp can be flashed for more than two times (the long-time bright indication indicates that the power is off) through long-pressing a starting key.
Some small current single chip microcomputer controls (such as a capacitor voltage reduction driving silicon controlled rectifier), the power supply below 5V drives the ESP-12WiFi module, the WiFi connection module comprises a 3.7V lithium battery power supply, and a charging port or a power plug.
In addition, the user may (intentionally and unintentionally) not immediately unplug the WiFi connection module, and in order to prevent the user from consuming power or occupying WiFi resources, the ESP-12WiFi connection module further enters a very low power consumption mode (0,4)) after no operation delay, or sets the ESP-12WiFi module to enter the very low power consumption mode by using a mobile phone or a computer. The WiFi online work can be continued through RST key pressing or pulling out of the ESP-12 module and then plugging in and waking up.
The timing settings are often in the following typical format:
[ [ date ] [ time ] ] function 1: duration 1[ function 2: duration 2] [ function 3: duration 3] … [ off-time ] …
Or
Date on time 1-off time 1 function/parameter 1
[ date ] on time 2-off time 2[ function/parameter 2]
[] The representation can be defaulted, and defaults with common values; the function/parameter may comprise a plurality of values.
Example 1: all the [ [ date ] [ time ] ] are default, default to start-up, default to stop-time, default to not cycle:
big fire 10 (minutes) small fire 30 (minutes)
Example 2:
4 month 1 day 8:30 alarm 10 (minute)
Example 3:
heating with 4:00-6:30 bath water
22:00-8:00 refrigerator power-on
The timing type typical format is universal, so that the WiFi module can be made to have certain universality and be shared by multiple applications.
The ESP-12WiFi module adopts NODEMCU firmware, LUA script language program disclosure and HTML file disclosure (generally, the programs can be directly seen from a browser), so that teaching popularization can be realized, and a user can rewrite the programs (script language, some nouns and numbers are particularly visual and convenient, particularly, a notebook can be used without a program development environment, and program interpretation is in the NODEMCU firmware) to form a more applicable and attractive operation interface. Specifically, an SSE program example comprising HTML5+ JS and a program example of I2C (master) two-wire serial bus interface initiating a read-from byte (1, n) with an edge-interrupt on SCL are provided.
The control function and the use method of the programmed singlechip timing chip are completely disclosed through technical documents, including the functions of singlechip pin and connection diagram, so that the personalized function can be realized by self programming.
The core of the invention is to provide application mode change caused by temporary connection of a WiFi module.
The initial idea was to use the WiFi module to temporarily connect the single chip with the mobile phone or computer WiFi, so as to achieve the convenient setting of the working requirement with the mobile phone or computer (because the setting of the conventional electrical appliance is troublesome, such as setting time of the electric rice cooker, setting time of various electronic clocks/timers), and as a result, it was not thought that the temporary use of the WiFi module brings a series of changes, especially brings a new application mode for the single chip.
Firstly, the mobile phone or the computer which is used with high popularity rate can be designed to have dynamic prompt for specific operation by everyone. Just as the mobile phone or the computer has made personalized timing setting in advance, the single chip microcomputer works or the specific starting of the timing type electric appliance is simple, namely, a display screen and a keyboard on the single chip microcomputer system or the timing type application electric appliance are not needed, and only one starting button and one or two state indicating LEDs are arranged. That is to say, the single chip microcomputer timing control or the formed operation interface of the electric appliance is generally unnecessary, the volume is reduced, the design is simplified, and the cost is reduced.
The method is further popularized along the idea, and on the premise that the pins of the single chip microcomputer allow, a plurality of timing functions are compiled in the single chip microcomputer, and specifically which one is used for online connection by means of the WiFi module is selected by a user. Because the mobile phone or the computer has dynamic operation prompt, pull-down menu, hook selection and the like, the function selection or personalized detailed customization is very convenient. Therefore, the programmed singlechip becomes a general chip without the need of writing programs by users (particularly suitable for rapidly meeting the requirements of personalized Xiaozhong at low cost, and is not suitable for batch production of customized chips due to the requirements of personalized Xiaozhong). Therefore, two application users are introduced, one is a conventional end user, the other is a secondary development merchant, the programmed singlechip is subjected to function customization according to the requirements of the end user by virtue of the familiarity of NODEMCU and the LUA scripting language and the HTML5 programming, and meanwhile, the matched WiFi module operation interface is adjusted, so that the singlechip timing chip and the matched WiFi module which are taken by the end user are customized and professional application suites.
In order to fully develop and apply the programmed singlechip by secondary development merchants, the programmed singlechip must have detailed function use description files, including a connection diagram and a function description of each pin of the singlechip (an output control signal also comprises PWM, an input signal also comprises ADC and provides a typical test circuit), and NODEMCU LUA script programming and HTML5 files in a matched WiFi module (including an SSE program example providing HTML5+ JS and a program example of I2C (master) two-wire serial bus interface triggering starting read bytes I2c. read (0, n): byte (1, n) in an SCL edge interrupt mode). The end user can also adapt to the self setting operation interface according to the rewriting (script language, rewriting some nouns and numbers is particularly intuitive and convenient, especially without a program development environment, a notebook is provided, and program interpretation is in NODEMCU firmware).
Note that: because the STC single chip generally needs to perform high-speed operation, such as outputting a 110KHz PWM driving signal required by micropore atomization ultrasonic waves or learning codes emitted by an infrared remote controller, and simultaneously needs a system clock and response key operations including short pressing and long pressing, generally only high-efficiency assembly languages (particularly 8-pin ICs of STC15 series, limited on-chip resources, and very efficient and simplified programs) can be used, and the programming difficulty is high, the program of the STC single chip is generally not popularized in teaching.
The applicable application classes:
1. timer control, the setting of the timer is actually divided into two parts: clock setting and timing setting. The two settings are troublesome to set by using a conventional clock module with a display screen, and the small key needs to be pressed repeatedly once, so that the two settings are prevented from being mistaken once by accident and are all heavy. The ideal method is to use a mobile phone or a computer to make the setting, and the setting is provided with a (HTML5) time control, so that only a click is selected, or a keyboard is used for directly inputting numbers or handwriting, which is convenient. No matter the clock setting or the timing setting is carried out, a mobile phone or a computer is not needed after the setting is finished, a display screen and a keyboard are not needed when the single chip microcomputer works, and only one starting button and one or two state indicating LEDs are reserved. The control comprises power-on and power-off, PWM numerical value adjustment, infrared remote control, wireless remote control, micropore atomization ultrasonic output and the like. The application examples include refrigerator peak valley power supply energy-saving socket, ultrasonic micropore atomization, learning type timing remote controller and the like.
2. Numerical adjustment class setting: the method comprises the steps of selecting the working frequency of a microporous atomization sheet, setting the brightness of an LED lamp (reducing the brightness to save energy, particularly supplying power to a high-voltage constant current of more than 36 LED lamp beads, and currently becoming mainstream, wherein the brightness is reduced to protect the LED lamp beads best) and fine-tuning the work of a battery car charger (adjusting the charging current to be safe but long in time, and increasing the large-current charging limit time for a cheap assembled battery without a battery protection circuit), and setting a plurality of special items (such as cooking, large fire for 10 minutes, small fire for 20 minutes, no heat preservation, hot dishes, large fire for 1 minute, small fire for 3 minutes, heat preservation, and safe heating for the old, small fire for 20 minutes, no heat preservation) according to personal requirements by a micro-control electric appliance, wherein the trivial settings are only explained by a mobile phone or a computer. Once the setting is finished, the use is convenient at ordinary times, a mobile phone or a computer is not needed any more, and only one starting button and a plurality of state indicating LEDs are needed (for example, the LED1 is bright to indicate that the fire is 10 minutes, the LED2 is bright to indicate that the fire is 20 minutes, the LED3 is bright to indicate that the temperature is kept for 60 minutes, the starting button is pressed for short time for rotation, and the long pressing is cancelled or turned off).
Note that both of the above two types of setting adjustments may involve relatively complicated human-computer interaction, such as the selection of the operating frequency of the microporous atomization sheet, which is not very high in operating current and atomization due to the processing difference of the microporous atomization sheet or the manufacturing difference of the boost inductor, and if the operating frequency is incorrectly selected, the atomization is small and the current is large, and the driving power tube is likely to be burnt out, so that the user can finely adjust the operating frequency, observe the effect in real time, and select the optimal fixation (this process is not required at ordinary times).
For example, when the storage battery of an electric vehicle is charged, whether the storage battery is damaged quickly or not is checked, the voltage rising condition during charging is usually observed, if the voltage rises quickly, the storage battery has problems, and a single chip microcomputer is involved to randomly and actively send sampling data to a mobile phone or a computer, so that the mobile phone or the computer carries out complex operation and displays the result. And these are all difficult to do once (insert supporting wiFi module and ally oneself with cell-phone or computer operation), and the work does not need the wiFi module at ordinary times, and it can only to need a start button and a plurality of status indication LED.
The applications listed above are realized economically and simply by a programmed singlechip, many of which are controlled by the singlechip in a timing manner, and a display screen keyboard is omitted (some of which even need to start a button and indicate the state of an LED (light emitting diode) such as an LED dimming lamp, and the LED dimming lamp is switched by successive power failure). When complex adjustment setting is rarely needed, the matched WiFi module is temporarily made on a mobile phone or a computer. And the matched WiFi modules can share one module, and all matched NODEMCU LUA programs are compiled together and loaded into the ESP-12WiFi module, and a mobile phone or a computer selects required application when the device is used.
Therefore, the timing control chip of the single chip microcomputer is provided.
The online of the mobile phone or the computer does not relate to the third-party network service, does not need to register/password, does not download and install the APP, and does not need to be connected with an external network. Therefore, the method does not need to be confused with the currently blown high Internet of things, and certainly, if networking is needed, the NODEMCU of the ESP-12 has the MQTT module and has the function of the Internet of things.

Claims (4)

1. A single-chip microcomputer timing chip with a WiFi module is characterized in that the single-chip microcomputer timing chip is subjected to timing control function setting through a matched WiFi connection module by means of a mobile phone or a computer before being used;
the single-chip microcomputer timing chip is a timing control chip realized by single-chip microcomputer programming, is provided with an I2C two-wire serial bus interface and is used for connecting a matched WiFi connection module and realizing the setting of a timing function, the confirmation of timing check, the calling-out check or the modification reset by a mobile phone or a computer;
the matched WiFi connection module is an ESP-12WiFi module which is programmed to define a two-wire serial bus interface with I2C and is used for connecting an I2C interface of the single chip microcomputer timing chip;
the data in the singlechip is actively transmitted to a mobile phone or a computer by adopting an SSE server pushing technology of informing an ESP-12WiFi module and HTML5+ JS of the interruption of the upper edge of an SCL;
at different times, one WiFi connecting module can be respectively connected with a plurality of single chip microcomputer timing chips, the single chip microcomputer timing chips are connected only when the set timing function needs to be changed or the timing check is confirmed, and the WiFi connecting module is not used when the single chip microcomputer timing chips work at ordinary times;
when the timing chip of the single chip microcomputer is separated from the WiFi connection module to work, only one starting key and one or more working state indicating LEDs are needed; the starting key operation comprises short pressing, long pressing or successive short pressing combined with the working state indication LED, so that multifunctional selective starting is realized; the IO ports of the singlechip timing chip are respectively connected with the start key and the working state indicating LED;
the single chip timing chip is provided with a flash EEPROM (electrically erasable programmable read-only memory) with the voltage of more than 1K and is used for storing the set start-stop time, the set cycle period, the set start time and the set remote control infrared code record, and the single chip timing chip is not lost when power is off; a battery is not kept by a built-in clock, the time on the mobile phone or the computer can be synchronized to a singlechip timing chip only by connecting the mobile phone or the computer before timing start, or the mobile phone or the computer is started at the set time as a time starting point, so that more applications do not need a real-time clock and only need to delay after starting;
the ESP-12WiFi module is programmed by NODEMCU firmware and LUA scripting language, is published in an open source, provides an SSE program example comprising HTML5+ JS and a program example that an I2C two-wire serial bus interface triggers and starts read bytes in an SCL upper edge interrupt mode, and is used for enabling a user to rewrite a more applicable operation interface by using the scripting language;
the mobile phone or the computer WiFi is connected with the ESP-12WiFi module by adopting a WiFi direct connection mode, the ESP-12WiFi module comprises HTTP service, the mobile phone or the computer does not need to download and install APP, and only a browser accesses 196.168.4.1 or 196.168.x.x, wherein 196.168.x.x is internally set or designated by a wireless router DHCP; third-party network service is not involved, and external network connection is not needed;
the method for connecting the ESP-12WiFi module with the mobile phone or the computer WiFi module comprises the following steps:
before the timing chip of the single chip microcomputer works and starts, a mobile phone or a computer is used for setting time or a timing function, so that a matched WiFi connection module needs to be connected; if the connection is carried out for the first time, the mobile phone or the computer finds an ESP-12WiFi module and no password or 12345678 in the wireless network setting, WIFI connection is carried out, after the connection is successful, a browser is opened to access 196.168.4.1, and time or timing function setting can be carried out after an operation interface is entered; then, the local wireless router WIFI connection name and the password are placed into a matched WiFi connection module, so that the local WIFI can be automatically connected after the matched WiFi connection module is connected each time; after the setting is successful, recording down the used IP address, and then connecting the mobile phone or the computer with the original local WIFI without finding an ESP-12WiFi module for connection in wireless network setting, wherein when the mobile phone or the computer needs to be set online, only a browser is used for accessing the recorded used IP address 196.168. x.x;
the mobile phone or the computer enters a setting interface and has dynamic operation prompts, including direct test effect or setting confirmation; after the setting is satisfied, the WiFi connection module is removed, and the start-stop work in the later use only needs to press a start key connected with the single chip microcomputer and observe the LED working state indication;
the mobile phone or the computer sets time or regularly has HTML5 standard time control, and only needs to select: a certain number in the month, day, hour, minute and week, or directly input numbers.
2. The single-chip microcomputer timing chip with the aid of the WiFi module as claimed in claim 1, wherein the I2C two-wire serial bus interface of the WiFi connection module includes a plug part designed with a four-core socket, and specifies the arrangement of the four-core socket: +, SCL, SDA, -; in addition, a USB connection interface used for programming the ESP-12WiFi module and connected with a computer is additionally arranged through an RS serial port of the ESP-12WiFi module;
aiming at micro current single-chip microcomputer control, an ESP-12WiFi module is driven by power supply below 5V and is not driven, and the WiFi connection module comprises a 3.7V lithium battery power supply and a charging port or a power plug;
considering that the user cannot immediately unplug the WiFi connection module, the WiFi connection module also enters an extremely low power consumption mode without operation delay, or an ESP-12WiFi module in the WiFi connection module is set by a mobile phone or a computer to enter the extremely low power consumption mode, and the ESP-12WiFi module is awakened to be plugged through an RST key on the ESP-12WiFi module or is unplugged.
3. The timing chip of claim 1, wherein the single chip is a STC15 series single chip, and comprises an 8-pin package, wherein two pins P3.3 and P3.4 are used as I2C slave communication ESP-12WiFi connection modules, and two pins P3.0 and P3.1 are used as a start button on a timer, P3.1 is used as an operating status indication LED on the timer, P3.2 and P3.5 control outputs, or P3.2 infrared code-sending learning records, except for the connection with a computer during programming.
4. The timing chip of claim 1, wherein if the timing chip is used as a timing ultrasonic microporous atomizing humidifier, the driving of the related ultrasonic microporous atomizing sheet, the humidity detection and the driving of the low-voltage dc fan are connected by an STC15W104 type 8-pin single chip microcomputer in the following manner: a port P3.1 series current limiting resistor R1 of the singlechip for outputting 110KHz PWM rectangular waves is connected with a grid G of an MOS tube MOS1, a source S of the MOS tube MOS1 is grounded, a drain D of the MOS tube MOS1 is connected with one end of a primary side of a high-frequency boosting transformer B, the other end of the primary side of the high-frequency boosting transformer B is connected with +12V, and two ends of a secondary side of the high-frequency boosting transformer B are connected with two ends of an ultrasonic micropore atomizing sheet W in parallel;
the humidity detection adopts a digital humidity sensor of a DHT11 bus interface, a singlechip port P3.2 is connected with only one data line of DHT11, the other two pins of the DHT11 are grounded one by one and connected with the power supply + end of the singlechip by one;
the output port P3.0 of the single chip microcomputer is connected with a current-limiting resistor R2 in series and is connected with a grid G of an MOS tube MOS2, a source S of the MOS tube MOS2 is grounded, a drain D of the MOS tube MOS2 is connected with a negative electrode of a direct current fan F, and a positive electrode of the direct current fan F is connected with + 12V;
if the single chip microcomputer timing chip is used as a timing infrared remote controller and a learning type coding record, the connection mode realized by the STC15W104 type 8-pin single chip microcomputer is as follows: the output port P3.5 of the single chip microcomputer is connected with the negative end of an infrared emission LED in series, and the positive end of the infrared emission LED is connected with the positive end of a power supply of the single chip microcomputer; the output end of the infrared receiving head is connected with the port P3.2 of the single chip microcomputer, and the other two pins of the infrared receiving head are grounded one by one and connected with the power supply + end of the single chip microcomputer one by one.
CN201910410187.5A 2019-05-16 2019-05-16 Borrow singlechip timing chip of wiFi module Expired - Fee Related CN110147058B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910410187.5A CN110147058B (en) 2019-05-16 2019-05-16 Borrow singlechip timing chip of wiFi module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910410187.5A CN110147058B (en) 2019-05-16 2019-05-16 Borrow singlechip timing chip of wiFi module

Publications (2)

Publication Number Publication Date
CN110147058A CN110147058A (en) 2019-08-20
CN110147058B true CN110147058B (en) 2020-10-16

Family

ID=67595595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910410187.5A Expired - Fee Related CN110147058B (en) 2019-05-16 2019-05-16 Borrow singlechip timing chip of wiFi module

Country Status (1)

Country Link
CN (1) CN110147058B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111049609B (en) * 2019-12-09 2021-11-12 思尔芯(上海)信息科技有限公司 Method for generating programmable clock by Ethernet

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205174858U (en) * 2015-12-07 2016-04-20 成都前锋电子有限责任公司 Realize WIFI data interchange's water heater
CN205427533U (en) * 2016-03-18 2016-08-03 成都前锋电子电器集团股份有限公司 Water heater wireless data switching control circuit
CN206450320U (en) * 2016-11-04 2017-08-29 恒信大友(北京)科技有限公司 A kind of high-performance high-speed motion mechanism dynamic characteristic tester
CN206611191U (en) * 2016-12-27 2017-11-03 时欣 A kind of separate type has the portable power source of WIFI signal
CN109247227A (en) * 2018-08-08 2019-01-22 浙江大学 A kind of automatic watering function control box being arranged based on soil humidity and upper lower threshold value
CN109447218A (en) * 2018-10-18 2019-03-08 成都芯创智联科技有限公司 Wifi label timing reporting system and WIFI label launching technique
CN208739136U (en) * 2018-09-12 2019-04-12 深圳数位科技有限公司 Communication module

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160124394A1 (en) * 2014-10-30 2016-05-05 Hua Wen Hsu Wireless inductive pointer clock
US9690272B2 (en) * 2015-02-16 2017-06-27 Polaris Tech Global Limited Indoor automation and control method and system thereof using RFID-to-Bluetooth selective adapter

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN205174858U (en) * 2015-12-07 2016-04-20 成都前锋电子有限责任公司 Realize WIFI data interchange's water heater
CN205427533U (en) * 2016-03-18 2016-08-03 成都前锋电子电器集团股份有限公司 Water heater wireless data switching control circuit
CN206450320U (en) * 2016-11-04 2017-08-29 恒信大友(北京)科技有限公司 A kind of high-performance high-speed motion mechanism dynamic characteristic tester
CN206611191U (en) * 2016-12-27 2017-11-03 时欣 A kind of separate type has the portable power source of WIFI signal
CN109247227A (en) * 2018-08-08 2019-01-22 浙江大学 A kind of automatic watering function control box being arranged based on soil humidity and upper lower threshold value
CN208739136U (en) * 2018-09-12 2019-04-12 深圳数位科技有限公司 Communication module
CN109447218A (en) * 2018-10-18 2019-03-08 成都芯创智联科技有限公司 Wifi label timing reporting system and WIFI label launching technique

Also Published As

Publication number Publication date
CN110147058A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
US8427006B2 (en) Device for disconnecting at least one appliance from the electrical mains, which provides at least one override operating mode, a configurable device, system and configuration method
US8862916B2 (en) Wireless control of power sockets based on host and signal quality
CN102378048B (en) Television (TV) set top box and automatic standby method thereof
CN103607822B (en) A kind of method of overheat protector of photoflash lamp of terminal and device
CN102368350A (en) Device and method for realizing universal type infrared remote controller based on mobile phone
CN201352430Y (en) Energy-saving digital photo frame
CN110297444B (en) Programmed single chip microcomputer with WiFi module
CN110147058B (en) Borrow singlechip timing chip of wiFi module
CN110297445B (en) Micro-control electric appliance with WiFi plugging module
CN110367594A (en) A kind of single wire communication circuit for obtaining tobacco tar information, method and electronic cigarette
CN107526606B (en) System and method for realizing chip power-on time self-adaptive control in writer
WO2021243944A1 (en) Electronic atomization device and control circuit therefor
CN110187656B (en) Electrical appliance with timing function by means of WiFi plug-in
CN209928235U (en) External equipment and system for refrigerator
Burroughs X-10 home automation using the PIC16F877A
CN203520299U (en) Timer-power-on control circuit
CN209560317U (en) Intelligent radio switching system based on Android control
CN202396043U (en) Self-controllable television state indicator lamp system
CN103368016B (en) A kind of intelligent socket that can control socket connecting and disconnecting
CN206557557U (en) A kind of smart home power consumption control equipment based on Internet of Things
CN206803431U (en) A kind of air-conditioning remote control based on Bluetooth technology
CN220750188U (en) Timing automatic fire-closing device for gas range
CN206672086U (en) STC single-chip microcomputers are downloaded and proper communication adaptive circuit automatically
CN109445302A (en) A kind of electric appliance intelligent controlling device and system with Music alarm clock
CN221551318U (en) Intelligent air conditioner controller with controllable shielding function of user remote controller

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201016

CF01 Termination of patent right due to non-payment of annual fee