Close

POWER OPTIMIZATION BY USING SLEEP MODE

A project log for SOLAR POWERED ARDUINO WEATHER STATION

A solar powered Arduino Weather Station to help the farmers

open-green-energyOpen Green Energy 06/28/2015 at 14:120 Comments

Picture of POWER OPTIMIZATION BY USING SLEEP MODE

temp_-758114554.jpg

temp_185183326.jpg

temp_1442858346.jpg

temp_-595250227.jpg

The weather data does not change frequently.So we can take reading at an interval of 5mins.As we are taking readings at regular intervals, it is a fantastic way to save lots of power. A system with appropriate sleep schedules can run for several months on just two AA batteries.We are so lucky that Arduino has several sleep modes that can be used to reduce power consumption.

This is most useful for any sensor networks.You can use this tricks in any of your stand alone sensor project.

After searching through the internet for using the sleep modes, I found a simple but powerful library by Rocket Scream has a Lightweight Low Power library supports all AVR power down modes. Each mode has an associated library method that lets you control sleep duration using the watchdog timer.For a novice programmer like me it is very simple and easy to use.

How to use LowPower Library :

1. Download the library from GitHub
2.Extract the zip file to the arduino library in your computer.
3.Import the library in your code.
4.Write the following one line code for power saving.
"LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF) ; "

You can also pass different arguments to shut off individual peripherals. For different argument and sleep time refer the table provided by Lightweight Low Power Arduino Library.


example code :

#include "LowPower.h"
void setup()
{ 
// No setup is required for this library 
} 
void loop() 
{ 
// Sleep for 8 s with ADC module and BOD module off 
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); 
// Do something here 
// Example: read sensor, log data, transmit data 
}



Lets use it in the blink code of arduino IDE example



Apply "LowPower library" in Blink code

#include "LowPower.h" // import the lowpoer library
int led = 13; 
void setup()
{ 
pinMode(led, OUTPUT); 
}
void loop() 
{ 
digitalWrite(led, HIGH); 
LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF); // instead of delay(1000) ; 
digitalWrite(led, LOW); 
LowPower.powerDown(SLEEP_1S, ADC_OFF, BOD_OFF); // instead of delay(1000) ; 
}

Before using the Lowpower library current taken by arduino

51.7mA when led is ON

47mA when led is OFF

After using the Lowpower library current taken by arduino

34.93mA when led is ON
31.73mA when led is OFF

Are you happy to reduce 32.43 % power ?? Hey there is still room to reduce the power consumption.
Your arduino board have different power sucking components like power led,voltage regulator and USB interface chip which takes most of the power even when it is idle.

Discussions