# Optimise Pico Power Usage

**URL:** <https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407>\
**Category:** Uncategorized\
**Created:** [15 March 2024 04:16 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407 "2024-03-15T04:16:03Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [15 March 2024 04:16 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/1 "2024-03-15T04:16:03Z")

</div>

I’m looking into ways to reduce power usage on my battery powered pico projects by optimising my code and disable things when I’m not using them.  
I currently have no way to monitor usage apart from measuring how long it takes the battery to go flat.  
I found this device and it seems like it would do the trick but is it overkill?  
NORDIC SEMICONDUCTOR NRF-PPK2  
I’d rather buy something from Core Electronics if you have a device that can do it?  
Happy to hear any suggestions 🤠  
Thanks  
David

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [15 March 2024 04:55 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/2 "2024-03-15T04:55:16Z")

</div>

Hi David.

### Something general

I recently saw @Michael recommend this product on another thread.

> **[Makerverse Nano Power Timer](https://core-electronics.com.au/makerverse-nano-power-timer.html)**
>
> Periodically cycles power to your project, greatly extending battery life.

### Something Specific.

This is a debugging probe that might help you measure.

> **[Raspberry Pi Debug Probe](https://core-electronics.com.au/raspberry-pi-debug-probe.html?gad_source=1&gclid=Cj0KCQjwwMqvBhCtARIsAIXsZpYzZ4jGIRneSIlCp2B7PgCpR8ExM06eZy_ffwx-5cxjt8ppjmr3MfQaAsTLEALw_wcB)**
>
> Use this RP2040-based probe to make debugging UART and SWD devices a breeze!

For example suppose some code like

```rust
/*UNTESTED*/
fn get_light_reading(photo_detector_active_flag : &bool, my_light_reader : SPdetector) -> f32 {
   //Tell the main function that the photo-detector is ON
   photo_detector_active_flag = true;
   info!("photo_detector is {}", photo_detector_active_flag);
   // Get light reading
   match my_light_reader.read() {
      Some(r) => return reading;
      None() => return 0.0;
   }
}

```

This code tells the debugger that the sensor is being used.  
You can plug the debugger into a computer, or even a different micro-controller which just stores that data on flash for later.

An alternative is MOSFETs.  
Perhaps the function that reads the data is also responsible for providing voltage to the base of a MOSFET which allows current to flow to the sensor. Here you are not measuring, but you are making the code responsible for the power management.

Hell… you could do both of these!

### Even more specific?

I’d need more information.  
What kind of things are you controlling with your Pico?  
Like Motors? Speakers? Sensors?

##### Hope that helps.

Pix ❣

---

<div class="post-metadata">

**Author:** ![Liam](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam/32/3562_2.png) [@Liam](https://forum.core-electronics.com.au/u/Liam)\
**Post date:** [15 March 2024 06:01 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/3 "2024-03-15T06:01:23Z")

</div>

Hi David,

PIx has some amazing points in there that are worth considering - the power timer is great and behaves kind of like a watering timer.

> [@David191372](#):
>
> I found this device and it seems like it would do the trick but is it overkill?  
> NORDIC SEMICONDUCTOR NRF-PPK2

The Power profiler is actually a great value board - Its great at lower power levels where you might have an MCU and some low-power sensors.  
Core stocks a similar device: [Qoitech Otii Arc | Core Electronics Australia](https://core-electronics.com.au/qoitech-otii-arc.html) With a higher current output.  
The benefit of these lab tools are to catch all of the transients in your project and integrate some flags in code - when is the WiFi on the board starting up? When are my sensors turning on? ect ect  
Michael uses the Otii Arc here: [Datalogging Weather Station (Battery Powered) - Tutorial Australia](https://core-electronics.com.au/projects/datalogging-weather-station-battery-powered/)  
And I’ve seen Seon use the power profiler on some streams: [https://www.youtube.com/@UnexpectedMaker](https://www.youtube.com/@UnexpectedMaker)

Liam

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [15 March 2024 08:25 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/4 "2024-03-15T08:25:59Z")

</div>

Hi Pix,  
They are interesting solutions but not quite what I’m looking for.  
More details below….

Hi Liam,  
This is for the 12V Battery monitor project previously discussed.

> [@12v Pico Battery Monitor](https://forum.core-electronics.com.au/t/12v-pico-battery-monitor/18812):
>
> Hi Everyone, I’m looking to build a 12v battery monitor and I thought this would be a fairly common thing to want to do. I can’t find much in an out of the box solution. Is there a Picodev option to monitor an external battery? Or is this something I could mock up on a bread board? I’d also want to charge a lithium battery to power the pico from the same 12v source so I still can report a flat (12v) battery. I plan to build this into a LoRa system once I have the basic monitor figured out.…

In Summary, my project uses two Pico W’s each with LoRa Wan modules.  
The wifi is not actually in use at present but I saw something on YouTube that indicates the On board led uses the wifi pins.  
The hand held device has a 4 digit LED display.  
I have managed to get it working quite well. The device at the monitoring end runs directly off the 12v battery that is being monitored so that should have plenty of power but I don’t want to put a significant drain it say over a couple of weeks. I have a stackable RTC that I could use to put this device to sleep during the night.  
On the display end device I think I have done ok by putting the device to sleep. I can use a button on a GPIO pin to wake it up and a second press while it’s awake to request the voltage. Once the result has been displayed it waits 30 seconds for an additional request or it goes back to sleep. A flashing led indicates waiting and no led indicated asleep.  
Now I wish to optimise things where I can, but I need to be able to measure the results of the changes I make.  
I’ll go check out the link you posted.  
I have also been wondering if I can use a spare pico to build a monitor the power usage during project development.  
More learning required 🤠  
David

PS The Qoitech Otii Arc looks fabulous but outside the hobby budget. 🤠

---

<div class="post-metadata">

**Author:** ![Pixmusix](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/pixmusix/32/9719_2.png) [@Pixmusix](https://forum.core-electronics.com.au/u/Pixmusix)\
**Post date:** [15 March 2024 10:48 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/5 "2024-03-15T10:48:42Z")

</div>

> [@David191372](#):
>
> but I need to be able to measure the results of the changes I make.

Oh I think I get it now.  
You’re looking for something that you can place between the battery and some device _to measure_ what that device is drawing form the battery? That way you can make a change to your code and understand how much of an impact that change had.  
Is that right?

---

<div class="post-metadata">

**Author:** ![James46717](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@James46717](https://forum.core-electronics.com.au/u/James46717)\
**Post date:** [15 March 2024 19:36 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/6 "2024-03-15T19:36:29Z")

</div>

> [@David191372](#):
>
> I have also been wondering if I can use a spare pico to build a monitor the power usage during project development.

Suggest you search for ‘Current Shunt Arduino’.  
The ADC of the UNO is more accurate than the Pico ADC. The Arduino measures the voltage either side of a current shunt resistor and from that you can calculate the current and record it. The value of shunt resistor depends on how much current you are measuring and how much effect on the circuit you can tolerate. Also the ability of the Arduino to accurately detect small voltage differences.

In my experience the ATMega328P ADC circuits have been more accurate than the Pico.

Regards  
Jim

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [15 March 2024 23:45 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/7 "2024-03-15T23:45:18Z")

</div>

Hi All  
It seems to me that by the time all these add ons to turn things on and off to save battery power are implemented you will be using more power than the power you save. Chicken and egg situation eh!!

Cheers Bob

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [16 March 2024 01:15 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/8 "2024-03-16T01:15:16Z")

</div>

Hi Pixmusix,  
Yes that’s it exactly. 🤠

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [16 March 2024 01:20 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/9 "2024-03-16T01:20:26Z")

</div>

Hi Bob,  
It’s just during testing. Once I know what works best I’ll go with that.  
For example my devices both have wifi but I don’t use it at the moment.  
How much power do I save when I disable it.  
There are several different kinds of sleep mode, how do they compare?  
All questions that if I can answer myself my project will have a better outcome and I’ll learn something 🤠

---

<div class="post-metadata">

**Author:** ![Robert93820](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@Robert93820](https://forum.core-electronics.com.au/u/Robert93820)\
**Post date:** [16 March 2024 01:56 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/10 "2024-03-16T01:56:07Z")

</div>

Hi David  
Have a look at a device I have.  
Ruideng AT34.  
Copy of the manual here with all the tech specifications.  
[RUIDENG USB Tester with Full Colour Display Instructions](https://manuals.plus/ruideng/usb-tester-with-full-colour-display-manual).  
It is a real time display, that is you have to look at it and make notes for different scenarios.

The down side is it has connectors fitted for USB A so for your application you would need to get a USB A male to female cable and cut it and make your connections with the free ends and have this device in line for measurements. I think you would be capable of handling that.

This device is designed to be inserted into a USB connection even though the voltage measurement is from 3.7 to 30V and would be probably pretty useful in the future.  
Cheers Bob

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [16 March 2024 04:01 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/11 "2024-03-16T04:01:51Z")

</div>

Hi Robert, that looks interesting.  
I’ll way up my choices and post again once I have tried something and have some results.  
Thanks to everyone who responded.  
David

---

<div class="post-metadata">

**Author:** ![James46717](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@James46717](https://forum.core-electronics.com.au/u/James46717)\
**Post date:** [16 March 2024 08:52 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/12 "2024-03-16T08:52:38Z")

</div>

> [@David191372](#):
>
> There are several different kinds of sleep mode, how do they compare?

I did some investigation of the Pico Micropython sleep modes. (see thread below)  
In the end I found the best way to save power with the Pico is to power if off via something like the Makerverse Nano Timer. The software sleep modes are not as good as the Arduino & ESP32.

All the best.  
Jim

> [@Pi Pico - Sleep & Dormant states](https://forum.core-electronics.com.au/t/pi-pico-sleep-dormant-states/12584):
>
> PR2040 data sheet lists Sleep State & Dormant State. Tested the implementation of these functions for the Pi Pico in Micro Python & Circuit Python using Thonny. Both implementations work ok; the Pico sleeps for the set number of seconds in Sleep State and resets after the set number of seconds in Dormant State; as you would expect. But … … power source connected to VSYS, USB connection removed, current meter to measure power. The results are no where near the claimed 1.3mA or 0.8mA. Micro P…

PS btw my previous post about a current shunt and measuring the voltages will not work very well. The differences are too small to be accurate enough for the Pico & Arduino ADC’s. It would need an Op Amp to see the small changes and produce a corresponding amplified voltage output. I tested the Pico and Arduino on a simple circuit. The Arduino values were more stable and varied by about 3 or 4 for the same pin. But for a 50mA current the ADC values were too close to be reliable for calculating current.

---

<div class="post-metadata">

**Author:** ![David191372](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/david191372/32/6165_2.png) [@David191372](https://forum.core-electronics.com.au/u/David191372)\
**Post date:** [23 March 2024 10:47 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/13 "2024-03-23T10:47:03Z")

</div>

Hi Guys,  
Just a followup. I ended up getting one of these.

> [@David191372](#):
>
> NORDIC SEMICONDUCTOR NRF-PPK2

Its a bit of a learning curve for me to use it but it looks like it is spot on for measuring these really small currents and can provide up to 1A to power the pico (from two usb cables) So my measurement problems are under control. Thanks for all your suggestions.

David  
PS It was about $150 from a place called DigiKey in USA.  
Now I see there is a DigiKey in Australia. I wonder if they stock them 🙂 Delivery was under a week so can’t complain.

---

<div class="post-metadata">

**Author:** ![John104830](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@John104830](https://forum.core-electronics.com.au/u/John104830)\
**Post date:** [23 March 2024 21:03 UTC](https://forum.core-electronics.com.au/t/optimise-pico-power-usage/19407/14 "2024-03-23T21:03:33Z")

</div>

If you order from Digikey Australia they send it to you from the US, but it only takes a few days.
