go_away

Author Topic: 5V to 3V Using a Resistor  (Read 29767 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
5V to 3V Using a Resistor
« 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?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline frodo

  • Supreme Robot
  • *****
  • Posts: 329
  • Helpful? 2
  • BOW DOWN TO MY MIGHTY STARE!!
Re: 5V to 3V Using a Resistor
« Reply #1 on: January 30, 2009, 02:52:04 PM »
whats the AREF pin do?
OMG!!!! I AM SUPREME ROBOT!!!

Check out my Web

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: 5V to 3V Using a Resistor
« Reply #2 on: January 30, 2009, 03:15:43 PM »
you want 2v dropping at 10mA. 2 / .01
You need 200 Ohms
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline frodo

  • Supreme Robot
  • *****
  • Posts: 329
  • Helpful? 2
  • BOW DOWN TO MY MIGHTY STARE!!
Re: 5V to 3V Using a Resistor
« Reply #3 on: January 30, 2009, 03:30:22 PM »
so, what does the AREF pin do  ???
OMG!!!! I AM SUPREME ROBOT!!!

Check out my Web

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: 5V to 3V Using a Resistor
« Reply #4 on: January 30, 2009, 03:34:08 PM »
so, what does the AREF pin do  ???
sets the reference voltage of the analog input.
Frodo please dont hijack this thread , and don't reply unless the reply will answer my original question. Make a new topic if you need to.

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?
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: 5V to 3V Using a Resistor
« Reply #5 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
« Last Edit: January 30, 2009, 03:37:07 PM by HDL_CinC_Dragon »
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: 5V to 3V Using a Resistor
« Reply #6 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.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline HDL_CinC_Dragon

  • Supreme Robot
  • *****
  • Posts: 1,261
  • Helpful? 5
Re: 5V to 3V Using a Resistor
« Reply #7 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
United States Marine Corps
Infantry
Returns to society: 2014JAN11

Offline frodo

  • Supreme Robot
  • *****
  • Posts: 329
  • Helpful? 2
  • BOW DOWN TO MY MIGHTY STARE!!
Re: 5V to 3V Using a Resistor
« Reply #8 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.
OMG!!!! I AM SUPREME ROBOT!!!

Check out my Web

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: 5V to 3V Using a Resistor
« Reply #9 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).
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Re: 5V to 3V Using a Resistor
« Reply #10 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

assuming 10 bit ADC
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.
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline pomprocker

  • Supreme Robot
  • *****
  • Posts: 1,430
  • Helpful? 16
  • Sorry miss, I was giving myself an oil-job.
Re: 5V to 3V Using a Resistor
« Reply #11 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

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: 5V to 3V Using a Resistor
« Reply #12 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

Offline rippa911

  • Jr. Member
  • **
  • Posts: 15
  • Helpful? 0
Re: 5V to 3V Using a Resistor
« Reply #13 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

assuming 10 bit ADC
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 :(

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,207
  • Helpful? 15
  • 1.6L Peugeot 307 tuner
Re: 5V to 3V Using a Resistor
« Reply #14 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.....
For whom the interrupts toll...


P.S. I've been inactive for almost a year... Don't give promises but I'll try to complete my tutorials. I'll let you know when..

Cheers!

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: 5V to 3V Using a Resistor
« Reply #15 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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: 5V to 3V Using a Resistor
« Reply #16 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.

The ADC converts an analog input voltage to a 10-bit digital value through successive approximation.
The minimum value represents GND and the maximum value represents the voltage on the AREF pin minus 1 LSB.

Optionally, AVCC or an internal 2.56V reference voltage may be connected to the AREF pin by writing to the REFSn bits in the ADMUX Register.
The internal voltage reference may thus be decoupled by an external capacitor at the AREF pin to improve noise immunity.
"
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,132
  • Helpful? 108
Re: 5V to 3V Using a Resistor
« Reply #17 on: February 08, 2009, 02:15:25 PM »
Why on earth not just go with the internal reference?

Nice! Sometimes we all get involved in an answer to the question. But sometimes the question is the wrong question!
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

 


Get Your Ad Here

data_list