CN110297444B - Programmed single chip microcomputer with WiFi module - Google Patents

Programmed single chip microcomputer with WiFi module Download PDF

Info

Publication number
CN110297444B
CN110297444B CN201910406743.1A CN201910406743A CN110297444B CN 110297444 B CN110297444 B CN 110297444B CN 201910406743 A CN201910406743 A CN 201910406743A CN 110297444 B CN110297444 B CN 110297444B
Authority
CN
China
Prior art keywords
module
wifi
esp
computer
programmed
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.)
Active
Application number
CN201910406743.1A
Other languages
Chinese (zh)
Other versions
CN110297444A (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.)
Hangzhou Hexue Education Technology Co ltd
Original Assignee
Hangzhou Hexue Education Technology Co ltd
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 Hangzhou Hexue Education Technology Co ltd filed Critical Hangzhou Hexue Education Technology Co ltd
Priority to CN201910406743.1A priority Critical patent/CN110297444B/en
Publication of CN110297444A publication Critical patent/CN110297444A/en
Application granted granted Critical
Publication of CN110297444B publication Critical patent/CN110297444B/en
Active 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/10Program control for peripheral devices
    • G06F13/12Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
    • G06F13/124Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
    • 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
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Automation & Control Theory (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a programmed singlechip with WiFi module, which is generally applied by self programming, but is additionally connected with ESP-12WiFi module for typical application of some singlechips, WiFi is connected with a mobile phone or a computer, and the singlechip is individually set with the convenience of operation of the mobile phone or the computer, and is equivalent to a programming customization function to a certain extent. The present invention proposes such a mode: the single chip microcomputer is connected with the ESP-12 through an I2C interface, and the ESP-12 is designed into a WiFi module and is only used when being on-line and is not used at ordinary times. The single chip microcomputer control system omits a display screen and a keyboard, and only one key and one or two working state indicating LED lamps are needed, so that the structure is simple, and the cost is reduced. And emphasizes the relevant technical data of the open script program or the online cloud service, so that the single chip microcomputer chip becomes a universal chip, and a user can arrange a setting interface by self.

Description

Programmed single chip microcomputer with WiFi module
Technical Field
The invention relates to the technical field of automatic control of electric appliances, in particular to a programmed singlechip with 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 beyond the technical content of typical application of the single chip microcomputer, but the situation does not exist along with the popularization of an ESP-12WiFi single chip microcomputer (ESP8266) module. The singlechip is conveniently arranged by a mobile phone or a computer, and is also equivalent to programming customization to a certain extent, and a new singlechip + WiFi application mode comes and can be added into the emerging network cloud service trend.
Disclosure of Invention
Based on the above background art, the present invention provides a programmed single chip microcomputer with WiFi module.
The technical scheme adopted by the invention is as follows: a programmed singlechip borrows WiFi module, the programmed singlechip carries out function setting on the programmed singlechip through a matched WiFi connection module by means of a mobile phone or a computer before use;
the programmed singlechip is provided with an I2C (slave) two-wire serial bus interface for connecting a matched WiFi connection module, and the function parameter setting or the working parameter checking of a mobile phone or a computer is realized;
the matched WiFi connection module is an ESP-12WiFi module, the ESP-12WiFi module is programmed to define a two-wire serial bus interface with an I2C (master) and is used for connecting an I2C (slave) interface of the programmed single chip microcomputer, the WiFi connection module is connected only when the set function needs to be changed or the working parameters need to be checked, and the single chip microcomputer does not work at ordinary times without the WiFi connection module;
the ADC port of the ESP-12 in the matched WiFi connection module is used for displaying a detected (0-3.3V) voltage value;
the data in the single chip microcomputer is actively transmitted to a mobile phone or a computer by adopting (I2C) SSE server push technology of informing ESP-12 and HTML5+ JS of interruption on an SCL;
the programmed singlechip 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 working parameters and preventing the set working parameters from being lost when power is cut off;
when the programmed singlechip breaks away from the WiFi connection module and works, only one starting key and one or two working state indicating LED lamps 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, and multifunctional selective starting is realized by combining with the working state indicating LED lamp; the IO ports of the singlechip are respectively connected with the starting key and the working state indicating LED lamp;
WiFi connection is adopted for the mobile phone or computer WiFi connection ESP-12 module, 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 set or designated by a wireless router DHCP; third-party network services are not involved, and connection through an external network is not needed.
Further, the method for connecting the ESP-12 module by the WiFi of the mobile phone or the computer is as follows:
before the programmed singlechip works and starts, function setting is carried out on the singlechip chip by using a mobile phone or a computer, 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, a browser is opened to access 196.168.4.1, and after an operation interface is entered, function setting can be carried out; then, the local WIFI connection name and the password of the wireless router 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; recording the used (DHCP) IP address (196.168.0.103) after the setting is successful, and then connecting the mobile phone or the computer with the original local WIFI without entering a wireless network for finding ESP-12 connection, and when the mobile phone or the computer needs to be set online, only accessing the recorded IP (DHCP)196.168.0.103 by a browser;
entering a mobile phone or computer setting interface, and having dynamic operation prompts including direct test effect or setting confirmation; after the setting is satisfied, the WiFi connecting module is removed, and the starting and stopping work in the later use can be realized only by pressing a starting key connected with the single chip microcomputer and observing a working state indicating LED lamp.
Furthermore, the programmed singlechip has multiple functions on the premise that the pin functions are not in conflict and the internal resources are allowed, and a user does not need to reprogram the programmed singlechip, specifically starts which function and sets through an I2C interface byte command, namely, the function setting of the programmed singlechip is transferred to the programming of a matched ESP-12 module.
Furthermore, the ESP-12 module is programmed by NODEMCU firmware and LUA scripting language;
furthermore, the user puts forward the demand on the network, transmits the script program from the network, and the user himself swipes the script program into the matched WiFi module, and then the matched WiFi module is used for connection, so that the purpose that the programmed singlechip is set by the mobile phone or the computer in a personal satisfaction manner is achieved.
Further, the I2C (master) two-wire serial bus interface of the matched WiFi connection module comprises a plug small component designed with a five-core socket, and the arrangement of the five-core socket is specified as follows: ADC, +, SCL, SDA, -, and through the RS serial port of ESP-12 add the USB connection interface used for programming ESP-12 and connected with computer, make it become general hardware, namely: programmable WiFi to I2C (master) + ADC;
further, some micro current single chip microcomputer control devices drive the ESP-12WiFi module with power supply below 5V, and the WiFi connection module comprises a 3.7V lithium battery power supply and a charging port or a power plug.
Furthermore, considering that the user cannot immediately unplug the WiFi connection module, the WiFi connection module also enters the very low power consumption mode without operation delay, or sets the ESP-12 in the WiFi connection module to enter the very low power consumption mode by using a mobile phone or a computer, and wakes up the RST key on the ESP-12 or is unplugged and then plugged.
Furthermore, the common STC15 series single-chip microcomputer for the single-chip microcomputer comprises an 8-pin packaged single-chip microcomputer, wherein two pins P3.3(SDA) and P3.4(SCL) are used as an I2C slave (slave) communication ESP-12WiFi connection module, the two pins P3.0 and P3.1 are connected with a computer when programming is reserved, the P3.0 is used as a starting button, the P3.1 is used as an LED working state indicator lamp, and the P3.2 and P3.5 control output or P3.2 infrared code sending learning record is usually kept.
The invention has the beneficial effects that: a typical single chip microcomputer is connected with a mobile phone or a computer by a WiFi module to realize function setting, so that a display screen and a keyboard which are high in cost and occupy volume are omitted from a single chip microcomputer system, the shell is reduced, and the design is simplified. And this kind of programmed, can connect the mobile phone or computer by WiFi module to carry on the monolithic chip that the function customizes has also become the quasi-general chip, born a new user and exempted from the application mode of the programmed monolithic chip: due to the simplicity of the scripting language programming, the singlechip programming is transferred to the scripting programming, so that a user can rewrite a function setting interface (HTML5) of a mobile phone or a computer or become a network cloud service project.
Drawings
Fig. 1 is a connection diagram of an ESP-12WiFi module and an STC15 series single chip microcomputer.
Detailed Description
The method is characterized in that a singlechip is applied to connect 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 serial bus 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.
The control output may comprise high frequency PWM and varying the duty cycle may allow control to be varied continuously.
An ADC port of an ESP-12 in the WiFi connection module is used for displaying a detected (0-3.3V) voltage value and is specially used for displaying and detecting important working parameters on a mobile phone or a computer, such as working current of an air conditioner compressor (if the current is large and does not rotate, a phase-shifting capacitor is damaged), working current of an LED lamp (the working current becomes large and influences the service life), working current of a battery car charger (the charging speed is large and influences the service life), and optimal working frequency selection of an ultrasonic spray microporous sheet (a frequency value with the strongest current of the spray and stable change is selected). In general, the display detection value does not require precision as long as there is a relative change as a setting reference.
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.
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 easy to program. 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 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 view the setting at the time.
The single chip microcomputer 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. Some LED lamps do not even need to be pressed, for example, the brightness or the color tone of the LED lamps arranged on the top can be switched by gradually cutting off the power; and automatically setting actions according to the timing after the timing class is powered on.
For simple timing applications (such as a refrigerator peak-valley electricity energy-saving socket) rarely set by some end users, the ESP-12WiFi module is connected with the single chip microcomputer through only one four-core connecting wire.
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 five-core socket: two I2C communications, two positive and negative power supplies, one ADC, arranged: ADC, +, SCL, SDA, -. The existing five-core interfaces are many (for example, a mini socket of a USB, although the standard USB interface is 4 cores, the standard USB interface is 5 cores by adding a metal outer frame). Typically, a WiFi plug module is sold with a complementary programmed monolithic chip.
Because many characteristics of this kind of wiFi plug module have the commonality (general connection is seen in fig. 1), many supporting wiFi plug modules also make general product, promptly: the programmable WiFi changes I2C (master) + ADC, designs into a small plug part (similar to a larger USB disk or a bank U cycle) with a five-core socket, and specifies the arrangement of the five-core socket: ADC, + SCL SDA, and increase the USB interface that is used for programming ESP-12 and online with the computer, that is, the RS serial port of ESP-12 changes USB programming interface and actually includes three kinds of forms: (1) the direct RS serial port is connected with the RS232 serial port of the old-fashioned computer; (2) the USB interface of the computer is connected through an RS-USB converter; (3) the RS-USB conversion IC and related circuits are arranged on an ESP-12WiFi plug module and connected with a computer USB port by a USB cable. The three forms can enable a user to program the ESP-12WiFi plug-pull module through a computer, so that the ESP-12WiFi plug-pull module is universal (the user can swipe different matching programs to match different applications).
The ESP-12WiFi module programming adopts NODEMCU firmware, LUA scripting language program disclosure and HTML file disclosure (generally, the programs can be directly seen from a browser), so that teaching popularization can be realized (including gratuitous/gratuitous network cloud services), users can rewrite (scripting language, rewriting some nouns and numbers or removing some unused functions, the operation interface is particularly visual and convenient, a notebook is used without a program development environment, and program interpretation is in the NODEMCU firmware), and the operation interface is more suitable and attractive. 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 are fully disclosed through technical documents, including I2C interface byte command/parameter format and function description, singlechip pin function and connection diagram, and the personalized function can be realized by self programming.
Note that: because the STC single chip microcomputer usually needs to execute 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 operation including short pressing and long pressing, generally only an efficient assembly language (particularly an STC15 series 8-pin IC, the on-chip resources are limited, the program needs to be highly efficient and simplified), and the programming difficulty is high, the program of the STC single chip microcomputer is not popularized in teaching.
The script program writing process: the user downloads LuaLoader computer software and connects the computer through the RS serial port of the ESP-12 to the USB programming connection interface, and the LUA script language can be written into the ESP-12.
The method for connecting the ESP-12 module with the WiFi of the mobile phone or the computer comprises the following steps:
before the single chip microcomputer controls work and starts, functional parameters are set by a mobile phone or a computer, 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-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 after an operation interface is entered, function parameter setting can be carried out. 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 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 prompt or validity confirmation is provided, including immediate test effect; after the setting is satisfied, the WiFi connection module is removed, and the subsequent use (namely the on-line singlechip works at ordinary times) only needs to press a start key connected with the singlechip. For the selective starting with multiple functions, the starting key is pressed for a short time one by one, and the state of the LED of the indicator lamp is observed.
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.
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 ESP-12WiFi module, and in order to prevent the user from consuming power or occupying WiFi resources, the ESP-12WiFi module further enters a very low power consumption mode (0,4)) after no operation delay, or the ESP-12WiFi module is set to enter the very low power consumption mode by using a mobile phone or a computer. The WiFi on-line work can be continued by RST key pressing or pulling out and then plugging in and waking up of the ESP-12WiFi module.
The core of the invention is to provide application mode change caused by temporary connection of a WiFi module.
The first idea is to connect the single chip with the WiFi module temporarily by the mobile phone or the computer WiFi to realize the convenient function setting by the mobile phone or the computer (because the setting of the conventional electric appliance is troublesome, such as setting time of an electric cooker, setting time of various electronic clocks/timers, lacking of editing keyboards of digital time formats and the like), and the specific operation can be designed to have dynamic prompt just for the use of the mobile phone or the computer with high popularity rate. The mobile phone or the computer sets the singlechip in advance, so that the singlechip works or the specific function of the application appliance is started simply, namely, a singlechip system or a display screen and a keyboard on the application appliance are not needed, and only one starting button and one or two state indicating LEDs are arranged. That is to say, the system of the single chip microcomputer or the formed operation panel keyboard of the application electric appliance generally needs no keyboard, the volume is reduced, the design is simplified, and the cost is reduced.
The method is further popularized along the idea, and the programmed singlechip has multiple functions on the premise that the pin functions are not conflicted and the internal resources are allowed, so that a user does not need to reprogram the programmed singlechip, specifically, which function is started is set through an I2C interface byte command, namely, the function setting of the programmed singlechip is transferred to the programming of a matched ESP-12 module (the ESP-12 is connected with the singlechip through an I2C).
The ESP-12 module is programmed by NODEMCU firmware and LUA scripting language, is relatively easy, especially rewrites some nouns, numbers or removes some unused functions (on the premise of normal work of the existing scripting program, which is not satisfactory enough for an individual), is more intuitive and convenient, does not need a program development environment, is provided with a notebook, and can be connected with a computer at any time to write a program. Under the technical environment, sufficient technical documents and script programming descriptions are provided, including an SSE program example of HTML5+ JS, a program example of I2C (master) two-wire serial bus interface for triggering and starting byte reading in an SCL (interrupt mode), byte commands/parameter formats and function descriptions of an I2C interface, pin functions of a single chip microcomputer and a connection diagram, so that a user (generally referring to a user with a programming base) can adapt a function setting interface more suitable for the user (namely, not only the function of a programmed single chip microcomputer can be set, but also the setting interface of a mobile phone or a computer can be personalized) or more programmed single chip microcomputer applications can be matched according to the script program.
Today, where network commerce is developed, naturally also includes providing network cloud services: the user puts forward the demand on the network, transmits the script program from the network, and the user himself swipes the script program into the matched WiFi module, and then the matched WiFi module is used for connection, so that the programmed singlechip is set by the mobile phone or the computer in a personal satisfaction manner.
Two users are actually separated, one is a conventional end user (the user can use a mobile phone to set the user, and only can select from the existing operation interface), the other user is a secondary development merchant (network cloud service or a user with a programming base), and the programmed singlechip is customized according to the requirements of the end user by virtue of the familiarity of NODEMCU, LUA script language and HTML5 programming, and the matched WiFi module operation interface is adjusted, so that the program of the matched WiFi module obtained by the end user is a customized and personalized setting interface.
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 (due to lack of an editing keyboard such as a digital time format and the like), and the small keys need to be pressed repeatedly, so that the settings are not mistaken once by accident and are all the same. 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 a peak-valley power supply energy-saving socket of a refrigerator, a seedling raising timing atomizing humidification, a 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, which is the mainstream at present, and solving the problems that the brightness is reduced to the best protection if one LED lamp bead is damaged), finely adjusting the work of a battery car charger (adjusting the charging current to be safe but long in time; adding a large-current charging limit to a cheap assembled battery without a battery protection circuit), and clearly explaining the trivial settings only by using a mobile phone or a computer.
Note that such setting adjustments may include relatively complex human-computer interactions, such as selection of operating frequency of the microporous atomization sheet, where operating current is not very large and atomization is very strong due to processing differences of the microporous atomization sheet or manufacturing differences of the boost inductor, and if the operating frequency is incorrectly selected, atomization is small and current is large, and it is likely that the driving power tube is burned out, so that a user can himself or herself fine-tune 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 (plug in a matched WiFi module to operate with a mobile phone or a computer).
The invention leads out the ADC input port of the ESP-12, namely, hardware conditions are provided for realizing the functions.
The applications listed above are realized economically and simply by a programmed singlechip, and a display screen keyboard is omitted (some applications even do not need a start button and LED state indication, such as an LED dimming lamp, which is switched by successive power-off). When complex adjustment setting is rarely needed, the matched WiFi module is temporarily made on a mobile phone or a computer.
With WiFi direct, the ESP-12WiFi module includes an HTTP server, as long as the browser accesses 196.168.4.1 or 196.168.x.x (as specified by the wireless router DHCP, which may also be specified, e.g., 196.168.1.100).
The online of the mobile phone or the computer does not relate to third-party network service, does not need to register/password, does not download and install APP, and does not need to be connected through an external network, so that the online of the mobile phone or the computer is not confused with the currently blown high Internet of things, and if networking is needed, an MQTT module is arranged in the NODEMCU of the ESP-12, and the NODEMCU has the function of the Internet of things.

Claims (9)

1. A programmed singlechip borrowing a WiFi module is characterized in that the programmed singlechip sets functions through a matched WiFi connection module by means of a mobile phone or a computer before being used;
the programmed singlechip is provided with an I2C (slave) two-wire serial bus interface for connecting a matched WiFi connection module, and the function parameter setting or the working parameter checking of a mobile phone or a computer is realized;
the matched WiFi connection module is an ESP-12WiFi module, the ESP-12WiFi module is programmed to define a two-wire serial bus interface with an I2C (master) and is used for connecting an I2C (slave) interface of the programmed single chip microcomputer, the WiFi connection module is connected only when the set function needs to be changed or the working parameters need to be checked, and the single chip microcomputer does not work at ordinary times without the WiFi connection module;
an ADC port of an ESP-12 in the matched WiFi connection module is used for displaying a detection voltage value, and the detection voltage value is 0-3.3V;
the data in the single chip microcomputer is actively transmitted to a mobile phone or a computer by adopting (I2C) SSE server push technology of informing ESP-12 and HTML5+ JS of interruption on an SCL;
the programmed singlechip 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 working parameters and preventing the set working parameters from being lost when power is cut off;
when the programmed singlechip breaks away from the WiFi connection module and works, only one starting key and one or two working state indicating LED lamps are needed; the starting key operation comprises short pressing, long pressing or successive short pressing, and the multifunctional selective starting is realized by combining with the working state indicating LED lamp, wherein the short pressing time is shorter than 0.5 second, and the long pressing time is longer than 0.5 second; the IO ports of the singlechip are respectively connected with the starting key and the working state indicating LED lamp;
WiFi connection is adopted for the mobile phone or computer WiFi connection ESP-12 module, 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 set or designated by a wireless router DHCP; third-party network services are not involved, and connection through an external network is not needed.
2. The programmed singlechip microcomputer with a WiFi module of claim 1, wherein the ESP-12 module is WiFi-connected to a mobile phone or a computer in the following way:
before the programmed singlechip works and starts, function setting is carried out on the singlechip chip by using a mobile phone or a computer, 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, a browser is opened to access 196.168.4.1, and after an operation interface is entered, function setting can be carried out; then, the local WIFI connection name and the password of the wireless router 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; recording the used IP address 196.168.0.103 after the setting is successful, and then connecting the mobile phone or the computer with the original local WIFI without finding ESP-12 connection in wireless network setting, wherein when the mobile phone or the computer needs to be set online, only the recorded IP address 196.168.0.103 needs to be accessed by a browser;
entering a mobile phone or computer setting interface, and having dynamic operation prompts including direct test effect or setting confirmation; after the setting is satisfied, the WiFi connecting module is removed, and the starting and stopping work in the later use can be realized only by pressing a starting key connected with the single chip microcomputer and observing a working state indicating LED lamp.
3. The programmed singlechip via WiFi module of claim 1, wherein the programmed singlechip makes the programmed singlechip multifunctional without conflict of pin function and permission of internal resource, and the specific function is set by byte command of I2C interface, that is, the function setting of the programmed singlechip is transferred to the programming of the matched ESP-12 module.
4. The programmed monolithic computer with WiFi module of claim 1 wherein ESP-12 module is programmed using nodecu firmware and LUA scripting language.
5. The programmed singlechip borrowing WiFi module as in claim 1, wherein a user puts forward a demand on the network, a script program is transmitted from the network, the user swipes the script program into the matched WiFi module and then the matched WiFi module is used for on-line connection, and personal satisfaction is achieved by setting the programmed singlechip through a mobile phone or a computer.
6. The programmed single-chip microcomputer with a WiFi module of claim 1, wherein the I2C (master) two-wire serial bus interface of the WiFi connection module includes a plug small component with a five-core socket, and the arrangement of the five-core socket is defined as follows: ADC, +, SCL, SDA, -, and through the RS serial port of ESP-12 add the USB connection interface used for programming ESP-12 and connected with computer, make it become general hardware, namely: the programmable WiFi goes to I2C (master) + ADC.
7. The programmed monolithic computer with WiFi module as recited in claim 1, wherein some micro current monolithic computer control, its power supply below 5V drives the ESP-12WiFi module, such WiFi connection module includes 3.7V lithium battery power supply, and charging port or power plug.
8. The programmed singlechip microcomputer for lending WiFi module of claim 1, wherein considering that the user will not immediately unplug the WiFi connection module, the WiFi connection module further includes entering the very low power consumption mode without operation delay, or setting the ESP-12 in the WiFi connection module to enter the very low power consumption mode by using a mobile phone or a computer, waking up through the RST button on the ESP-12 or unplugging and then plugging in.
9. The programmed single-chip microcomputer with a WiFi module of claim 1, wherein the single-chip microcomputer is a STC15 series single-chip microcomputer, and comprises an 8-pin package, wherein two pins P3.3(SDA) and P3.4(SCL) are used as I2C slave (slave) communication ESP-12WiFi connection modules, and the two pins P3.0 and P3.1 are connected with a computer during programming, and except that the two pins P3.0 and P3.1 are used as a start button, P3.1 is used as an LED working state indicator lamp, P3.2 and P3.5 control outputs or P3.2 infrared code sending learning records at ordinary times.
CN201910406743.1A 2019-05-16 2019-05-16 Programmed single chip microcomputer with WiFi module Active CN110297444B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910406743.1A CN110297444B (en) 2019-05-16 2019-05-16 Programmed single chip microcomputer with WiFi module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910406743.1A CN110297444B (en) 2019-05-16 2019-05-16 Programmed single chip microcomputer with WiFi module

Publications (2)

Publication Number Publication Date
CN110297444A CN110297444A (en) 2019-10-01
CN110297444B true CN110297444B (en) 2020-11-13

Family

ID=68026796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910406743.1A Active CN110297444B (en) 2019-05-16 2019-05-16 Programmed single chip microcomputer with WiFi module

Country Status (1)

Country Link
CN (1) CN110297444B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113193800A (en) * 2021-04-13 2021-07-30 南昌三瑞智能科技有限公司 Rotation direction conversion method of direct-current brushless electronic speed regulator
CN114879548B (en) * 2022-03-11 2024-07-19 昆明理工大学 Intelligent remote IO station value machine panel equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281110B (en) * 2013-07-08 2017-09-29 广东美的制冷设备有限公司 The communication system of wireless communication apparatus and Internet of Things electric equipment, method
CN204086932U (en) * 2014-04-08 2015-01-07 深圳市天赐鸿业灯饰有限公司 A kind of intelligent controller
CN108649395A (en) * 2018-04-08 2018-10-12 浙江警察学院 A kind of intelligent patch panels and control method based on WiFi controls
CN109040254B (en) * 2018-08-08 2020-07-07 浙江大学 Soil humidity control box cultivated in a pot based on WIFI connects cell-phone or computer
CN109197022B (en) * 2018-09-10 2021-01-12 杭州合学教育科技有限公司 Hose water supply micropore atomising head device

Also Published As

Publication number Publication date
CN110297444A (en) 2019-10-01

Similar Documents

Publication Publication Date Title
AU2010340314B2 (en) Providing power to an accessory during portable computing device hibernation
JP3110949U (en) USB connector with card detector
CN110297444B (en) Programmed single chip microcomputer with WiFi module
CN102378048B (en) Television (TV) set top box and automatic standby method thereof
CN102368350A (en) Device and method for realizing universal type infrared remote controller based on mobile phone
US20120297217A1 (en) Power controller, power controlling device and power-saving method for power controlling device
CN106685018B (en) Reverse charging method and device and terminal
CN102912589A (en) Full-automatic washing machine without display control device and control method for full-automatic washing machine
WO2005036906A1 (en) A mobile communication terminal and it’s radio communication module
CN110297445B (en) Micro-control electric appliance with WiFi plugging module
CN110147058B (en) Borrow singlechip timing chip of wiFi module
CN103323767B (en) A kind of method and system thereof of testing bluetooth module on embedded PCB A
CN112787897A (en) Household appliance control method and water heater
CN211403175U (en) Computer remote control start-up system
CN112380076A (en) Mobile terminal performance testing method and device based on photoinduction
CN203520299U (en) Timer-power-on control circuit
CN103049068A (en) Intelligent timing multifunctional computer startup-shutdown device
CN101261534B (en) Bidirectional wireless perimeter set electricity-saving method
CN110187656B (en) Electrical appliance with timing function by means of WiFi plug-in
CN210836540U (en) Bathroom heater wireless remote controller circuit and remote controller
JP2001282425A (en) Controller for connecting remote controller
CN201185008Y (en) Control device for computer interface
JPH11191931A (en) Portable type electronic equipment and battery control method therefor
CN211086962U (en) Intelligent installing system of control switch
CN215264781U (en) Portable burning device

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