21
\$\begingroup\$

I'm a student studying electronics and I'm having trouble understanding the concept behind current sourcing and current sinking. We've covered it in a lab using a 7404 and an LED and all that. Just having trouble getting an intuitive understanding of what exactly is happening.

If anyone can take a crack at explaining, it would be greatly appreciated.

Just to be sure, I understand what the process is, in terms of current flow and from input to output and vice versa. Just not getting why one is preferred over the other, and what it has to do with having a floating Hi input or why I wouldn't want to have a floating Hi.

Input would be greatly appreciated.

Thanks!

\$\endgroup\$
6
  • \$\begingroup\$ This should be tagged 'electronics', which will require creating a new tag. \$\endgroup\$ Nov 11, 2009 at 3:59
  • 1
    \$\begingroup\$ Aren't all of the questions on here technically about electronics? \$\endgroup\$
    – Amos
    Nov 11, 2009 at 9:36
  • \$\begingroup\$ @Amos, not really. This question is low-level electronics ... really, how transistors work and are used. Most of the questions here are higher level: how can put pieces together to solve a specific problem. That's why I think it needs a specific tag. \$\endgroup\$ Nov 11, 2009 at 23:51
  • \$\begingroup\$ @W. Craig Trader - Wouldn't discrete-electronics be a better tag, then? \$\endgroup\$ Jul 16, 2011 at 12:37
  • 2
    \$\begingroup\$ @Fake - It's not discrete, it's integrated. My first idea was fundamentals, but that's not it either, methinks. I'm still thinking :-) \$\endgroup\$
    – stevenvh
    Jul 16, 2011 at 12:44

6 Answers 6

25
\$\begingroup\$

short version: current sources connect things to Vcc, current sinks connect them to ground.

longer version: The following is a practical explanation of current-sources/sinks as used in microcontrollers & TTL logic. For a more theoretical description, see the Wikipedia page on current source.

Some devices are very good at creating a connection to ground. (or whatever the lowest voltage is in the system, e.g. 0V) Other devices are very good at creating a connection to Vcc. (or whatever is the highest voltage in the system, e.g. +5V)

Those devices that are good connecting to ground are called current sinks; those good at connecting to Vcc are called current sources. Until recently (the last decade or so), it was unusual for integrated circuits to be good at being both. Most were good at being current sinks but were terrible at being current sources. So at lot of circuits were designed so all the chip had to do was connect to ground to make the circuit do its thing. Many chips still have an asymmetric current drive ability and function better switching to ground than switching to Vcc.

To me a good example of current source and current since are the standard "switch" configuration of a PNP and NPN transistor. A PNP is a good current source: you almost always connect its emitter to Vcc, and it switches it on/off. A NPN is a good current sink: its emitter is almost always connected to ground and it switches the ground connection on/off.

Why you choose one over the other often depends on the capabilities of the parts available to you. For instance, an RGB LED is often a "common-anode" type where the anode (positive lead) is connected on all three LED elements, so to turn on an element you need to connect its lead to ground. You can use three pins on a microcontroller to do this (or three NPN transistors) and they would be acting as current sinks.

\$\endgroup\$
10
\$\begingroup\$

Transistors are like water valves. They can either block a flow of water, or allow a flow of water to pass through them.

Current sources and current sinks both have these valves at the output, to either block current or allow current from outside devices. The difference is simple:

  • A current sink has a valve that internally connects to a low pressure
  • A current source has a valve that internally connects to a high pressure

If you connect a current sink to a component that's connected to a low pressure, nothing will happen. Both sides are at the same pressure, so it doesn't matter whether the valve is open or closed, no current will flow.

\$\endgroup\$
4
\$\begingroup\$

enter image description here

To start with, the floating input. In TTL floating inputs are the same as high, and they're not bad, as they are in CMOS. If you leave the input floating or make it high the second transistor will get current through the input transistor's base-collector junction, so the second transistor will conduct, and create a voltage drop over the 1k\$\Omega\$ resistor, which in turn will cause the lower output transistor to pull the output low. So it's indeed working as an inverter.

The output configuration is known as a totem-pole. It's kind of a push-pull, but with a difference: instead of a complementary NPN-PNP pair it uses two NPN transistors, and the diode an 130\$\Omega\$ resistor make it even more asymmetrical.
As a consequence a TTL totem-pole will be able to sink much more current than it can source, typically 16mA vs 0.4mA. So if you want to use TTL to control LEDs you'll want to connect the LED's anode via a resistor to \$V_{CC}\$ and sink the current.

\$\endgroup\$
2
\$\begingroup\$

Adding to todbot's answer. The reason you see thinks better at current sinking was not arbitrary, the transistor is physically one step faster to make with older processes. I also believe it's mobility of electrons is higher, but that is probably a bit too much device physics. -Max

\$\endgroup\$
2
\$\begingroup\$

If your output is either sourcing current or sinking it, it means the device is actively trying to drive the voltage on that output to one of the supply rails; the positive supply when sourcing, the ground/return when sinking. I.e., that the output is at a low impedance relative to one of the supply lines.

A floating line is one that has a high impedance to the supply/ground system. Floating inputs can behave a bit like little antennas, and pick up random noise from your circuit. This is why unused inputs should either be pulled to +V or ground. Most inputs are high impedance anyway.

If you're connecting standard CMOS outputs to the next devices inputs, there isn't too much to worry about, as the CMOS output stage will have the next device's input driven hard to one or the other logic levels. The output stage has two transistors, one that can drive the output to the +V rail, another that can pull it to ground.

A problem you might encounter, though, is when you have an 'open collector' (OC) or 'open drain' (OD) output stage. These devices basically only have the capability to pull the output to ground. When the output is at logic low, zero volts, the next device's input will be held at ground as the output sinks current. But when the output needs to be a logic '1', the output transistor shuts off, leaving you with .. a floating input. So with this kind of connection, you usually see a pull-up resistor to ensure that the voltage on the input doesn't wag around in response to whatever EMI is at hand. The resistor value is usually toward the smaller end of what you can get away with to not overwhelm the current sink capability of the OC/OD output.

The other common situation is 'tri-state' outputs. These are devices that have two transistor output stages, so they can drive '0' or '1' logic levels without aid of a pull-up resistor, but internally to the device there are controls that can turn off BOTH output transistors, resulting in the 'hi-Z' output condition. If you connect a single tri-stateable output to a single input, and conditions allow the output to go into tri-state mode, you get another case of floating input. You'd probably see a pull-up resistor under these circumstances too, for the same reasons as for the OC device. However, tri-stateable outputs are most often seen in 'bus' situations, where one of several devices asserts the logic level, and all others sit in their hi-Z state. Examine the schematic and there's usually a pull-up resistor on that line somewhere.

\$\endgroup\$
-1
\$\begingroup\$

Here are two images of current sink and current source (e.g in a PLC device):

Note that current sink is often used with micro controllers that may have problem sourcing current.

Figure 1 shows a sinking digital output that is connected to a sourcing digital input.

In this circuit, the load is pulled to ground because of the sinking digital input provided.

Sinking digital output diagram

Image source: Proces-Data - Current Source and Current Sink

Figure 2 shows a sourcing digital output that is connected to a sinking digital input.

In this circuit, the load is pulled up to receive voltage because the sourcing digital input has been provided.

Sourcing digital output diagram

Image source: Proces-Data - Current Source and Current Sink

\$\endgroup\$
4
  • \$\begingroup\$ Without any words of explanation, that's really confusing. \$\endgroup\$
    – Simon B
    Mar 26, 2020 at 15:22
  • \$\begingroup\$ Simon B the explanation was being going on. now it is done. \$\endgroup\$ Mar 26, 2020 at 15:35
  • \$\begingroup\$ @vahid_rowghanian - Welcome :-) I recommend that you read the tour and help center to see how Stack Exchange sites are different from typical internet forums. One example is that when you include something in an answer (e.g. photo, image or text) which isn't your original work, you need to properly reference it and add a link back to the original web page, as explained in this site rule. I found the original images and added the necessary links for you this time, but please add those links yourself in future. Thanks. \$\endgroup\$
    – SamGibson
    Mar 26, 2020 at 17:52
  • \$\begingroup\$ @vahid_rowghanian - I think you have made some mistakes in your text e.g. for the image showing a sinking digital output, you refer to a "sinking digital input". Similarly, for the image showing a sourcing digital output, you refer to a "sourcing digital input". Please review your text in comparison to the diagrams, and ensure the text is correct for each diagram. Thanks. \$\endgroup\$
    – SamGibson
    Mar 26, 2020 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.