NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Running ATMega 168 on 3.3 volts

May 02, 2012
by dvdsnyd
dvdsnyd's Avatar

Hi all,

It has been a little while since I have posted. I believe I have gotten my pressure sensor(BMP085) working. I still have a bit of fiddling with getting altitude out of it. I have also been working on a little protoboard project, so I don't have to worry about loose wires. Basically I moved the standard NK to protoboard. Nothing really new there :-D

Anyways, I want to do something with my new pressure sensor. I would like to build a small and lightweight maximum recording rocket altimeter. I am going to make it out of some protoboard I have lying around, since it is just a prototype.

The Pressure sensor runs off of 3.3 volts and uses I2C for communication with the microcontroller. Since I want to keep it compact and lightweight, I would like to be able to ditch the logic level translator( 2 mosfets) and one of the voltage regulators. I would like to run the whole thing off of a small lipo battery I have. I believe it is a 3.7 volt single cell battery. It was used for a very small helicopter.

I know to program the microcontroller I have to use 5 volts, hence using my little programmer board I made, and then just swapping the chip over to the altimeter board. I know it is possible to run at 3.3 volts, but what do I have to do programming wise? Do I need to do anything to the bootloader? The biggest issue I foresee running into is messing up the clock, since I believe it would no longer be running at the designed clock speed?? Is there some way to calculate what clock speed I would be running at? Would I need a different oscillator? Or just use the internal one? With the I2C interface and the BMP805, there are specific delays for conversions to complete. I would think changing the clock speed would screw these up as well, considering it seems the the NK guys set up the delay function specific to the NK crystal. I searched the forums here, but couldn't find anything specific to what I am asking. If someone could point me in the right direction, it would be great!

Thanks a lot,

David

May 02, 2012
by pcbolt
pcbolt's Avatar

Hi David -

Glad to hear you got the sensor working. The datasheet for the Atmega168 (page 306 sec. 28.3) gives the oscillator frequency vs. operating voltage specs you'd need to design for. In short, you can use 14.7 Mhz down to an input voltage of about 3.5 to 3.6v. The big design question to answer is if your sensor can tolerate pin inputs of 3.6 volts you'd be golden. If not, you'd have to get a slower oscillator or like you said use the internal one. If you use an internal clock you will need to program the fuses. You will have to change, re-compile and re-load the bootloader which is not a big deal, but you'd need an programming module to do it.

If you can get away with using 3.6 volts you could just use your MOSFETS to level shift the 5 volt USB UART programming connections. Then you wouldn't have to change the way you are doing things much at all. Check the spec sheet for your sensor, you might be OK.

May 05, 2012
by dvdsnyd
dvdsnyd's Avatar

Hi pcbolt-

Thanks for the response.

Looking at the datasheet of the Baro sensor, it says the absolute maximum voltage on all pins is 4.5 volts, so on that front we should be golden :-). Should I use some sort of regulator in between the battery and the electronics? Or can I just use the 3.7 volt lipo directly? I am just concerned with power surges. Or am I over thinking this? Also, is the MOSFET logic level shift basically the same that I have in between the 3.3 volt baro sensor and the 5 volt power supply I had before?

Thanks a lot!

David

May 05, 2012
by pcbolt
pcbolt's Avatar

Hi David -

Sounds like you'll be flying your rocket in no time. As to the question of running at 3.7 volts, that won't hurt the MCU at all, just be sure your sensor can handle it. Most chips have tolerances that allow for a "little" extra voltage. If not, there is a problem with trying to regulate down to 3.6v from 3.7v. Usually, voltage regulators need a bigger voltage difference between input and output (there's a term for that but I can't remember it). So your choices are to either use 3.7 direct, or use 5v or higher and regulate down to 3.6. You might be able to use a 3.6v zener diode, but even that will draw some wasted current.

As far as the MOSFET's, you'd have to connect the gate to the lower voltage supply( 3.3v), the source to the lower voltage signal (MCU pins) and the drain to the higher voltage signal (USB wires). You'll also need pullups resistors on the signal lines (I think). Remember 3.3v is cutting it a little close with the 14.7 Mhz oscillator.

May 07, 2012
by dvdsnyd
dvdsnyd's Avatar

Thanks pcbolt,

It will be a little while. Still working out the bugs on my programmer/prototype board. Plus I need to order a few parts. A couple of crystals is really all I need. But I want to make up a schematic in Eagle too. Hopefully soon :-). I think for the prototype I am going to just program the microcontroller then move it over to the altimeter. That way I won't have to add more to the altimeter board. Thanks for the suggestion though, Maybe when I try to do something with SMD components and get deeper into all this I will go that route...Least try it.

I did a little interpolation on the frequency-supply voltage graph. From what I calculate, Using 3.6 volts(My battery outputs 3.7v) I get a minimum frequency of about 15 MHz. So I won't be going under that. From what I can tell, all the components will be able to handle that voltage.

Thanks for all the help!

David

May 07, 2012
by pcbolt
pcbolt's Avatar

No problem - 'course you owe us a few pictures when it gets flying along with the altitude readings :-)

May 08, 2012
by dvdsnyd
dvdsnyd's Avatar

I think that can be arranged :-)

May 08, 2012
by Ralphxyz
Ralphxyz's Avatar

dvdsnyd, are you going to store the altitude readings in EEPROM to see what altitude you gained or are you going to use some radio telemetry to see live time results?

Are you using the code from SparkFun BMP085?

Ralph

Post a Reply

Please log in to post a reply.

Did you know that you can make a spooky Halloween Jack-O-Lantern with a microcontroller? Learn more...