# Battery Considerations For RP2040 and NEO-M9N GPS Logger

I am a software engineer, but new to hardware hacking, so I apologize if this is missing any detail, I will try to be thorough and update with any requested information. I also tried to keep this as specific to the topic as I could.

I am working on a small tracking system as a personal project. I am using a SparkFun Pro Micro board based on the RP2040 that I had laying around as a microcontroller, and I want to use the SparkFun Ublox NEO-M9N as the GPS unit. I had a spare ceramic antenna that I attached to the GPS unit's antenna socket. For the software side I installed MicroPython on the MC board.

I have the system working, but now I have to think about how to get as much battery life out of this as I can. My requirement is to get 7 days of life out of the device between charges. It looks like at full throttle the system needs ~180mA. I am also somewhat constrained in that this tracker must be 0.25" thick or less.

The thickness requirement ruled out a lot of connectors and cable based solutions like a LiPo. I can build outward using up to a standard letter sized envelope in surface area, but the depth is a hard requirement. My plan is to solder power or a female port to the board/use, or a small USB-C cable to use the Pro Micro USB-C port.

As for getting the most out of whatever power solution works best:

My natural inclination is to introduce waits and deep sleeps through MicroPython, configure the GPS board to poll less frequently, and other software based efficiencies. I don't want to spend a lot of time optimizing something with little effect on the power issue, however, and worry I overestimate the role of software in getting power supply right. (If all the software optimization is equal to cutting off the LEDs I should skip the code at first)

I have come across some people talking about voltage converters and such to decrease the power waste, but I am struggling to find a good primer on how to think about power consumption and supply.

I know very skilled electrical engineers can make hearing aids that last weeks on coin-cell batteries, but I have a hunch I can get done what I want without such sophistication.

Finally: I have a 2500 mAh battery that supplies 3.3V, if I connected that to the board it should last (in theory - disregarding wear on the battery) 2500/180 ~ 14 hours, correct?

Is the best way to do this to just use a multimeter and go from that benchmark?

• Current drawn is measured in mA, not mAh. But indeed 2500 mAh / 250 mA = about 10 hours (though the exact number depends on your cut-off voltage, the exact discharge curve at that current draw, temperature, time since last charge, etc.). Is the 6.35 mm limit with or without case? If with case the options are probably quite limited, other than some coin cells you’ll have a hard time fitting anything, but even the board, GPS and antenna will be a tight fit, won’t they? I doubt you’ll get 7 days without appropriate use of sleep modes and a good regulator. – jcaron May 24 at 23:54
• How often do you want to take a GPS reading? – ErikR May 25 at 1:12
• Once an hour, maybe twice. The 250mA figure is what I have gathered from datasheets and online reviews of the boards. IIRC when I chose the components the power draw was around 180mA, but I couldn't find those sources again. I added some to my recollection figuring if the actual draw was less than that it would just mean more battery life. – TomM May 25 at 1:27
• According to this the GPS is 31mA: sparkfun.com/GPS_Guide – TomM May 25 at 1:32
• Why don't you use flat Lipo batteries? High capacity 10000mAH thickness 11mm lipo rechargeable flat battery - US$10 - US$33 aliexpress.com/item/… – tlfong01 May 25 at 1:45

All of the information I read from the Sparkfun documentation suggests the following about current consumption:

1. A larger amount of current (100 mA) is needed for satellite acquisition
2. For tracking only 31 mA is needed (for continuous mode) or 20 mA (in power save mode)

So a lot will depend on how often and how long you'll be in acquisition mode.

Sleeping the RP2040 will help, but putting the UBLOX into power save mode will help more. Depending on how often you want to get a GPS reading it might be better to just shut the entire UBLOX module down and pay the acquisition cost again. You can use a P-MOSFET to control power to the UBLOX module from the RP2040 if you can't control it any other way.

I have come across some people talking about voltage converters and such to decrease the power waste, but I am struggling to find a good primer on how to think about power consumption and supply.

A switching power converter is unlikely to help in this case. They have their own inefficiencies and a current penalty just to keep them operating. Your battery voltage is already close to your needs. Things might be different if your design needed to use, for instance, a 12V battery but you needed a 3.3V rail for your MCU.

• That's very helpful, I appreciate your comment. I also need to be able to verify the power draw of the microcontroller board. Where do you typically search for these figures? – TomM May 25 at 1:42
• The current draw of a MCU depends on what code it's executing -- how many transistors are flipping between 0 and 1 and at what rate. So I would just write some code and measure it. You can decrease draw by turning off clocks, turning off functional units like ADCs and DACs. Slowing down the MCU's own clock can have a dramatic effect on power consumption - for instance change to a 32 KHz clock when sleeping and then back to full speed when you wake up. – ErikR May 25 at 1:58
• That is extremely helpful. I will look into the code to measure those data! – TomM May 25 at 2:00