FB pixel

Difference between Sourcing and Sinking in a Circuit

Published


I remember in college hearing something about sourcing and sinking in a circuit and being very confused as I’d never heard of it before. Let’s try and avoid you having the same experience. It’s a simple concept but the implications are important. Let’s start with a circuit diagram to see what this is all about.

Figure 1: Sourcing vs Sinking network
Figure 1: Sourcing vs Sinking network

In an electrical circuit, sourcing refers to a device or circuit element that provides electrical energy to the circuit, while sinking refers to a device or circuit element that consumes electrical energy from the circuit. In the image above, the device is sinking, or absorbing the current that is coming from the voltage rail through the load. This same device is then sourcing current to the load that is connected to ground. This is the essence of sinking or sourcing.

Outside of a device sourcing and sinking current, some other common examples of a sourcing device is a power supply, which provides electrical energy to the circuit in the form of a voltage or current. A sink could be considered the load itself, which consumes electrical energy in the form of current and converts it into other forms of energy, such as light, heat, or motion. Voltage or current sources are the ones sourcing the energy while the loads are the ones sinking the energy.

Since, in our experience, most of the time that sourcing and sinking a load is being discussed in reference to using a microcontroller, it’s important to note that it is generally better to sink current into the microcontroller rather than sourcing it. Sinking current into a microcontroller means that the current flows into the microcontroller's input pins, and is then consumed by the internal components of the microcontroller. While this may sound strange or non-ideal, it is generally easier for the microcontroller to shunt this current to ground and absorb a little power as heat rather than try and generate the sourcing current. Sourcing current can cause large voltage swings on the input which can introduce noise.

It's also worth noting that depending on the microcontroller used, it may have an internal protection mechanism such as pull-up/pull-down resistors and clamping diodes. These are designed to help sink current into the microcontroller, further enabling them to safely handle the incoming current.

There are, of course, many exceptions. Sourcing current out of a microcontroller means that current flows out of the microcontroller's output pins, and is then consumed by external components in the circuit. This method is less common and less versatile for digital circuits, but is used for analog circuits where the microcontroller acts as a current source. As a source, the microcontroller can output data or control signals to other devices. For example, if you want to control the speed of a motor, you would use a microcontroller as a source to send a PWM signal to the motor.

Like many things in engineering, the final decision of whether to use a microcontroller as a sink or a source depends on the specific requirements of the application and the desired functionality. If the circuit can be controlled properly by sinking the current into the microcontroller, then that is the recommended setup. Cases such as driving an LED are more appropriately set up to have the LEDs and their current limiting resistors connected to VCC with their cathode is attached to the MCU GPIO. However, when driving a communications line with specific voltage levels required and tight timing, then the microcontroller will act as the source, driving the voltage as needed. While it may seem that sometimes sinking and sourcing are functionally the same, the real life mechanics of devices come into play and can sway your decision on where.

Figure 2: Sinking vs Sourcing a simple LED Circuit
Figure 2: Sinking vs Sourcing a simple LED Circuit

While I have intentionally focused primarily on MCUs, it is important to pull back and remember that, at a higher level, sourcing current is simply creating current and sinking current is either shunting current to ground or absorbing current. This is the most important thing to remember when discussing the concept with others but the potential ramifications should definitely be considered when doing a circuit design. I hope this has been helpful, if you have any questions, please leave them in the comments below!

Make Bread with our CircuitBread Toaster!

Get the latest tools and tutorials, fresh from the toaster.

What are you looking for?