Make xbee sleep w/o forcing a pin high.

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Make xbee sleep w/o forcing a pin high.

Post by seakoz »

My goal:
Allow my boarduino to control when the xbee (using the ladyada xbee adapter) will be on or off.

What amazes me is that apparently, if you put the xbee into hibernate mode (ATSM1), it requires you to keep a pin high to keep the xbee off. This seems crazy! I would expect it to be the other way around, turn a pin high when you want to use the modem, turn it off when you don't.

Anyone have any suggestions on how to do what I want? My whole purpose in doing this is to lower the power requirements.

My first thought was to use one of the digital pin outs as the power source for the xbee. This works with a normal boarduino but i've converted my boarduino to run on 3.3v power (by swapping the 7805 with a 3.3v regulator).

Any help would be greatly appreciated!

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by Franklin97355 »

The xbee is a 3.3v device so you could cut in after the regulator with your power.

seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by seakoz »

I tried that by running the digital pin out into the 3v line on the modem. Didn't work. But, if I run vout from my boarduino into the 3v line, the modem works just fine.

Thankfully I have a small pile of unbuilt xbee adapters lying around. I'm going to build one without the reset line tied to vcc (by way of a resistor) and instead see if i can use the reset line to control the modem.

User avatar
ericwertz
 
Posts: 93
Joined: Sun Jun 01, 2008 4:18 am

Re: Make xbee sleep w/o forcing a pin high.

Post by ericwertz »

I tried that by running the digital pin out into the 3v line on the modem. Didn't work.

If you're doing what I think you're doing (trying to provide power to the XBee by directly connecting a *duino digital I/O pin), it won't work in the general case.

The problem is that the digital outputs on the microprocessor can't source enough current to keep the XBee happy. Typical source current for I/O pins like these are in the 4-30mA range, and the XBee's going to want 45-50mA when the radio's on, if you believe the datasheet (the XBee Pro will need even more than that when transmitting).

You could, however, use the digital output to switch a transistor that provides the power to the XBee. But in general, what you're really trying to do is exactly what Hibernate mode was designed for. So unless you've convinced yourself that Hibernate is lousy for your application, it's probably the way to go. The datasheet says that it uses less than 10uA. For all we know, it might even be 1uA. The good news is that you can actually measure it with a voltmeter/ammeter pretty easily, just by sticking it in series with your power source.

Don't forget that if you really do want to cut-off power all the way to the XBee, that you'll have to do your all your power-on initialization every time you wake it up. Depending on what your usage profile is, you can actually use more power raising it from the dead each time, rather than from just out of hibernation.

For example, let's say Hibernate takes 10uA of current, and the XBee takes 10mA just sitting there without the radio on, just to make the numbers easy. So then, Hibernate would take 1/1000 of the power as when it's up with the radio off (on is supposedly ~50mA). So then, if you can't re-initialize the XBee from power-off in 1/1000 of the time that you're going to be keeping it off, then you should be hibernating instead. And if Hibernate really only takes 2uA and 20mA on average to bring it back up, it's 1/10,000. To a first order of magnitude, that's what you need to be looking at.

Gotta warn you, you're only going to be able to figure out so much from what it says about power consumption from the datasheet. You may not be able to make a good guess about how much power you need to bring up the XBee from being a rock (or from hibernate, for that matter), for example. If push comes to shove, you have to be prepared to actually measure it if it's that important to you.

My totally half-assed guess would be that unless you were planning to keep the XBee off for at least 20 minutes at a time, then don't bother thinking about it.

The other half of my ass says that if you're using a linear-regulator to power your Boarduino+XBee, then that's perhaps where you should be looking to save power first, as the hibernate vs. put-to-death issue may just be noise compared to using that thing.

I think that Hibernate is probably your friend.

good luck!
-e

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by adafruit »

i dont understand why not just use a pullup resistor and then pull the pin low to wake?

seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by seakoz »

When you say use a pull-up resistor, you mean put that between the arduino output pin and the xbee sleep pin? The purpose of this resistor is to reduce the amount of current allowed to go through to the sleep pin right?


I've done what the other poster has suggested and so far my battery life is improved, still testing to see if it's improved enough...

Thanks!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by adafruit »

well just because a pin is high doesnt mean theres any current draw. its probably just a signal pin, no power used while its high. for CMOS inputs (which it probably is), power is only consumed when the pin -changes state-

seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by seakoz »

oh, a little confused then.

What do I gain from the pull-up resistor over plugging the xbee sleep pin directly into the arduino digital pin out?

Thanks for your patience!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by adafruit »

nothing. i thought maybe you wanted to have the boarduino off too

seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by seakoz »

I thought about that too, I'm hoping I don't have to figure out how to power down and power up the boarduino on an hourly basis.

I'm hoping that if I can get 48 hours of battery charge, then I should be able to trickle charge the batteries (and avoid a charging circuit) back to full capacity in that time.

To turn off the boarduino too, i'd have to have it go to sleep and use an external interrupt right?

Thanks!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by adafruit »

ya

seakoz
 
Posts: 14
Joined: Mon Apr 20, 2009 10:43 pm

Re: Make xbee sleep w/o forcing a pin high.

Post by seakoz »

That's what I thought.

I don't think I need to conserve that much power, I've hit 43 hours (and counting) on my 4 AA batteries by sleeping the xbee and dropping to 3.3v. I also removed the "on" led although I don't know how much juice I would have lost through that.

That should be enough to let the solar cell do its thing.

Thanks!

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”