¿How many power are we saving?
For answering this question we meassure the current power with normal SquidBee and later with the new power saving mode.
SquidBee normal mode ==> 69 - 70 mA. Power saved 69 mA
SquidBee power save mode ==> 14 mA in sleep mode 69 mA (sending state aprox. 0.5 s every 5 min)
Power saved ((14 mA x 295 s) + (69 mA x 5 s)) / 300 = 14. 91 mA
As you can see, the power saved is (69 - 14.91) / 69 = 78%
No doubt one of the most important features in a wireless sensor network is the battery life of the motes. Currently, with the initial SquidBee software the battery life doesn't last too long due to the sensor read interval (the mote read and send messages every 5 seconds).
Normally in a "standard" sensor network, we don't need the motes send data every 5 seconds, because temperature, humidity or light don't change so much. So we consider a good interval of time is for example 5 minutes for sending data messages.
Another thing we do for saving power in SquidBee is to use the sleeping mode in the board and the XBee module. Arduino can be configured to be sleeping and wake up with an interrupt source.
In Arduino we are going to use power save mode to save power and as interrupt source we are going to use the overflow interrupt in timer 2.
Timer 2 is a 8 bit counter (counts until 255) and is able to trigger an overflow interrupt if we also use a 10 bits preescaler we divide the frecuency by 1024 and we get an interrupt source that is triggered 61 times per seconds (16000000 / 1024 / 255 = 61).
Once the interrupt source on timer 2 is configured we have to set the parameters to put Arduino and the XBee module in sleep mode.
Arduino
For setting the sleep paramters in Arduino we use the sleep library (example in arduino playground)
XBee
To configure XBee in sleep mode is very easy, the XBee we are gonig to use has to be configured with these parameters:
- ATSM1 => Sleep mode - pin hibernate
- ATD70 => CTS flow control disabled
- ATD70 => CTS flow control disabled
Finally, we have to connect the pin 6 in arduino with pin 9 in XBee, since Arduino is working with 5v and XBee with 3.3 V, we shouldn't connect them directly, we are going to use a resistor bridge to adapt these levels (see image).
Once we have all the hardware we just upload the code and it's done, we have our Squidbee saving all the power we can.
Комментариев нет:
Отправить комментарий