Projects
Power Supply

Power Supply

Powering Microcontroller Boards

There are multiple ways to supply power to a microcontroller board:

  • USB Connector

The board can be powered by connecting it to a computer using an appropriate USB cable depending on the USB connector provided with the board. The USB cable is also used to upload programs to the board from the IDE running on the computer. The cable also acts as a data transmission channel to send data to or receive data from the microcontroller on the computer (the data is processed on the computer by the IDE or a Node-RED flow).

Once the board is programmed and if it does not need to exchange data with a program running on a computer it can be powered by an external battery placed in a holder with a USB connector.

  • VIN Pin

If you have a battery without a USB connector you can supply power using wires connected to the VIN and Ground pins on the board. The VIN pin is connected directly to the input pin of the onboard voltage regulator on boards and therefore it does not have reverse polarity protection, which is required to protect the regulator. Hence, this approach must be used with caution.

  • Barrel Jack Connector

Some boards have a barrel jack connector which is a connector that is typically found on an AC to DC converter. The board can then be supplied power from an electrical wall socket.

  • Battery Connector

Some boards have a battery connector which can be used with battery holders.

⚠️

The preferred option to supply power to a board for beginners is through the USB connector from the computer or through the barrel jack connector from an AC to DC converter. The reason these are preferred is that they provide a regulated supply with a fixed voltage, unlike batteries whose voltage may vary as they discharge and also need appropriate connectors.

Powering Modules and Components

When starting with building circuits we typically use breadboards. Modules and components are then supplied power directly from the ouput power pins on the board. You can get a breadboard compatible power supply module with a barrel jack connector that can be used to power modules and components separately using an AC to DC converter.

Supply and Operating Voltage

Microcontroller boards are usually powered by a 5V supply. They have output voltage pins to supply power to connected components, which can be 5V or 3.3V or both. The operating voltage of a board is the voltage of the signal output on the pins to which components and other boards are connected to exchange data with, which can be 5V or 3.3V (but not both).

Modules and components almost always have the same supply and operating voltage.

It is very important to know the operating voltage of the board and each connected component. Even if the power supplied to the connected component is as expected, the signal value voltages should also be considered.

If a component with a 3.3V operating voltage is connected to a board with a 5V operating voltage the component may burn out. If a component with a 5V operating voltage is connected to a board with a 3.3V operating voltage it may not work properly.

For example, an Arduino Nano can supply 5V or 3.3V to power components but has an operating voltage of 5V. So even if you connect a 3.3V component with the correct supply voltage it may still burn out because the signals from the Nano will be at 5V.

On the other hand an ESP32 can only supply 3.3V and has the same operating voltage. So all 3.3V components will work just fine but 5V components may need an alternative power supply, while the signal voltage may be sufficient.

If you must use a board and components with different operating voltages, you can use a level shifter. This is a circuit used to translate signals from one voltage level to another. Level shifters only work with digital signals, you cannot level shift analog signals.

Current Drawn

Each microcontroller board is capable of supplying a maximum current and each connected component draws a certain amount of current. If the connected components together draw more current that the microcontroller board can supply the circuit may not work properly.