Project

General

Profile

Resolved: JeeNode Micro + RFM69CW + coin cell

Added by flabbergast over 5 years ago

Does anyone have any experience with running a JeeNode Micro with RFM69CW from a coin cell (CR2032)? I.e. is a coin cell powerful enough to sustain a RFM69CW?

I’ve tried running a RFu-328 from Ciseco (essentially a small atmega328p board, no regulator or anything other than a couple of caps) with a RFM69CW soldered on it from a CR2032 coin cell, directly powering the RFu-328.
It starts OK, survives rf12_initialize(); rf12_sleep(RF12_SLEEP); calls, but seems to “die” when I later run rf12_sleep(RF12_WAKEUP);.
EDIT: I should add that the same thing runs OK when powered from 2 alkaline AA batteries. Also, there is a 100uF electrolytic capacitor to “help” the coin cell to cope.


Replies (14)

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

I think there is indeed a problem with the sleep function with the RFM69x. The code is present but doesn’t take effect. As I recall, it is possible to write the appropriate registers to manually induce sleep.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

Thanks - I’ll have a look at the library code.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

Well - turned out that I was being thickheaded … again. The problem with RFu-328 turned out to the fuses: as most of Arduino clones, the atmega328p has set a brown-out detection on, level=2.7V. Apparently starting a transmission on the RFM69CW brought the battery voltage down enough to trigger the brown-out. I’ve changed the fuses to level=1.8V and now it transmits OK.

So I suppose there should be no problem with JeeNode Micro as well - but I’d still like to hear if someone has tried running a RFM69CW on a JNµ.

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

I have run the RFM69CW successfully on a Tiny84A processor. I have also had it work on JNu but then had a problem with two other JNu devices - seemed like individual hardware but I didn’t get to the bottom of it.

Do you now think that rf12_sleep works with the RFM69CW?
Can you confirm which library you used?

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

Thanks for the info. I might go for it and get a JNµ for playing around…

About the sleep: in my case it turned out that the power hog was not waking from (I suppose presumed) sleep, but starting a transmission. I think I can try to measure the power consumption of the whole module to determine if RFM actually goes to sleep or not… this might take me a bit of time since I need to set things up so that I can do some measurements.

Is there some other way to check this?

As for the software: I’m using RFu_jeelib - which only differs from jeelib in some pin assignments (the radio is wired to different pins on a RFµ-328; credits go to OpenEnergyMonitor as well for doing it for RFM12B). I’ve pulled the RF12Demo branch 2 days ago (looked like the most recent one, with some cool stuff happening in the RF12Demo sketch).

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

flabbergast wrote:
> Is there some other way to check this?

I put it to sleep and then sent a packet in its direction and it received and output it. I don’t think it should have seen the packet if it was asleep.

> As for the software: I’m using RFu_jeelib - which only differs from jeelib in some pin assignments (the radio is wired to different pins on a RFµ-328; credits go to OpenEnergyMonitor as well for doing it for RFM12B). I’ve pulled the RF12Demo branch 2 days ago (looked like the most recent one, with some cool stuff happening in the RF12Demo sketch).

The RF12Demo sketch isn’t really worthwhile for the JNu, it is a real squeeze to get it into the flash although the RAM is usually fine.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

> I put it to sleep and then sent a packet in its direction and it received and output it. I don’t think it should have seen the packet if it was asleep.

This works. So: using jeelib/RF12Demo branch, trying a simple sketch which just checks for received packets every second or so:
- if I use rf12_sleep(RF12_SLEEP); and rf12_sleep(RF12_WAKEUP); between the checks, no packets are received.
- if I don’t use the sleep/wakeup code, packets are received.

Nice! I might measure the power consumption at some point anyway.

> > As for the software: I’m using RFu_jeelib - which only differs from jeelib in some pin assignments (the radio is wired to different pins on a RFµ-328; credits go to OpenEnergyMonitor as well for doing it for RFM12B). I’ve pulled the RF12Demo branch 2 days ago (looked like the most recent one, with some cool stuff happening in the RF12Demo sketch).
>
> The RF12Demo sketch isn’t really worthwhile for the JNu, it is a real squeeze to get it into the flash although the RAM is usually fine.

Sure - I just wanted to test things with a recent code. I mean to use JNµ as a temperature sensor or something like that.

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

flabbergast wrote:
> > I put it to sleep and then sent a packet in its direction and it received and output it. I don’t think it should have seen the packet if it was asleep.
>
> This works. So: using jeelib/RF12Demo branch, trying a simple sketch which just checks for received packets every second or so:
> - if I use rf12_sleep(RF12_SLEEP); and rf12_sleep(RF12_WAKEUP); between the checks, no packets are received.
> - if I don’t use the sleep/wakeup code, packets are received.

I’m confident you will confirm that this is definitely with RFM69CW hardware? I will retest with my hardware.

> Nice! I might measure the power consumption at some point anyway.

It would be great to quantify it for the RFM69x.

> Sure - I just wanted to test things with a recent code. I mean to use JNµ as a temperature sensor or something like that. The library is fine it is just RF12Demo is getting a little bloated (jcw would say very bloated).

Also, I have retested my JNu hardware today and discovered that I don’t have a hardware problem at all, just an excess of RF signal on my confined test bench.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

JohnO wrote:
> flabbergast wrote:
> > > I put it to sleep and then sent a packet in its direction and it received and output it. I don’t think it should have seen the packet if it was asleep.
> >
> > This works. So: using jeelib/RF12Demo branch, trying a simple sketch which just checks for received packets every second or so:
> > - if I use rf12_sleep(RF12_SLEEP); and rf12_sleep(RF12_WAKEUP); between the checks, no packets are received.
> > - if I don’t use the sleep/wakeup code, packets are received.
>
> I’m confident you will confirm that this is definitely with RFM69CW hardware? I will retest with my hardware.

Yes. I don’t have any RFM12B’s at all, both devices used for testing this were with RFM69CW radios (both atmega328p boards).

> > Sure - I just wanted to test things with a recent code. I mean to use JNµ as a temperature sensor or something like that. The library is fine it is just RF12Demo is getting a little bloated (jcw would say very bloated).
>
> Also, I have retested my JNu hardware today and discovered that I don’t have a hardware problem at all, just an excess of RF signal on my confined test bench.

That’s good news - thanks!

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

flabbergast wrote:
> > > This works. So: using jeelib/RF12Demo branch, trying a simple sketch which just checks for received packets every second or so:
> > > - if I use rf12_sleep(RF12_SLEEP); and rf12_sleep(RF12_WAKEUP); between the checks, no packets are received.
> > > - if I don’t use the sleep/wakeup code, packets are received.

I am unable to get my RFM69CW to sleep. I am using a command “104z” within RF12Demo which does this:

            if (value == 104) rf12_sleep(RF12_SLEEP);  // Sleep
            if (value == 104) showString(PSTR(" rf12 Zzz...\n"));  // DEBUG

and my output looks like this:

Current configuration:
 ^ i30 g212 @ 868 MHz o1700 r80
> 104z
 rf12 Zzz...
OK  31 afc=0 fei=440 lna=5 (-44.5dB)
OK  31 afc=0 fei=440 lna=5 (-45.5dB)
OK  31 afc=0 fei=440 lna=5 (-44.5dB)

RE: JeeNode Micro + RFM69CW + coin cell - Added by JohnO over 5 years ago

Perhaps something else in RF12Demo wakes it up.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

OK, here’s the sketch that I used on the “node” (I tried again this morning, and it worked just as before): gist
The other end was running RF12Demo, which I used to send packets.

RE: JeeNode Micro + RFM69CW + coin cell - Added by flabbergast over 5 years ago

So, I’ve bought one JeeNode Micro and soldered a RFM69CW onto it. Running it from a CR2032 coin cell was quite an adventure: it “worked” quite erratically, mostly did not… so yes, power issues. I got some support from martynj via e-mail:

> For the power supply issues, it helps to look at it in terms of energy. The coin cell has a relatively high
> internal resistance (increasing with age). Supplying a blip of 30 - 45 mA for a transmit packet does not come from
> the coin cell directly, most is supplied from the charge in the reservoir capacitor across the cell, so the actual
> supply voltage drops by the end of the packet. If the RFM Lowbat threshold is set too high, this can trigger
> and/or if the voltage droops to around ~2V, the RF module will latch up or go into reset.
> Keeping the transmit power down helps by reducing the peak current demand - adding more C across the battery will
> help also.

I’ve solved it in software by lowering the TX power that RFM69CW uses, by editing jeelib/RF69.cpp, in the array configRegs_compat, adding 0x11, 0b10010110,.
(The register 0x11 is RegPaLevel; the lower 5 bits set power: –18 + value. So I set the power to be –18 + 0b10110 = 18 + 22 = 4dB, like the RFM12B’s.
See RFM69CW datasheet, v1.1, Table 25: Transmitter registers.)
A hardware fix is to add a large enough capacitor to help the battery
the RFu-328 board I mentioned before has a 100uF cap, and this is enough to run on full 13dB power.

At any rate, my JNu now happily runs and reports temperature and humidity every 5 minutes.

Resolved: JeeNode Micro + RFM69CW + coin cell - Added by martynj over 5 years ago

If you intend to increase the reservoir capacitor, for a ‘fix and forget’ sensor, I suggest avoiding electrolytics. Relative to the self-discharge of the coin cell, these have a substantial leakage current which usually gets worse with age, so stealing significant precious energy.
You can work out an optimum size once you have an estimate of the Tx current draw. It is easiest to deal in Q, the charge on the reservoir capacitor, C. Remember to use Farads in the equations !

To first order, the charge for a short transmit block comes entirely from the capacitor (the coin cell is isolated by the time constant created by its internal resistance).

> Charge consumed = Tx current (Amps) x Tx block send time (seconds)
> Start Vdd = Vbatt (take a value close to end of life)
> Let Vdd a the end of the Tx block = Vend
> Then charge consumed ∆Q = C x (Vbatt - Vx) = Tx current (A) x Tx block send time (seconds)
> For a chosen Vend, solve for C

You should find that the C sizing is well within the range of the larger ceramic capacitors (tiny leakage). Overate the voltage spec a little for long life and double the estimated C value to allow for the voltage dependency of the actual C you get with hi-K ceramics.

    (1-14/14)