Atmega 328 chip - 3.3V?

Im making an Arduino on a perfboard using the Atmega 328. I need 3.3V for a BT module. What is the best way to achieve this? Using a resistor? (R= V/I) 5V/.04A = 125ohm resistor. Is this correct?

No, definitely not.

Use a voltage regulator.

A voltage regulator.

I would consider running the whole board on 3.3V (and the ATmega at 8MHz). If that is not possible or desirable, I like the MCP1700/1702 regulators if the current requirement is modest, else something like an LD1117.

I have a pot and a bag of different resistors, I dont have a voltage regulator though and rather not spend money if I dont have to. I already soldered a 16MHZ crystal on there. Whats the best way besides a voltage reg?

AllenI:
Whats the best way besides a voltage reg?

Wait to until until you can buy one.

http://www.cmiyc.com/tutorials/regulator-basics/
Under the "alternatives" section I explain why most alternatives won't work.

I see it says the Vin can change, but if Im using a digital I/O pin, isnt Vin either HIGH 5V or LOW 0V? Also, I have a 7805 regulator already on the circuit to bring down the 12V power supply and a couple spares, can I use a 5V to fix that problem of change in voltage?

If not, is this what I should be buying:

Thanks for help btw

The voltage out of the resistor will change depending on the load, which will vary, eg. if the output pin is low or high.

Why not order a 3.3V regulator?

AllenI:
I see it says the Vin can change, but if Im using a digital I/O pin, isnt Vin either HIGH 5V or LOW 0V? Also, I have a 7805 regulator already on the circuit to bring down the 12V power supply and a couple spares, can I use a 5V to fix that problem of change in voltage?

If not, is this what I should be buying:
http://www.radioshack.com/product/index.jsp?productId=2062601

Thanks for help btw

That, plus some resistors, would do the job, but my god, what a price.

I wouldn't expect to spend more than $0.50 on a simple voltage regulator.

For instance: SPX1117M3-L-3-3 - $0.22

Why not resistors? A resistor changes the voltage drop across it according to the current passing through it. V=RxI. If (when) the current changes, the voltage dropped across it will change. The current flow in a DC circuit is (almost) never static. Even a simple lightbulb's current changes as it heats up. If an LED turns on, the current increases by say 20mA. If it turns off, it drops by 20mA. All those changes in current would be reflected as changes in voltage across the resistor. And why not a resistive divider? Simply because they are unable to provide enough current to power something. They are strictly very low current for providing offsets / biases etc as inputs to other devices.

AllenI:
I see it says the Vin can change, but if Im using a digital I/O pin, isnt Vin either HIGH 5V or LOW 0V? Also, I have a 7805 regulator already on the circuit to bring down the 12V power supply and a couple spares, can I use a 5V to fix that problem of change in voltage?

If not, is this what I should be buying:
http://www.radioshack.com/product/index.jsp?productId=2062601

Thanks for help btw

Unless it's an emergency don't buy common electronics parts from Radio Shack, unless you are a trust fund baby. Learn to use on-line vendors.

Lefty

retrolefty:
Unless it's an emergency don't buy common electronics parts from Radio Shack, unless you are a trust fund baby. Learn to use on-line vendors.

Lefty

You mean Ripoff Shack...

Ok, I see your point. Im trying to find one local but I cant. RadioShack has an adjustable V-Reg but Im not too excited about the price.

majenko:
That, plus some resistors, would do the job, but my god, what a price.

I wouldn't expect to spend more than $0.50 on a simple voltage regulator.

For instance: SPX1117M3-L-3-3 - $0.22

Yeah I see a few places have them pretty cheap but I was looking to finish this project today if possible. And skip that price from RadioShack. But I might have no choice if I wanna finish today.

So, since I do have a few spare 7805's can I use one of those with a resistor since I'll have a regulated 5V coming out the Vout? Or is that not a wise choice, I dont wanna compromise the circuit.

AllenI:
So, since I do have a few spare 7805's can I use one of those with a resistor since I'll have a regulated 5V coming out the Vout? Or is that not a wise choice, I dont wanna compromise the circuit.

How many ways do we have to say "NO" in?

To use a resistor you have to have 2 constant values - the voltage AND the current. With the 7805 the voltage will be constant. The current WILL NOT be constant. Ergo, you CANNOT use a resistor. EVER. FULL STOP.

Don't ask again. The answer will STILL be NO!

You REQUIRE a voltage regulator. Do you really have a need to finish the project today? Are you just being impatient? Order one on-line (and make sure you have / order the right capacitors to support it at the same time), sit back, and relax. Play a few games. Chill for a day or so while they arrive. Stop living life in the fast lane, it'll only lead to an early grave.

Unless it's an emergency don't buy common electronics parts from Radio Shack, unless you are a trust fund baby. Learn to use on-line vendors.

Lefty
[/quote]

I try to practice this as much as possible. But I just got the other components I ordered in the mail and was anxious to finish this project today.

majenko:

AllenI:
So, since I do have a few spare 7805's can I use one of those with a resistor since I'll have a regulated 5V coming out the Vout? Or is that not a wise choice, I dont wanna compromise the circuit.

How many ways do we have to say "NO" in?

To use a resistor you have to have 2 constant values - the voltage AND the current. With the 7805 the voltage will be constant. The current WILL NOT be constant. Ergo, you CANNOT use a resistor. EVER. FULL STOP.

Don't ask again. The answer will STILL be NO!

You REQUIRE a voltage regulator. Do you really have a need to finish the project today? Are you just being impatient? Order one on-line (and make sure you have / order the right capacitors to support it at the same time), sit back, and relax. Play a few games. Chill for a day or so while they arrive. Stop living life in the fast lane, it'll only lead to an early grave.

Lol, not trying to be difficult here, I'm still learning. I understand what your saying though about the current from the I/O pins not being constant. But if I were to power the BT module by the 12V power supply instead of an I/O pin, wouldnt that supply the constant current I need, being the module would draw from the wall wart instead of one of the Atmega's pins?

AllenI:
Lol, not trying to be difficult here, I'm still learning. I understand what your saying though about the current from the I/O pins not being constant. But if I were to power the BT module by the 12V power supply instead of an I/O pin, wouldnt that supply the constant current I need, being the module would draw from the wall wart instead of one of the Atmega's pins?

No, because you do not provide current, the BT module draws current. It takes what it needs when it needs it. Its needs will change depending on what it is doing. If it's transmitting it will be drawing a lot more current than if it's sat there idle.

And you never ever EVER consider powering something from a digital IO pin, unless it is an LED. The IO pins can provide at most 40mA, which is nowhere near enough to power something like a BT module.

AllenI:
So, since I do have a few spare 7805's can I use one of those with a resistor since I'll have a regulated 5V coming out the Vout? Or is that not a wise choice, I dont wanna compromise the circuit.

It might be regulated out of the 7805, but once it goes through the resistor it won't be, because the current will vary.

Read the link (http://www.cmiyc.com/tutorials/regulator-basics/) about why you can't use a resistor.

majenko:

AllenI:
Lol, not trying to be difficult here, I'm still learning. I understand what your saying though about the current from the I/O pins not being constant. But if I were to power the BT module by the 12V power supply instead of an I/O pin, wouldnt that supply the constant current I need, being the module would draw from the wall wart instead of one of the Atmega's pins?

No, because you do not provide current, the BT module draws current. It takes what it needs when it needs it. Its needs will change depending on what it is doing. If it's transmitting it will be drawing a lot more current than if it's sat there idle.

Just so I completely understand this, 7805 fundamentally is a no-go b/c though it'll put out a regulated 5V and adding a resistor(lets say 125ohm) to it will bring it down to 3.3V, that 3.3V can and will change depending on the state of the module and the needed current of that particular state, thus changing the current going through the resistor, thus changing the resistance anywhere from 0-125, ultimately changing the 3.3V and either going too low or too high and frying my module.

And you never ever EVER consider powering something from a digital IO pin, unless it is an LED. The IO pins can provide at most 40mA, which is nowhere near enough to power something like a BT module.

Well thanks for saving my 328 chip from myself

AllenI:
Just so I completely understand this, 7805 fundamentally is a no-go b/c though it'll put out a regulated 5V and adding a resistor(lets say 125ohm) to it will bring it down to 3.3V, that 3.3V can and will change depending on the state of the module and the needed current of that particular state, thus changing the current going through the resistor, thus changing the resistance anywhere from 0-125, ultimately changing the 3.3V and either going too low or too high and frying my module.

Close.

It doesn't change the resistance. The resistance cannot change.

What it does is change the voltage that is dropped across the resistor.

Say you have a resistor of 125Ω, and a regulated 5V supply.

If the module draws 10mA then Ohms Law tells us that V=RxI, which is 125 x 0.01 which is 1.25, so the voltage after the resistor would be 5-1.25 = 3.75V.

If it draws 30mA, then the same formula: 125 * 0.03 = 3.75, so the voltage after the resistor at that point would be 5-3.75 = 1.25V. BT module cannot function.

If it only draws 5mA, then 125 * 0.005 = 0.625V, so the voltage after the resistor would be 5-0.625 = 4.375V and bang goes the BT module.

This is how ammeters work. A very small resistance is placed in the circuit where you want to find out the current, and the voltage dropped across that resistor is measured. Using Ohms Law the ammeter then calculates the current that must be flowing through the resistor.

These are some of the fundamentals that you really must get to grips with in order to do electronics.

majenko:

AllenI:
Just so I completely understand this, 7805 fundamentally is a no-go b/c though it'll put out a regulated 5V and adding a resistor(lets say 125ohm) to it will bring it down to 3.3V, that 3.3V can and will change depending on the state of the module and the needed current of that particular state, thus changing the current going through the resistor, thus changing the resistance anywhere from 0-125, ultimately changing the 3.3V and either going too low or too high and frying my module.

Close.

It doesn't change the resistance. The resistance cannot change.

What it does is change the voltage that is dropped across the resistor.

Say you have a resistor of 125?, and a regulated 5V supply.

If the module draws 10mA then Ohms Law tells us that V=RxI, which is 125 x 0.01 which is 1.25, so the voltage after the resistor would be 5-1.25 = 3.75V.

If it draws 30mA, then the same formula: 125 * 0.03 = 3.75, so the voltage after the resistor at that point would be 5-3.75 = 1.25V. BT module cannot function.

If it only draws 5mA, then 125 * 0.005 = 0.625V, so the voltage after the resistor would be 5-0.625 = 4.375V and bang goes the BT module.

This is how ammeters work. A very small resistance is placed in the circuit where you want to find out the current, and the voltage dropped across that resistor is measured. Using Ohms Law the ammeter then calculates the current that must be flowing through the resistor.

These are some of the fundamentals that you really must get to grips with in order to do electronics.

Ok I think everything clicked now. Thanks for clearing that up. Im just gonna order a few 3V regulators rather than buying an adjustable reg.. Yeah I thought I had most of it down, this is my first perfboard project and not using an already assembled Arduino. But hey, Im a little wiser now. Thanks everyone for the replies and links.