Multifunctional multiplexing circuit and electrical equipment
By designing a multi-function multiplexing circuit, using the input/output port shared by the main control chip to connect the detection module and the alarm module, the problem of insufficient chip IO port in the existing technology is solved, and AD detection and buzzer driving are realized Share, save resources and reduce costs.
Patent Information
- Application Number
- CN202411567773.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-21
AI Technical Summary
The prior art requires 2 chip input/output ports when implementing analog-to-digital signal conversion and buzzer driving, resulting in insufficient chip IO ports, which increases cost and resource waste.
A multi-function multiplexing circuit is designed to connect the detection module and the alarm module through the input/output port shared by the main control chip, and to realize signal detection and alarm functions by using the normal cut-off of the first switching unit and the main control chip control conduction.
It realizes the completion of AD detection and buzzer driving through one chip IO port, saving chip IO port resources and reducing costs.
Smart Images

Figure CN119496500A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of circuit multiplexing, and in particular to a multifunctional multiplexing circuit and electrical equipment. Background Art
[0002] With the development of intelligent electrical appliances, their functions are gradually enriched. The increase in functions has led to a serious shortage of pin resources in product chips.
[0003] The existing technical solutions require two input / output ports (IO) of the main control chip to realize analog-to-digital (AD) signal conversion detection and buzzer driving. Sometimes the number of IO ports of the chip may be insufficient, so only chips with more IO ports can be used, which leads to increased costs and waste of resources. Summary of the invention
[0004] In view of this, the present invention provides a multi-functional multiplexing circuit and electrical equipment to solve the problem that the number of chip IO ports is insufficient due to the increase in product functions.
[0005] In a first aspect, the present invention provides a multifunctional multiplexing circuit, the circuit comprising a main control chip, a detection module, an alarm module and a first switch unit, the main control chip is provided with an input / output port, wherein one end of the detection module is connected to the input / output port, and the other end of the detection module is connected to the alarm module after passing through the first switch unit;
[0006] The first switch unit is normally cut off, and the main control chip uses the detection module connected to the input / output port to perform signal detection;
[0007] When the main control chip controls the first switch unit to be turned on, the main control chip drives the alarm module to alarm by using the input / output port.
[0008] Beneficial effect: The multifunctional multiplexing circuit provided in the embodiment of the present invention is provided with a common input / output port on the main control chip for connecting multiple modules. The input / output port is not only connected to the detection module, but also connected to the alarm module through the detection module and the first switch unit. At the same time, the first switch unit is normally cut off, and the alarm module is not connected to the main control chip at this time, so that the main control chip can use the input / output port and the detection module to realize signal detection. When the main control chip controls the first switch unit to be turned on, the alarm module is connected to the main control chip, so that the main control chip uses the input / output port to drive the alarm module to alarm.
[0009] The present invention can realize the work of multiple modules through the input / output port shared by the main control chip, which can save chip IO port resources and thus reduce chip costs.
[0010] In an optional implementation, the circuit further includes a voltage dividing module, and a voltage dividing port of the voltage dividing module is connected to the control end of the first switch unit;
[0011] The normal voltage at the voltage-dividing port is greater than or equal to a cut-off voltage threshold of the first switch unit, so that the first switch unit is normally cut off.
[0012] Beneficial effect: In an embodiment of the present invention, the voltage divider port of the voltage divider module is connected to the control end of the first switch unit, and the normal voltage at the voltage divider port is kept greater than or equal to the cut-off voltage threshold of the first switch unit, so that the first switch unit remains cut off under normal conditions, disconnecting the connection between the alarm module and the main control chip, thereby facilitating conventional AD detection work.
[0013] In an optional implementation, when the first switch unit is turned off, the main control chip uses the input / output port to obtain the detection signal input by the detection module, and determines the current value of the detection amount based on the detection signal.
[0014] Beneficial effect: The main control chip uses the detection signal generated by the detection module at the input / output port to calculate the current value of the detection amount according to the detection signal, thereby realizing AD detection.
[0015] In an optional implementation, the main control chip outputs a control signal when detecting that the current value of the detection amount exceeds a preset range; wherein the low-level voltage of the control signal is less than the cut-off voltage threshold of the first switch unit.
[0016] Beneficial effect: In an embodiment of the present invention, the main control chip is used to monitor the current value of the detection quantity. When it is detected that the current value exceeds the set preset range, an alarm prompt is required. At this time, the main control chip will output a control signal with a low-level voltage less than the cut-off voltage threshold of the first switch unit, thereby controlling the first switch unit to be turned on and connecting the alarm module to the circuit for alarm.
[0017] In an optional implementation, the main control chip continuously outputs a control signal via the input / output port within a preset time to control the first switch unit to be turned on, so that the alarm module continuously sounds an alarm within the preset time.
[0018] Beneficial effect: In an embodiment of the present invention, a preset time for the alarm can be set. During the preset time, the main control chip will continue to output a control signal to maintain the on state of the first switch unit, so that the alarm module can continue to alarm, thereby effectively reminding the user.
[0019] In an optional implementation, the main control chip determines the current value of the ambient temperature based on the detection signal;
[0020] When the main control chip detects that the current value of the ambient temperature exceeds the preset temperature range, the main control chip outputs a pulse width modulation signal to control the first switch unit to be turned on.
[0021] Beneficial effect: In an embodiment of the present invention, the main control chip can utilize the detection signal input by the detection module at the input / output port to monitor the ambient temperature, and when the ambient temperature exceeds the preset temperature range, it outputs a pulse width modulation signal to turn on the first switch unit, and uses the alarm module to sound an alarm to prompt the user.
[0022] In an optional implementation, the detection module includes a first power supply, a first resistor, a second resistor and a first capacitor;
[0023] One end of the first resistor is respectively connected to the input / output port, the first end of the first capacitor, the first end of the second resistor and the first interface of the first switch unit, and the other end of the first resistor is connected to the first power supply;
[0024] The second end of the first capacitor and the second end of the second resistor are grounded.
[0025] Beneficial effect: A temperature detection circuit composed of a first power supply, a first resistor, a second resistor and a first capacitor can be used to form a corresponding analog voltage signal at the input / output port, so that the main control chip can use the analog voltage signal to determine the ambient temperature and realize ambient temperature monitoring.
[0026] In an optional implementation, the first resistor is a thermistor.
[0027] Beneficial effect: In the embodiment of the present application, the first resistor is a thermistor, which is a sensor resistor and a sensitive element, and its resistance value will change significantly with the change of temperature. Therefore, the ambient temperature can be detected by changing the resistance value of the first resistor.
[0028] In an optional implementation, the voltage dividing module includes a second power supply, a third resistor and a fourth resistor;
[0029] The second power supply is connected to one end of the fourth resistor via the third resistor, the other end of the fourth resistor is grounded, and the voltage dividing port between the third resistor and the fourth resistor is connected to the control end of the first switch unit.
[0030] Beneficial effect: In the embodiment of the present invention, the third resistor and the fourth resistor form a voltage divider circuit to provide a reference normal voltage at the voltage divider port, so that the first switch unit is turned off, and the normal AD detection function can be performed. At the same time, since the first switch unit is turned off, the alarm module will not alarm.
[0031] In an optional implementation, the alarm module includes a third power supply, a fifth resistor, a sixth resistor, a second switch unit, a seventh resistor and an alarm device;
[0032] One end of the fifth resistor is connected to the second interface of the first switch unit, and the other end of the fifth resistor is respectively connected to the first end of the sixth resistor and the control end of the second switch unit;
[0033] The third power supply is respectively connected to the second end of the sixth resistor and the first interface of the second switch unit. The second interface of the second switch unit is grounded via the seventh resistor. The alarm device is connected in parallel to both ends of the seventh resistor.
[0034] Beneficial effect: In the embodiment of the present invention, when the first switch unit is turned on, the third power source forms a loop through the sixth resistor, the fifth resistor, the first switch unit to the ground, thereby turning on the second switch unit of the triode, so that the alarm device alarms. After the alarm is completed, the main control chip changes the input / output port to the AD detection port for ambient temperature detection.
[0035] In an optional implementation, the alarm device is a buzzer.
[0036] Beneficial effect: In the embodiment of the present invention, when the first switch unit is turned off, the second switch unit is also turned off, and the buzzer does not sound; when the first switch unit is turned on, the second switch unit is also turned on, and the buzzer sounds, so as to remind the user in time.
[0037] In an optional implementation, the first switch unit and the second switch unit are triodes.
[0038] Beneficial effect: Using transistors to control circuits in different ways is simple and efficient.
[0039] In a second aspect, the present invention provides an electrical device, comprising the multifunctional multiplexing circuit of the first aspect or any corresponding embodiment thereof.
[0040] In an optional embodiment, the electrical device is a water heater. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is a structural schematic diagram of an existing circuit system according to an embodiment of the present invention;
[0043] Figure 2 is a schematic structural diagram of a multifunctional multiplexing circuit according to an embodiment of the present invention;
[0044] Figure 3 is a schematic structural diagram of another multi-function multiplexing circuit according to an embodiment of the present invention;
[0045] Figure 4 is a structural schematic diagram of another multi-function multiplexing circuit according to an embodiment of the present invention;
[0046] Figure 5 It is a schematic diagram of the structure of an electrical device according to an embodiment of the present invention.
[0047] Description of reference numerals:
[0048] 100. Multifunctional multiplexing circuit;
[0049] 10. Main control chip; 101. Input / output port;
[0050] 20. Detection module; 201. First power supply; 202. First resistor; 203. Second resistor; 204. First capacitor;
[0051] 30. Alarm module; 301. Third power supply; 302. Fifth resistor; 303. Sixth resistor; 304. Second switch unit; 305. Seventh resistor; 306. Alarm device;
[0052] 40. A first switch unit;
[0053] 50. Voltage divider module; 501. Second power supply; 502. Third resistor; 503. Fourth resistor. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] An embodiment of the present invention provides a schematic diagram of the structure of an existing circuit system. Figure 1 As shown, the AD detection circuit and the buzzer driving circuit in the existing circuit system each use one chip IO port.
[0056] Among them, AD detection is the input port, R1 is the NTC resistor, and its resistance changes with temperature. R1 and R2 form a voltage divider circuit. The ambient temperature can be calculated by detecting the voltage at the IO port through AD. For example, this circuit is usually used to detect the ambient temperature. When the ambient temperature is 0℃, the resistance of the NTC resistor is about 325KΩ, the resistance of R2 is 270KΩ, and the capacity of C1 is 0.1uF. It can be calculated that the voltage of the IO port is about 2.2V at this time, that is, when the voltage detected by the AD of the IO port is about 2.2V, the ambient temperature is 0℃; for another example, when the ambient temperature is 40℃, the resistance of the NTC resistor is about 53KΩ, the resistance of R2 is 270KΩ, and the capacity of C1 is 0.1uF. It can be calculated that the voltage of the IO port is about 4.1V at this time, that is, when the voltage detected by the AD of the IO port is about 4.1V, the ambient temperature is 40℃.
[0057] See again Figure 1 , the buzzer driver is the output port, the buzzer driver circuit is connected to the IO2 port of the chip, and the buzzer driver circuit includes R5, R6, R7, transistor Q1 and buzzer BUZ1, wherein the resistance of R5 is 5.1KΩ, the resistance of R6 is 5.1KΩ, and the resistance of R7 is 5.1KΩ. When buzzing is not required, the IO2 port outputs a high-level signal (5V), and the transistor Q1 is cut off. When buzzing is required, the IO2 port outputs a pulse width modulation (PWM) signal of a certain frequency. When the PWM signal is high (5V), the transistor Q1 is cut off. When the PWM signal is low (0V), the transistor Q1 is turned on, thereby making the buzzer BUZ1 buzz.
[0058] The existing technical solution requires two chip IO ports to implement AD detection and buzzer driving. Sometimes the number of chip IO ports may be insufficient, so only chips with more IO ports can be used, which increases costs and wastes resources.
[0059] Therefore, the embodiment of the present invention provides a circuit system in which AD detection and buzzer driving share one chip IO port, thereby saving the resource of one chip IO port and reducing the cost.
[0060] According to an embodiment of the present invention, a multifunctional multiplexing circuit 100 is provided. Figure 2 As shown, the multifunctional multiplexing circuit 100 includes a main control chip 10, a detection module 20, an alarm module 30 and a first switch unit 40. The main control chip 10 is provided with an input / output port 101, wherein one end of the detection module 20 is connected to the input / output port 101, and the other end of the detection module 20 is connected to the alarm module 30 after passing through the first switch unit 40.
[0061] Furthermore, the first switch unit 40 is normally turned off, and the main control chip 10 performs signal detection using the detection module 20 connected to the input / output port 101. That is, at this time, the alarm module 30 is not connected to the main control chip 10, and the alarm module 30 does not work.
[0062] In addition, when the main control chip 10 controls the first switch unit 40 to be turned on, the main control chip 10 drives the alarm module 30 to alarm by using the input / output port 101 .
[0063] The multifunctional multiplexing circuit provided in the embodiment of the present invention is provided with a common input / output port 101 on the main control chip 10 for connecting multiple modules. The input / output port 101 is not only connected to the detection module 20, but also connected to the alarm module 30 through the detection module 20 and the first switch unit 40. At the same time, the first switch unit 40 is normally cut off, and the alarm module 30 is not connected to the main control chip 10 at this time, so that the main control chip 10 uses the input / output port 101 and the detection module 20 to realize signal detection. When the main control chip 10 controls the first switch unit 40 to be turned on, the alarm module 30 is connected to the main control chip 10, so that the main control chip 10 uses the input / output port 101 to drive the alarm module 30 to alarm.
[0064] The present invention can realize the work of multiple modules through the input / output port 101 shared by the main control chip 10, which can save chip IO port resources and thus reduce chip costs.
[0065] It should be noted that the main control chip 10 can be a main control device such as a microcontroller unit (MCU), and the first switch unit 40 can be a switching device such as a transistor or a MOS tube, as long as the switch control effect can be achieved, and the present invention is not limited to this.
[0066] In some optional embodiments, such as Figure 3 As shown, the multifunctional multiplexing circuit also includes a voltage divider module 50, a voltage divider port VREF of the voltage divider module is connected to the control end of the first switch unit 40, wherein the normal voltage at the voltage divider port VREF is greater than or equal to the cut-off voltage threshold of the first switch unit 40, so that the first switch unit is normally cut off.
[0067] It should be noted that the cut-off voltage threshold can be set according to actual usage, as long as it can ensure that when the main control chip does not output the control signal, the first switch unit 40 can remain cut off under normal conditions. Exemplarily, the cut-off voltage threshold can be 0.1V, and the normal voltage at the voltage divider port VREF is 2V. At this time, the first switch unit 40 is cut off, the connection between the alarm module 30 and the detection module 20 is disconnected, and the alarm module 30 is not connected to the main control chip 10. At this time, conventional AD detection work can be performed.
[0068] In an embodiment of the present invention, the voltage divider port VREF of the voltage divider module 50 is connected to the control end of the first switch unit 40, and the normal voltage at the voltage divider port VREF is kept greater than or equal to the cut-off voltage threshold of the first switch unit 40, so that the first switch unit remains cut off under normal conditions, disconnecting the connection between the alarm module 30 and the main control chip 10, thereby facilitating conventional AD detection work.
[0069] In some optional implementations, when the first switch unit 40 is turned off, the main control chip 10 uses the input / output port 101 to obtain the detection signal input by the detection module 20, and determines the current value of the detection amount based on the detection signal.
[0070] Specifically, when the main control chip 10 uses the input / output port 101 to perform AD detection, the detection module 20 will generate a detection signal at the input / output port 101. The main control chip 10 then performs analog-to-digital conversion on the detection signal to obtain the corresponding voltage value, and calculates the current value of the detection amount based on the correspondence between the voltage value and the detection amount, thereby realizing AD detection.
[0071] It should be noted that the correspondence between the voltage value and the detection amount can be calibrated in advance through experiments, and the obtained correspondence or conversion formula can be stored in the main control chip 10 so that the main control chip can quickly calculate the current value of the detection amount based on the detection signal, thereby improving the detection efficiency.
[0072] In the embodiment of the present invention, the main control chip uses the detection signal generated by the detection module at the input / output port to calculate the current value of the detection amount according to the detection signal, thereby realizing AD detection.
[0073] Furthermore, the main control chip 10 outputs a control signal when detecting that the current value of the detection amount exceeds a preset range. It should be noted that the low level voltage of the control signal is less than the cut-off voltage threshold of the first switch unit.
[0074] Specifically, the preset range corresponding to the detection amount can be set according to the current scenario. As long as the value of the detection amount is within the preset range, it means that the size of the detection amount is normal; if the current value of the detection amount exceeds the preset range, it means that an abnormality has occurred or the current value of the detection amount has reached the set value, and an alarm is required. The main control chip 10 outputs a control signal to control the first switch unit 40 to turn on.
[0075] In an embodiment of the present invention, the main control chip is used to monitor the current value of the detection amount. When it is detected that the current value exceeds the set preset range, an alarm prompt is required. At this time, the main control chip will output a control signal with a low-level voltage less than the cut-off voltage threshold of the first switch unit, thereby controlling the first switch unit to be turned on and connecting the alarm module to the circuit to alarm.
[0076] Furthermore, the main control chip 10 continuously outputs a control signal via the input / output port 101 within a preset time to control the first switch unit 40 to be turned on, so that the alarm module 30 continuously gives an alarm within the preset time.
[0077] Specifically, the alarm module will memorize the current value of the detection quantity before the alarm. Since the change rate of the detection quantity is not very fast and the alarm time is relatively short and fast, the alarm value at the time of alarm is still the value of the detection quantity just before the alarm, which can ensure the accuracy of the alarm value displayed at the time of alarm.
[0078] In an embodiment of the present invention, a preset alarm time can be set. During the preset time, the main control chip 10 will continue to output a control signal to maintain the on state of the first switch unit 40, so that the alarm module can continue to alarm, thereby effectively reminding the user.
[0079] In some optional embodiments, the main control chip 10 determines the current value of the ambient temperature based on the detection signal. When the main control chip 10 detects that the current value of the ambient temperature exceeds a preset temperature range, the main control chip 10 outputs a pulse width modulation signal to control the first switch unit 40 to turn on.
[0080] Specifically, the high level of the pulse width modulation signal, i.e., the PWM signal, may be 5V, and the low level may be 0V, and the frequency of the PWM signal may be set according to the actual scenario. When the PWM signal is at a high level (5V), the first switch unit 40 is turned off, and when the PWM signal is at a low level (0V), the first switch unit 40 is turned off and on.
[0081] It should be noted that the detected quantity may be ambient temperature, humidity, air pressure, etc., which may be set specifically according to the actual application scenario. The embodiment of the present invention is described by taking ambient temperature as an example.
[0082] In an embodiment of the present invention, the main control chip 10 can utilize the detection signal input by the detection module 20 at the input / output port 101 to monitor the ambient temperature, and when the ambient temperature exceeds a preset temperature range, output a pulse width modulation signal to turn on the first switch unit 40, and use the alarm module 30 to sound an alarm to prompt the user.
[0083] In some optional embodiments, such as Figure 4As shown, the detection module 20 includes a first power supply 201, a first resistor 202, a second resistor 203 and a first capacitor 204, wherein one end of the first resistor 202 is respectively connected to the input / output port 101, the first end of the first capacitor 204, the first end of the second resistor 203 and the first interface of the first switch unit 40, and the other end of the first resistor 202 is connected to the first power supply 201. In addition, the second end of the first capacitor 204 and the second end of the second resistor 203 are grounded.
[0084] In the embodiment of the present invention, the first power source 201 may be a +5V electrode, the resistance of the second resistor 203 may be 270KΩ, and the capacity of the first capacitor 204 may be 0.1uF.
[0085] In some optional embodiments, the first resistor 202 is a thermistor, which is a sensor resistor and a sensitive element whose resistance value changes significantly with temperature. Therefore, the ambient temperature can be detected by changing the resistance value of the first resistor.
[0086] In an embodiment of the present invention, a temperature detection circuit composed of a first power supply, a first resistor, a second resistor and a first capacitor can be used to form a corresponding analog voltage signal at the input / output port, so that the main control chip can use the analog voltage signal to determine the ambient temperature and realize ambient temperature monitoring.
[0087] In some optional embodiments, see again Figure 4 The voltage divider module 50 includes a second power supply 501, a third resistor 502 and a fourth resistor 503, wherein the second power supply 501 is connected to one end of the fourth resistor 503 via the third resistor 502, the other end of the fourth resistor 503 is grounded, and the voltage divider port VREF between the third resistor 502 and the fourth resistor 503 is connected to the control end of the first switch unit 40.
[0088] Specifically, the second power source 501 may be a +5V electrode, the resistance value of the third resistor 502 may be 10KΩ, and the resistance value of the fourth resistor 503 may be 6.8KΩ.
[0089] In the embodiment of the present invention, the third resistor 502 and the fourth resistor 503 form a voltage divider circuit to provide a reference normal voltage at the voltage divider port VREF, so that the first switch unit is turned off, and the normal AD detection function can be performed. At the same time, since the first switch unit is turned off, the alarm module will not alarm.
[0090] In some optional embodiments, see again Figure 4The alarm module 30 includes a third power supply 301, a fifth resistor 302, a sixth resistor 303, a second switch unit 304, a seventh resistor 305 and an alarm device 306, wherein one end of the fifth resistor 302 is connected to the second interface of the first switch unit 40, and the other end of the fifth resistor 302 is respectively connected to the first end of the sixth resistor 303 and the control end of the second switch unit 304.
[0091] In addition, the third power supply 301 is connected to the second end of the sixth resistor 303 and the first interface of the second switch unit 304 respectively. The second interface of the second switch unit 304 is grounded after passing through the seventh resistor 305. The alarm device 306 is connected in parallel to both ends of the seventh resistor 305.
[0092] Specifically, the third power supply 301 can be a +5V electrode, the resistance of the fifth resistor 302 can be 5.1KΩ, the resistance of the sixth resistor 303 can be 5.1KΩ, the resistance of the seventh resistor 305 can be 5.1KΩ, and the second switch unit 304 can be a switching device such as a transistor or a MOS tube.
[0093] It should be noted that when an alarm is required, the first resistor 202 and the second resistor 203 will not affect the alarm circuit. When an alarm is required, the chip IO port is changed from an input port to an output port, and the voltage output by the IO port network is 5V (when PWM is high) or 0V (when PWM is low), which in turn causes the first switch unit 40 to be turned on or off. The turn-on and turn-off of the first switch unit 40 is only related to the voltage level of the IO network, and has nothing to do with the first resistor 202 and the second resistor 203. The turn-on and turn-off of the first switch unit 40 further controls the turn-on and turn-off of the second switch unit 304, thereby alarming.
[0094] In the embodiment of the present invention, when the first switch unit 40 is turned on, the third power supply 301 forms a loop through the sixth resistor 303, the fifth resistor 302, the first switch unit 40 to the ground, thereby turning on the transistor second switch unit 304, so that the alarm device alarms. After the alarm is completed, the main control chip changes the input / output port 101 to the AD detection port for ambient temperature detection.
[0095] In some optional implementations, the alarm device 306 is a buzzer.
[0096] In the embodiment of the present invention, when the first switch unit is turned off, the second switch unit is also turned off, and the buzzer does not sound; when the first switch unit is turned on, the second switch unit is also turned on, and the buzzer sounds, so as to remind the user in time.
[0097] The multifunctional multiplexing circuit of the present invention is described in detail below with reference to a specific application example.
[0098] See again Figure 4 , AD detection and buzzer driving use one chip IO port in time-sharing mode.
[0099] The IO port is set as the AD detection port by software default. In the temperature range of 0℃-40℃ to be detected, the resistance range of the first resistor 202 is 325KΩ-53KΩ, and the voltage range of the IO port is 2.2V-4.1V. The third resistor 502 and the fourth resistor 503 form a voltage divider circuit to provide a reference voltage (2V) at the voltage divider port VREF. At this time, the first switch unit 40 is turned off, and the normal AD detection function can be performed. At the same time, since the first switch unit 40 is turned off, the second switch unit 304 is also turned off, and the buzzer will not buzz.
[0100] When the buzzer is needed to sound, the software changes the IO port from the default AD detection port to the output port, outputs a PWM signal of a certain frequency, and when the PWM signal is at a high level (5V), the first switch unit 40 is turned off, and when the PWM signal is at a low level (0V), the first switch unit 40 is turned on, and the third power supply 301 passes through the sixth resistor 303, the fifth resistor 302, the first switch unit 40 to the ground to form a loop, and then the second switch unit 304 is turned on, so that the buzzer sounds. When the buzzing is finished, the software changes the IO port to the AD detection port again.
[0101] Moreover, when a buzzer is required, the first resistor 202 and the second resistor 203 will not affect the buzzer circuit. When a buzzer is required, the chip IO port is changed from an input port to an output port, and the voltage output by the IO port network is 5V (when PWM is high) or 0V (when PWM is low), which in turn causes the first switch unit 40 to be turned on or off. The turn-on and turn-off of the first switch unit 40 is only related to the voltage level of the IO network, and has nothing to do with the first resistor 202 and the second resistor 203. The turn-on and turn-off of the first switch unit 40 further controls the turn-on and turn-off of the second switch unit 304, thereby causing the buzzer to buzz.
[0102] The above circuit is used for ambient temperature detection and buzzing. The ambient temperature will not change very quickly, and the buzzing time of the buzzer is generally only 1-2s. When the buzzer is beeping, the software remembers the temperature before the buzzer. When the buzzer is beeping, it is considered that the ambient temperature is still the temperature before the buzzer. When the buzzer ends, AD detection is performed immediately, which can normally realize the ambient temperature detection and buzzing functions required by the circuit.
[0103] Specifically, the first switch unit 40 and the second switch unit 304 may be triodes or MOS transistors.
[0104] The present invention designs a circuit system in which AD detection and buzzer driving share one IO port, thereby saving one chip IO port resource.
[0105] According to an embodiment of the present invention, there is provided an electrical device, such as Figure 5 As shown, the electrical device includes a multifunctional multiplexing circuit 100. Exemplarily, the electrical device may be a water heater or other device that requires AD detection and buzzer alarm, but the present invention is not limited thereto.
[0106] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A multifunctional multiplexing circuit, characterized in that: The circuit includes a main control chip, a detection module, an alarm module and a first switch unit, wherein the main control chip is provided with an input / output port, wherein one end of the detection module is connected to the input / output port, and the other end of the detection module is connected to the alarm module via the first switch unit; The first switch unit is normally cut off, and the main control chip performs signal detection using a detection module connected to the input / output port; When the main control chip controls the first switch unit to be turned on, the main control chip drives the alarm module to alarm by using the input / output port.
2. The multifunctional multiplexing circuit according to claim 1, characterized in that: The circuit further comprises a voltage dividing module, wherein a voltage dividing port of the voltage dividing module is connected to a control end of the first switch unit; The normal voltage at the voltage-dividing port is greater than or equal to a cut-off voltage threshold of the first switch unit, so that the first switch unit is normally cut off.
3. The multifunctional multiplexing circuit according to claim 2, characterized in that: When the first switch unit is turned off, the main control chip uses the input / output port to obtain the detection signal input by the detection module, and determines the current value of the detection amount based on the detection signal.
4. The multifunctional multiplexing circuit according to claim 3, characterized in that: The main control chip outputs a control signal when detecting that the current value of the detection amount exceeds a preset range; wherein the low level voltage of the control signal is less than a cut-off voltage threshold of the first switch unit.
5. The multifunctional multiplexing circuit according to claim 4, characterized in that: The main control chip continuously outputs the control signal using the input / output port within a preset time, and controls the first switch unit to be turned on, so that the alarm module continuously gives an alarm within the preset time.
6. The multifunctional multiplexing circuit according to claim 4, characterized in that: The main control chip determines the current value of the ambient temperature based on the detection signal; When the main control chip detects that the current value of the ambient temperature exceeds a preset temperature range, the main control chip outputs a pulse width modulation signal to control the first switch unit to be turned on.
7. The multifunctional multiplexing circuit according to any one of claims 2 to 6, characterized in that: The detection module includes a first power supply, a first resistor, a second resistor and a first capacitor; One end of the first resistor is respectively connected to the input / output port, the first end of the first capacitor, the first end of the second resistor and the first interface of the first switch unit, and the other end of the first resistor is connected to the first power supply; The second end of the first capacitor and the second end of the second resistor are grounded.
8. The multifunctional multiplexing circuit according to claim 7, characterized in that: The first resistor is a thermistor.
9. The multifunctional multiplexing circuit according to any one of claims 2 to 6, characterized in that: The voltage dividing module includes a second power supply, a third resistor and a fourth resistor; The second power supply is connected to one end of the fourth resistor via the third resistor, the other end of the fourth resistor is grounded, and a voltage dividing port between the third resistor and the fourth resistor is connected to the control end of the first switch unit.
10. The multifunctional multiplexing circuit according to any one of claims 2 to 6, characterized in that: The alarm module includes a third power supply, a fifth resistor, a sixth resistor, a second switch unit, a seventh resistor and an alarm device; One end of the fifth resistor is connected to the second interface of the first switch unit, and the other end of the fifth resistor is respectively connected to the first end of the sixth resistor and the control end of the second switch unit; The third power supply is connected to the second end of the sixth resistor and the first interface of the second switch unit respectively. The second interface of the second switch unit is grounded after passing through the seventh resistor. The alarm device is connected in parallel to both ends of the seventh resistor.
11. The multifunctional multiplexing circuit according to claim 10, characterized in that: The alarm device is a buzzer.
12. The multifunctional multiplexing circuit according to claim 10, characterized in that: The first switch unit and the second switch unit are triodes.
13. An electrical device, characterized in that: The electrical device comprises the multifunctional multiplexing circuit according to any one of claims 1 to 12.
14. The electrical device according to claim 13, characterized in that: The electrical equipment is a water heater.