Tuning fork level switch circuit with adjustable alarm frequency function and implementation method
By designing a tuning fork level switch circuit with adjustable alarm frequency function, users can adjust the alarm frequency independently, solving the problem of unable to set the alarm frequency independently in the existing technology, and improving the flexibility of use and the system intelligence.
Patent Information
- Application Number
- CN202411920823.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-03-14
AI Technical Summary
The existing tuning fork level switch cannot set the alarm frequency independently, and users need to rely on the instrument manufacturer to make on-site changes, which leads to inconvenience in use and increases production costs.
Design a tuning fork level switch circuit with adjustable alarm frequency function, and collect the vibration frequency of the tuning fork sensor through the frequency measurement circuit, and combine the internal algorithm of the microcontroller and the alarm frequency setting circuit to realize the function of user manual fine-tuning or resetting the alarm frequency.
Improves the flexibility of use, users can adjust the alarm frequency independently, reduce maintenance costs, and enhance the intelligent and visual alarm functions of the system.
Smart Images

Figure CN119618345A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of tuning fork level switches, and in particular to a tuning fork level switch circuit with an adjustable alarm frequency function. Background Art
[0002] The tuning fork level switch causes the fork body to vibrate through the resonance of the piezoelectric crystal inside the tuning fork sensor. When the material damping effect is applied, the vibration frequency and amplitude of the fork body will change. These changes are detected by the frequency detection circuit in the circuit board, and then converted into switch signal output after being analyzed and processed by the single-chip microcomputer (MCU). The tuning fork level switch is suitable for almost all liquid media, and is not affected by foam, eddy current, and gas. It is also suitable for measuring medium-density solid powder or particles that can flow freely, and is widely used in industrial and civil sites. At present, the alarm frequency of the tuning fork sensor is fixed in the single-chip microcomputer (MCU) or memory, and the user cannot set the alarm frequency by himself. When the measured medium changes or the measurement position changes, the alarm frequency needs to be changed. The user needs the technicians of the instrument manufacturer to make on-site changes. Some tuning fork level switches do not have the function of changing the frequency on-site, so they can only replace the instrument, which not only wastes the user's time but also seriously reduces the user's production efficiency, thereby increasing the production cost and failing to meet the user's needs. Therefore, the tuning fork level switch with adjustable alarm frequency uses an external circuit in conjunction with the internal program algorithm of the microcontroller (MCU). Users can manually fine-tune the alarm frequency or reset the alarm frequency to meet on-site needs, saving time and effort, being convenient and fast, and having certain engineering value and good application prospects. Summary of the invention
[0003] In view of the problems existing in the prior art, the present invention provides a tuning fork level switch circuit with an adjustable alarm frequency function, which uses a frequency measurement circuit to collect and measure the vibration frequency of the fork body of the tuning fork sensor; the alarm frequency is set by cooperating with the alarm frequency setting circuit and the internal algorithm of the single-chip microcomputer; a relay output circuit is used to output the switch quantity; an LED alarm light circuit is used to display the alarm status; a data storage circuit is used to store the key parameters and alarm information of the instrument; a power supply circuit is used to provide power for each circuit and the single-chip microcomputer; a frequency detection circuit, an alarm frequency setting circuit, a relay output circuit, and a data storage circuit are connected to the single-chip microcomputer to complete functions such as data analysis, frequency calculation, alarm frequency setting, alarm status display, and data storage.
[0004] To achieve the above purpose, the technical solution of the present invention is: a tuning fork level switch circuit with an adjustable alarm frequency function, including: a power supply circuit, a tuning fork sensor, a frequency measurement circuit, a single-chip control center circuit, an alarm frequency setting circuit, a relay output circuit, an LED alarm light circuit and a data storage circuit, the power supply circuit provides power for each circuit and the single-chip microcomputer, the frequency measurement circuit is respectively connected to the tuning fork sensor and the single-chip control center circuit, and is used to collect and measure the vibration frequency of the tuning fork sensor, and transmit it to the single-chip microcomputer after amplification and filtering, the alarm frequency setting circuit is used to set the alarm frequency, the single-chip control center circuit is respectively connected to the frequency detection circuit, the alarm frequency setting circuit, the relay output circuit, the LED alarm light circuit and the data storage circuit, and is used to perform data analysis, frequency calculation, alarm frequency setting, alarm status output control, LED alarm light control data storage and other functions, the relay output circuit is used to output a switch alarm signal, the LED alarm light circuit is used to display the alarm status, and the data storage circuit is used to store the key parameters and alarm information of the instrument.
[0005] The present invention has the following technical effects: First, it improves the flexibility of use: users can manually fine-tune the alarm frequency through the alarm frequency setting circuit, or reset the alarm frequency to meet different on-site needs without relying on the instrument manufacturer to make on-site changes, which greatly improves the convenience of use.
[0006] Secondly, intelligent control is realized: a single-chip microcomputer is used as the control center, which is responsible for data analysis, frequency calculation, alarm frequency setting, alarm status output control, LED alarm light control and data storage, etc., which improves the intelligence level of the system.
[0007] Furthermore, it has a visual alarm function: the relay output circuit can output a switch alarm signal, and the LED alarm light circuit can visually display the alarm status, making it convenient for users to discover and handle alarm events in a timely manner.
[0008] In addition, it has data storage function: the data storage circuit can record the key parameters and alarm information of the instrument, providing a basis for subsequent maintenance and analysis.
[0009] Finally, the overall structure is simple and reliable: the modular design of each function is convenient for maintenance and upgrading, suitable for harsh environments in industrial sites, and improves product reliability.
[0010] In general, the present invention effectively solves the problem that the existing tuning fork level switch cannot independently set the alarm frequency, improves the flexibility and applicability of use, reduces the maintenance cost of users, and has good engineering application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1is a system block diagram of the present invention; Figure 2 This is a power supply circuit diagram of the present invention; Figure 3 This is a frequency measurement circuit diagram of the present invention; Figure 4 A circuit diagram for setting the alarm frequency of the present invention; Figure 5 It is a circuit diagram of a portion of the single-chip microcomputer control center circuit U6A of the present invention; Figure 6 It is a circuit diagram of the single chip microcomputer control center circuit U6B of the present invention; Figure 7 A circuit diagram for storing data of the present invention; Figure 8 This is the circuit diagram of the LED warning light of the present invention; Fig. 9 It is the relay output circuit diagram of the present invention; Fig.10 The figure is a flowchart of the system of the present invention. DETAILED DESCRIPTION
[0012] The following is further described with reference to the accompanying drawings: like Figure 1 As shown, a tuning fork level switch circuit with adjustable alarm frequency function includes: a power supply circuit, a tuning fork sensor, a frequency measurement circuit, a single-chip control center circuit, an alarm frequency setting circuit, a relay output circuit, an LED alarm light circuit and a data storage circuit. The power supply circuit provides power for each circuit and a single-chip microcomputer (MCU); the frequency measurement circuit is respectively connected to the tuning fork sensor and the single-chip control center circuit, and is used to collect and measure the vibration frequency of the tuning fork sensor, and transmit it to the single-chip microcomputer after amplification and filtering; the alarm frequency setting circuit is used to set the alarm frequency; the single-chip control center circuit is respectively connected to the frequency detection circuit, the alarm frequency setting circuit, the relay output circuit, the LED alarm light circuit and the data storage circuit, and is used to perform functions such as data analysis, frequency calculation, alarm frequency setting, alarm status output control, LED alarm light control data storage, etc.; the relay output circuit is used to output the switch alarm signal; the LED alarm light circuit is used to display the alarm status; the data storage circuit is used to store the key parameters and alarm information of the instrument.
[0013] like Figure 2 As shown, the power supply circuit includes a power supply chip U1, a fuse F1, a varistor RP1, a bridge D0, a TVS tube D1, a voltage regulator diode D6, a capacitor C0, a capacitor C6, a capacitor C8, a capacitor C12, and a capacitor CY1; The power input terminal 24V+ is connected to one end of the varistor RP1 and the fuse F1 respectively, and the power input terminal 24V- is connected to the other end of the varistor RP1 and the 4th pin of the bridge D0 respectively; the other end of the fuse F1 is connected to the 3rd pin of the bridge D0; the 1st pin of the bridge D0 is V+, which is connected to the positive electrode of the capacitor C0, one end of the capacitor C6 and one end of the inductor L1 respectively; the 2nd pin of the bridge D0 is V-, which is connected to the negative electrode of the capacitor C0, the other end of the capacitor C6, the positive electrode of the TVS tube D1, one end of the capacitor C8, and the capacitor C11 respectively. The cathode of the inductor L1 and one end of the capacitor CY1; the other end of the inductor L1 is connected to the cathode of the TVS tube D1 and the anode of the Zener diode D6; the cathode output of the Zener diode D6 is Vin, which is respectively connected to the other end of the capacitor C8, the anode of the capacitor C11 and the pin 1 of the power chip U1; the pin 3 of the power chip U1 is the power output 12V+, which is connected to the anode of the capacitor C12; the pin 2 of the power chip U1, the other end of the capacitor CY1 and the cathode of the capacitor C12 are connected to the analog ground.
[0014] This circuit provides overvoltage protection through the RP1 varistor, the fuse F1 provides overcurrent protection, the bridge D0 is for forward and reverse connection protection, the capacitor C0, capacitor C6 and inductor L1 are for power ripple filtering, and the TVS tube D1 is for preventing static electricity. The function of this circuit is to reduce the input 24V to 12V to power each circuit.
[0015] like Figure 3 As shown, the frequency measurement circuit includes a socket CON1, a chip U7, a resistor R40, a resistor R41, a resistor R16, a resistor R17, a resistor R23, a resistor R24, a resistor R30, a resistor R31, a resistor R25, a resistor R26, a resistor R27, a resistor R32, a capacitor C4, a capacitor C26, a capacitor C27, a capacitor C28, a capacitor C29, a capacitor C30, a capacitor C31, and a capacitor C32: Socket CON1 is connected to the tuning fork sensor, wherein pin 1 of socket CON1 is F_in, connected to one end of capacitor C4; pin 2 of socket CON1 is connected to digital ground; pin 3 of socket CON1 is F_out, connected to pin 14 of chip U7; the other end of capacitor C4 is connected to resistor R17; resistor R40 and resistor R41 divide 12V into 6V; the first and second operational amplifiers of chip U7 are respectively connected to resistor R17, resistor R16, resistor R23, resistor R30, resistor R31, resistor R24, capacitor C26 and capacitor C27; the third and fourth operational amplifiers of chip U7 are respectively connected to resistor R25, resistor R26, resistor 27, resistor R32, capacitor C31, capacitor C28, capacitor C29 and capacitor C32; the output pin 14 of the operational amplifier is connected to F_out; the model of chip U7 is LM358.
[0016] Resistors R40 and R41 divide the 12V voltage to obtain 6V as a voltage reference. When the piezoelectric crystal inside the tuning fork sensor is powered on, it resonates and causes the fork body to vibrate. The frequency measurement circuit collects the vibration frequency signal F_in of the tuning fork sensor, and amplifies the vibration frequency signal F_in through the amplifier circuit composed of the first operational amplifier U7A and the second operational amplifier U7B of the chip U4 and their surrounding resistor-capacitor circuits. The amplified signal passes through the bandpass filter circuit composed of the third operational amplifier U7C and the fourth operational amplifier U7D of the chip U4 and their surrounding resistor-capacitor circuits, which can detect the amplified vibration frequency signal F_out and then pass it to the STM32F103 microcontroller. The built-in pulse counter of the STM32F103 microcontroller can calculate the vibration frequency; like Figure 4 As shown, the alarm frequency setting circuit includes a rotary dial switch MP1, a button Key1, a capacitor C1 and a capacitor C2. The 0 pin of the rotary dial switch MP1 is connected to the power supply 3.3V, and the other 1-4 pins are respectively connected to the PA0-PA3 pins of the single-chip microcomputer; one end of the button Key1 is connected to the ground, and the other end is connected to the PA4 pin of the single-chip microcomputer; one end of the capacitor C1 and the capacitor C2 is connected to the power supply 3.3V, and the other end is connected to the digital ground; The user inputs the set alarm frequency by rotating the DIP switch MP1 and pressing the key Key1, and the microcontroller reads and updates the setting.
[0017] like Figure 5 , Figure 6 As shown, the single-chip control center circuit includes a single-chip U6, a crystal oscillator Y1, a resistor R12, a resistor R1, a resistor R2, a resistor R47, a capacitor C9, a capacitor C10, a capacitor C3, a capacitor 44, a capacitor 45, a capacitor 46, and a capacitor 47; The 5th pin of the single-chip computer U6 is connected to the resistor R12, the crystal oscillator Y1, and one end of the capacitor C9. The 6th pin of the single-chip computer U6 is respectively connected to the resistor R12, the other end of the crystal oscillator Y1 and one end of the capacitor C10. The other ends of the capacitors C9 and C10 are connected to the digital ground. The 7th pin of the single-chip computer U6 is connected to one end of the resistor R2. The 44th pin of the single-chip computer U6 is connected to one end of the resistor R47. The 24th, 36th, 48th and 9th pins of the single-chip computer U6 are connected to the capacitors 44, One end of capacitor 45, capacitor 46, and capacitor 47 are connected to the power supply 3.3V, and pin 23, pin 35, pin 47, pin 8 of the microcontroller U6 and the other ends of capacitor 44, capacitor 45, capacitor 46, and capacitor 47 are connected to the digital ground; one end of resistor R1 is connected to 3.3V, and the other end of resistor R1 is connected to resistor R2 and capacitor C3; the other ends of capacitor C3 and resistor R47 are connected to the digital ground; the model of the microcontroller U6 is STM32F103C8T6.
[0018] Using the alarm frequency setting circuit, users can change the alarm frequency in two ways. The first way, when the user needs to fine-tune the alarm frequency, the encoder in this circuit can be used to adjust the alarm frequency range up and down within the factory setting. There are 10 gears "0"-"9" in the encoder, which correspond to the 10 alarm frequencies set at the factory. The alarm frequencies of two adjacent gears differ by 10HZ. If the user feels that the alarm frequency is slightly larger or smaller during use, the alarm frequency can be fine-tuned by adjusting the gear of the encoder. The second way, when the user needs to reset the alarm frequency, the encoder gear needs to be adjusted to "F", and then long press the button in the alarm frequency setting circuit. The STM32F103 microcontroller will set the currently detected frequency as the alarm frequency; The STM32F103 microcontroller has a built-in alarm frequency. When the detected vibration frequency falls within the alarm frequency range, the STM32F103 microcontroller controls the relay output circuit to output the alarm switch value, and at the same time controls the LED alarm light circuit to display the alarm status; like Figure 7 As shown, the data storage circuit includes a storage chip U2, a resistor R45, a resistor R46 and a capacitor C7: the 5th pin of the storage chip U2 is connected to the SCL communication interface of the single-chip microcomputer through the resistor R45, and the 6th pin is connected to the SDA communication interface of the single-chip microcomputer through the resistor R46; the 8th pin of the storage chip U2 is connected to the 3.3V power supply through the capacitor C7; the 1st pin, the 2nd pin, the 3rd pin and the 4th pin of the storage chip U2 are all connected to the digital ground.
[0019] The data storage circuit uses a ferroelectric memory chip FM24CL16-S and is composed of resistors and capacitors. It is used to store the key parameters and alarm information of the instrument and realize the data reading and writing operations through the single-chip microcomputer.
[0020] like Figure 8 As shown, the LED warning light circuit includes components LED1, transistor Q5, transistor Q3, transistor Q4, resistor R4, resistor R5, resistor R8, resistor R14, resistor R15, resistor 17, resistor R18, resistor 21, and resistor R22; Pin 2 of LED1 is connected to the 3.3V power supply; Pin 1, Pin 3, and Pin 4 of device LED1 are connected to one end of resistor R4, resistor R14, and resistor R15 respectively; the other ends of resistor R4, resistor R14, and resistor R15 are connected to the collectors of transistor Q5, transistor Q3, and transistor Q4 respectively; the emitters of transistor Q5, transistor Q3, and transistor Q4 are connected to the digital ground; the base of transistor Q5 is connected to one end of resistor R5 and one end of R8 respectively; The base of transistor Q4 is connected to one end of resistor R17 and one end of resistor R22 respectively; the other ends of resistor R5, resistor R18 and resistor R17 are connected to the 4th, 3rd and 2nd pins of microcontroller U6 respectively; the other ends of resistor R8, resistor 21 and resistor R22 are connected to digital ground; component LED1 is a common anode three-color LED lamp, and the model of transistor Q5, transistor Q3 and transistor Q4 is 3904; The LED alarm light circuit is composed of three-color LED lights, three transistors 3904 and resistors and capacitors. The transistors and surrounding resistors provide a driving circuit for the LED alarm light. When the microcontroller gives a high-level signal, the transistor is turned on, and the corresponding LED alarm light lights up to realize the alarm function.
[0021] like Fig. 9 As shown, the relay output circuit includes a transistor Q1, an optocoupler U4, a diode Q4, a diode Q3, a double-pole double-throw relay K1, a resistor R3, a resistor R6, a resistor R7, and a resistor R42; One end of resistor R3 is connected to the power supply 3.3V, and the other end of resistor R3 is connected to the collector of transistor Q1; the base of transistor Q1 is respectively connected to one end of resistor R6 and resistor R7; the emitter of transistor Q1 is connected to pin 1 of optocoupler U4; the other end of resistor R6 is connected to pin 42 of the microcontroller; the other end of resistor R7 and pin 2 of optocoupler U4 are connected to digital ground; one end of resistor R42, the cathode of diode D4, and pin 8 of relay K1 are all connected to the power supply 12V; the other end of resistor R42 is respectively connected to pin 4 of optocoupler U4 and the base of transistor Q6; the collector of transistor Q6 is respectively connected to the anode of diode D4 and pin 7 of relay K1; the emitter of transistor Q6 is connected to the anode of diode D3; pin 3 of optocoupler U4 and the cathode of diode D3 are both connected to analog ground.
[0022] The core function of the relay output circuit is to realize the output control of the switch alarm signal. Through the signal trigger of the single-chip microcomputer, the circuit can drive the switching of the relay, thereby realizing the switch control or alarm function of the external device. When the single-chip microcomputer outputs a high-level signal to the resistor R6, the transistor Q1 is turned on, the optocoupler U4 is activated, and the current at its output end flows through the resistor R42 and drives the base of the transistor Q6; after the transistor Q6 is turned on, its collector current makes the relay K1 pull in and completes the switching of the switch state; when the single-chip microcomputer outputs a low-level signal, the transistors Q1 and Q6 are both turned off, the relay K1 is released, and returns to the initial state.
[0023] The working principle of the present invention is as follows: a piezoelectric crystal inside a tuning fork sensor generates resonance after being energized, causing the fork body to vibrate; a frequency measurement circuit collects the vibration frequency of the tuning fork sensor, and transmits the frequency to an STM32F103 single-chip microcomputer after signal amplification and filtering; a pulse counter built into the STM32F103 single-chip microcomputer can calculate the vibration frequency; an alarm frequency is prefabricated inside the STM32F103 single-chip microcomputer; when the detected vibration frequency belongs to the alarm frequency range, the STM32F103 single-chip microcomputer controls a relay output circuit to output a switch quantity, and simultaneously controls an LED alarm lamp circuit to display an alarm state; and the STM32F103 single-chip microcomputer uses a data storage circuit to store key parameters and alarm information of an instrument.
[0024] like Fig.10 As shown, the implementation method of the present invention is based on a tuning fork level switch circuit and is performed according to the following steps: A. Initialization: After the tuning fork level switch circuit is powered on, the control microcontroller initializes the system, sets relevant parameters, and checks the status of each module to ensure that the system is in normal operation.
[0025] B. Read the alarm frequency: The microcontroller reads the preset alarm frequency value from the data storage circuit and uses it as the reference frequency for subsequent detection and comparison.
[0026] C. Detect vibration frequency: The tuning fork sensor vibrates and generates a frequency signal after being powered by power. The actual vibration frequency is measured by the frequency detection circuit, and the measurement result is transmitted to the microcontroller for processing.
[0027] D. Frequency comparison and alarm drive: The microcontroller compares the actual vibration frequency detected with the preset alarm frequency value; if the detected frequency value is lower than the alarm frequency, it is determined that the alarm condition is met; the relay output circuit is controlled to drive the alarm device, output an alarm signal, and trigger the LED alarm light for status indication.
[0028] E. Determine whether to adjust the alarm frequency: If the user does not perform fine-tuning of the alarm frequency, the original alarm frequency is maintained and the detection process continues; if the user initiates an adjustment operation, the alarm frequency adjustment mode is entered.
[0029] F. Read adjustment data and update alarm frequency: In the alarm frequency adjustment mode, the MCU reads the adjustment data input by the user from the alarm frequency setting circuit; updates the alarm frequency value according to the encoder data read to ensure that the set alarm frequency meets user requirements, and writes the updated alarm frequency to the data storage circuit for storage.
[0030] G. Determine whether to reset the alarm frequency: If the user does not initiate the alarm frequency reset operation, the frequency adjustment mode is exited; if the user selects the reset operation, the system uses the actual vibration frequency currently detected as the new alarm frequency value, and writes the updated alarm frequency into the data storage circuit for storage.
[0031] H. End process: After completing the above steps, return to the loop detection process, and the system continues to monitor the vibration frequency of the tuning fork sensor in real time to ensure stable operation of the equipment.
Claims
1. A tuning fork level switch circuit with adjustable alarm frequency function, characterized in that: include: A power supply circuit, a tuning fork sensor, a frequency measurement circuit, a single-chip control center circuit, an alarm frequency setting circuit, a relay output circuit, an LED alarm light circuit and a data storage circuit. The power supply circuit provides power for each circuit and the single-chip microcomputer. The frequency measurement circuit is respectively connected to the tuning fork sensor and the single-chip microcomputer control center circuit, and is used to collect and measure the vibration frequency of the tuning fork sensor, and transmits it to the single-chip microcomputer after amplification and filtering. The alarm frequency setting circuit is used to set the alarm frequency. The single-chip microcomputer control center circuit is respectively connected to the frequency detection circuit, the alarm frequency setting circuit, the relay output circuit, the LED alarm light circuit and the data storage circuit, and is used to perform functions such as data analysis, frequency calculation, alarm frequency setting, alarm status output control, LED alarm light control data storage, etc. The relay output circuit is used to output switch alarm signals, the LED alarm light circuit is used to display the alarm status, and the data storage circuit is used to store key parameters and alarm information of the instrument.
2. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1 is characterized in that: The power supply circuit includes a power supply chip U1, a fuse F1, a varistor RP1, a bridge D0, an inductor L1, a TVS tube D1, a voltage regulator diode D6, a capacitor C0, a capacitor C6, a capacitor C8, a capacitor C11, a capacitor C12 and a capacitor CY1; The power input terminal 24V+ is connected to one end of the varistor RP1 and the fuse F1 respectively, and the power input terminal 24V- is connected to the other end of the varistor RP1 and the 4th foot of the bridge D0 respectively; The other end of the fuse F1 is connected to pin 3 of the bridge D0; pin 1 of the bridge D0 is V+, which is respectively connected to the positive electrode of capacitor C0, one end of capacitor C6 and one end of inductor L1; pin 2 of the bridge D0 is V-, which is respectively connected to the negative electrode of capacitor C0, the other end of capacitor C6, the positive electrode of TVS tube D1, one end of capacitor C8, the negative electrode of capacitor C11 and one end of capacitor CY1; the other end of inductor L1 is connected to the negative electrode of TVS tube D1 and the positive electrode of Zener diode D6; the negative electrode output of Zener diode D6 is Vin, which is respectively connected to the other end of capacitor C8, the positive electrode of capacitor C11 and pin 1 of power chip U1; pin 3 of power chip U1 is power output 12V+, which is connected to the positive electrode of capacitor C12; pin 2 of power chip U1, the other end of capacitor CY1 and the negative electrode of capacitor C12 are connected to analog ground.
3. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The frequency measurement circuit includes a socket CON1, a chip U7, a resistor R40, a resistor R41, a resistor R16, a resistor R17, a resistor R23, a resistor R24, a resistor R30, a resistor R31, a resistor R25, a resistor R26, a resistor R27, a resistor R32, a capacitor C4, a capacitor C26, a capacitor C27, a capacitor C28, a capacitor C29, a capacitor C30, a capacitor C31, and a capacitor C32: The socket CON1 is connected to the tuning fork sensor, wherein the pin 1 of the socket CON1 is F_in, connected to one end of the capacitor C4; the pin 2 of the socket CON1 is connected to the digital ground; the pin 3 of the socket CON1 is F_out, connected to the pin 14 of the chip U7; the other end of the capacitor C4 is connected to the resistor R17; the resistor R40 and the resistor R41 divide the 12V into 6V; the first and second operational amplifiers of the chip U7 are respectively connected to the resistor R17, the resistor R16, the resistor R23, the resistor R30, the resistor R31, the resistor R24, the capacitor C26 and the capacitor C27; the third and fourth operational amplifiers of the chip U7 are respectively connected to the resistor R25, the resistor R26, the resistor 27, the resistor R32, the capacitor C31, the capacitor C28, the capacitor C29 and the capacitor C32, and the output pin 14 of the operational amplifier is connected to F_out.
4. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The alarm frequency setting circuit includes a rotary dial switch MP1, a button Key1, a capacitor C1 and a capacitor C2; Pin 0 of the rotary DIP switch MP1 is connected to the power supply 3.3V, and the other four pins are connected to the PA0-PA3 pins of the microcontroller respectively; one end of the button Key1 is connected to the ground, and the other end is connected to the PA4 pin of the microcontroller; one end of the capacitor C1 and the capacitor C2 is connected to the power supply 3.3V, and the other end is connected to the digital ground.
5. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The single-chip control center circuit includes a single-chip computer U6, a crystal oscillator Y1, a resistor R12, a resistor R1, a resistor R2, a resistor R47, a capacitor C9, a capacitor C10, a capacitor 44, a capacitor 45, a capacitor 46, a capacitor 47, and a capacitor C3; The 5th pin of the single-chip computer U6 is connected to the resistor R12, the crystal oscillator Y1, and one end of the capacitor C9, the 6th pin of the single-chip computer U6 is connected to the resistor R12, the other end of the crystal oscillator Y1 and one end of the capacitor C10, and the other ends of the capacitors C9 and C10 are connected to the digital ground; the 7th pin of the single-chip computer U6 is connected to one end of the resistor R2; the 44th pin of the single-chip computer U6 is connected to one end of the resistor R47; the 24th, 36th, 48th and 9th pins of the single-chip computer U6 and one end of the capacitors 44, 45, 46 and 47 are connected to the power supply 3.3V, and the 23rd, 35th, 47th and 8th pins of the single-chip computer U6 and the other ends of the capacitors 44, 45, 46 and 47 are connected to the digital ground; one end of the resistor R1 is connected to 3.3V, and the other end of the resistor R1 is connected to the resistor R2 and the capacitor C3; the other end of the capacitor C3 and the resistor R47 are connected to the digital ground.
6. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The data storage circuit includes a storage chip U2, a resistor R45, a resistor R46, and a capacitor C7: Pin 5 and pin 6 of the memory chip U2 are connected to resistor R45 and resistor R46 respectively; pin 7 of the memory chip U2 is connected to pin 7 of the microcontroller; pin 8 of the memory chip U2 and one end of the capacitor C7 are connected to a power supply of 3.3V; pin 1, pin 2, pin 3, pin 4 of the memory chip U2 and the other end of the capacitor C7 are connected to the digital ground.
7. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The LED warning light circuit includes components LED1, transistor Q5, transistor Q3, transistor Q4, resistor R4, resistor R5, resistor R8, resistor R14, resistor R15, resistor 17, resistor R18, resistor 21, and resistor R22; Pin 2 of device LED1 is connected to a 3.3V power supply; Pin 1, Pin 3, and Pin 4 of device LED1 are connected to one end of resistor R4, resistor R14, and resistor R15 respectively; the other ends of resistor R4, resistor R14, and resistor R15 are connected to the collectors of transistor Q5, transistor Q3, and transistor Q4 respectively; the emitters of transistor Q5, transistor Q3, and transistor Q4 are connected to digital ground; the base of transistor Q5 is connected to one end of resistor R5 and one end of R8 respectively; The base of Q3 is connected to one end of resistor 18 and one end of R21 respectively; the base of transistor Q4 is connected to one end of resistor R17 and one end of resistor 22 respectively; the other ends of resistor R5, resistor R18 and resistor R17 are connected to pin 4, pin 3 and pin 2 of microcontroller U6 respectively; the other ends of resistor R8, resistor 21 and resistor R22 are connected to digital ground; component LED1 is a common anode three-color LED lamp, and the models of transistors Q5, transistor Q3 and transistor Q4 are 3904.
8. The tuning fork level switch circuit with adjustable alarm frequency function according to claim 1, characterized in that: The relay output circuit includes a transistor Q1, an optical coupler U4, a diode Q4, a diode Q3, a double-pole double-throw relay K1, a resistor R3, a resistor R6, a resistor R7, and a resistor R42; One end of resistor R3 is connected to the power supply 3.3V, and the other end of resistor R3 is connected to the collector of transistor Q1; the base of transistor Q1 is connected to one end of resistor R6 and resistor R7 respectively; the emitter of transistor Q1 is connected to pin 1 of optocoupler U4; the other end of resistor R6 is connected to pin 42 of the microcontroller; the other end of resistor R7 and pin 2 of optocoupler U4 are connected to digital ground; one end of resistor R42, the cathode of diode D4, and pin 8 of relay K1 are all connected to the power supply 12V; the other end of resistor R42 is connected to pin 4 of optocoupler U4 and the base of transistor Q6 respectively; the collector of transistor Q6 is connected to the anode of diode D4 and pin 7 of relay K1 respectively; the emitter of transistor Q6 is connected to the anode of diode D3; pin 3 of optocoupler U4 and the cathode of diode D3 are all connected to analog ground.
9. A method for implementing a tuning fork level switch circuit with an adjustable alarm frequency function, based on the tuning fork level switch circuit with an adjustable alarm frequency function according to claim 8, characterized in that: Follow these steps: A. Initialization: After the tuning fork level switch circuit is powered on, the control microcontroller initializes the system, sets relevant parameters, and checks the status of each module to ensure that the system is in normal operation; B. Reading alarm frequency: The MCU reads the preset alarm frequency value from the data storage circuit and uses it as a reference frequency for subsequent detection and comparison; C. Detect vibration frequency: The tuning fork sensor vibrates to generate a frequency signal after being powered on. The actual vibration frequency is measured through the frequency detection circuit, and the measurement result is transmitted to the microcontroller for processing; D. Frequency comparison and alarm drive: The single chip microcomputer compares the actual vibration frequency detected with the preset alarm frequency value; if the detected frequency value is lower than the alarm frequency, it is determined that the alarm condition is met; the relay output circuit is controlled to drive the alarm device, output the alarm signal, and trigger the LED alarm light for status indication; E. Determine whether to adjust the alarm frequency: If the user does not perform fine-tuning of the alarm frequency, the original alarm frequency is maintained and the detection process continues; if the user initiates an adjustment operation, the alarm frequency adjustment mode is entered; F. Read adjustment data and update alarm frequency: In the alarm frequency adjustment mode, the MCU reads the adjustment data input by the user from the alarm frequency setting circuit; updates the alarm frequency value according to the encoder data read to ensure that the set alarm frequency meets the user's needs, and writes the updated alarm frequency into the data storage circuit for storage; G. Determine whether to reset the alarm frequency: If the user does not initiate the alarm frequency reset operation, the frequency adjustment mode is exited; if the user selects the reset operation, the system uses the actual vibration frequency currently detected as the new alarm frequency value, and writes the updated alarm frequency into the data storage circuit for storage; H. End process: After completing the above steps, return to the loop detection process, and the system continues to monitor the vibration frequency of the tuning fork sensor in real time to ensure stable operation of the equipment.