# Society of Robots - Robot Forum

## Electronics => Electronics => Topic started by: airman00 on January 30, 2009, 02:48:46 PM

Title: 5V to 3V Using a Resistor
Post by: airman00 on January 30, 2009, 02:48:46 PM
I want to convert my 5V power supply into a 3V power supply for use with the AREF pin of my ATmega168
I know that I can one of the following:
1. Get a dedicated 5V to 3V regulator IC
2. Use a diode with a 2V voltage drop

I was thinking about doing the following.
If AREF drew a constant current then I might be able to use a resistor to do the job.
Lets say AREF drew 10mA when Vcc for the microcontroller was 5V.

V= IR , or Volts  = current*resistance  - Ohms Law
Substitute Values - 3 = .01*R
Solve - 300 = R    = 300 ohms

So if I use a 300 ohm resistor in series from the 5V supply to the AREF , the AREF should get 3V

Is this correct? Am I missing something?
Title: Re: 5V to 3V Using a Resistor
Post by: frodo on January 30, 2009, 02:52:04 PM
whats the AREF pin do?
Title: Re: 5V to 3V Using a Resistor
Post by: HDL_CinC_Dragon on January 30, 2009, 03:15:43 PM
you want 2v dropping at 10mA. 2 / .01
You need 200 Ohms
Title: Re: 5V to 3V Using a Resistor
Post by: frodo on January 30, 2009, 03:30:22 PM
so, what does the AREF pin do  ???
Title: Re: 5V to 3V Using a Resistor
Post by: airman00 on January 30, 2009, 03:34:08 PM
so, what does the AREF pin do  ???

you want 2v dropping at 10mA. 2 / .01
You need 200 Ohms
But isn't V representing the voltage output , and not the voltage drop?
Title: Re: 5V to 3V Using a Resistor
Post by: HDL_CinC_Dragon on January 30, 2009, 03:36:08 PM
negative.
When calculating a series resistor you take how much voltage you want it to drop and then how much current you want it to have going through it and plug it into ohms law. so:
Vdrop / Icircuit = Rseries
Title: Re: 5V to 3V Using a Resistor
Post by: airman00 on January 30, 2009, 03:43:28 PM
negative.
When calculating a series resistor you take how much voltage you want it to drop and then how much current you want it to have going through it and plug it into ohms law. so:
Vdrop / Icircuit = Rseries
OK I understand now

Anyone know how much current AREF draws on the ATmega168 ? I can't seem to find it in the datasheet.
Title: Re: 5V to 3V Using a Resistor
Post by: HDL_CinC_Dragon on January 30, 2009, 03:49:54 PM
Im thinking its safe to say that the current doesnt really matter. It doesnt say anything about AREF current on the 168 DS or the 8 DS. Im assuming 10mA would be fine for it
Title: Re: 5V to 3V Using a Resistor
Post by: frodo on January 30, 2009, 03:55:39 PM
oh ye sorry. just needed to know for some reason. i would just use a diode with 2V drop but i wouldn't really be able to give definitive answers because i'm not that good at circuits and pin-outs.
Title: Re: 5V to 3V Using a Resistor
Post by: Soeren on January 30, 2009, 04:35:05 PM
Hi,

Using a resistor could become quite bad.
Using a 2V zener (if you can find it) would not cause any permanent harm, but would still be bad.
Not knowing Ohms Law (and Watts Law) as an aspiring robotteer is very bad!
Not knowing how to handle an analog reference voltage input pin gives bad measuring, so must be considered quite bad.

If you want to use it as reference for an A/D-C with just a hint of precision, you need the same precision for that supply (since it relies on it).
For that purpose you might grab a reference diode (usually not found in 3V, but shop around and remember to check their tolerance, temperature coefficient etc.) and if eg. a 5V ref. diode is used a resistive divider of a suitable impedance. Another way is to use a laser trimmed CCG with a 0.1% resistor. Whatever way, remember that you won't get any better precision than what your reference defines.

But, before tinkering anymore with controllers and such, learn Ohms, Watts, Thevenins, Nortons and Kirchoffs laws and theorems, they are the cornerstones of any electronics design and just assembling other peoples designs is the electronics equivalent of assembling a jigsaw-puzzle.

You have 5V, you want 3V, how many volts do you need to drop?   5-3=2

Be good (= don't do bad).
Title: Re: 5V to 3V Using a Resistor
Post by: airman00 on January 30, 2009, 06:04:30 PM
Now that I think about it , there is not much difference (for my application, at least) from using a 5V supply and a 3V supply

at 5V I have resolution of 5/1024 = .005V each step
at 3V I have resolution of 3/1024 = .003V each step

@Soeren
I learned it a while ago , and haven't really needed those laws that badly until now. I have a program called Electronics Assistant which calculates the proper resistor values, capacitor values , etc. after you enter in some values of your own. Having a program do all my calculations for me (like just this morning I used it to calculate the proper resistor for a high power LED)
I realized how bad I am in these laws, so I plan to review it over this weekend.
Title: Re: 5V to 3V Using a Resistor
Post by: pomprocker on January 30, 2009, 06:18:59 PM
Voltage divider circuit

Dropping down from 5v to 3v is a 2v drop, that gives us a resistor ratio of 2:3 (drop 2 volts down to 3v), or 0.66:1, but that won't work with 5% resistors, so we could round down to 0.6:1

using the resistor ratio calculator:
http://www.play-hookey.com/dc_theory/resistor_ratios.html

That tells us we can use any resistors with the ratios of 20:12 or 30:18

We could use (12ohm & 20ohm), (120ohm & 200ohm), (1.2kohm & 2kohm), (12kohm & 20kohm), (120kohm & 200kohm), all the way up to (120Mohm & 200Mohm). The same goes with the 30:18 ratio.

It would all give you 3v.

Its all in the blog  :D
http://pomprocker.blogspot.com/2009/01/battery-monitor-voltage-divider-circuit.html
Title: Re: 5V to 3V Using a Resistor
Post by: Admin on February 07, 2009, 10:43:56 AM
airman00, you don't have just two resistors in series.

When current enters AREF, that means current is going through yet another resistance to reach ground.

You effectively have one resistor in series with two parallel resistors. As such, if the current in AREF changes, so does the input voltage to AREF.

If you are trying to improve accuracy, the most effective way is with a voltage regulator :P
Title: Re: 5V to 3V Using a Resistor
Post by: rippa911 on February 07, 2009, 10:59:35 AM
Now that I think about it , there is not much difference (for my application, at least) from using a 5V supply and a 3V supply

at 5V I have resolution of 5/1024 = .005V each step
at 3V I have resolution of 3/1024 = .003V each step

@Soeren
I learned it a while ago , and haven't really needed those laws that badly until now. I have a program called Electronics Assistant which calculates the proper resistor values, capacitor values , etc. after you enter in some values of your own. Having a program do all my calculations for me (like just this morning I used it to calculate the proper resistor for a high power LED)
I realized how bad I am in these laws, so I plan to review it over this weekend.

Sorry for offtopic bet where can I find that program?
I tried to google but it gave me many programs using same name :(
Title: Re: 5V to 3V Using a Resistor
Post by: TrickyNekro on February 07, 2009, 11:00:39 AM
I agree with admin.... but.... think of that... which is the simplest regulator???
A resistor and a zener.... There are 3V1 zener diodes.... with a current limiting resistor you can go play safely....
Google "regulator with zener" and you will find lot's of things...

What is the current draw at Aref? I assume it can't be more than 1mA.....
Title: Re: 5V to 3V Using a Resistor
Post by: Webbot on February 07, 2009, 04:41:38 PM
You could achieve it with two resistors:-

+5v---
|
R1
|
|-------- Aref
|
R2
|
+ov---

As pomprocker say you could use: 'We could use (12ohm & 20ohm), (120ohm & 200ohm), (1.2kohm & 2kohm), (12kohm & 20kohm), (120kohm & 200kohm), all the way up to (120Mohm & 200Mohm).'

BUT - you need to know how much current is required by Aref when it has a 3v input. Lets call it Iref. You can then work out the resistive load of the Aref pin on the mcu as Rref = V/I = 3 / Iref.

So now your circuit actually looks like this:
+5v---
|
R1
|
|-------- Aref ----
|                   |
R2                 Rref
|                   |
+ov-----------------------

Since the 3/Iref is now in parallel with R2 then it will effect the value of R2. Connecting 2 resistors in parallel results in 1 resistor with a value of 1/(1/Ra + 1/Rb)
+5v---
|
R1
|
|-------- Aref
|
1 /  ( 1/R2 + 1/Rref)
|
+ov---

So what I'm trying  :-\ to get at is: the Rref value is VERY significant. You will need to choose a value of R2 that is at least one tenth of the value of Rref (so that Rref becomes insignificant). Otherwise Rref will effectively be changing the value of R2 and so the R1-R2 divider will actually end up generating a different voltage from the required 3v.
Title: Re: 5V to 3V Using a Resistor
Post by: Soeren on February 07, 2009, 10:39:35 PM
Hi,

Resistive dividers are only as precise and stable as the voltage feeding them (and a plain old voltage regulator is nowhere near 10 bit in neither precision nor stability)!
A dedicated reference voltage is needed for that.

Since Atmel have never been the best to index their datasheets or put stuff in a logical order, I didn't find anything relevant until now (still didn't find what I was looking for - the input current of the AREF pin), but... Why on earth not just go with the internal reference?

"The ADC has a separate analog supply voltage pin, AVCC. AVCC must not differ more than ±0.3 V from VCC. See the paragraph "ADC Noise Canceler" on page 206 on how to connect this pin.

Internal reference voltages of nominally 2.56V or AVCC are provided On-chip. The voltage reference may be externally decoupled at the AREF pin by a capacitor for better noise performance.