Go Down

Topic: Aref voltage (Read 614 times) previous topic - next topic

Tumbleweed

Third post,
I am having so much fun with this breadboard.
When I use my analog accelerometer I want to set the Aref voltage to 3.3 volts to get the full range from it.
Do I need to drop the Aref voltage at pin 21 of the Atmega328 with a zener or voltage regulator to 3.3v before I set it at that in the sketch?
Thanks in advance.
TomJ
Einstein once said you don't really understand anything until you can explain it to your Grandmother

CrossRoads

I believe so - otherwise your choices are 1.1V or 5V.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Tumbleweed

CrossRoads,
My take on it too. I found a reference on another search I did for something else that said you could damage your board if you didn't but now I can't find it. One tutorial for the 335 analog acceleometer sets it at the internal 1.1 to really narrow the bandwidth for maximum sesitivity, I am going to try that too.
Thanks for your help.
TomJ
Einstein once said you don't really understand anything until you can explain it to your Grandmother

retrolefty

#3
Mar 05, 2012, 02:41 am Last Edit: Mar 05, 2012, 02:44 am by retrolefty Reason: 1
There is a warning section lower down on the reference section covering using the external Aref pin. Check it out and you should be fine:

http://arduino.cc/en/Reference/AnalogReference

You know a suitable voltage source to use could be a simple 10 turn trim pot wired to the boards regulated Vcc +5vdc, just wire the wiper to Aref pin, and adjusted to give you the exact top of range scale you want. A simple life is a happy life.


Lefty

superKittens

#4
Mar 05, 2012, 06:25 am Last Edit: Mar 05, 2012, 06:26 am by superKittens Reason: 1

You know a suitable voltage source to use could be a simple 10 turn trim pot wired to the boards regulated Vcc +5vdc, just wire the wiper to Aref pin, and adjusted to give you the exact top of range scale you want. A simple life is a happy life.


Well...yes you can do that but there's a catch.  You can't control how much current your IC is going to draw so your voltage divider may not exactly work at the voltage you want (I've tried this on another project and instead of getting 5V as calculated, I got about 2.5-3 V).  
The best thing to do is to use a regulator or a zener diode rated at 3.3V.  I guess since the divider is a pot, then you could simply adjust to get the voltage you want.

Is this the Analog Devices ADXL335 accelerometer?  I found that just jumpering the 3.3V pin on the Uno to ARef did the job.

CrossRoads

"jumpering the 3.3V pin on the Uno to ARef"
That's certainly a simple way to get there!
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

superKittens

"That's certainly a simple way to get there!"

haha yup!

TomJ, if you (or anyone else) are interested, I've got a very very simple sketch to read in the accelerometer's values and convert them into "G's."  There's an awesome tutorial on Instructables that's on the comments section at the top of my code.  I wrote it for the ADXL335, but any analog accelerometer will do really.

https://github.com/superkittens/Arduino-Sketches/tree/master/accel_test

Tumbleweed

Thanks everyone,
Good catch on the warning lefty, I had the 5v power to the Aref pin and was going to try the 1.1 internal setting. Already smoked my Uno board, (don't ask) that's why I'm breadboarding, didn't need to ruin the Atmega338 too.
superKittens,
nice code for me to try this with, thanks.
Crossrads, I looked al over and couldn't find the 3.3 v pin on my breadboard. Just kidding, actually I do have a LM33L powering the accelerometer.

TomJ
Einstein once said you don't really understand anything until you can explain it to your Grandmother

Go Up