[Analog circuit] ULN2003 driving common cathode or common anode digital tube thinking

The picture below is taken from the ULN2003 specification

1. From the typical application circuit diagram given in the specification, the driving led is sinking current. Can it output a high level to provide voltage to the led to drive the led? Refer to the figure below. If you connect the circuit in the following way, will all be successful? There are also different opinions on this issue on the Internet. I think ULN2003 cannot drive common cathode digital tubes, that is, the circuit diagram on the right is wrong, because ULN2003 outputs low-level effective.

A concept is proposed here, the structure of open collector (OC) or open drain (OD) output.
ULN2003 is the structure of open collector. Use the following figure to explain the structure of open collector

1. For Figure 1, when the input at the left end is "0", the front triode is cut off (that is, the collector C and the emitter E are equivalent to disconnection), so the 5V power supply is added to the right triode through a 1K resistor. The transistor on the right is turned on (that is, a switch is closed), and the output is "1".
When the input at the left end is "1", the front transistor is turned on, while the rear transistor is pulled low and in cut-off (equivalent to the switch is turned off). At this time, the output is floating and is in the "high impedance state".

2. We simplified Figure 1 to the form of Figure 2. When the input is "0", the switch is turned on and the output is pulled low; when the input is "1", the switch is turned off and the output is floating, and it is in a high-impedance state. At this time, the level state is unknown. If a pull-down resistor is connected to the ground, the output is "0"; if a pull-up resistor is connected to VCC, the output is "1". So it can be seen that the state of the high-impedance state is unknown.

3. 1K in Figure 3 is the pull-up resistor. If the switch is closed, the output level is 0; if the switch is open, the output level is 5V. At this time, the internal resistance of the output is 1K. If you want to connect a resistor R as a load, the final voltage on the load is 5*R/(R+1K), so if you want to get a higher voltage, you can use two methods One is to increase the value of R, or reduce the value of the pull-up resistor 1K, which can improve the driving capability. However, the value of the pull-up resistor 1K should not be too small, because the switch will generate current when the switch is closed, and this current cannot be too large. Therefore, the choice of this pull-up resistor needs to be considered comprehensively.

For the open-drain (OD) output, it is very similar to the open-collector output. Just replace the above transistor with a field effect tube. In this way, the collector becomes the drain, and the OC becomes the OD. The principle analysis is the same.

Another output structure is push-pull output. The structure of the push-pull output is to replace the upper pull-up resistor with a switch. When it is to output a high level, the upper switch is on and the lower switch is off; when it is to output a low level, the opposite is true. Compared with OC or OD, this push-pull structure has strong high and low-level driving capabilities. If two output ports with different output levels are connected together, a large current will be generated and the output ports may be burned out. The OC or OD output mentioned above will not have such a situation, because the current provided by the pull-up resistor is relatively small. If the push-pull output is set to high-impedance state, the two switches must be disconnected at the same time (or use a transmission gate on the output port), so that it can be used as an input state. Some IO ports of AVR microcontrollers have this structure.

This article analyzes the knowledge of ULN2003 driving the digital tube, and at the same time, it is also a sort of my own. For the pull-up resistance, pull-down resistance, open collector output, open drain and push-pull output, it is also a simple record for my own learning. notes.

Guess you like

Origin blog.csdn.net/wsq_666/article/details/114003634