Go Down

Topic: Atmega328p Power Saving Techniques (Read 6720 times) previous topic - next topic

pito

#30
Apr 13, 2013, 11:48 am Last Edit: Apr 13, 2013, 11:50 am by pito Reason: 1
Quote
So you think there's no way I could get an IR receiver that draws 0.35mA to draw less and still work?

You can hardly get it afaik, but you may design such. I am currently coping with the same issue, the standard TSOP1738 from my junk box takes ~1mA. Thinking about a low power IR "detector" (few uAmps draw, detecting 38kHz infra signal), which wakes up the mcu and the mcu then switches on the 1738.

Nick Gammon


@Nick: a quick comment - when you measure the voltage drop on a 1Meg resistor pls do consider a standard meter has ~10Meg internal resistance. So, 1Meg || 10Meg = 0.909Meg, thus your nA values will be 9% off.. ;)


That's a very good point, and it shows the flaw in my plan. I don't normally measure current like that, and was trying to help the OP resolve whether or not his meter was wildly out. The uCurrent device doesn't have that flaw, as it amplifies the voltage drop across its internal resistor.

In fact, my reading was out by about 10% and you have explained why, thanks!
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

bradley

Lefty - I think I know what you mean by latency time.

Mr. Gammon - With bare minimum code running on 3.3V, the atmega draws 46.6 mA. In its sleep mode, it draws .01mA. Correct me if I'm wrong,  but it seems the only way to wake the chip from sleep mode without drawing additional current from the system is through the internal watch dog timer. If this is the case, then is it possible to save more power using the watch dog timer to sleep for 200ms and wake for 7ms and during that 7ms of wake, you can power up the chip and pins and do an external pin interrupt to receive signal?

Also, is it possible to save even more power by achieving a "pulsed supply voltage" such that the voltage and current is just enough to receive signal as apposed to continuously drawing a constant power from the source?

Thanks for keeping up with my thread.






Nick Gammon

You don't have to use the watchdog, in itself that draws quite a lot of current.

My tests of interrupts (eg. pin change interrupts) show that you can be down to nano-amps until a key is pressed. See:

http://www.gammon.com.au/forum/?id=11497&reply=4#reply4

100 nA until a key is pressed.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

bradley

Just tested your setup and it's really nice. I didn't have the keypad, so I just used a push button. But the real challenge here is how do I incorporate this setup with an ir receiver instead of a push button. The receiver needs a constant 0.35mA supply current in order to work. So it seems that there's no better way to save more power than use a watch dog timer fluctuating from 100nA to 0.35mA to wake the chip intermitedly.


Nick Gammon

Normally IR receivers are in mains-powered equipment (eg. a TV) and the sender (the remote) is battery powered. Trying to save power whilst detecting IR pulses is going to be problematic.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

fungus


I'm between Sketch C and D in the link and reading 0.40mA after by turning ADC off. I should expect a huge power reduction according to his method, but I'm not. I don't know if I'm missing any steps leading up to that reduction, but if you could help, that'll be fantastic!


How are you measuring it? The error might be in the measuring device once you get down to these values.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

bradley

@fungus - I got that problem solved. Thanks

@Mr. Gammon - Okay, so that concludes that for IR! I don't know much about rf transceiver, but could you help clear this up for me? I found an rf transceiver model nRF24L01 that takes about 900 nanoAmps in sleep mode, 22 microAmps in standby mode, and above 10milliA when transmit and/or receive. My questions are when this transceiver is in sleep or standby mode, can it receive signal or do you have to power it up for it to receive or does the signal cause it to power up from sleep mode?


Here's a link: Page 14 is where power consumption is at:

https://docs.google.com/viewer?a=v&q=cache:ANWvWgCEyaMJ:www.nordicsemi.com/eng/content/download/2730/34105/file/nRF24L01_Product_Specification_v2_0.pdf+&hl=en&gl=us&pid=bl&srcid=ADGEESjvGkOhVwt8_Dp3LKqfqZeASZGVzVX04R0alriMhtZwfG4NXR5ufvPKsYPNKC-FgnVFwibbZbhyXNJ_YDYMNdSkiMG-LrY544m2CsxP1ApsJ3LVzEBT2u_mmwS8yxC39q1PbF6R&sig=AHIEtbTIzEoK25INVW44oQYBPP-vWYbArw

fungus

#38
Apr 25, 2013, 04:03 am Last Edit: Apr 25, 2013, 04:20 am by fungus Reason: 1

Okay, so I tried your method and measured the voltage across the circuit which comes to about 4.8V. Putting a 1M Ohmz resistor in series and measured the drop across it comes out to 4.1V. Did Ohmz law and got 4100 nanoAmps.


I'm doing the same thing right now and getting very similar numbers (measured about 0.33mA current with my cheapo meter, got 4.1V with the 1M resistor).

I'm confused about what's happening though:

If the voltage drop across the 1M resistor is 4.1V, that means there's only 0.9V across the chip - not enough to keep running! How do I know it's sleeping properly?

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

bradley

You know it sleeps properly when you are able to measure the current dissipation across the chip to be less than .1mA. The chip can go as low as .1uA if you set the fuses and clock correctly.

Make sure you don't have ANY other sensors or leds or "stuff" hooked up into your circuit, because they may be drawing power and current from the system. Don't have anything on your breadboard except for your atmega chip.

fungus


You know it sleeps properly when you are able to measure the current dissipation across the chip to be less than .1mA. The chip can go as low as .1uA if you set the fuses and clock correctly.


I know that...my question is about how to accurately measure the current. I want to confirm that I'm setting the fuses and clock correctly.

Of course we're going to measure a small current if we put a 1 Megaohm resistor in a 5V circuit, Ohms law tells us it can't possibly be more than 5uA.

I want to know how this method tells us the current consumption of the AVR chip. It doesn't make any sense to me.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus

More thoughts:

If I'm seeing a voltage drop of about 4V across my 1M resistor in a 5V circuit, that means the AVR chip has a resistance of about 250K at that moment in time.

Using that resistance value I can calculate current consumption with a real working voltage, eg. 2.5V from a coin cell.

At 2.5V the chip would use about 10uA (assuming the resistance stays the same). This is far more than the datasheet says it should draw. The datasheet says it should draw less than 4uA at 2.5V in sleep mode with watchdog timer enabled.

(nb. This is a Tiny85V, not a Mega328P...)

I guess what I need to do is find a resistor which gives me a voltage drop closer to the 2.5V target voltage.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus

Ok...some results.

I tried a 100K resistor and got about 4V drop across it (the same as the 1M resistor - weird!)

I tried a 10K resistor and got 2.27V drop across it. That gives 2.73V across the chip, which is in the right range.

But...2.27V across a 10K resistor is .227mA - two orders of magnitude higher than it should be.

So I'm as confused as ever. Going into sleep mode definitely uses less power (I can measure the difference!) but consumption doesn't seem to be anywhere near as low as it should be.

FWIW my sleep code is:
Code: [Select]

  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  sleep_enable();
  sleep_mode();


Brownout detection is disabled by fuse bits and the watchdog timer wakes the chip up after the correct amount of time (I've timed it).

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

dc42


So I'm as confused as ever. Going into sleep mode definitely uses less power (I can measure the difference!) but consumption doesn't seem to be anywhere near as low as it should be.


Did you read my reply #18 ?
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

bradley

Have you set ADCSRA = 0?

Our measurements may not likely be the same based on several factors. Firstly, you're using a different chip. Secondly, I don't know what your setup looks like to determine what's wrong. It could be a software issue or hardware issue, such as something wrong with the wiring.

Are you asking how to accurately measure current of the chip using a multi-meter or with the 1M Ohmz method Nick showed?

Here, follow these steps to get your power readings: http://www.gammon.com.au/forum/?id=11497

I was able to get the Attiny85V chip down to pretty low power in the uA as well using these steps.

Go Up