RFM98W @ Atmega328p - power consumption

That’s really important. While I don’t have proof it happens, I could easily see high power consumption being one of the sorts of subtle and non-intuitive misoperation that occurs when part of the chip is unpowered - eg “I’m not using the ADC why do I need the analog supply?” (one does anyway… but then you are using the ADC).

I like the idea with the INA219, it isn’t expensive and I will get continous data. I’m not sure if I understand what you mean by " increase the sense resistor and bypass it with a capacitor", but I think to check where the leak is, normal connection should be ok.

The sense resistor usually shipped on experimenter boards is too small to measure tiny currents very well. Switching to a larger resistor will do that, but the circuit may operate poorly with a high impedance power supply, and the ADC may end up undersampled, so putting a capacitor across it helps smooth things out a bit. You’re not really measuring instantaneous power with an I2C sensor anyway, more “very short term average” for events that may take 10’s to 100’s of milliseconds. (Don’t try to print all the data, measure frequently, print an average over a longer timeframe, and ideally an integrated total for each individual excursion above sleep current such as a tranmission or receive window, or waking up to read some sensors without transmitting)

Indeed.

I did try the code being used, and noticed that pin 8 was being set high, but there is no mention of it here;

//pins for RFM98W
#define RESET 9
#define NSS 10
#define MOSI 11
#define MISO 12
#define SCK 13
#define DIO0 2
#define DIO1 3

SX1278 lora = new Module(NSS, DIO0, RESET, DIO1);

I noticed because most of my boards by default have an LED on pin 8.

So I tried an example from the RadioHead library, and that did the same, in fact configuring pins 6,7,8, as outputs and setting them high. Why would the library do that without apparently being asked to, it could cause all sorts of issues?

You would need to work out why this non-TTN library is doing that, but not in here …

Thank you @LoRaTracker for all the effort, i really appreciate it. Since I want to move to TTN anyway, any recommendation for an atmega ttn library?

By the way, this is my test device. In idle mode I can’t measure the Voltage, because my multimeter has mV only. sender

And I will connect the AGND and AVCC pins.

This works:

and there’s someone on here who can answer questions :wink:

1 Like

Thank you all for all the help. I really appreciate it. I will let you know about my results. Happy holiday everybody.

Summary:

  • Connect AGND and AVCC
  • Measure Current or Voltage over Resistance continuously and log it to file or similar
  • switch to LMIC for TTN

There are low cost multimeters that will log to file via a PC application, the HP-90EPC for instance.

There are USB power meters that will give a running total of maHr, these can be handy, an example is the UM25C.

Alternativly use very low capacity LiPos, say 100mAhr or less, you dont need to wait so long.

1 Like

Hi. Recently I bought two SX1276 to work with 2 Arduino Mini and Pro to get started with my LoRaWAN nodes. Also, I received today my Heltex HTCC-AB1 which will be with a Raspberry Pi do work as a LoRaWAN 1 channel gateway. I suggest you use 3xAAA or AA. Could be better and easier to regulate from 4.5v and to handle with low power over time in your project.
I would try to reply to your circuit and test with an oscilloscope in a few weeks.

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