Tracking down a 9mA power drain
In the writeup for the project above, I mentioned that, when idle, the system was drawing 9mA. Since I was more interested in the end-to-end story, I flagged this as an issue to follow up on at some other stage. Then @smerrett79 caught me out with the question as to whether I had any idea where the 9mA could stem from. This then forced my hand to knuckle down and take a closer look. What followed turned into a useful troubleshooting exercise where I had to work out how to isolate the issue. In software, isolation can be performed with debugging tools and diagnostic messages. But when chasing currents, I had to think a little harder. I will admit, I did employ AI to help guide the process.
Isolating the Problem
The first step was to rule out the usual suspects. Since the XBee will draw 30mA when running and less than 1μA when in power-down mode, during the system operations, I could see just from the lab power supply that during communication, the system would draw 40+mA and then drop to 9mA when idle, demonstrating that the XBee is successfully going into power-down mode. The open question was the INA219 and the MCU. It was then I realised that I had missed the INA219. This was an easy fix. Since I have modelled the sensor on a Finite State Machine, I only needed to set a power-down profile for the INA219 in the wake-up and sleep states. This managed to shave 4mA off the full system current draw. So now I was down to 5mA to locate.
To get a better understanding and more precise numbers, I broke out the INA219 from the PCB to a breadboard and did the same with the XBee - but for that, I created an adapter cable so that I could install a breadboard between the PCB and the XBee unit. I could then connect my multi-meter set to the mA and μA range to measure the current consumed by each individual unit during their power-down modes.
| Measurement Point | Active | Sleep/Power-Down |
|---|---|---|
| Full System | 41mA | 4.73mA |
| INA219 | 631μA | 46μA |
| XBee | 28mA | 0.5μA |
I could see from the diagnostic output that the MCU was going into a halt-state but I could not say 100% that this was in true power-down mode. A further test to prove the MCU’s power-down mode also came from @smerrett79 to check using the TCB0. I exposed and configured a GPIO port and connected the oscilloscope to that and monitored the signal during the system’s wake/sleep cycle. I could see the system definitely halts when in sleep mode.
The last thing to check was the power system. As I had mentioned in the writeup - I only used whatever regulators I had on hand that could fit the purpose but I did not consider the quiescent current of the devices. The TC1262, from the data sheet, was seemingly OK. But the L7805 could be the problem. The data sheet mentions 4.3 - 6.0 mA. I assembled a new PCB. This time without the MCU and related components - only the power system. This system alone was drawing 4.71 mA. I then assembled a small LM2931 onto a SOIC breakout, removed the L7805 from the test board I had for checking the power system and wired in the LM2931. This device would prove to be a bad choice for the overall system but for troubleshooting purposes, it demonstrated that the power system alone was able to be reduced to 1.03 mA from 4.71 mA. This is still 300μA above the data sheet sum-of-parts for power-down mode but still a significant improvement on the original 9mA.
Conclusion
It turns out idle current isn’t the only spec that matters - load rating needs the same scrutiny, and during the troubleshooting, I hadn’t given it any: pushing the LM2931 under the full system load, rather than just idle, damaged both the regulator and the XBee module. A useful, if costly, way to find that out.
As I’ve mentioned, I like using an Internal Block Diagram to define how modules connect and communicate, but I’ve not yet treated current draw as a specification to model against. One thing this exercise has taught me is that I should be tracking quiescent current as a parameter in my UML models. Had I had a current draw budget in mind and taken note of the quiescent currents in the regulator data sheets, I may have thought better of using what I already had in stock. The lesson is: reaching for what’s already in the parts bin isn’t the same as choosing the right part for the job.
I have a board revision in mind to support multiple sensors, so this will be a good time to also re-think the power system design.


