Skip to content

Commit 7319319

Browse files
committed
Update power-consumption.md
1 parent bee5593 commit 7319319

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

content/learn/04.electronics/11.power-consumption/power-consumption.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,44 @@ description: 'Learn about measuring power consumption on an Arduino board.'
44
tags: [Power Consumption]
55
author: 'Karl Söderby'
66
---
7+
8+
All electronic devices, including Arduino boards, consume power. The power consumption is measured in ampere hours (Ah), and with low voltage devices, it is typically measured in mAh.
9+
10+
When creating projects that run on a battery or is power-constrained, taking power consumption into account can be critical. It will among other things help you decide which kind of battery you need to use.
11+
12+
In this article, we will demonstrate how you can perform power consumption tests, using a **power profiler**. A power profiler is used to measure consumption over a specific time period, where we record several thousands samples. You will find instructions for both the hardware setup, the software setup, and the actual power consumption tests in this article.
13+
14+
***Note that in this article, third party products are being used.***
15+
16+
## Hardware & Software Needed
17+
18+
For power consumption tests in this article, we used the following hardware & software. Note that there are many alternatives on the market.
19+
20+
- [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download)
21+
- [Power Profiler Kit II](https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2)
22+
- [Arduino board (link to store)](https://store.arduino.cc/)
23+
- Jumper wires
24+
25+
## Measuring Power Consumption
26+
27+
Power consumption measurements are done by connecting a power profiler between your Arduino and computer. The power profiler is connected to the computer via USB, and then to the Arduino via jumper wires. For power consumption measurements, we simply use two wires: **power** and **ground**. The power cable is connected to your Arduino's power pins, and ground goes to one of the GND pins on the board.
28+
29+
When it is connected, the power profiler can measure the power consumption of your board with a high accuracy. Any power that your board consumes can now be detected, and with a software tool (such as the [nRF Connect for Desktop](https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-Desktop/Download)), we can record power consumption over time.
30+
31+
So what is it that we are measuring? In very simple terms, all electronic devices draw current, whether it is small or big. A small LED can for example draw 10 mA (0.01 A), while a servo motor can draw up towards 1000 mA (1 A). If you have an LED on for an hour that draws 10 mA, we can express it as **mAh**, which means **milli-ampers consumed per hour**.
32+
33+
### Power Consumption Example
34+
35+
To provide a practical example, let's take the [Nano ESP32](). We ran a simple sketch on the board, which continuously runs the `analogRead()` function. The test ran for 60 seconds, and recorded 100'000 samples. The result was an average of **31.05 mA**.
36+
37+
Now, if we wanted to power this application using a battery, we know that the power consumption is 31.05 mA. If we intend to run the application with a fully re-charged 300 mAh battery, we would be able to run for approximately 9 hours, as we would be consuming **31.05 * 9 = 279.45**, according to the formula below:
38+
39+
- **milli-ampere hours (mAh) = power consumption * hours**
40+
41+
With that information, we can make an educated guess of what type of battery we should get. For example, a battery with more capacity, let's say 600 mAh, would in theory last for twice the period.
42+
43+
***Note that there are other factors at play, such as the battery's discharge rate and the general quality of the battery.***
44+
45+
## Hardware Setup
46+
47+
## Software Setup

0 commit comments

Comments
 (0)