Arduino stops working when xbee is in sleep mode


I use the Squidbee system to measure some values…
I want to reduce the power consumption of the nodes, therefore I wanted to set the xbee modules into sleep mode, when they are not transmitting data.

If I enable the sleep mode on the xbee devices,the program that is running on the micro controller stops working.

I don’t know a solution for this problem.

Any help would be great!



You can read this article,

Good luck

You can also use arduino POWER_MODE_IDLE and maintain the USART working so the Arduino will wake up automatically when receiving data on in the serial pins.

See for more information.

This problem is the same I have.

As soon as the XBee module is configured to use anyone of the sleep modes (pin sleep, i.e.) and starts to sleep, the microcontroller stops working as well (like if there's a switch off in the circuit).

The error is easy to find:

1.- Write a very stupid program which blinks the on-board led

2.- Configure the XBee module to sleep according to Sleep_RQ state (pin 9), when Sleep_RQ is asserted XBee will sleep, when Sleep_RQ is deasserted XBee will awake

If we start the execution, the Arduino's led start to blink (this behavior is ok) and XBee tries to find a network to join in. Regardless of the result of this action, the ZigBee protocol (I am using "Series 2" modules, which work with XBee ZB firmware) leads XBee to sleep.

As soon as XBee sleeps, the Arduino's led stops blinking, like if the microcontroller were not powered.

What I expected was the Arduino's microcontroller to execute the code regardless the state of XBee (sleep / awake). I think is the behavior all people would expect.

All the examples I found (including the ones you mention, Marcos and Ecerulm) are very different from what we want to achieve. This examples only leads to sleep Arduino's microcontroller and not the radio, what is ok in certain cases (i.e., if we need the radio to be always on). But what happens if We only want to transmite messages with very low rate (once a week, i.e.)? ZigBee is great, because the sleep modes provided are very powerful on this way, and it's very easy to configure the module to awake itself (and anyothers as well).

Problem: Unexpected behavior of Arduino in a common situation, when sleeping XBee's modules.

I am using XBee Shield from Libelium, Arduino and XBee Modules (either series 1 and 2). I tried several configurations, but none of them worked propertly.

Any ideas?

Santiago Barro

Re-reading this post rings a bell.

If you are using the XBee Shield then make sure that the configuration for DIO7 is DISABLED as this XBee pin is connected to the RST in the Arduino. If you leave the default option (1 - CTS) random resets after a couple of seconds may occur.

I remember that I run into random resets after upgrading my XBee and it was because of that. Check my post to see how to change the configuation of DIO7.

That could be the source of your problems. I'm not sure. It could be that DIO7 level is changed when the XBee goes to sleep, check the documentation. Or better use a multimeter to monitor the voltage in that pin and see what happens.

If it's that the easy solution would be to remove the connection between DIO7 and arduino RST. I current use arduino mini pro so I don't use the shield and therefore my DIO7 in the XBee is not connected to arduiono RST so I dont run into this anymore.

Hope that helps

I found more information in the XBee Manual it seems that XBee will always set DIO7 high when entering sleep. No matter what setting you put for DIO7 in the config. So you only option is to put XBee to sleep without resetting the Arduino is cutting the connection between DIO7 and RST pin. Good luck!

You could read more about this in "CTS Flow Control" and "End Device Sleep Configuration" chapters of the Xbee manual.

If CTS flow control is enabled (D7 command) when the serial receive buffer is 17 bytes away from being full, the module de-asserts CTS (sets it high) to signal to the host device to stop sendint serial data. CTS is re-asserted after the serial recive buffer has 34 bytes of space.

If CTS flow control is disbled (d7), the CTS pin is also de-asserted(high) when entering sleep, and asserted (low) upon waking


My program is communicating between two Xbees: one on Xbee breakout board(transmitter) and the other on arduino Duemilanove via Xbee Shield (Receiver). Connection is working fine that is i am receiving same think that i am sending.

When i connect arduino with my PC and send the commands via arduino software's serial monitor the code works fine but when i send commands via the transmitter Xbee to the receiver Xbee, it RESETS the code running on Arduino every time receiver receives a command. This is never desired.

@ecerulm......Do i have to disconnect the DIO7 and RST connection as well to rectify this problem?

Anyone has an idea why this can happen. Please help.