Hackster is hosting Hackster Holidays, Ep. 5: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 5 on Friday!
Naman Chauhan
Published © GPL3+

Reducing Arduino Power Consumption

One the most important feature of portable electronics should be long battery life. We can reduce the current drawn by several ways.

IntermediateFull instructions provided2 hours7,156
Reducing Arduino Power Consumption

Things used in this project

Hardware components

Microchip ATmega328 with Arduino Optiboot (Uno)
×1
Breadboard (generic)
Breadboard (generic)
×1
Male/Male Jumper Wires
×1
Capacitor 22 pF
Capacitor 22 pF
×1
16 MHz Crystal
16 MHz Crystal
×1
Adafruit 2200 mAh Battery - 5V 1A
×1
SparkFun USB to Serial Breakout - FT232RL
SparkFun USB to Serial Breakout - FT232RL
Optional
×1
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
USB to Serial Breakout Board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Atmega328 with minimal circuit schematics

The FTDI programmer in the upper left corner is an optional component.

Code

Sketch to put peripherals to idle state

C/C++
Remember to install the library.
#include <LowPower.h>

void setup()
{
  pinMode(13,OUTPUT);
}

void loop() 
{
  digitalWrite(13,HIGH);
  delay(2000);
  digitalWrite(13,LOW);
  LowPower.idle(SLEEP_2S, ADC_OFF, BOD_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, 
                SPI_OFF, USART0_OFF, TWI_OFF); 
  //Enter idle state for 8 s with the rest of peripherals turned off
  //Each microcontroller comes with different number of peripherals
}

Download LowPower Library - Github

Credits

Naman Chauhan

Naman Chauhan

41 projects • 129 followers
Programmer, electronic adept masquerading as Computer Science student. Email for Cooperation/Sponsorships to chauhannaman98@gmail.com

Comments