Author Topic: is radio.receiveDone expensive on the battery?  (Read 2301 times)

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
is radio.receiveDone expensive on the battery?
« on: November 29, 2016, 01:13:09 PM »
I'm getting confused wrt power consumption of my custom board + moteino. The board has a BME280 and 2 rj11 for getting data from wind dir, rain etc.. these are not connected while trying to measure the power consumption.

in my main loop I pretty much do the following:
check radio.receiveDone if data check what kind of cmd we got (clients can request 1 data point or continuous data through a start/stop cmd)
at the end just sleep for 1s w LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF);

I'll make a long story short but the board was using 22mAmp and after putting flash to sleep and some cleanup I'm now at 17mAmp. Decided to look at MotionMote and after changing the IC2 address to  76 got it to work nicely and I get around 1mAmp! Darn I thought, seems too low :-) Maybe the BME280 library I use is the issue, long story short it's not.

Added a call in the loop to radio.receiveDone, power down for 1 sec (instead of the 8s in the code) and now I see the consumption going from 1ish mAmp and then every sec or so jump to 4 then , then 14 up to 32mAmp and then goes back down. (note that the BME280 is queried every sec or so, maybe the BME280 is stabilizing))

Removing all code from MotionMote and keeping just the sleep code and the radio.receiveDone shows power consumption of 17mAmp - is  radio.receiveDone expensive? is there a better to do this?

Looking at RFM69::receiveDone I'm not certain what is taking so long if there is no payload - maybe the call to re-enable the interrupts? maybe I should set the radio in receive mode only once and then only check if we have payload?

Anyhow, please let me know if anyone has a better way to do this or I"m completely off the mark in my assumption.

thanks!

X
update1: the hoperf spec does says Low RX current of 10.3 mA Low current: Rx = 16 mA for RFM69 so I suppose 17mA w my crappy measurement may be correct...
« Last Edit: November 29, 2016, 01:45:54 PM by xavier »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: is radio.receiveDone expensive on the battery?
« Reply #1 on: November 30, 2016, 09:33:46 PM »
radio.receiveDone() puts your radio in RX mode *and also* calling it checks if data has arrived.
RX mode is around 15ma. So there's your answer.

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: is radio.receiveDone expensive on the battery?
« Reply #2 on: December 01, 2016, 12:55:59 PM »
yes thanks - looked at the spec for the radio and as update in my question the RFM69 seems to take 17mA during reception mode.

Is there an updated version of Tom's Listening mode code or is there a way to still be able to put the radio in reception but use less than 10mA? thanks!

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Re: is radio.receiveDone expensive on the battery?
« Reply #3 on: December 01, 2016, 01:55:29 PM »
Whenever the radio is in receiving mode it will take around 16mA as per the spec. There's only one way to get average current down for reception and that is to put the radio to sleep when you know it doesn't need to receive a packet and only put into RX mode when you need to. Part of the challenge for low power equipment is coming up with strategies to allow that to happen, it is especially challenging for gateways and repeaters. It's not, however, impossible. Just difficult.
Mark.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: is radio.receiveDone expensive on the battery?
« Reply #4 on: December 01, 2016, 02:05:25 PM »
Is there an updated version of Tom's Listening mode code or is there a way to still be able to put the radio in reception but use less than 10mA? thanks!
See this branch.