Go Down

Topic: Power consumption of pins in different pin modes (Read 489 times) previous topic - next topic

Yom092090

I am building a project that is battery-powered and must have a low power consumption. From this https://youtu.be/urLSDi7SD8M video, I know that floating pins consume more power than pins set to output HIGH or LOW. I am wondering if putting the pins in INPUT_PULLUP mode would save even more power since they are no longer floating and are not be outputting a voltage. I would love to know the difference between these two approach. P.S. I don't have a current meter that is precise enough to do the measurements myself.

ChrisTenone

Go to this page and scroll about 1/8 of the way down. Here is the summary table from Gammon Forum:

Quote
Testing in SLEEP_MODE_PWR_DOWN:


All pins as outputs, and LOW: 0.35 µA (same as before).

All pins as outputs, and HIGH: 1.86 µA.

All pins as inputs, and LOW (in other words, internal pull-ups disabled): 0.35 µA (same as before).

All pins as inputs, and HIGH (in other words, internal pull-ups enabled): 1.25 µA.
What, I need to say something else too?

wilykat

wSo it seems like a good practice to set all unused pins to low.

srnet

wSo it seems like a good practice to set all unused pins to low.
Or do nothing, as they default to inputs ?

$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

sterretje

Or do nothing, as they default to inputs ?
That's floating inputs which will result in constant flipping of all the logic gates resulting in higher power consumption.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Yom092090

So the point is to not let the pins be in a floating state?

sterretje

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Coding Badly

So the point is to not let the pins be in a floating state?
You could follow the recommendation provided by Atmel in the processor's datasheet.  Given the fact that they make power consumption guarantees it seems likely they also provide guidelines for meeting those guarantees.


DrAzzy

What doesn't make sense to me is that gammon's tests with pullups on (as atmel suggests) has higher power consumption than when the pins are left floating (which atmel says will result in increased power consumption)....
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Coding Badly

What doesn't make sense to me...
I believe Nick ran the tests shortly after acquiring the current mirror.  Maybe there were some kinks that had not been worked out.


westfw

Floating inputs do not have a CONSTANT current consumption.  It depends on what voltage they float to, which depend on... lots of random factors.  If you have floating inputs, you can change the Current consumption by waving your hand nearby...

mu234

:D This is the best joke I have heard today ! Cheers! Indeed, I am happy with my current consumption (500uA) so I will leave as it is, probably I will not get lower, if I consider and changing the ports as ins to outs and vice versa... Thanks anyway!

Best.

DrAzzy

500uA seems really high!

Did you forget to turn off the ADC before you put it to sleep? That alone takes off ~270uA from the sleep mode power consumption.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Smajdalf

What doesn't make sense to me is that gammon's tests with pullups on (as atmel suggests) has higher power consumption than when the pins are left floating (which atmel says will result in increased power consumption)....
I don't believe the Nick Gammon's results either. Maybe some leakage on his test board? Or damaged chip? Sadly I don't have time to test it.

Anyway in all sleep modes except for Idle sleep the input digital buffer is disabled (unless the pin is used as a wake up source) so there should be no difference if the pin is HIGH, LOW or even floating. From my tests the worst case current consumption of a floating pin is 100uA, but is much less typically (@ room temperature!). I think the additional current consumption even with all pins floating is small compared to the current consumption of the CPU running @16MHz.
Banned forever by Coding Badly for "trolling". Good luck with such attitude.

srnet

#14
Jan 26, 2019, 05:04 pm Last Edit: Jan 26, 2019, 05:05 pm by srnet
Anyway in all sleep modes except for Idle sleep the input digital buffer is disabled (unless the pin is used as a wake up source) so there should be no difference if the pin is HIGH, LOW or even floating. From my tests the worst case current consumption of a floating pin is 100uA, but is much less typically (@ room temperature!). I think the additional current consumption even with all pins floating is small compared to the current consumption of the CPU running @16MHz.
I have an ATMEGA1284P on a breadboard at the moment, checking a designs sleep current.

Its set to wakeup on an interrupt from a DS3231 RTC Alarm going off.

I have only 10 of the 32 I\O pins available in use, the rest are not connected or configured at all, so will be defaulting to inputs and floating.

The board setup is ATMEGA1284P, TPL5010 acting as Watchdog, 2Kbyte FRAM, DS3231 RTC, MIC2005 high side switch turning off a SX1278 LoRa device.

Sleep current of the lot is 1.0uA and stable, waving of hands or touching un-used pins makes no differance.

Clearly by leaving 22 unused pins as inputs I am doing something wrong ?

$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Go Up