Okay, the subject is hard to craft, but hopefully you can help.
I have a wireless network using XBees. One coordinator and one end device (there are more but not for this problem). I am using the series 2, which I know how to do, that is not the problem. My problem is one of power consumption.
Summary: On the end device, in the loop, the device first goes into sleep mode 2 times (16 seconds), wakes up, reads sensor data, wakes up the XBee, transmits the value, puts the xbee back to sleep, end of main loop.
To wake up the xbee, I set the pinMode of wake_pin to output and set it low. After I transmit, I set it high.
My problem is the following:
A) If I place the pinMode(wake_pin, OUTPUT) in the setup(), the system doesn't consume power as it should. The arduino is awake for the 16 seconds, RESETS (flash of pin 13), then runs 1 time correctly and transmits my data.
B) If I place the pinMode(wake_pin, OUTPUT) in the loop(), the system consumes power as it should (16 seconds asleep, then wake up, increase in mA for about 1-2 seconds, NO reset, back to sleep). However the xbee does not send data.
So...why is it that the xbee is only going to wake up when I place the pinMode() in the setup()??
Any tips or clues or help will be MUCH appreciated. BTW, in sleep mode, I'm running < mA. During away mode, I'm running at 9 mA.
Thanks,
JEremy