Author Topic: Measure current Moteino  (Read 16422 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Measure current Moteino
« Reply #30 on: December 18, 2015, 09:39:26 AM »
Does that mean you're running off the internal resonator then?  If so, have you experienced anything negative (aside from possibly slower serial baud rates) from doing that?

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Measure current Moteino
« Reply #31 on: December 18, 2015, 02:12:32 PM »
Yeah I always use the internal one for the bare bones battery nodes. For one thing the Tinos don't have an external crystal. And then it's just easier to treat all bare bones nodes the same. I have the wireless boot loader so I don't need serial. An advantage with crystal would be having an accurate clock at least when you're not sleeping. And as discussed yesterday the option of going to 16mhz with good batteries.

No real practical downside to speak of.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Measure current Moteino
« Reply #32 on: December 18, 2015, 07:35:50 PM »
Thanks, that's good to hear there's no problem with SPI communication with the RFM69 if using the internal RC oscillator. 

Assuming I'm reading the datasheet properly, there's an additional benefit to using the internal RC oscillator, and that would be much faster start-up times when waking up from powerdown sleep:  just 6 clock cycles (750ns, if 8Mhz) if using internal RC oscillator (from Table 9-12) versus 16,000 clock cycles (2 milliseconds if 8Mhz) if using a crystal oscillator (Table 9-4).

Is that significant?  Well, if you were relying on Listen-Mode and you were waking up the radio once a minute, then that would equate to a savings of more than 17 minutes of "waking up" time for the moteino, and the same amount of time savings for the radio if it's in Rx mode waiting for the atmega328p to respond to its packet received interrupt.

So, assume current utilized by the radio is 16mA while in Rx mode.  So, that would be a savings of about 4.7mah for just the radio over the year, or about 47mah over 10 years. 

Well, it's not nothing, but if running off a couple of AA's, I'd struggle to call it significant. 

I need to measure how long it takes for the atmega328p to read a packet waiting for it from the radio's queue.  If it's 2ms or less at 8mhz, then staying at 8Mhz would save about the same amount (i.e. not much) as compared to running at 4mhz.  In that case, for simplicity, I think an argument could be made to just run at 4mhz (so I can chase declining battery voltage all the way down to 1.8v) and not worry about changing frequency.

However, if running from energizer utimate lithium batteries, even that might not be significant either, as I'd only recover about 5% (guestimate) of otherwise wasted battery energy, because the discharge curve is apparently so steep between 2.4v to 1.8v (i.e. 1.2v to 0.9v per cell). 

So, unless I'm overlooking something (?), then if running off a non-coincell battery, it seems I'm already at the point of diminishing returns, even if using an atmega328p that's running off a 16Mhz/8Mhz crystal.     :D

On the other hand, if running off a coincell for as long as possible, I can see how these optimizations might prove significant in a frequent usage scenario.

[Edit: On the other hand, if running on Alkaline batteries instead of energizer L91 lithium batteries, maybe running at 4Mhz does buy significant extra time.  8Mhz is good down to 2.4v, and there looks to be meaningful energy between 1.2 to 0.9v (per cell) in the alkaline discharge curve:

I have no idea what the dischare curves would look like for the much lower currents that would be drawn (certainly much lower than a constant 50ma), so it's hard for me to extrapolate.  Is it qualitatively similar?  Anyhow, I guess it's worth looking into--or perhaps just setting the clock frequency to 4Mhz and moving on--since for indoor use Alkaline's are certainly much cheaper than lithium's.  It would be nice to build just once for a probable worst-case and then have a single standardized platform going forward and never need to revisit this].
« Last Edit: December 19, 2015, 05:57:40 PM by WhiteHare »

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Measure current Moteino
« Reply #33 on: December 19, 2015, 02:07:50 AM »
Not really. The Moteino uses a low fuse of DE which translates to 256 cycles on wake from powerDown. Still I wasn't aware of the difference. Thanks for pointing it out.

ulli

  • Jr. Member
  • **
  • Posts: 87
Re: Measure current Moteino
« Reply #34 on: December 24, 2015, 05:13:03 AM »
Has anybody thought about how a moteino could measure it's own power consumption?
Is there a way to do so with a shunt for example?

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Measure current Moteino
« Reply #35 on: December 24, 2015, 09:57:36 AM »
Quote
Has anybody thought about how a moteino could measure it's own power consumption?

Not clear if that applies to your situation, but I've been doing some experiments with a moteino boosting it's own vcc lately and have used the time it takes a capacitor to discharge down to a certain voltage to measure it's power consumption.

This is particularly useful for sleep where just about everything you connect distorts measurements. E.g. my scope with it's 1MO impedance draws about 2-3uA. Better not to connect anything and report voltage after sleeping a minute.