Arduino, ESP32, Raspberry Pi and LED strips: the currents stated by the manufacturers, how to do the sums with the right margin and when you need a step-down
· By Ada Intelisano · informaticait.it technical team
The ESP32 that reboots just as it connects to Wi-Fi, the Raspberry Pi warning about low voltage: often the project is fine and the problem is the power supply. Espressif says so in its design guidelines: when the ESP32 transmits, the current jumps suddenly and, if the supply can't keep up, the voltage collapses. Choosing well costs little; you just need to do the sums before you buy.
The sums are done in amps
The board sets the voltage: 5 V for the Raspberry Pi and NeoPixel strips, 7 to 12 V on the Arduino UNO's barrel jack, 12 V for many LED strips. The amps you work out by adding up what each part draws: board, sensors, display, motors, LEDs. The power supply has to be able to deliver more than that. Mean Well, which makes a great many power supplies, recommends choosing one rated at 30% more power than the actual need (for 100 W, one of 130 W or more) and points out that in the heat the available power drops, as the curves in its datasheets show.
A power supply bigger than you need does no harm: the board only takes the current it needs. Adafruit sums it up like this: extra amps are good, extra volts are bad.
To find out how much your project really draws, measure it. In the guide How much does it draw? Current and power with the INA219 we do it step by step with an ESP32.
Arduino
From the computer's USB: a USB 2.0 port supplies 500 mA (USB specification), and the UNO R3 has a resettable fuse that cuts off the USB if more than 500 mA is drawn. On the barrel jack Arduino recommends 7 to 12 V for the UNO R3: a 9 V 1 A supply is the classic choice. The UNO R4 (Minima and WiFi) accepts 6 to 24 V, and its 5 V pin supplies up to 1.2 A when the board is powered from the jack, or up to 2 A when it is powered from USB. But Arduino itself warns: high-current devices such as servo motors should never be powered from the 5 V pin.
Output pins are for control, not for power. On the UNO R3 the recommended value is 20 mA per pin (40 mA is the ATmega328P's absolute maximum, never to be exceeded); on the UNO R4 it is 8 mA. Motors and LED strips need a MOSFET, as we explain in the guide MOSFET module with Arduino and ESP32.
ESP32
Espressif asks for a 3.3 V supply that can deliver at least 500 mA. On development boards the on-board regulator takes care of this, but the principle stands: the source has to cope with the transmission peaks. The ESP32-DevKitC has three inputs, USB, the 5V pin and the 3V3 pin, and Espressif is clear: use only one at a time, otherwise the board or the power source can be damaged. So no USB cable plugged in while you power it from the 5V pin.
If the project runs on batteries, the sums change: you will find them in the guides Lithium batteries: voltages, charging and protection and ESP32 power consumption and deep sleep.
Raspberry Pi
Here the figures come from the official documentation, as the recommended power supply current:
- Raspberry Pi 5 and Pi 500: 5 A;
- Raspberry Pi 4 and Pi 400: 3 A;
- Raspberry Pi 3 B and 3 B+: 2.5 A;
- Zero and Zero W: 1.2 A.
The Pi 5 also works with a 3 A supply, but then it limits USB peripherals to 600 mA in total instead of 1.6 A, and USB boot is disabled by default. The official 27 W supply delivers 5.1 V at 5 A (plus 9, 12 and 15 V for other USB-C PD devices) and the Pi 5 recognises it automatically. For the Pi 4 and Pi 400 there is the 15 W supply, 5.1 V 3 A, and for models with micro USB the 12.5 W one, 5.1 V 2.5 A. If the voltage drops below about 4.63 V, the board notices and reports it (every model from the B+ onwards, except the Zero series).
A note on cables: a standard USB-C cable is rated for 3 A; above that you need electronically marked cables, up to 5 A. The official supplies have a fixed cable, so the question doesn't arise.
Addressable 5 V LED strips
A NeoPixel strip's consumption depends on colour and brightness, and the worst case is full white. Take the 5-metre Adafruit roll with 30 LEDs per metre: the product page states up to 60 mA per LED and about 9.5 W per metre at full white. For the whole roll that comes to between 9 and 10 A at 5 V (our calculation). With Mean Well's margin, the 5 V 5 A supply is right for about two metres of this strip at full brightness; for the whole roll, write to us and we will tell you how to split it across several supplies.
Adafruit's advice to avoid surprises:
- a 500 to 1000 µF capacitor (rated 6.3 V or more) across + and − where the power comes in;
- a 300 to 500 Ω resistor on the data wire, close to the first LED;
- connect ground first, then 5 V, then data;
- on long strips, feed power in at several points, so that no LED is more than about a metre from a power connection.
The 5.5 × 2.5 mm DC socket to screw terminal adapter is handy for connecting the strip wires to the 5 V 5 A supply's plug without cutting it. A first low-power experiment is in the guide The LED ring: twelve colors from a single pin.
12 V LED strips
Here the sums are simpler, because the whole strip lights up together. According to its product page, the 5-metre Adafruit warm white COB roll draws about 1.8 A in total at most. Add 30% and you reach about 2.3 A (our calculation): the 12 V 2 A plug-in supply is right for up to about four metres of this strip, and for the whole roll the 12 V 5 A desktop supply has plenty in hand. If a strip's product page gives watts per metre, this is how to work out the current: watts per metre times the number of metres, divided by 12.
When the voltage isn't the right one
You have a 12 V supply for the strip and need 5 V for the ESP32 and the sensors? Instead of a second power supply, you can fit a step-down. The DFRobot DFR1015 module takes 7.5 to 30 V and gives 3.3, 5, 9 or 12 V, your choice; without a heatsink it reaches 3 A (2.5 A at 9 V). The DFR0831 turns 7 to 24 V into 5 V at 4 A with six outputs, and DFRobot suggests it precisely for servo motors and LED strips. To understand when a linear regulator will do and when you need a switching one, read Linear or switching regulator: which one to choose and Step-down, step-up and buck-boost: choosing the right module.
A word on safety: all the power supplies in this article are plug-in or desktop units, already enclosed, and the 230 V side is never touched. Power supplies that connect to the mains through screw terminals are installed by a qualified person.
Not sure which power supply to buy?
Send us a list of what you want to connect (board, sensors, motors, metres of strip) and we will tell you how many amps you need and which power supply from our range will do the job.