Go Down

Topic: Is there a voltage regulated, level shifted I2C bus solution for AA powered unit (Read 2302 times) previous topic - next topic

Jack Christensen

Have you considered just running everything on 3.3V? I designed a data logger that runs on 2xAA cells and uses an MCP1640 boost regulator, that when not enabled, simply passes the battery voltage straight through. The logging cycle is: Wake up (via RTC interrupt), enable boost regulator, increase system clock speed to 8MHz, power sensors on, take readings, save data, program next wake time, power sensors off, reduce clock to 1MHz, disable boost regulator, go to sleep. Using 1MHz allows the MCU to operate down to 1.8V when running on battery voltage, but while reading sensors and saving data, everything runs on the regulated voltage.

The regulator can be configured to supply either 3.3V or 5V; exclusive of sensor requirements, everything else on the board is equally happy with either but of course 3.3V will provide better battery life. Sleep current is only a few microamps. It uses EEPROM for logging memory (hence the 512kB limitation). I've thought about redesigning it with an SD card but that's a low priority project.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/


Have you considered just running everything on 3.3V? I designed a data logger that runs on 2xAA cells and uses an MCP1640 boost regulator, that when not enabled, simply passes the battery voltage straight through. The logging cycle is: Wake up (via RTC interrupt), enable boost regulator, increase system clock speed to 8MHz, power sensors on, take readings, save data, program next wake time, power sensors off, reduce clock to 1MHz, disable boost regulator, go to sleep. Using 1MHz allows the MCU to operate down to 1.8V when running on battery voltage, but while reading sensors and saving data, everything runs on the regulated voltage.

The regulator can be configured to supply either 3.3V or 5V; exclusive of sensor requirements, everything else on the board is equally happy with either but of course 3.3V will provide better battery life. Sleep current is only a few microamps. It uses EEPROM for logging memory (hence the 512kB limitation). I've thought about redesigning it with an SD card but that's a low priority project.


For ultra low-power projects, I've found that voltage regulators in general (boost or buck) use too much power.  Instead, I go with using  3-4 batteries and a diode to drop the voltage a bit and to protect the circuit from batteries being inserted the wrong way.  The goal is to put the circuit slightly above the rated voltage with fresh batteries.  For example, I commonly have ATmega8 projects running at 5.5 volts with fresh batteries.  Sure, out of spec a bit, but I've never had anything blow up, even with 6 volts.  Same goes with a 3.3V system, 3 batteries with a diode.

By taking out the voltage regulator, you really can create a system that uses 1uA when the ATmega8 is in sleep mode.  Sure, you use an extra batter or two.  But batteries are cheap and you can design systems that can log or interact for SEVERAL years.  I have a few projects that draw less current than the battery looses just sitting on the shelf with nothing connected.  You need to shut everything down, even the brown-out detector.  If you need my ultra low-power code, write me, I'll probably eventually make it into a library.

My typical ultra-low power project will put the ATmega8 in almost total sleep (just waiting for a trigger pin or timer).  I typically attach an LED that blinks every minute so you know it's still working.  The trick with the LED to use the least amount of power is to use a very bright LED, use a larger resistor to limit the current to maybe 1mA, and use the built-in sleep of the ATmega8 for the time the LED is on.  In other words, turn on the LED (only using 1mA) put the ATmega8 to sleep for 15ms, wake back up, turn off the LED, then return to long sleep.  This uses less power because it's only using 1mA for 15ms instead of leaving the ATmega8 awake for 5ms during a shorter blink and consuming more than 10mA.  The little things add up, and I'm a bit of a current Nazi.

Also, I would not suggest reducing the clock speed to 1MHz.  I've found you'll use more power at 1MHz than at 8MHz.  The reason is first there's not much of a power savings from 8MHz to 1MHz, and secondly your code takes 8 times as long to run.  The end result is you actually use a lot more power at 1MHz.  16MHz would be slightly more efficient, but then you need external crystal/caps which raises component cost/complexity.  So, I typically use the internal 8MHz oscillator.  Makes it easy, cheap, and more energy efficient than 1MHz.

Keep in mind that I've spent hundreds of hours developing ultra low-powered systems.  I've measured the actual current used and calculated everything to the nth degree.  In other words, I'm not guessing what I'm saying is true, I've done it, countless times.  The ATmega8 is a VERY good platform if low power is the goal.  Also, I'm talking about using a ATmega8 chip and a custom circuit, not an Arduino, which will never work in an ultra low-power system.

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Oh, there's one other thing.  Also when doing an ultra low-voltage system I monitor the input voltage by using the ATmega8's internal bandgap reference voltage.  Basically, I monitor the voltage of the batteries.  During development, I'll use a variable voltage source where I can turn down the voltage till the system fails.  I'll then add something like 10% to that voltage and set that as my limit.  Every so often (like once a day) the ultra low-powered system will get a battery voltage reading.  Once it's below the set range, the blinking changes from once every 60 seconds to a double flash or flashing every 8 seconds.  Something so you know the battery is low and needs to be replaced.

By the way, I've yet to actually reach a low battery level warning in an actual system because they really will last for around 7 years.  I've only simulated it.  I've also done projects where I could press a button and it would flash out the voltage via an LED.  So I know it works, just a little too well.  Duracell hates me ;)

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Jack Christensen

Sucks to be Duracell  :D

Sounds like you've got everything nailed. I'm familiar with most or all of the techniques you outlined and can't disagree. A major goal for my project was very low power, but that wasn't the only goal. It had to supply regulated voltage during the logging cycle and also provide the option of 3.3V or 5V. The 1MHz clock is not necessarily used for minimum power, it's to ensure the MCU is operating within spec when running on the battery only (which could be as low as 1.8V, which is the BOD setting I used). At any rate, it runs at 1MHz for relatively few cycles, just before sleeping. I had heard it said that 1MHz was the sweet spot for low power, but have not done the measurements myself so am not in a position to differ with your experience.

I'm really happy with the way the data logger works and the power consumption looks like it probably exceeded my expectations by a fair amount. The logging cycle can be as short as 15ms depending on sensors. Just received data from a couple loggers that were in Northern Michigan through the winter. The first was inside an insulated but unheated cabin where temperatures got down to 1°F.  Its regulator was configured for 3.3V. It started with a less-than-fresh pair of AA cells, that measured 3003mV at the start, and 2987mV after 184 days. The second logger was in an open shed. It used 5V, and its battery started at 3255mV and ended at 2844mV after 195 days with temperatures as low as -22°F. It had more sensors and more complex sensors than the first unit; I don't have current measurements but I imagine its sensors drew 2-4 times more current than those of the first unit, and for longer intervals.

I can tell you get a kick out of the low power capabilities these MCUs have. So do I!
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

I had heard it said that 1MHz was the sweet spot for low power


It really depends on the task.  If awake only long enough for computation, 8 or 16 MHz uses less power.  If you're waiting for a communications reply or something like that, 1 MHz would use less power.  So in your situation, I'm sure 1 MHz is the way to go.

Have you had any problems running at 1 MHz?  I got some unstable results at 1 MHz.  2 and 4 MHz were fine, but at 1 MHz there were timing issues.  It could have just been the sensors I was working with.

I'm really happy with the way the data logger works and the power consumption looks like it probably exceeded my expectations by a fair amount. The logging cycle can be as short as 15ms depending on sensors. Just received data from a couple loggers that were in Northern Michigan through the winter. The first was inside an insulated but unheated cabin where temperatures got down to 1°F.  Its regulator was configured for 3.3V. It started with a less-than-fresh pair of AA cells, that measured 3003mV at the start, and 2987mV after 184 days. The second logger was in an open shed. It used 5V, and its battery started at 3255mV and ended at 2844mV after 195 days with temperatures as low as -22°F. It had more sensors and more complex sensors than the first unit; I don't have current measurements but I imagine its sensors drew 2-4 times more current than those of the first unit, and for longer intervals.

I can tell you get a kick out of the low power capabilities these MCUs have. So do I!


Yes, I'm a little passionate about ULP MCUs.  I love the battery stats you provide, I do the same thing.  I have an ULP test unit I've setup as a torture device on my desk at work.  I just tested the voltage again and at 230 days the average AA battery voltage is 1.41 volts (down from a 1.62 volt start).  This is my torture device, which is setup to trigger much more frequent than normal.

What voltage regulators do you use?  I've been using the Microchip MCP1700/MCP1702 which has a very low quiescent current (2 µA).  What are you using for a boost regulator?

Tim
Arduino - Teensy - Raspberry Pi
My libraries: NewPing - LCDBitmap - toneAC - NewTone - TimerFreeTone

Jack Christensen

Hey Tim, when the Energizer Bunny retires, we sure know who to nominate for a replacement!  :D

Have had no trouble whatsoever with 1MHz in general, on ATmegas or on ATtinys, but I don't know that I've tried reading sensors much at the slower speeds. I could imagine that some of the libraries that do their own bit-banging and timing may be sensitive to system clock speed but I don't have specifics.

I use the MCP1640C or MCP1640D boost regulator for the data logger (the former should be a bit more efficient, the latter provides a little better regulation, again a distinction that makes little difference for my project I think). Typical shutdown current is sub-µA according to the datasheet. The only gripe I have with it is that I haven't been able to come close to the output current as advertised in the datasheet. It also has problems starting if the load is too large. But the data logger doesn't use much current so it's great for that application. I've used the MCP1700/02 in other projects and they work very well indeed.

Cheers ... jc
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

EKMallon

Just wanted to blow the dust off of this thread, as I found a really cheap vreg'd level shifter recently:

http://www.ebay.com/itm/251384699933?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

And I really appreciate the tips about how to make the project more energy efficient!  I have a few Pro-mini based loggers now and have been thinking of swapping out the Voltage regulator there for something with a lower quiescent current.

Although I have to admit I am no where near your ability levels, I have completed a power burn down test of my own, and thought I would post it hear just for giggles.  Keep in mind that I had very little electronics experience before this project. Also I am saving all the data to an SD card, which is a huge power burden for the logger, but more practical if I want people to build their own units later.

http://edwardmallon.wordpress.com/2014/08/14/project-update-power-tests-battery-issues/

Jack Christensen

@EKMallon, wow, quite a story! I'd say that's a good start on a book about the project. I'm curious about the total amount of data logged. It sounded like the 30-minute interval was maybe longer than optimal. What would a better interval be, and how many bytes of data are logged for each interval?
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

EKMallon

The sensors attached to each logger vary, but generally I am juggling 96 ascii characters per record. I am using pString, even for number data, because it gives me protection from buffer overflows, which is REALLY important for a coding newbie like me who is swapping sensors all the time. When I concatenated the recent test data into a single csv file, it came to around about 40 mB in size. (about equivalent to 1 year at a 1.5 minute sample interval)

Also, I have been doing tests with the Rocket Scream Mini Ultra boards, and they are delivering incredibly low sleep currents, right out of the box. I am sure they ship these things with the BOD fuse turned off, which I am not that happy about for a logger application, but still, they are delivering the same kind of performance I have been seeing from the unregulated tiny-duino boards.  I have test's ongoing to see how gracefully they handle the situation when the power supply voltage falls below the rated input on their voltage regulator.    The MC5205 regulators on the regular Pro Mini & clone boards go into a  1/2 second  "Start & Shut down again"  loop when this happens, which I am sure is not good for the SD cards?

What I would like on systems with voltage regulators, is a more graceful fail over that simply passes  the power supply voltage through when it falls below the regulators spec'd input.  Some of my sensors would would start to deliver bad data at that point, but some are much hardier, and would keep going fine until I reached the SD card cutoff around 2.7 volts.

EKMallon

@Teckel:

I just wanted to say thanks for the low current LED tip! 

I had a ton of LED pips with "live" 1ms delays in my code.  Now I have 10k ohm limiters on the leds (yes they are pretty dim, but that's ok) , and since I had sleeping delays already (while waiting for sensor conversions) I just set these low current leds on for those instead of their previous pips.  The net result has been a significant improvement in the overall power performance of my loggers.  I will be looking in the regulator suggestions as well.

cheers!

Go Up