5/07/2011

Sleeping Be(e)auty

Voltage regulator LM2937, XBee (End Device), LM335
One thing I was really waiting for was the "sleep mode" feature of the XBees. This might be a huge energy saver.Mobile Sensors with XBees running on two batteries without microcontroller could be as tiny as a pocket lighter and run for months (or years) without changing the power source!
Thinking about solar powered/ energy harvesting devices they could even stay longer connected to a (sensor-) network with the possibility of bidirectional communication (transmitting sensor data or actuate a device). A lot of applications could come into mind where neither wires nor a AC power source is required.

With "Sleep Mode" End Devices are introduced in Chapter 6 which differ from routers mostly by falling asleep for a certain amount of time. Because they do, you might have trouble. I will tell you later what my personal experiences were while digging through the first pages of the chapter.

To begin with you have to configure the XBee as an end device and configure the corresponding AT commands for your intended project. Again everything is described very well in the book. Until text meets "expert" (me).

WARNING.

Check all the settings twice while programming the commands via the terminal. After writing it to the XBee flash your bee might turn into a lifeless piece of epoxide resin if you made a "fat finger trade"  - that means you typed in any command that turns the XBee into a dumb object. Or into a hyperactive. As I did.

In the parts list of the "Simple Sensor with Sleep Project" there is an alternative configuration with two AA batteries mentioned. If you read my blog entry about the LM335 issues, you might have noticed, that I had some problems getting exact temperature readings if the supply voltage falls below a certain value. I suspect unless the batteries are very, very fresh you might get into trouble with this double AA option and get erroneus readings. I tried it with batteries and rechargeable batteries and both didn't work at room temperature.

But everything worked fine with "normal" supply voltage. I put my multimeter into current measurement mode and could observe how the current consumption fell from about 41.75mA to 2.39mA for a second to go up again like the interval (ATSM4, ATSP64, ATST14) programmed into the XBee.

LM335 directly connected to PIN 13
2.39mA.Hm. That's not zero while sleeping. The LM335 draws 1mA at 25°C (supply voltage 3.3V, resistor 330 ohms). The rest goes to the voltage regulator (quiescent current 1.4mA, datasheet says 2mA so that's in line with the specs). I did some tests and connected the Vcc of the LM335 (330 ohms resistor) to pin 13. This pin is only "HIGH" when the XBee awakes. So the temperature sensor only draws current, when the sleep mode is inactive. At room temperature everything worked well - I got the same temperature readings as before. I'm still thinking about getting the 3.3 volts without voltage regulator. Two batteries are not sufficient for the LM335, three would be too much for the XBee (Vcc limits: 2.1 - 3.6 volts). Any hint how to solve this problem is appreciated.

One last word regarding typing in the AT commands for the sleep mode. Somehow while testing some options I typed in something wrong. The result was a non- or better hyperactive reacting XBee. I spent a lot of time to get the device into command mode with the help of the terminal in X-CTU. If you look for the green "DTS"-light and at the same time typing in the "+++" you have a chance to talk again to the XBee. I was lucky and tried to program the settings described in the book. And again my XBee got hyperactive. In the end I flashed a router firmware (after an arcade like typing to get into command mode) and then went back to an end device firmware. Keep in mind to activate "always update firmware".

No comments:

Post a Comment