RFM98W @ Atmega328p - power consumption

There is no such thing. Any LoRaWAN compliant gateway needs to receive multiple channels at multiple spreading factors. Please do not use one channel abominations for TTN as they disrupt the normal functioning of the network.

I don’t - it means you have to introduce more components which will have to be on all the time and won’t be able to power the circuit when they have drained the batteries below the regulators cut off, even for an LDO / super-LDO this will reduce runtime.

Whereas as properly configured 328P can rock on at 8MHz (aka a hacked Pro Mini, remove the Vreg & LEDs) down to 2.4V which is pretty much two very flat batteries.

At some point in the near future I’ll try @mcgreg’s circuit because if I set the fuses right and get a bit of a tail wind, at 4MHz you can drop to 1.8V.

As for the Heltec module, @kersing can sleep easy, the Cubecell range is either an Arduino LoRaWAN client or an AT over serial device - it will take more effort to hack it in to a single channel gateway which we all know is not LoRaWAN compliant and is disruptive to the network, than it would be to buy a PyGate or a TTIG or a board to sit on the top of the Pi and be a real gateway. Yes, technically possible to hack the hell out of a CubeCell to drive the ASR6501 SiP as a gateway but why?

2 Likes

Thanks, Jac.

Actually, 2.4V which is to say 1.2V per cell is a fair ways from “flat” for an Alkaline where the discharge curve of useful energy really runs all the way down to a volt. And that’s especially true at the kind of light currents being used. Fortunately both the SX127x and the SX126x can operate down to 1.8V in a carefully designed system.

Of course it’s also true that a linear regulator from a 3 cell voltage is going to be wasteful.

Many modern ultra low power radio systems are now using switching supplies, sometimes to run core parts at voltages lower still - eg, see the sx126x docs.

Hi.
If you want to measure and estimate battery life, this is good tool for you.

Thanks

Keep the maximum power it can provide in mind:

up to 150 mA

For those with deep pockets, check the Qoitech OTII. Excellent tool for professionals but probably too pricey for the avarage user.

Free software! But will need:

To be the hardware that does the actual measuring on the OP’s 328P

Guys, my motivation drops as quick as my battery energy :frowning:

First, I connected AGND to GND and AVCC to VCC as suggested. Somehow I can’t read the voltage via software anymore, I got always 5.2 Volt (sic!) via the “Read 1.1V reference against AVcc” and no, I did not touched the AREF pin. No expansion for the battery lifetime.

Second, I hooked up an INA219 to an Arduino Nano and connected it to my LoRa device. I’m measuring 10xsecond, create a second avg and print it to serial monitor.
I also changed the sleeptime to 60 seconds for the test.

After 12 hours test, I see nothing odd: Consumption is around 0 mAh on idle, when sending data I have peaks which are around 7 mA per Second. So my power consumption is at total avg at 0.16 mAh, see attached an one hour example.

One thing I don’t get is the voltage. The load voltage (loadvoltage = busvoltage + (shuntvoltage / 1000):wink: is always around 1.00 V. That can’t be true, can it?

The only conclusion I have is the power supply. Are ALL my batteries so bad? When they last 30 days with an avg @0.16mAh it means they should be 100mAh only. I did use brand new Eneloops (purchased in July 2020) and GP Super AA Alkaline.

During porting to the TTN library, I was also too stupid and had some issues (the device signature was slightly different) uploading it to one of my Atmegas, so I used the avrdude -F flag, since than, my device is dead. Well, it’s really a steep and stony path till now.

ina219

7mA is about right for the processor running with the LoRa device on and not in sleep mode. It is most definetly not the currnet consumption when transmitting, so you cannot use the 7mA to calculate battery life.

The packets are probably too short (time wise) for the current to be measured by most meters, so to see what it is increase the packet length by sending more data and setting the spreading factor to 12.

I measure 10x the second and create an avg. I also log the max reading for each second. During LoRa, the avg per second is about 7 mA, the max peak is around 33 mA.

|Timestamp            |Avg |Max  |
|[2020-08-12 18:52:12]|6,81|32,10|
|[2020-08-12 18:53:20]|6,53|32,40|
|[2020-08-12 18:53:21]|3,48|32,10|
|[2020-08-12 18:54:30]|6,98|32,30|
|[2020-08-12 18:55:39]|6,85|32,20|
|[2020-08-12 18:56:48]|6,84|32,20|
|[2020-08-12 18:57:57]|9,99|32,40|
|[2020-08-12 18:59:06]|6,76|32,30|
|[2020-08-12 19:00:15]|6,84|32,20|
|[2020-08-12 19:01:24]|6,61|32,40|
|[2020-08-12 19:02:33]|7,01|32,20|
|[2020-08-12 19:03:42]|6,91|32,10|
|[2020-08-12 19:04:52]|7,01|32,40|
|[2020-08-12 19:06:00]|3,71|32,50|
|[2020-08-12 19:07:09]|6,56|32,20|
|[2020-08-12 19:08:19]|6,92|32,60|
|[2020-08-12 19:09:27]|7,01|32,20|
|[2020-08-12 19:10:37]|6,99|32,20|
|[2020-08-12 19:11:45]|6,81|32,30|

I use the total avg of 0,16mA to calculate battery lifetime.

  • Change the sense resistor in the INA219, probably increase it by a factor of 10 so you have more resolution

  • Measure 1000x a second so you can actually capture transmit

  • Get your ordinary meter on microamp mode, short the leads with a clip lead, start up your node until it goes to sleep then remove the clip lead and measure the actual sleep current

  • Leave it running over a long period of time (days, weeks) with something capturing logs, to see that software doesn’t suddenly get into some mode where it no longer sleeps.

You can probably fix your mis-flashed Arduino by putting the ISP sketch on another and using it to re-install the appropriate bootloader.

It’ s running over 4 days now, no changes, the power consumption as expected.
(@cslorabox: I changed the measure to 100x per seconds, it can’t get faster. The peak is ~30 mA.

But i realized another thing. As soon as I connecteded the INA, the voltage of the atmega don’t drop anymore, see here:

VCC_INA
I’ve connected the INA, as described here:
https://www.14core.com/wiring-the-i2c-ina219-zero-drift-bidirectional-currentpower-monitor-with-mcu/

image

In addition, I have the USB port of the Arduino Nano connected to my PC, to log the data. The USB shouldn’t be an issue to the atmega powered by battery, should it?

So what does INA to the circut that it works as expected ?!

I’m not entirely clear on what you are doing.

But if you want to use an INA219 and an Arduino to monitor the power used by an Arduino-based node, then the monitoring Arduino needs to be entirely separate from the monitored Arduino.

The monitored Arduino must not have any interfaces connected which could donate or steal power - ie, things like USB, ISP… UARTs can also be a concern.

1 Like

Sure, the monitoring device has a usb connection, the monitored device hasn’t of course.
Both are seperated, the only connection is the INA.

Final question on that topic: even when I completely disconnect the monitoring device, my voltage stays stable for 7 days now.
So I have only Vin+ and Vin- from ina219 connected between the battery and my LoRa device, other pins and usb on ina219 are disconnected. So what on the ina219 does the trick? Shunt? Some diodes?
During my measurements I see sometimes negative micro Ampere values, might that be the issue? So should I think about reverse current protection?

Thank you for your support.

You’re not going to be able to measure a supply voltage without a ground connection. Differential measurement across the shunt might still work.

I don’t want to measure it. I wanted to doublecheck that the power consumption is low (as expected) when the INA219 is between the battery and the LoRa node. Without the INA219 the voltage drops quickly.

Its unclear what you mean by that