Sawtooth wave signal generation method based on single-chip microcomputer and wireless signal shielding device
Through the sawtooth wave signal generation method based on a microcontroller, the problem of insufficient sawtooth wave linearity of the traditional wireless signal shield is solved, and a higher quality sweep signal and a more flexible system design are realized.
Patent Information
- Application Number
- CN202411698501.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-04-08
AI Technical Summary
The linearity of sawtooth waves generated by the traditional wireless signal shield using a 555 timer is not ideal, which affects the quality of the sweeping signal, and has a complex circuit structure, high cost and poor flexibility.
The sawtooth wave signal generation method based on the microcontroller is adopted to generate sawtooth wave signals through multiple IO ports of the microcontroller, which achieves more precise timing control and improves the linearity of the sawtooth wave signal.
It improves the linearity of the sawtooth wave signal, improves the quality of the swept frequency signal, simplifies the circuit structure, reduces costs, and enhances the flexibility of the system.
Smart Images

Figure CN119781578A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of wireless signal shielding, and in particular to a sawtooth wave signal generation method based on a single chip microcomputer and a wireless signal shielding device. Background Art
[0002] With the rapid development and widespread application of wireless communication technology, the demand for wireless signal shielding technology in specific occasions is also increasing. Traditional wireless signal jammers usually use a 555 timer to generate a sawtooth wave to control the voltage-controlled oscillator (VCO) to generate a sweep signal, thereby shielding wireless signals in a specific frequency band. However, this method has the following problems: The linearity of the sawtooth wave generated by the 555 timer is not ideal, which affects the quality of the sweep signal. The traditional circuit structure is complex, the number of components is large, and the hardware cost is relatively high. Lack of flexibility makes it difficult to quickly adjust and optimize according to actual needs. Summary of the invention
[0003] In view of the above problems, the present application provides a sawtooth wave signal generation method based on a single chip microcomputer and a wireless signal shielding device to solve the problem that the sawtooth wave linearity generated by the 555 timer used in the existing wireless signal shielding device is not ideal, which affects the quality of the sweep signal.
[0004] To achieve the above object, the inventor provides a method for generating a sawtooth wave signal based on a single chip microcomputer, comprising the following steps:
[0005] S110: Initialize the single-chip microcomputer and configure the first IO port, the second IO port and the third IO port of the single-chip microcomputer to output mode;
[0006] S120: Setting the initial state, setting the first IO port, the second IO port and the third IO port to a low level;
[0007] S130: Enter the main loop;
[0008] S140: Setting the first delay time T1 to a first preset time and the second delay time T2 to 0 ns;
[0009] S150: setting the first IO port, the second IO port and the third IO port to a high level;
[0010] S160: Delay for a first delay time T1, and set the first IO port to a low level;
[0011] S170: Delaying for a second delay time T2, setting the first IO port, the second IO port and the third IO port to a low level;
[0012] S180: Subtract the second preset time from the first delay time T1, and increase the second delay time T2 by the second preset time;
[0013] S190 determines whether the first delay time T1 is Ons;
[0014] If yes, return to step S140;
[0015] If not, return to step S150;
[0016] S1100: The square waves outputted from the first IO port, the second IO port and the third IO port of the single chip are filtered by an RC filter circuit to obtain a sawtooth wave signal.
[0017] In some embodiments, the following steps are also included:
[0018] The single chip microcomputer obtains the delay parameter through the fourth IO port, and configures the first preset time and the second preset time according to the delay parameter.
[0019] Another technical solution is provided, a wireless signal shielding device based on a single chip microcomputer, comprising:
[0020] A single chip microcomputer, the single chip microcomputer comprises a first IO port, a second IO port and a third IO port, the single chip microcomputer is used to output a square wave through the first IO port, the second IO port and the third IO port according to the sawtooth wave signal generation method described above;
[0021] An RC filter circuit, wherein the RC filter circuit is used to generate a sawtooth wave signal after performing RC filtering on the square wave output by the single-chip microcomputer;
[0022] A voltage-controlled oscillator, the voltage-controlled oscillator is used to receive the sawtooth wave signal sent by the RC filter circuit, and generate a radio frequency signal of a corresponding frequency according to the voltage change of the received sawtooth wave signal;
[0023] An antenna module is used to send a radio frequency signal generated by a voltage-controlled oscillator.
[0024] In some embodiments, it also includes:
[0025] A radio frequency amplification module is provided between the voltage-controlled oscillator and the antenna module, and is used to amplify the radio frequency signal generated by the voltage-controlled oscillator.
[0026] In some embodiments,
[0027] The RC filter circuit includes a first resistor, a second resistor and a capacitor;
[0028] One end of the first resistor is connected to the first IO port of the single-chip microcomputer, and the other end of the first resistor is connected to one end of the second resistor, the second IO port of the single-chip microcomputer and one end of the capacitor;
[0029] The other end of the first resistor is connected to the voltage controlled oscillator and the third IO port;
[0030] The other end of the capacitor is grounded.
[0031] In some embodiments, the single chip microcomputer further includes:
[0032] The fourth IO port, the single chip microcomputer is used to receive an external control signal through the fourth IO port, and adjust the delay parameter according to the external control signal.
[0033] In some embodiments, it also includes:
[0034] A switch tube, wherein a source end of the switch tube is connected to a power supply, and a drain end of the switch tube is connected to a power input end of the voltage-controlled oscillator;
[0035] The single chip microcomputer further includes a fifth IO port, and the fifth IO port of the single chip microcomputer is connected to the enable end of the switch tube.
[0036] In some embodiments, the switch tube is a MOS tube.
[0037] In some embodiments, the operating frequency range of the voltage controlled oscillator is 2.2 GHz to 2.5 GHz.
[0038] In some embodiments, a display screen is also included, and the display screen is connected to the single chip microcomputer.
[0039] Different from the prior art, the above technical solution, when the single-chip microcomputer multiple IO ports control the RC filter circuit to generate a sawtooth wave signal, first initialize the single-chip microcomputer, and configure the first IO port, the second IO port and the third IO port of the single-chip microcomputer to the output mode, then set the initial state, set the first IO port, the second IO port and the third IO port of the single-chip microcomputer to a low level, enter the main loop, configure the first delay time T1 and the second delay time, then set the first IO port, the second IO port and the third IO port to a high level, and then after delaying the first delay time, set the first IO port to a low level, and after delaying the second delay time, set the first IO port, the second IO port and the third IO port to a low level, and then subtract the second preset time from the first delay time T1 to obtain a new first delay time. The first delay time T1 and the second delay time T2 are added to the second preset time to obtain a new second delay time T2, and then the first IO port, the second IO port and the third IO port are set to a high level again, and after delaying the first delay time, the first IO port is set to a low level, and after delaying the second delay time, the first IO port, the second IO port and the third IO port are set to a low level, and the cycle continues. When the first delay time T1 is reduced to 0ns, the first delay time T1 is reconfigured to the first preset time and the second delay time T2 is configured to be 0ns, and a new cycle begins. Compared with the traditional 555 timer to generate a sawtooth wave signal, the sawtooth wave signal is generated based on the single-chip microcomputer. Through software control, more precise timing control can be achieved, thereby improving the linearity of the sawtooth wave signal.
[0040] The above-mentioned records related to the invention content are only an overview of the technical solution of the present application. In order to enable ordinary technicians in the field to more clearly understand the technical solution of the present application, and then implement it according to the text of the specification and the contents recorded in the drawings, and to make the above-mentioned purpose and other purposes, features and advantages of the present application easier to understand, the following is an explanation in combination with the specific implementation mode and drawings of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings are only used to illustrate the principles, implementation methods, applications, characteristics and effects of the specific embodiments of the present application and other related contents, and shall not be considered as limitations of the present application.
[0042] In the drawings of the specification:
[0043] Figure 1 A schematic flow chart of a method for generating a sawtooth wave signal based on a single chip microcomputer according to a specific implementation method;
[0044] Figure 2 A structural schematic diagram of a wireless signal jammer based on a single chip microcomputer described in a specific implementation method;
[0045] Figure 3A schematic diagram of a circuit principle of a wireless signal jammer based on a single chip microcomputer described in a specific implementation method;
[0046] Figure 4 It is a schematic diagram of the working process of starting signal shielding of the single chip microcomputer described in the specific implementation method;
[0047] Figure 5 This is a schematic diagram of a sawtooth wave signal waveform generated by a single chip microcomputer described in a specific implementation method.
[0048] The reference numerals in the above drawings are described as follows:
[0049] 210, single chip microcomputer,
[0050] 220, voltage controlled oscillator,
[0051] 230, antenna module,
[0052] 240. Radio frequency amplification module. DETAILED DESCRIPTION
[0053] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0054] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0055] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0056] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0057] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0058] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0059] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0060] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0061] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0062] See also Figure 1 This embodiment provides a method for generating a sawtooth wave signal based on a single chip microcomputer, comprising the following steps:
[0063] S110: Initialize the single-chip microcomputer and configure the first IO port, the second IO port and the third IO port of the single-chip microcomputer to output mode;
[0064] S120: Setting the initial state, setting the first IO port, the second IO port and the third IO port to a low level;
[0065] S130: Enter the main loop;
[0066] S140: Setting the first delay time T1 to a first preset time and the second delay time T2 to 0 ns;
[0067] S150: setting the first IO port, the second IO port and the third IO port to a high level;
[0068] S160: Delay for a first delay time T1, and set the first IO port to a low level;
[0069] S170: Delaying for a second delay time T2, setting the first IO port, the second IO port and the third IO port to a low level;
[0070] S180: Subtract the second preset time from the first delay time T1, and increase the second delay time T2 by the second preset time;
[0071] S190: Determine whether the first delay time T1 is Ons;
[0072] If yes, return to step S140;
[0073] If not, return to step S150.
[0074] S1100: The square waves outputted from the first IO port, the second IO port and the third IO port of the single chip are filtered by an RC filter circuit to obtain a sawtooth wave signal.
[0075] When multiple IO ports of a single-chip microcomputer control an RC filter circuit to generate a sawtooth wave signal, the single-chip microcomputer is first initialized, and the first IO port, the second IO port and the third IO port of the single-chip microcomputer are configured as output mode, and then the initial state is set, the first IO port, the second IO port and the third IO port of the single-chip microcomputer are set to a low level, and the main loop is entered, and the first delay time T1 and the second delay time are configured, and then the first IO port, the second IO port and the third IO port are set to a high level, and then after the first delay time is delayed, the first IO port is set to a low level, and after the second delay time is delayed, the first IO port, the second IO port and the third IO port are set to a low level, and then the first delay time T1 is subtracted from the second preset time to obtain a new first delay time and second delay time T1. 2 plus the second preset time to obtain a new second delay time T2, and then the first IO port, the second IO port and the third IO port are set to a high level again, and after the first delay time is delayed, the first IO port is set to a low level, and after the second delay time is delayed, the first IO port, the second IO port and the third IO port are set to a low level, and the cycle continues. When the first delay time T1 is reduced to 0ns, the first delay time T1 is reconfigured to the first preset time and the second delay time T2 is configured to 0ns, and a new cycle begins. Compared with the traditional 555 timer to generate a sawtooth wave signal, the RC circuit based on the single-chip microcomputer control generates a sawtooth wave signal. Through software control, more precise timing control can be achieved, thereby improving the linearity of the sawtooth wave signal.
[0076] In some embodiments, the following steps are also included:
[0077] The single chip microcomputer obtains the delay parameter through the fourth IO port, and configures the first preset time and the second preset time according to the delay parameter.
[0078] The single chip microcomputer obtains the delay parameter through the fourth IO port, and can configure the first preset time and the second preset time according to the delay parameter, thereby conveniently adjusting the frequency and slope of the sawtooth wave signal.
[0079] See also Figure 2-3 , a wireless signal shielding device based on a single chip microcomputer, comprising:
[0080] The single-chip microcomputer 210 includes a first IO port, a second IO port and a third IO port. The single-chip microcomputer 210 is used to output a square wave through the first IO port, the second IO port and the third IO port according to the sawtooth wave signal generation method in the above embodiment; wherein the single-chip microcomputer 210 adopts the STC8G1K08A single-chip microcomputer 210, which has the characteristics of low power consumption and high performance, and is very suitable for use in portable devices.
[0081] An RC filter circuit, wherein the RC filter circuit is used to generate a sawtooth wave signal after performing RC filtering on the square wave output by the single-chip microcomputer;
[0082] A voltage-controlled oscillator 220, wherein the voltage-controlled oscillator 220 is used to receive the sawtooth wave signal sent by the RC filter circuit, and generate a radio frequency signal of a corresponding frequency according to a voltage change of the received sawtooth wave signal;
[0083] The antenna module 230 is used to send the radio frequency signal generated by the voltage-controlled oscillator 220 .
[0084] A sawtooth wave signal is generated through the first IO port, the second IO port and the third IO port of the single-chip microcomputer 210, and then input into the voltage-controlled oscillator 220. The voltage-controlled oscillator 220 generates a radio frequency signal of a corresponding frequency according to the voltage change of the received sawtooth wave signal, and then sends a high-frequency square wave signal through the antenna module 230. Wireless signals can be shielded in various scenarios where wireless signals need to be shielded. Compared with the traditional 555 timer generating sawtooth wave signals, the single-chip microcomputer 210 is used to control the generation of sawtooth wave signals. Through software control, more precise timing control can be achieved, thereby improving the linearity of the sawtooth wave signal.
[0085] In some embodiments, it also includes:
[0086] The RF amplification module 240 is disposed between the voltage-controlled oscillator 220 and the antenna module 230, and is used to amplify the high-frequency square wave signal generated by the voltage-controlled oscillator 220. The antenna module 230 is connected to the RF module via the SMA WiFI antenna interface.
[0087] The radio frequency signal generated by the voltage-controlled oscillator 220 is amplified by the radio frequency amplification module 240, so that the shielding range can be improved. The radio frequency amplification model uses the NGA-589 radio frequency amplifier chip, which has the characteristics of high gain and low noise, and is very suitable for amplifying radio frequency signals in the 2.4GHz frequency band. The signal power after amplification can reach 20dBm, which is enough to shield the wireless signal in the target area, and the shielding distance can be up to 3 meters.
[0088] In some embodiments, the RC filter circuit includes a first resistor R10, a second resistor R0 and a capacitor C0;
[0089] One end of the first resistor R10 is connected to the first IO port of the single chip computer 210, and the other end of the first resistor R10 is connected to one end of the second resistor R0, the second IO port of the single chip computer 210 and one end of the capacitor C0;
[0090] The other end of the first resistor R10 is connected to the voltage controlled oscillator 220 and the third IO port;
[0091] The other end of the capacitor C0 is grounded.
[0092] The single chip microcomputer 210 controls the RC circuit to generate a sawtooth wave signal waveform (the input end of the signal generator (VCO)) as shown in FIG. Figure 5 The first IO port P3.2 outputs a PWM with a gradually increasing positive duty cycle (such as Figure 5 (c) shows that the waveform of the signal after being directly filtered by the RC filter circuit (disconnecting the P3.3 and P5.4 pins) is as follows Figure 5 As shown in (a), it can be seen that the sawtooth wave has a discharge time of about 1μs. According to circuit theory, when the duty cycle of the first IO port P3.2 is 100%, the second IO port P3.3 and the third IO port P5.4 output low level (such as Figure 2 The waveform after superimposing the filtering is shown in Figure 2. The waveform after filtering by the RC filtering circuit is shown in Figure 2. Figure 5 As shown in (b), the sawtooth wave can be instantly pulled down to a low level at the maximum point. The experimental results show that a regular sawtooth wave signal can be generated through the control of the RC filter circuit and software program.
[0093] In some embodiments, the single chip microcomputer 210 further includes:
[0094] The fourth IO port, the single chip microcomputer 210 is used to receive an external control signal through the fourth IO port and serial communication, and adjust the delay parameter according to the external control signal.
[0095] The single-chip microcomputer 210 receives an external control signal through the fourth IO port. The single-chip microcomputer 210 can adjust delay parameters, such as the first preset time and the second preset time, according to the received external signal, to adjust the frequency and slope of the sawtooth wave signal.
[0096] In some embodiments, it also includes:
[0097] A switch tube Q1, wherein a source end of the switch tube Q1 is connected to a power source, and a drain end of the switch tube Q1 is connected to a power input end of the voltage-controlled oscillator 220;
[0098] The single chip microcomputer 210 further includes a fifth IO port, and the fifth IO port of the single chip microcomputer 210 is connected to the enable terminal of the switch tube Q1.
[0099] The single-chip microcomputer 210 can control the power supply of the voltage-controlled oscillator 220 through the fifth IO port to achieve the standby energy-saving effect. When wireless signal shielding is required, the single-chip microcomputer 210 controls the switch tube Q1 to be turned on through the fifth IO port, thereby making the voltage-controlled oscillator 220 work. When wireless signal shielding is not required, the single-chip microcomputer 210 controls the switch tube Q1 to be turned off through the fifth IO port, and the voltage-controlled oscillator 220 enters the standby mode. The switch tube Q1 is a MOS tube. In other embodiments, the switch tube Q1 can also use other types of transistors, such as triodes, insulated gate bipolar transistors IGTBs, etc.
[0100] In some embodiments, the operating frequency range of the voltage controlled oscillator 220 is 2.2 GHz to 2.5 GHz. The operating frequency range of the voltage controlled oscillator 220 is 2.2 GHz to 2.5 GHz, covering the common Wi-Fi and Bluetooth signal frequency bands in this frequency band.
[0101] In some embodiments, a display screen is also included, and the display screen is connected to the single chip computer 210. The working state of the wireless signal shielding device, the shielded signal frequency, etc. can be displayed on the display screen.
[0102] In some embodiments, a wireless signal shielding device based on a single chip microcomputer 210 mainly includes the following modules: a single chip microcomputer 210 module, a voltage controlled oscillator 220 module, a radio frequency amplification module 240, an antenna module 230, a power module 50 and a display module. The hardware circuit schematic diagram of the wireless signal shielding device is shown in FIG. Figure 2 shown.
[0103] The single-chip microcomputer 210 module adopts the STC8G1K08A single-chip microcomputer 210, which has the characteristics of low power consumption and high performance, and is very suitable for portable devices. In this embodiment, the three I / O ports (P3.3, P3.2 and P5.4) of the single-chip microcomputer 210 module are used to control the generation of a high-linearity sawtooth wave signal. In addition, an I / O port (P3.1) is used to receive an external control signal to adjust the parameters of the sawtooth wave signal, and an I / O port (P5.5) is used to control the VOC power supply to achieve a standby energy saving effect.
[0104] The voltage controlled oscillator 220 module receives the sawtooth wave signal generated by the single chip microcomputer 210 module, and generates a high frequency square wave signal of a corresponding frequency according to the voltage change of the signal. The voltage controlled oscillator 220 used in this embodiment has an operating frequency range of 2.2 GHz to 2.5 GHz, covering the common Wi-Fi and Bluetooth signal bands in this frequency band.
[0105] The RF amplifier module 240 uses the NGA-589 RF amplifier chip, which has the characteristics of high gain and low noise, and is very suitable for RF signal amplification in the 2.4GHz band. The signal power after amplification can reach 20dBm, which is enough to shield the wireless signal in the target area, and the shielding distance can be up to 3 meters.
[0106] The antenna module 230 uses an omnidirectional antenna to transmit the amplified radio frequency signal. The gain of the antenna is 3dBi, which can achieve a good signal coverage effect.
[0107] The power supply module provides a stable working voltage for the entire system. In this embodiment, a lithium battery is used for power supply, and a DC-DC conversion circuit is used to generate different voltages required by each module.
[0108] The display module uses a serial port display screen to display the current working status and parameter information, such as working frequency, output power, etc.
[0109] 1. By using the I / O port of the single-chip microcomputer 210 with a simple RC circuit to replace the traditional 555 timer, the linearity of the sawtooth wave signal is greatly improved, thereby improving the quality of the sweep signal and improving the signal shielding effect;
[0110] 2. Simplified the circuit structure, reduced the number of components and reduced costs.
[0111] 3. The programmable characteristics of the single chip microcomputer 210 are utilized to enhance the flexibility of the system and to quickly adjust and optimize the working parameters according to actual needs.
[0112] 4. The NGA-589 RF amplifier chip is used to effectively shield wireless signals in the 2.4GHz frequency band.
[0113] The following describes in detail how the microcontroller 210 module generates a sawtooth wave signal with high linearity.
[0114] like Figure 4 The schematic diagram of the workflow of the single chip microcomputer 210 starting signal shielding is shown. When the wireless signal shielding device starts working, each module is initialized and waits for serial port instructions. When it is in standby mode, it enters standby mode. In standby mode, IO ports P3.2, P3.3 and P5.4 output low level, and IO port P5.5 outputs high level; when the signal shielding work is turned on, IO port P3.2 outputs PWM with a duty cycle from 0% to 100%, IO ports P3.3 and P5.4 output high level, and when the IO port P3.2 output duty cycle reaches 100%, IO ports P3.3 and P5.4 output low level. The specific process of generating sawtooth wave signal by single chip microcomputer 210 mainly includes the following steps:
[0115] S1: Initialize the microcontroller 210 and configure four I / O ports (P3.2, P3.3, P5.4 and P5.5) to output mode;
[0116] S2: Set the initial state, set P3.2, P3.3, and P5.4 to low level;
[0117] S3: Enter the main loop;
[0118] S4: The initial value of variable T1 is set to 1500ns, and the initial value of variable T2 is set to 0ns
[0119] S5: Set P3.2, P3.3, and P5.4 to high level;
[0120] S6: Delay T1 time (from 1500ns to 0);
[0121] S7: Set P3.3 to low level;
[0122] S8: Delay T2 time (0 to 1500ns);
[0123] S9: Set P3.3 to high level;
[0124] S10: When T1 decreases to 0, P3.2, P3.3, and P5.4 are set to low level at the same time;
[0125] S11: T2 increases by 10ns, T1 decreases by 10ns;
[0126] S12: When T1 decreases to 0, return to step S4 and recycle
[0127] S13: Return to step S5 and continue the cycle.
[0128] In the above process, by precisely controlling the switch timing and delay time of the three I / O ports, the output signal can generate an approximately ideal sawtooth wave signal after passing through the RC filter circuit. Compared with the traditional 555 timer solution, this method has the following advantages:
[0129] 1. Software generates sawtooth wave signal: through software control, more precise timing control can be achieved, thereby improving the linearity of the sawtooth wave;
[0130] 2. More adjustable: By modifying the delay parameters in the program, the frequency and slope of the sawtooth wave can be easily adjusted;
[0131] 3. Better temperature stability: The clock source of the microcontroller 210 usually uses a crystal oscillator, which has better temperature stability than the RC circuit in the 555 timer.
[0132] The single chip microcomputer 210 controls the generation of the sawtooth wave signal waveform (the input end of the signal generator (VCO)) as follows Figure 5 shown. Figure 5 In the figure, (a) is the output waveform of a single I / O port (P3.2) after filtering. (b) is the output waveform of a single I / O port (P3.2) combined with I / O ports P3.3 and P5.4 after superimposition filtering. (c) is the PWM output of P3.2 with a duty cycle from 0 to 100%. (d) is a sawtooth waveform diagram generated by using the microcontroller 210 to control multiple cycles. I / O port P3.2 outputs a PWM with a positive duty cycle that gradually increases (such as Figure 5 (c)), the signal is directly filtered by RC (in Figure 2 The waveform after disconnecting P3.3 and P5.4 pins is as follows Figure 5 As shown in (a), it can be seen that the sawtooth wave has a discharge time of about 1μs. According to circuit theory, when the duty cycle of I / O port P3.2 is 100%, P3.3 and P5.4 output low level (such as Figure 3 As shown), the output waveform after superposition filtering, the waveform after RC filtering is as follows Figure 5 As shown in (b), the sawtooth wave can be instantly pulled down to a low level at the maximum point. The experimental results show that a regular sawtooth wave signal can be generated through the control of the RC filter circuit and software program.
[0133] In order to further improve the flexibility of the system, this embodiment also receives an external control signal through the P3.1 port. Through this signal, the following functions can be achieved:
[0134] 1. Adjust the frequency of the sawtooth wave: By changing the value of the delay parameters T1~T4, the frequency of the sawtooth wave can be adjusted;
[0135] 2. Adjust the frequency sweep range: By changing the level variation range of P1.0 to P1.2, the amplitude of the sawtooth wave can be adjusted, thereby changing the frequency sweep range of the voltage-controlled oscillator 220;
[0136] 3. Turn on / off the shielding function: By controlling whether the single-chip microcomputer 210 outputs a sawtooth wave signal, the shielding function can be turned on and off.
[0137] In practical applications, the wireless signal shielding device of the present invention can be optimized according to different usage scenarios. For example:
[0138] 1. Meeting room scenario: The scanning frequency range can be limited to 2.4GHz~2.4835GHz, specifically shielding Wi-Fi signals;
[0139] 2. Examination scene: the scanning frequency range can be expanded to 2.4GHz~2.5GHz, while shielding Wi-Fi and Bluetooth signals;
[0140] 3. Special places: The working parameters can be dynamically adjusted through external control signals to achieve precise shielding of signals in specific frequency bands.
[0141] The wireless signal shielding device of the present invention can also be optimized and expanded as follows:
[0142] 1. Multi-band shielding: By adding an additional voltage-controlled oscillator 220 and a radio frequency amplifier module 240, it is possible to simultaneously shield multiple frequency bands, such as shielding 2.4GHz and 5GHz Wi-Fi signals;
[0143] 2. Intelligent control: Combined with environmental perception technology, it can realize the function of automatically adjusting the output power according to the surrounding signal strength, which not only ensures the shielding effect but also reduces energy consumption;
[0144] 3. Network management: By adding wireless communication modules, network management of multiple devices can be achieved, which is suitable for signal shielding needs in large places.
[0145] The whole device adopts a compact design, small size, easy to carry and concealed installation. The main components are all surface mounted, which improves the reliability and anti-interference ability of the product.
[0146] The wireless signal shielding device of the present invention performs well in actual tests. In the 2.4GHz frequency band, within 3 meters of the device, it effectively blocks the connection between the wireless device and the access point. At the same time, due to the use of sweep frequency technology, the interference to the legal frequency band is small, which meets the requirements of relevant regulations.
[0147] It should be noted that the specific implementation of the present invention is not limited to the above-mentioned embodiments. Those skilled in the art can make various modifications and improvements based on the technical solution of the present invention, and these modifications and improvements should fall within the protection scope of the present invention.
[0148] In addition, the wireless signal shielding device of the present invention should be used in compliance with relevant laws and regulations and only in permitted occasions and scopes.
[0149] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.
Claims
1. A method for generating a sawtooth wave signal based on a single chip microcomputer, characterized in that: The following steps are involved: S110: Initialize the single-chip microcomputer and configure the first IO port, the second IO port and the third IO port of the single-chip microcomputer to output mode; S120: Setting the initial state, setting the first IO port, the second IO port and the third IO port to a low level; S130: Enter the main loop; S140: Setting the first delay time T1 to a first preset time and the second delay time T2 to 0 ns; S150: setting the first IO port, the second IO port and the third IO port to a high level; S160: Delay for a first delay time T1, and set the first IO port to a low level; S170: Delaying for a second delay time T2, setting the first IO port, the second IO port and the third IO port to a low level; S180: Subtract the second preset time from the first delay time T1, and increase the second delay time T2 by the second preset time; S190 determines whether the first delay time T1 is Ons; If yes, return to step S140; If not, return to step S150; S1100: The square waves outputted from the first IO port, the second IO port and the third IO port of the single chip are filtered by an RC filter circuit to obtain a sawtooth wave signal.
2. The method for generating a sawtooth wave signal based on a single chip microcomputer according to claim 1, characterized in that: The following steps are also included: The single chip microcomputer obtains the delay parameter through the fourth IO port through serial communication, and configures the first preset time and the second preset time according to the delay parameter.
3. A wireless signal shielding device based on a single chip microcomputer, characterized in that: include: A single chip microcomputer, the single chip microcomputer comprising a first IO port, a second IO port and a third IO port, the single chip microcomputer is used for outputting square waves through the first IO port, the second IO port and the third IO port according to the sawtooth wave signal generation method according to any one of claims 1 to 2; An RC filter circuit, wherein the RC filter circuit is used to generate a sawtooth wave signal after performing RC filtering on the square wave output by the single-chip microcomputer; A voltage-controlled oscillator, the voltage-controlled oscillator is used to receive the sawtooth wave signal sent by the RC filter circuit, and generate a radio frequency signal of a corresponding frequency according to the voltage change of the received sawtooth wave signal; An antenna module is used to send a radio frequency signal generated by a voltage-controlled oscillator.
4. The wireless signal shielding device based on a single chip microcomputer according to claim 3 is characterized in that: Also includes: A radio frequency amplification module is provided between the voltage-controlled oscillator and the antenna module, and is used to amplify the radio frequency signal generated by the voltage-controlled oscillator.
5. The wireless signal shielding device based on a single chip microcomputer according to claim 3 is characterized in that: The RC filter circuit includes a first resistor, a second resistor and a capacitor; One end of the first resistor is connected to the first IO port of the single-chip microcomputer, and the other end of the first resistor is connected to one end of the second resistor, the second IO port of the single-chip microcomputer and one end of the capacitor; The other end of the first resistor is connected to the voltage controlled oscillator and the third IO port; The other end of the capacitor is grounded.
6. The wireless signal shielding device based on a single chip microcomputer according to claim 3 is characterized in that: The single chip microcomputer also includes: The fourth IO port, the single chip microcomputer is used to receive an external control signal through the fourth IO port, and adjust the delay parameter according to the external control signal.
7. The wireless signal shielding device based on a single chip microcomputer according to claim 3 is characterized in that: Also includes: A switch tube, wherein a source end of the switch tube is connected to a power supply, and a drain end of the switch tube is connected to a power input end of the voltage-controlled oscillator; The single chip microcomputer further includes a fifth IO port, and the fifth IO port of the single chip microcomputer is connected to the enable end of the switch tube.
8. The wireless signal shielding device based on a single chip microcomputer according to claim 7 is characterized in that: The switch tube is a MOS tube.
9. The wireless signal shielding device based on a single chip microcomputer according to claim 3 is characterized in that: The operating frequency range of the voltage controlled oscillator is 2.2 GHz to 2.5 GHz.
10. The wireless signal shielding device based on single chip microcomputer according to claim 3 is characterized in that: It also includes a display screen, which is connected to the single chip microcomputer.