Is there a voltage regulated, level shifted I2C bus solution for AA powered unit

I have a general question, that I am sure many people have solved before: How do you stabilize both the voltage (to 3.3v) and the logic levels, when you are diving an unregulated Arduino system (eg: tinyduino, etc) directly from 3AA batteries. In this system the input voltage will swing from 5.4 volts (if I use lithium AA's) down to 2.8 volts as the batteries discharge in a year long data logger deployment. I have several I2C bus sensors (compas, accelerometer, temp, pressure, etc) with a max vcc of 3.3 volts.

I have been looking at the pololu 3.3V Step-Up/Step-Down Voltage Regulator S7V8F3 ( http://www.pololu.com/product/2122 ) as it has a shutdown pin that would allow me to completely de-power the sensors during the 99% sleep time of this application. But I still have to add a logic level shifter, to deal with the voltage changes on the mcu side of SDA/SCL and could use a little guidance finding one that is suitable. I also don't know if I am causing myself grief by shutting down the sensors all the time, but for such long term deployments quiescent current is almost the most important issue in the whole design.

And it occurred to me that this must be a reasonably common problem, so perhaps someone has already built something like this? Is there a single, off the shelf module that will provide both voltage regulation, and logic level isolation, to an I2C bus in battery powered situations?

But I still have to add a logic level shifter, to deal with the voltage changes on the mcu side of SDA/SCL and could use a little guidance finding one that is suitable.

The logic level shifters have pull up resistors on both sides. Simply connect these to your supply on each side. As the arduino side's supply voltage changes so will the voltage of the conversion.

You're looking for a logic level converter like: 4-channel I2C-safe Bi-directional Logic Level Converter [BSS138] : ID 757 : $3.95 : Adafruit Industries, Unique & fun DIY electronics and kits. It's just two mosfets and four resistors; pretty easy to implement on your own as well. The BSS138 mosfet is pretty common and can be found for less than $.10.

For a regulator, you can find lots of LDO regulators that include a "shutdown" pin. When in shutdown they consume mere microamps of current. An LP2951 ($1) would be an example and is available in a DIP package -- needs just three capacitors to go with it. The S7V8F3 would work fine as well.

Thank you both.

But I was wondering if there was a single chip or break out board that did both functions at the same time - boost/buck voltage regulation to 3.3v and logic level shifting, as an off the shelf part. It just seemed like these might be a very common combination.

Sorry it is not a common combination and I have never seen a joint board.

Well I did eventually find one:

but I will have to wait for their reply to find out what voltage regulator they are using. I need both boost & buck, with low quiescent current. (I know, I'm asking for alot)

For now though, I will probably cobble together the Sparkfun PCA9306 Level Translator Breakout:
( SparkFun Level Translator Breakout - PCA9306 - BOB-15439 - SparkFun Electronics )
with the Pololu 3.3V Step-Up/Step-Down Voltage Regulator S7V8F3
( http://www.pololu.com/product/2122 )

as that regulator will handle the full voltage swing from my 3x AA battery pack ( 5.4 v down to <3 v )

The schematic is listed on the page, but I guarantee that it's a 3.3V linear regulator. That linear regulator will more than likely be more efficient (get more from your batteries) than a switching regulator would.

A 5.4V to 3V pack would be three batteries each going from 1.8V to 1V. What kind of battery are you using?

That linear regulator will more than likely be more efficient (get more from your batteries) than a switching regulator would.

An odd statement. Have you anything to back that up?

Grumpy_Mike:

That linear regulator will more than likely be more efficient (get more from your batteries) than a switching regulator would.

An odd statement. Have you anything to back that up?

The S7V8F3 at 3.3V is around 95% efficient (peak) with 3.6V input per Pololu's docs. For a linear regulator that's .3V drop, or (3.3 / 3.6 =) 91% efficient. So no, it's not more efficient meeting the peak efficiency, but it's respectably close. But as he mentioned this is a long-running project, I'm thinking that the lower quiescent current (< 1uA) of a linear regulator compared to the ".1 ma" quiescent current of the S7V8F3 is likely to put the linear regulator ahead.

And can you actually get a linear regulator that will work with just a 0.3V drop?

Newark lists 106 options with 300mv dropout or less.

OK thanks for posting.

Thanks for the extra input guys! I will do some more homework.

The 1.8 volt top end is from lithium AA batteries IF I can use them. In a 3-pack these run very close to the upper tolerance limit of my components, but 3000 mAh power is very attractive in a 1 year plus data logging situation. They also have a really nice flat power curve once they fall to 1.4-1.3 volts, so even if I shut the system down at 3 volts, I get 90% of the power out of the cells.

I have a solution but data storage is limited to 512kB. What is the logging frequency, and how many bytes per sample?

bytes per record: 64-96, depending on how many sensors I have attached, but there is alot of optimization I could do there.
15 minute sample frequency (so 96 records per day), but I want to bring that down to 5 minutes when interesting "events" are occurring, such as a storm pulse, etc. Looking at year long deployments so at the moment I don't think I can get down to 512k...currently using a 128 mb sd card.

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

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 :wink:

Tim

Sucks to be Duracell :smiley:

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!

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.

[quote author=Jack Christensen link=topic=235595.msg1735171#msg1735171 date=1400802666]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![/quote]

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