Suggestions on using an ATmega328 and a 3.7v lipo project?

Hi everyone

I am starting to play with the "bare bones ATmega328" and I had some questions. As I was reading through the excellent description by Nick Gamman on his low power temp & humidity sensor (http://www.gammon.com.au/forum/?id=12106), I found it to be as a great reference :). As I read through, though, I had a few questions about the design:

a. I only have available a 3.7v lipo that would serve as my power supply. Would there be a way to use this battery to power this project?
b. since battery voltage drops over time as you use it (for instance, a fully charged 1-cell lipo would be at ~4.2v, and then slowly decrease to 3.7v, etc etc), would this affect the accuracy of the readings that you get over time from your temperature & humidity sensors?
c. assuming that I can use my 3.7v lipo, how could I do if I needed to add an additional sensor that would use 5v as an input?
d. could I add an xbee to this project, and using the 3.7v power supply? For this, would I need to use an xbee explorer regulated board (I think these require 5v), or can I just connect the power from the xbee straight to the atmega328? Maybe even add some kind of power regulator?

Thanks & I look forward to hearing everyone's suggestions/thoughts!

You could a regulator to get everything running at 3.3V, then have Aref running from 3.3V also.
Need more details on you 5V part plan.

Thanks for the suggestion. The only thing is that if I use a power regulator to regulate the power going into the chip, I would be using a lot of wasteful current while the chip is sleeping. I'll have to think a bit more about how to do this...

If you have anything above 3.3, then you have to regulate down somehow for the xbee, for which you haven't described any plans for powering down.

ive had success with using the Pololu U1V10F3 step-up regulator using 2xAA batteries. it automatically switches to a step-down if the input voltage is more than 3.3v too, so would be suitable for your 3.7v lipo throughout its current cycle. it has a very low quiescent current of 1mA. there's a 5v version too - all of the sensors i've got work at 5v, just not the radio.

I found that temp/humidity sensors are very sensitive to voltage fluctuations, the DHT11 is rated for 3.0-5.5v and doesn't function at all at 2.7v. That said, its a pile of poo anyway, I've not tried the DHT22 but can not recommend the DHT11 at all - integer only and wildy inaccurate, plus its humidity sensor gets stuck and needs recalibrating after about a month.

The BMP085 can give some really weird readings when not running from a regulated supply even within its rated 3.0-5v (of the breakout board i'm using) and at 2.9v and its dead.

The DS18B20 is the only stable temperature sensor I've used, its the most accurate and even though its 3.0-5.5v it works fine at 2.7v or less.

I've got an 8MHz 328p, BMP085, DHT11, DS18B20 and nRF24L01+ running for 8 days off of 2xAA's with the Pololu regulator and jeelib.sleepy() Don't believe the months/years crap you read about, that's based off of datasheets of components not measured from assembled circuits.

a. I only have available a 3.7v lipo that would serve as my power supply. Would there be a way to use this battery to power this project?

I don't see why not, as the processor will run on that voltage, and the DHT22 will run from 3.3 to 6V. You might need to operate the processor at 8 MHz rather than 16 MHz.

b. since battery voltage drops over time as you use it (for instance, a fully charged 1-cell lipo would be at ~4.2v, and then slowly decrease to 3.7v, etc etc), would this affect the accuracy of the readings that you get over time from your temperature & humidity sensors?

I don't see why, since the sensor is rated to operate inside that range.

c. assuming that I can use my 3.7v lipo, how could I do if I needed to add an additional sensor that would use 5v as an input?

I doubt many sensors would insist on 5V but if they did, you could use a boost converter (get one from eBay for a couple of dollars) and connect that to the switched power line. When on it could provide 5V.

Hi sej7278, Nick & CrossRoads for such detailed & valuable suggestions/ideas!

These will definitely get me started as I start thinking about my potential project. Based from your recommendations & experiences, it sounds like having a regulated power supply coming into the chip such as the step-up/step-down or boost converter would work great. I am interested in running a couple of sensors such as the DHT22, xbee (I haven't played with a nRF24L01 yet), and maybe temp. Also, I recently learned about the DS18B20, and based on its specs I think that might do the trick for my needs.

I'm thinking of using a "power down" sleep mode from my ATmega, following the awesome tutorial that Nick made. This, in addition to a low-draw 3.3v supply (boost or step-up/down) would do.

Thank you so much guys for all your input! This was actually super helpful...

L.

I wouldn't run the processor chip from the step-up converter, as then it would have to be on all the time, drawing current. Just switch it on and off when required.

sounds good. Lots of thing to consider!

what would have to be on all the time - the chip or boost? surely if the chip is sent to sleep the boost would be idle as such a tiny current would be drawn?

similarly, what do you mean about turning it off - the boost or chip? and how?

with the lipo, same as with 3xAA batteries - without the boost you're going to get to the point where there's not enough voltage pretty soon, and it wouldn't be smooth either. if you're using batteries you've always got to have some sort of regulator surely?

i know we always say its not about voltage its about current, but most sensors i've worked with cease to function under 2.7v even if the atmega can keep going.

what would have to be on all the time - the chip or boost? surely if the chip is sent to sleep the boost would be idle as such a tiny current would be drawn?

When you say "surely" would you like to measure it? The boost would have to be doing some work in case the output was needed.

similarly, what do you mean about turning it off - the boost or chip? and how?

The boost, in the same way I described turning off the SD card in my temperature logger project.

with the lipo, same as with 3xAA batteries - without the boost you're going to get to the point where there's not enough voltage pretty soon, and it wouldn't be smooth either. if you're using batteries you've always got to have some sort of regulator surely?

Not at all. I have a number of projects that run straight off batteries (with no regulator).

This one is still going months later:

i know we always say its not about voltage its about current, but most sensors i've worked with cease to function under 2.7v even if the atmega can keep going.

That's why you use the booster for the sensor only. And switch it on and off with a MOSFET.

That's why you use the booster for the sensor only. And switch it on and off with a MOSFET.

yes this is something i've been thinking about myself, as i'm not convinced my nRF24L01+ is sleeping with the MCU or the boost is only using 1mA, as i get 8 days from 2xAA batteries and the MCU/radio should only be awake 6secs per hour, it should last for months!

if i power the MCU directly and the radio/sensors from the boost, then i can guarantee that they're offlined via the mosfet.

so in your circuit where are you getting 5v from - it looks like some AA's and a regulator to me, what's the "reverse polarity protection" bit if not a 7805 or somesuch?

out of interest, how are you finding the dht22, the dht11 is utter rubbish i'd say, just wondering if the dht22 is worth 3x the price.

Nick & sej7278... you actually addressed my same thoughts/concerns. It definitely looks like I will have to experiment with the use of the mosfet to turn on/off a +5v reg/step-up regulator. That way I don't drain the battery while the chip is sleeping.

Nick may know more, but I don't think that he is using a regulator in his project... From the photo it looks like he is just feeding the voltage straight from the batteries (3 or 4 AA).

Btw... I've used the DHT22 in the past and I like it. Overall, it looks like it performs much better than its earlier versions (which I never used, but only read about).

Here's my temperature logger circuit:

It is powered by 3 x AA batteries. The reverse polarity protection is using a MOSFET (marked on the circuit).

It has been going now since August 2013 (around 4 months) on those same 3 batteries. It logs to the SD card every 15 minutes. There is no regulator. The processor (and the DHT22) run fine on the (approx) 4.2 V the batteries provide. I just measured the voltage for you. It's 4.33V, well within spec for the processor and the DHT22.

As for the DHT22, it seems OK. The temperature it reports is not quite what I get from other sources, but who knows which one is really correct?

yup, definitely looks like i'll try a mosfet (or maybe a 2N2222/TIP122 transistor as i don't have any mosfets to hand) to turn on the 3.3v boost to power the radio and sensors. i've got to use the boost as my radio cannot take more than 3.6v and some of my sensors cannot take less than a steady 2.9v, plus it would be nice to use 2xAA instead of 3 for size.

i've got to add in some sort of sleep interrupt button too, as its a cow to debug if something is working if you've got to wait 30mins for it to wake up!