Go Down

Topic: Arduino Mega 2560 R3 Power readings (Read 5523 times) previous topic - next topic

theace

Hello,

I recently measured my arduino mega current consumption. I ran a more complex program on the arduino, but it enters sleep (power down) and stays there. The current I measured was somewhere around 17mA.
I powered the arduino from a 3.7V battery (it gives 4-4.2V if fully charged) directly on the 5V pin and it runs with no problem.

My question is: who consumes all that current?

The voltage regulator is bypassed and only the power led is lit (1-2mA maybe?). Could it be the ATmega16U2 USB-to-TTL Serial chip?
I read somewhere that the ATmega16 is powered directly from the VCC line regardless of an USB cable being connected or not.
In that case, could it be disabled, or switched on/off depending on the state of the USB connection?

Thank you!

krupski

#1
Sep 01, 2015, 10:33 pm Last Edit: Sep 01, 2015, 10:37 pm by Krupski
Hello,

I recently measured my arduino mega current consumption. I ran a more complex program on the arduino, but it enters sleep (power down) and stays there. The current I measured was somewhere around 17mA.
I powered the arduino from a 3.7V battery (it gives 4-4.2V if fully charged) directly on the 5V pin and it runs with no problem.

My question is: who consumes all that current?

The voltage regulator is bypassed and only the power led is lit (1-2mA maybe?). Could it be the ATmega16U2 USB-to-TTL Serial chip?
I read somewhere that the ATmega16 is powered directly from the VCC line regardless of an USB cable being connected or not.
In that case, could it be disabled, or switched on/off depending on the state of the USB connection?

Thank you!
The 3 terminal regulator on the Arduino board draws between 8 and 15 milliamps (quiescent current). Plus, the 3.3v regulator and the 16u2 USB interface also draw several milliamps... as well as the power LED.

If you are going to use sleep mode, there are a few things to watch out for:

* Be sure you disable the analog to digital converter (clear the ADEN bit in ADCSRA).
* Also, be sure you either have the brown out detector turned off... either by the fuse setting or by the power save register.
* Be sure that your wake method uses an interrupt LEVEL and not an EDGE. To detect an edge, a clock source needs to run.
* Be sure that I/O pins don't float. A floating pin can drift to 1/2 VCC and cause the output drivers to both conduct, thereby placing a load between VCC and ground. Oddly, pull DOWNS  save more power than pull UPS.

I made a little infrared remote control using an ATTiny25 which is always powered up with 3 AAA cells. It goes to sleep at bootup and a pushbutton on INT0 wakes it up, sends out the IR data then it goes back to sleep.

In sleep mode it draws so little current that I can't measure it. With my meter set to 0...1.99 milliamps range, it reads 0 when asleep!

If you want to save the maximum amount of power, you will need to build your own board without any extras (no regulators, LED power indicators, etc....).

Here's the main loop of my IR controller... you can see where the power save stuff is done:

Code: [Select]

    while (1) {
        cli (); // disable interrupts
        cbi (ADCSRA, ADEN); // disable ADC (saves 280 uA)
        sleep_bod_disable (); // turn off brown-out detector
        cbi (MCUCR, (ISC01 | ISC00)); // set INT0 active on low level
        set_sleep_mode (SLEEP_MODE_PWR_DOWN); // set power down mode
        sleep_enable (); // enable power down mode
        sbi (GIMSK, INT0); // enable INT0
        sei (); // enable interrupts
        sleep_cpu (); // power down cpu
        // cpu is now asleep. when it's awakened by INT0, continue
        cli (); // interrupts off
        cbi (IO_PORT, IR_BIT); // be sure IR LED is initially off
        sbi (IO_DDR, IR_BIT); // IR drive pin as output
        send_sony (sony_shutter_rel); // send camera shutter command
        cbi (IO_DDR, IR_BIT); // IR drive pin as input
        sei (); // interrupts on
        cbi (IO_DDR, BUTTON); // pinmode button input (has a 10K external pullup)
        while (bit_is_clear (IO_PIN, BUTTON)) { // wait while button is down
            _delay_us (100000); // 100 msec
        }
    }



Good luck.
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

theace

Krupski: thanks about all those useful information. I do know about turning off all those modules in the processor (ADC, brown out, etc) and about the pins, but my concern is about the rest of the components on the board that can draw power.

As I said, I power my arduino mega straight through the 5V pin, so the voltage regulator is bypassed. The power led is known to draw power (I will remove it in the future). But what else is drawing that current (~18mA)?

I read different topics and the suspect might be the USB chip (ATmega16U2) that draws power regardless of the board being connected to the USB or not. This is the thing that I would want to disable, but I don't know a reliable way. Could it be via software (modified firmware to do some sleeps), or hardware (cutting some wires or removing some components like suggesting here: http://forum.arduino.cc/index.php?topic=179013.0).

I though about making my own board, but I don't have all the means and time to do it and, also, the ATmega2560 chip has a lot of small pins and is difficult to solder it. So I though that I could go with a normal Arduino mega 2560 and strip some of it's parts + good sleep code to go to a 1-2mA range maximum.

krupski

#3
Sep 02, 2015, 05:30 pm Last Edit: Sep 02, 2015, 10:50 pm by Krupski Reason: fixed typo
Krupski: thanks about all those useful information. I do know about turning off all those modules in the processor (ADC, brown out, etc) and about the pins, but my concern is about the rest of the components on the board that can draw power.

As I said, I power my arduino mega straight through the 5V pin, so the voltage regulator is bypassed. The power led is known to draw power (I will remove it in the future). But what else is drawing that current (~18mA)?

I read different topics and the suspect might be the USB chip (ATmega16U2) that draws power regardless of the board being connected to the USB or not. This is the thing that I would want to disable, but I don't know a reliable way. Could it be via software (modified firmware to do some sleeps), or hardware (cutting some wires or removing some components like suggesting here: http://forum.arduino.cc/index.php?topic=179013.0).

I though about making my own board, but I don't have all the means and time to do it and, also, the ATmega2560 chip has a lot of small pins and is difficult to solder it. So I though that I could go with a normal Arduino mega 2560 and strip some of it's parts + good sleep code to go to a 1-2mA range maximum.
Depends on what you want to do. Maybe a 328P or even an ATTiny would be enough? How many I/O pins and interrupts do you need?

By the way, 1 to 2mA in sleep in completely unacceptable. You should be able to get down into the NANOAMPS range (which is essential if you want to build a battery powered device). 1 to 2 mA will suck a battery pack dead in less than a week.

I made a nice multi function "code learning" IR remote with an RGB status indicator LED, an IR emitter, an IR detector, a piezo beeper, a 3X4 keypad and two pushbuttons using an ATTiny2313 with room, ports and interrupts to spare.

In sleep (fully powered down) mode, it doesn't draw enough to register on my DVM which has at the lowest setting a 0-1.999 milliamp current range. All it shows is 0.000

I've been thinking about powering the board through a resistor and measure the voltage drop across it to try and determine the sleep mode current. I'll have to probably take into account the input impedance of the meter (10 megohm)!

By the way, please see this link: AVR POWER SAVING

This is a link to Nick Gammon's excellent website, the AVR power save discussion section. It has all the info you will ever need. By the way, do yourself a favor and look over the rest of his site.... TONS of great info there.

Some of the info (red highlight by me):


Summary of methods
Use as many of the techniques listed here as are practical in your application. They are described in further detail below.
  • Run the processor at a lower frequency
  • Run the processor at a lower voltage
  • Turn off unneeded internal modules in software (eg. SPI, I2C, Serial, ADC)
  • Turn off brownout detection
  • Turn off the Analog-to-Digital converter (ADC)
  • Turn off the watchdog timer
  • Put the processor to sleep
  • Don't use inefficient voltage regulators - if possible run directly from batteries
  • Don't use power-hungry displays (eg. indicator LEDs, backlit LCDs)
  • Arrange to wake the processor from sleep only when needed
  • Turn off (with a MOSFET) external devices (eg. SD cards, temperature sensors) until needed



In regards to the suggestion "Run at a lower frequency", if you don't need full clock speed you can programmaticly change your clock speed. You can divide the main F_CPU by any power of 2 from 1 to 256 using the clock prescale function (part of the AVR library, not an Arduino command) - like this:

clock_prescale_set (clock_div_n);


...where the parameter is "clock_div_1" thru "clock_div_256" (that is, 1, 2, 4,....64, 128, 256).

To make sure your timing loops work properly, do code like this at the start of your program:


Code: [Select]
#include <avr/power.h> // may be needed
#undef F_CPU
#define F_CPU (16000000UL/2)
clock_prescale_set (clock_div_2);

 
Of course, the F_CPU/n and clock_div_n must match. If you do  "16000000UL/8"  for example, then you need  "clock_div_8"  obviously.

Good luck!
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

krupski

So I though that I could go with a normal Arduino mega 2560 and strip some of it's parts + good sleep code to go to a 1-2mA range maximum.
Wow!!! I just checked my IR remote project. I put a 10K resistor in series with the power supply (3 AAA cells) and read it with my DMM (10 meg input impedance).

I got 0.005 volts. I=0.005/10000 = 0.5 MICROAMPERES!!!

I'm amazed it's so low.
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

theace

Thanks for the info and congrats with the good job that you did on your projects.

I don't what to change the arduino that I'm using. I though that my project could expand in the future and I might need the multiple serial interfaces that the arduino mega provides and, also, the high number of pins.

My question is simple: what are the big on board consumers on the arduino mega 2560 and how can I disable them?

I know about the led, it will be removed in the future.
The voltage regulator is bypassed, so I don't need to worry about it.
The USB chip (ATmega16U2) is directly connected to the VCC and this might be the big attraction. How can I disable it?
Any other mA hungry piece worth mentioning?

I thank you about the other information (most of it I know of), but please stick to the topic.

krupski

#6
Sep 03, 2015, 08:27 pm Last Edit: Sep 16, 2015, 08:20 am by Krupski
Thanks for the info and congrats with the good job that you did on your projects.

I don't what to change the arduino that I'm using. I though that my project could expand in the future and I might need the multiple serial interfaces that the arduino mega provides and, also, the high number of pins.

My question is simple: what are the big on board consumers on the arduino mega 2560 and how can I disable them?

I know about the led, it will be removed in the future.
The voltage regulator is bypassed, so I don't need to worry about it.
The USB chip (ATmega16U2) is directly connected to the VCC and this might be the big attraction. How can I disable it?
Any other mA hungry piece worth mentioning?

I thank you about the other information (most of it I know of), but please stick to the topic.
A way to disable the 16U2 is to take a small drill (about 1/16 inch) and drill, by hand, a "divot" through the trace feeding the VCC. Using a drill to "cut" a trace is controllable (won't slip and damage other traces like a razor blade will) and can easily be re-jumped with a small drop of solder...... like this:






(edit to add): DO NOT DRILL ALL THE WAY THROUGH! JUST DRILL A TINY "DIVOT" - JUST DEEP ENOUGH TO CUT THE TRACE AND NO MORE!
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

theace

I did some research and found the following consumers on the arduino mega board (see image attached):
1) the power led;
2) 5V regulator;
3) 3.3V regulator;
4) ATMega16U, the USB chip.

In order to cut power from each one, the following can be done:
1) can be easily desoldered;
2) it is bypassed because I input power directly on the 5V pin;
3) and 4) can be disabled by drilling the 3 points marked in green (thanks to Krupski for highlighting me that option). Those points are leads to the VCC of ATMega16U (check this for more info) and the other two are the 1 (input voltage) and 3 (on/off) pins of the 3.3V regulator (more info).

Following this scheme, this would happen:
- no 3.3V power given by the board;
- the USB should still be functional if USB cable is inserted;
- power can be provided by all means: barrel plug, VIN, 5V, USB.

Now, I'm asking what possible problems could emerge if I drill those holes and would the board work as expected?

krupski

I did some research and found the following consumers on the arduino mega board (see image attached):
1) the power led;
2) 5V regulator;
3) 3.3V regulator;
4) ATMega16U, the USB chip.

In order to cut power from each one, the following can be done:
1) can be easily desoldered;
2) it is bypassed because I input power directly on the 5V pin;
3) and 4) can be disabled by drilling the 3 points marked in green (thanks to Krupski for highlighting me that option). Those points are leads to the VCC of ATMega16U (check this for more info) and the other two are the 1 (input voltage) and 3 (on/off) pins of the 3.3V regulator (more info).

Following this scheme, this would happen:
- no 3.3V power given by the board;
- the USB should still be functional if USB cable is inserted;
- power can be provided by all means: barrel plug, VIN, 5V, USB.

Now, I'm asking what possible problems could emerge if I drill those holes and would the board work as expected?
Well, for the 5 volt regulator (item #2 in your image), all you need to do to disable it is to carefully heat, then use a tiny jeweler's screwdriver or corner of a razor blade and lift pin #3 (closest to the USB connector) 1 or 2 mm above the trace.

If you ever want to re-enable it, just press it back down and re-solder it.

As far as "drilling holes", I'm sure you know, but let me be sure you know... you do NOT drill a hole all the way through the board. Only drill maybe 1/2 mm to 1 mm deep and make a conical "crater" just deep enough to sever the copper trace. Then you can re-jump it later if you want to simply by soldering a tiny drop into the "crater".

If you drill all the way through, you will:

  • Be unable to easily re-jump the connection later.
  • Risk cutting some trace on the other side of the board.


Good luck!
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

theace

As far as "drilling holes", I'm sure you know, but let me be sure you know... you do NOT drill a hole all the way through the board. Only drill maybe 1/2 mm to 1 mm deep and make a conical "crater" just deep enough to sever the copper trace. Then you can re-jump it later if you want to simply by soldering a tiny drop into the "crater".

If you drill all the way through, you will:

  • Be unable to easily re-jump the connection later.
  • Risk cutting some trace on the other side of the board.

Yes I understood that. My worries are if the board will behave as expected and that there are no electronic problems that can occur because of those 3 circuit interrupts that I displayed in the picture.

krupski

Yes I understood that. My worries are if the board will behave as expected and that there are no electronic problems that can occur because of those 3 circuit interrupts that I displayed in the picture.
Just wanted to be sure... because in a previous post you wrote "Now, I'm asking what possible problems could emerge if I drill those holes and would the board work as expected?".

Better safe than sorry!  :)
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Paul__B

As I said, I power my arduino mega straight through the 5V pin, so the voltage regulator is bypassed.
What on earth makes you think that?


Paul__B

The Arduino mega 2560 schematic.
Yes.  Now the NCP1117ST50T3G regulator in the top left of that schematic with the 47 µF capacitor is clearly - as it should be for normal operation - directly connected to the +5 V line, so if you feed 5V to the "Vcc" input, it is clearly not bypassed; it is very much permanently connected and drawing current.

And according to its datasheet, that would appear to be about 5 to 10 mA (pages 4, 9).

krupski

#14
Sep 19, 2015, 04:54 am Last Edit: Sep 19, 2015, 04:55 am by Krupski
Yes.  Now the NCP1117ST50T3G regulator in the top left of that schematic with the 47 µF capacitor is clearly - as it should be for normal operation - directly connected to the +5 V line, so if you feed 5V to the "Vcc" input, it is clearly not bypassed; it is very much permanently connected and drawing current.

And according to its datasheet, that would appear to be about 5 to 10 mA (pages 4, 9).

I believe that the OP is talking about powering the 5 volt line directly (bypassing the regulator INPUT).

If you apply 5 volts directly to a circuit that contains a 5v 3 terminal regulator (i.e. applying 5v to the OUTPUT pin of the regulator) (i.e. the regulator is not being used - it's just got +5 on it's output), it will draw a small current because there is a resistive divider across the output pin (the feedback for the "reference vs output" comparator op-amp) (see pic).


Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Go Up