Optimise Pico Power Usage

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 :cowboy_hat_face:
Thanks
David

1 Like

Hi David.

Something general

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

Something Specific.

This is a debugging probe that might help you measure.

For example suppose some code like

/*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 :heavy_heart_exclamation:

2 Likes

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.

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 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
And I’ve seen Seon use the power profiler on some streams: https://www.youtube.com/@UnexpectedMaker

Liam

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.

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 :cowboy_hat_face:
David

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

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?

1 Like

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

2 Likes

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

1 Like

Hi Pixmusix,
Yes that’s it exactly. :cowboy_hat_face:

2 Likes

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 :cowboy_hat_face:

1 Like

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.
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

1 Like

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

1 Like

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

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.

1 Like

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

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 :slight_smile: Delivery was under a week so can’t complain.

3 Likes

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

1 Like