Bidirectional PMW input and output circuit
By designing a bidirectional PMW input and output circuit, using the combination of PWM input and output ports of the microcontroller and PWM signal input/output ports, the problems of low compatibility and utilization in the prior art are solved, efficient bidirectional input and output of PWM signals are achieved, and circuit complexity and cost are reduced.
Patent Information
- Application Number
- CN202421582920.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2034-07-05
AI Technical Summary
In the prior art, the compatibility and utilization rate of PWM ports are low, the circuit structure is complex, the number of components is large, and the cost is high, so the function of input and output of bidirectional PWM signals cannot be realized.
A bidirectional PMW input and output circuit is designed, including a microcontroller PWM input port, a microcontroller PWM output port and a PWM signal input/output port. It is connected through independent electronic component links to realize the bidirectional input and output of the PWM signal.
It improves the utilization and compatibility of hardware ports, realizes precise control and protection of PWM signals, ensures stable signal transmission and safe operation of circuits, and reduces circuit complexity and cost.
Smart Images

Figure CN222690078U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the technical field of input and output PWM signal circuits, in particular to a bidirectional PWM input and output circuit. Background Art
[0002] At present, PWM input ports or output ports are used for motor speed control and status monitoring of water pumps, fans and other equipment. When the input frequency signal needs to be detected, some BMS design companies will design a separate PWM input port. When the external load needs to be controlled by PWM signal, some BMS design companies will design a separate PWM output port. Different PWM input / output ports are designed for different input / output signal types. Therefore, independently set PWM input or output ports will reduce the utilization rate of hardware ports.
[0003] For example, application number CN201620011410.0 discloses an input-output bidirectional compatible interface circuit, in which two input-output circuit units with the same circuit structure are set, including a unit input terminal, a unit output terminal, a power input terminal, an electrical isolation module, a current limiting module and two voltage divider modules, while realizing the isolation conversion between the internal level of the controller and the vehicle interface level, it also realizes the input-output bidirectional automatic compatibility, but it cannot control the device connected to the port by adjusting the duty cycle of the PWM signal, and there is a defect of not adapting to the PWM signal input and output; application number CN201922357523.2 discloses a PWM signal isolation conversion circuit, in which a single-channel PWM signal is isolated and converted into a multi-channel synchronous PWM signal output, and each PWM signal is isolated by an optocoupler, and each PWM signal can be adjusted by adjusting the single-channel PWM signal, but the PWM port can only be set as a PWM input port alone, and the bidirectional input and output function cannot be realized, and there is a defect of not being compatible with the PWM signal input and output.
[0004] Therefore, the input and output circuits disclosed in the above two utility model patents have a single design when inputting or outputting PWM signals, which results in low compatibility and utilization of the PWM port, as well as complex circuit structure, large number of components and high cost. Utility Model Content
[0005] The purpose of the utility model is to provide a bidirectional PMW input and output circuit to solve the technical problems mentioned in the above background technology.
[0006] In order to achieve the above-mentioned purpose, the utility model discloses a bidirectional PMW input-output circuit, comprising a single-chip microcomputer PWM input port, a single-chip microcomputer PWM output port and a PWM signal input / output port, and the single-chip microcomputer PWM input port and the single-chip microcomputer PWM output port are respectively connected to the PWM signal input / output port through their own independent electronic component links, wherein the circuit between the single-chip microcomputer PWM input port and the PWM signal input / output port is sequentially connected in series with a first current limiting circuit, a resistor R2, an anti-reverse diode D1, a second current limiting circuit, an overvoltage protection circuit and a decoupling and filtering circuit;
[0007] A transistor switching circuit is connected in series on the circuit between the single-chip computer PWM output port and the PWM signal input / output port, and pin 3 of the transistor switching circuit is connected in series with the second current limiting circuit, pin 1 of the transistor switching circuit is topologically connected to pin 3 of the NPN transistor Q2, and pin 2 of the NPN transistor Q2 is connected to the ground wire GND, and the overvoltage protection circuit is topologically connected between pin 2 of the NPN transistor Q2 and the ground wire GND, and the transistor switching circuit is connected in parallel with the overvoltage protection circuit.
[0008] Optionally, the first current limiting circuit includes a 5V direct current DC and a single-chip microcomputer pin pull-up resistor R1, and the direct current DC is connected in series with the single-chip microcomputer pin pull-up resistor R1, and the other end of the single-chip microcomputer pin pull-up resistor R1 is topologically connected to the circuit between the single-chip microcomputer PWM input port and the resistor R2, and the first current limiting circuit is used to protect the single-chip microcomputer PWM input port from damage by excessive current by providing a power supply with limited current, and the single-chip microcomputer pin pull-up resistor R1 ensures that the signal line is pulled up to a certain level to maintain the stability of the circuit;
[0009] The second current limiting circuit includes a 12V voltage and a resistor R4, and the 12V voltage is connected in series with the resistor R4, and the other end of the resistor R4 is topologically located in the circuit between the anti-reverse diode D1 and the overvoltage protection circuit. The second current limiting circuit is used to drive the NPN transistor Q1 part with high voltage requirements by providing voltage to the subsequent circuit, and the resistor R4 plays a current limiting role.
[0010] Optionally, the transistor switch circuit includes an NPN transistor Q1, a resistor R3, and a resistor R5, and pin 1 of the NPN transistor Q1 is connected in series with the resistor R3, and pin 2 of the NPN transistor Q1 is connected in series with the resistor R5, and is used to control the PWM output pin to control the on and off of the NPN transistor Q1, so as to output a PWM waveform with a certain frequency and duty cycle to the outside;
[0011] An NPN transistor Q2 is topologically connected between the resistor R3 and pin No. 1 of the NPN transistor Q1, pin No. 1 of the NPN transistor Q2 is connected in series with the resistor R5, and pin No. 1 of the NPN transistor Q2 is used together with R5 for current limiting protection of the subsequent circuit, and pin No. 1 of the NPN transistor Q2 is grounded GND.
[0012] Optionally, the overvoltage protection circuit includes a TVS diode TV1, and one end of the TVS diode TV1 is connected between the second current limiting circuit and the decoupling and filtering circuit, the other end of the TVS diode TV1 is connected between pin 2 of the NPN transistor Q2 and the ground line GND, and one end of the resistor R5 away from the NPN transistor Q2 is connected to the other end of the TVS diode TV1, and the TVS diode TV1 plays a clamping role, which is used to quickly respond to excessive voltage and protect the circuit from voltage shock;
[0013] The decoupling and filtering circuit includes a capacitor C1 and a ground line GND, and one end of the capacitor C1 is connected between the overvoltage protection circuit and the PWM signal input / output port, and the other end of the capacitor C1 is connected to the ground line GND. The capacitor C1 can filter out signal noise and smooth voltage fluctuations, thereby improving signal quality and circuit stability.
[0014] Optionally, the resistance values of the resistor R2 and the resistor R3 are equal, both are 1KΩ, and the resistor packages are the same, both are 0402, that is, the size is 0.04 inches by 0.02 inches, and the resistance precision is consistent, both are 1%;
[0015] The resistance of the resistor R4 is 2KΩ, the package is 1206, and the accuracy is 1%;
[0016] The resistor R5 has a resistance of 10Ω, a package size of 0402, and a precision of 1%.
[0017] Optionally, the anti-reverse diode D1 is of model BAS21HT1G, which is used to protect the circuit from damage caused by a power supply with wrong polarity or reverse current, and the anti-reverse diode D1 supports high voltage and high current, and is suitable for use as a switch and a rectifier;
[0018] The model of TVS diode TV1 is PESD1LIN.115, which can absorb excessive voltage that damages the circuit to protect the subsequent circuit and is used as a transient voltage suppressor for low voltage lines.
[0019] Optionally, the capacitor C1 has a capacitance of 1 nF, a package of 0402, and a withstand voltage of 100 V, and is used to effectively filter high-frequency noise, thereby maintaining the overall stability and performance of the circuit.
[0020] Compared with the prior art, the utility model has the following advantages:
[0021] In the bidirectional PMW input and output circuit, by setting a PWM input port and a PWM output port of the single-chip computer and a corresponding matching circuit, the circuit can be used as both a PWM input detection port and a PWM output port, that is, the multiplexing function of the port is increased, and the precise control and protection of the PWM signal is realized to ensure the stable transmission of the signal and the safe operation of the circuit. This not only improves the utilization rate and compatibility of the entire hardware port, but also reduces the variety of products on the production line, improves the production efficiency of the production line, further saves energy and reduces emissions, and achieves the effects of simple circuit structure, reliable performance, small number of components, low cost, and circuit failure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a schematic diagram of the bidirectional PMW input and output circuit structure of the utility model.
[0023] Figure 2 This is a schematic diagram of the structure of the PWM input signal detection circuit of the utility model.
[0024] Figure 3 This is a schematic diagram of the structure of the PWM signal output circuit of the utility model.
[0025] The accompanying drawings are marked as follows: 1. first current limiting circuit; 2. second current limiting circuit; 3. transistor switch circuit; 4. overvoltage protection circuit; 5. decoupling and filtering circuit. DETAILED DESCRIPTION
[0026] The technical solution of the utility model is described in detail below through specific embodiments.
[0027] Reference Figure 1-3 As shown, the utility model discloses a bidirectional PMW input-output circuit structure, including a single-chip microcomputer PWM input port, a single-chip microcomputer PWM output port and a PWM signal input / output port, and the single-chip microcomputer PWM input port and the single-chip microcomputer PWM output port are respectively connected to the PWM signal input / output port through their own independent electronic component links, wherein the circuit between the single-chip microcomputer PWM input port and the PWM signal input / output port is sequentially connected in series with a first current limiting circuit 1, a resistor R2, an anti-reverse diode D1, a second current limiting circuit 2, an overvoltage protection circuit 4 and a decoupling and filtering circuit 5;
[0028] A transistor switching circuit 3 is connected in series on the circuit between the PWM output port of the single-chip computer and the PWM signal input / output port, and pin 3 of the transistor switching circuit 3 is connected in series with the second current limiting circuit 2, pin 1 of the transistor switching circuit 3 is topologically connected to pin 3 of the NPN transistor Q2, and pin 2 of the NPN transistor Q2 is connected to the ground wire GND, and an overvoltage protection circuit 4 is topologically connected between pin 2 of the NPN transistor Q2 and the ground wire GND, and the transistor switching circuit 3 is connected in parallel with the overvoltage protection circuit 4.
[0029] Preferably, the first current limiting circuit 1 includes a 5V direct current DC and a single-chip microcomputer pin pull-up resistor R1, and the direct current DC is connected in series with the single-chip microcomputer pin pull-up resistor R1, and the other end of the single-chip microcomputer pin pull-up resistor R1 is topologically located on the circuit between the single-chip microcomputer PWM input port and the resistor R2. The first current limiting circuit 1 is used to protect the single-chip microcomputer PWM input port from damage by excessive current by providing a power supply with limited current, and the single-chip microcomputer pin pull-up resistor R1 ensures that the signal line is pulled up to a certain level to maintain the stability of the circuit;
[0030] The second current limiting circuit 2 includes a 12V voltage and a resistor R4, and the 12V voltage is connected in series with the resistor R4. The other end of the resistor R4 is topologically located in the circuit between the anti-reverse diode D1 and the overvoltage protection circuit 4. The second current limiting circuit 2 provides voltage to the subsequent circuit to drive the NPN transistor Q1 part with high voltage requirements, and the resistor R4 plays a current limiting role to protect the subsequent circuit.
[0031] Preferably, the transistor switch circuit 3 includes an NPN transistor Q1, a resistor R3, and a resistor R5, and the pin 1 of the NPN transistor Q1 is connected in series with the resistor R3, and the pin 2 of the NPN transistor Q1 is connected in series with the resistor R5, and is used to control the PWM output pin to control the on and off of the NPN transistor Q1, so as to output a PWM waveform with a certain frequency and duty cycle to the outside;
[0032] The NPN transistor Q2 is topologically connected between the resistor R3 and the pin No. 1 of the NPN transistor Q1, the pin No. 1 of the NPN transistor Q2 is connected in series with the resistor R5, and the pin No. 1 of the NPN transistor Q2 is used together with R5 for current limiting protection of the subsequent circuit, and the ground wire GND of the pin No. 1 of the NPN transistor Q2 is used to stabilize the working state of the NPN transistor Q2.
[0033] Preferably, the overvoltage protection circuit 4 includes a TVS diode TV1, and one end of the TVS diode TV1 is connected between the second current limiting circuit 2 and the decoupling and filtering circuit 5, and the other end of the TVS diode TV1 is connected between the No. 2 pin of the NPN transistor Q2 and the ground wire GND, and one end of the resistor R5 away from the NPN transistor Q2 is connected to the other end of the TVS diode TV1. The TVS diode TV1 plays a clamping role, which is used to quickly respond to excessive voltage and protect the circuit from voltage shock, that is, to protect the subsequent circuit;
[0034] The decoupling and filtering circuit 5 includes a capacitor C1 and a ground line GND, and one end of the capacitor C1 is connected between the overvoltage protection circuit 4 and the PWM signal input / output port, and the other end of the capacitor C1 is connected to the ground line GND. The capacitor C1 can filter out signal noise and smooth voltage fluctuations, thereby improving signal quality and circuit stability, and is used to absorb static or surge to protect the subsequent circuit.
[0035] Preferably, the resistance values of resistors R2 and R3 are equal, both are 1KΩ, and the resistor packages are the same, both are 0402, that is, the size is 0.04 inches by 0.02 inches, and the resistance precision is consistent, both are 1%, which is used for current limiting;
[0036] The resistance of resistor R4 is 2KΩ, the package is 1206, and the accuracy is 1%;
[0037] The resistance value of resistor R5 is 10Ω, the package is 0402, and the accuracy is 1%.
[0038] Preferably, the anti-reverse diode D1 is of model BAS21HT1G, which is used to protect the circuit from damage caused by a power supply with wrong polarity or reverse current, and the anti-reverse diode D1 supports high voltage and high current, and is suitable for use as a switch and a rectifier;
[0039] The model of TVS diode TV1 is PESD1LIN.115, which can absorb excessive voltage that damages the circuit to protect the subsequent circuit and is used as a transient voltage suppressor for low voltage lines.
[0040] Preferably, the capacitor C1 has a capacitance of 1 nF, a package of 0402, and a withstand voltage of 100 V, and is used to effectively filter high-frequency noise, thereby maintaining the overall stability and performance of the circuit.
[0041] It is additionally noted that, during the external PWM input signal detection process, the PWM signal input port is sequentially connected in series with a decoupling and filtering circuit consisting of a capacitor C1 connected to the ground line GND, a current limiting circuit consisting of a 12V voltage connected in series with a resistor R1, a resistor R2, a voltage divider circuit connected to the ground line GND by a resistor R3, and a single-chip computer;
[0042] During the PWM signal output process, the single chip computer is sequentially connected to the resistor R4 and the NPN transistor Q1, and the emitter of the NPN transistor Q1 is connected to the ground line GND, the collector of the NPN transistor Q1 is connected to a current limiting circuit with a 12V voltage connected in series by the resistor R5, and a decoupling and filtering circuit and a PWM signal output port connected to the ground line GND by a capacitor C2 are topologically connected in sequence between the current limiting circuit and the NPN transistor Q1.
[0043] Working principle: First, when the PWM signal is input, the first current limiting circuit 1 provides a 5V reference voltage to the MCU PWM input port, and the signal current entering the MCU is reduced and adjusted through the resistor R2, and the anti-reverse diode D1 prevents any reverse current from damaging the MCU, and the decoupling and filtering circuit 5 effectively reduces the interference of the circuit, and the PWM signal is input to the MCU PWM input port of the MCU; then when the PWM signal is output, the second current limiting circuit 2 provides a 12V necessary voltage to the transistor switch circuit 3 and uses R4 to limit the current, and the MCU PWM output The resistor R3 at the port controls the amount of current flowing to the base of pin 1 of the NPN transistor Q1, thereby controlling the switching state of the NPN transistor Q1, and the resistor R5 at the emitter of pin 2 of the NPN transistor Q1 stabilizes the voltage and helps control the switching speed of the NPN transistor Q1, while the NPN transistor Q2 controls the connection between the ground line GND and the NPN transistor Q1, and the overvoltage protection circuit 4 short-circuits the excess voltage in the NPN transistor Q1 and the NPN transistor Q2 to the ground line GND to protect the subsequent circuit and ensure that the PWM output port of the microcontroller can output a PWM signal.
[0044] The above description is only a preferred embodiment of the utility model and is not intended to limit the utility model. Any modifications, equivalent substitutions, improvements, etc. made within the design concept of the utility model should be included in the protection scope of the utility model.
Claims
1. A bidirectional PMW input and output circuit, characterized in that: The device comprises a single-chip microcomputer PWM input port, a single-chip microcomputer PWM output port and a PWM signal input / output port, wherein the single-chip microcomputer PWM input port and the single-chip microcomputer PWM output port are respectively connected to the PWM signal input / output port through respective independent electronic component links, wherein a first current limiting circuit (1), a resistor R2, an anti-reverse diode D1, a second current limiting circuit (2), an overvoltage protection circuit (4) and a decoupling and filtering circuit (5) are sequentially connected in series in the circuit between the single-chip microcomputer PWM input port and the PWM signal input / output port; A transistor switch circuit (3) is connected in series to the circuit between the single-chip computer PWM output port and the PWM signal input / output port, and pin No. 3 of the transistor switch circuit (3) is connected in series with the second current limiting circuit (2), pin No. 1 of the transistor switch circuit (3) is topologically connected to pin No. 3 of an NPN transistor Q2, and pin No. 2 of the NPN transistor Q2 is connected to a ground line GND, and the overvoltage protection circuit (4) is topologically connected between pin No. 2 of the NPN transistor Q2 and the ground line GND, and the transistor switch circuit (3) is connected in parallel to the overvoltage protection circuit (4).
2. A bidirectional PMW input-output circuit according to claim 1, characterized in that: The first current limiting circuit (1) comprises a 5V direct current DC and a single-chip microcomputer pin pull-up resistor R1, wherein the direct current DC is connected in series with the single-chip microcomputer pin pull-up resistor R1, and the other end of the single-chip microcomputer pin pull-up resistor R1 is topologically located on a circuit between the single-chip microcomputer PWM input port and the resistor R2; The second current limiting circuit (2) comprises a 12V voltage and a resistor R4, and the 12V voltage is connected in series with the resistor R4, and the other end of the resistor R4 is topologically connected to the circuit between the anti-reverse diode D1 and the overvoltage protection circuit (4).
3. A bidirectional PMW input-output circuit according to claim 2, characterized in that: The transistor switch circuit (3) comprises an NPN transistor Q1, a resistor R3 and a resistor R5, wherein a pin No. 1 of the NPN transistor Q1 is connected in series with the resistor R3, and a pin No. 2 of the NPN transistor Q1 is connected in series with the resistor R5; The NPN transistor Q2 is topologically connected between the resistor R3 and the pin No. 1 of the NPN transistor Q1, and the pin No. 1 of the NPN transistor Q2 is connected in series with the resistor R5.
4. A bidirectional PMW input-output circuit according to claim 3, characterized in that: The overvoltage protection circuit (4) comprises a TVS diode TV1, and one end of the TVS diode TV1 is connected between the second current limiting circuit (2) and the decoupling and filtering circuit (5), the other end of the TVS diode TV1 is connected between pin 2 of the NPN transistor Q2 and a ground line GND, and one end of the resistor R5 away from the NPN transistor Q2 is connected to the other end of the TVS diode TV1; The decoupling and filtering circuit (5) comprises a capacitor C1 and a ground line GND, and one end of the capacitor C1 is connected between the overvoltage protection circuit (4) and the PWM signal input / output port, and the other end of the capacitor C1 is connected to the ground line GND.
5. A bidirectional PMW input-output circuit according to claim 4, characterized in that: The resistance values of the resistor R2 and the resistor R3 are equal, both are 1KΩ, and the resistor packages are the same, both are 0402, and the resistance precision is consistent, both are 1%; The resistance of the resistor R4 is 2KΩ, the package is 1206, and the accuracy is 1%; The resistor R5 has a resistance of 10Ω, a package size of 0402, and a precision of 1%.
6. A bidirectional PMW input-output circuit according to claim 4, characterized in that: The model of the anti-reverse diode D1 is BAS21HT1G; The model of TVS diode TV1 is PESD1LIN.
115.
7. A bidirectional PWM input-output circuit according to claim 4, characterized in that: The capacitor C1 has a capacitance of 1nF, a package size of 0402, and a withstand voltage of 100V.
Citation Information
Patent Citations
Two -way compatible interface circuit of input / output
CN205301913U
PWM signal isolation conversion circuit
CN210670029U