Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

I need some enlightment - AREF = ???


  • Please log in to reply
10 replies to this topic

#1 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 10 September 2010 - 08:50 PM

I'm playing with some breadboarding projects.

(some history of them for fun)

I bought a Experimenters Kit from HiTechnic awhile ago. It lets you connect a LEGO NXT to a breadboard.

So, now I'm redoing those same projects, but using the Netduino instead. Rather fun, since I have my circuits and components all laid out... I just need to learn the Netduino side.

So... one of the projects has a potentiometer that you use to control a bank of LEDs. Depending the value, one of 6 LED's turn on.

At first, the pot reading was all over the place. When turned all the way down, it read from 0 to 1023. In the loop, it kept bouncing. When you turn it up the slightest bit, it reads 1023 all the time.

So I came to the forum to figure out what I was doing wrong. First thing I did, was a search on "analog"... and I found a post talking about the AREF needing to be connected to 3.3v

Ahhh... thanks so much. Wiring the 3.3V header to the AREF header works. I still have so much to learn about hardware. Thanks for the lesson!


I did that, and now it works fine.

My question is... what is AREF, and why does it need to be connected to 3.3v. And in what cases do I need to connect that?
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#2 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 10 September 2010 - 09:01 PM

I'm playing with some breadboarding projects.

(some history of them for fun)

I bought a Experimenters Kit from HiTechnic awhile ago. It lets you connect a LEGO NXT to a breadboard.

So, now I'm redoing those same projects, but using the Netduino instead. Rather fun, since I have my circuits and components all laid out... I just need to learn the Netduino side.

So... one of the projects has a potentiometer that you use to control a bank of LEDs. Depending the value, one of 6 LED's turn on.

At first, the pot reading was all over the place. When turned all the way down, it read from 0 to 1023. In the loop, it kept bouncing. When you turn it up the slightest bit, it reads 1023 all the time.

So I came to the forum to figure out what I was doing wrong. First thing I did, was a search on "analog"... and I found a post talking about the AREF needing to be connected to 3.3v



I did that, and now it works fine.

My question is... what is AREF, and why does it need to be connected to 3.3v. And in what cases do I need to connect that?


AREF is "Analog REFerence" and since the Atmel doesn't have an analog reference built in you need to use it to give it an 'understanding' (as I understand AREF) so it can have a baseline to read analog inputs.

It's only needed when you are using a 3.3V device that has an analog input (for example, my Maxbotix sonar).

#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 10 September 2010 - 09:18 PM

to give it an 'understanding' (as I understand AREF) so it can have a baseline to read analog inputs.

Netduino microprocessor uses Successive approximation ADC, which requires the reference voltage to normalize the input. The conversions extend from 0V to AREF.

#4 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 12 September 2010 - 02:42 AM

Thanks everyone! That gets me going in the right direction. I'm a software guy... so I'm learning all the hardware as I go. :)
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#5 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 17 September 2010 - 07:41 AM

AREF is "Analog REFerence" and since the Atmel doesn't have an analog reference built in you need to use it to give it an 'understanding' (as I understand AREF) so it can have a baseline to read analog inputs.

It's only needed when you are using a 3.3V device that has an analog input (for example, my Maxbotix sonar).


Just wondering, if this is so often needed why isen't it directly bridged to 3.3v from the start or atleast by a onboard switch maybe even a 3 state switch(off, 3.3v, 5v).

I was playing around with my temp sensor from electronic bricks starter kit and coulden't understand why i got max value all the time. Found some post about the AREF and since there is no headers on top of the electronic bricks shield i had to tap 5v from the sensor to aref by a jumper-wire.

By the way great jobb with this netduino, i liked the arduino but hated the modded c language and that i coulden't program or deploy from Visual Studio so now my dreams have come true B)

#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 September 2010 - 05:13 PM

Just wondering, if this is so often needed why isen't it directly bridged to 3.3v from the start or atleast by a onboard switch maybe even a 3 state switch(off, 3.3v, 5v).


Hi Azazel,

Honestly, the biggest reason why this wasn't included is because the 32-bit ARM chip used on the Netduino does not have an internal AREF. The 8-bit AVR chip has an internal AREF--which is a cool feature.

Since this has been a highly-requested feature, we have added an internal AREF to the feature list for a future Netduino board revision. To enable that capability, we'll add extra hardware to the Netduino...and we'll add a function/property to the AnalogInput software feature which will let the user specify internal vs. external AREF. Users will be able to continue enjoying the flexibility and higher-accuracy of using an external AREF, but this will be a cool option and will make it even easier to get started.

Chris

#7 Azazel

Azazel

    Member

  • Members
  • PipPip
  • 28 posts
  • LocationSweden

Posted 17 September 2010 - 05:43 PM

Hi Azazel,

Honestly, the biggest reason why this wasn't included is because the 32-bit ARM chip used on the Netduino does not have an internal AREF. The 8-bit AVR chip has an internal AREF--which is a cool feature.

Since this has been a highly-requested feature, we have added an internal AREF to the feature list for a future Netduino board revision. To enable that capability, we'll add extra hardware to the Netduino...and we'll add a function/property to the AnalogInput software feature which will let the user specify internal vs. external AREF. Users will be able to continue enjoying the flexibility and higher-accuracy of using an external AREF, but this will be a cool option and will make it even easier to get started.

Chris


Sound real nice, i will look forward to the chance to get the new version to play with.

#8 outlet

outlet

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 March 2011 - 09:06 PM

I am new to electronics also. From what I have read, the analog input can only accept up to 3.3v (5v would be bad?). So if I connect a temp sensor to analog, should I use the 3.3v connection on the same side as the analog input, or use the AREF on the digital io side? Thanks!

#9 demonGeek

demonGeek

    Advanced Member

  • Members
  • PipPipPip
  • 42 posts
  • LocationCanada

Posted 30 March 2011 - 10:22 PM

I am new to electronics also.

From what I have read, the analog input can only accept up to 3.3v (5v would be bad?). So if I connect a temp sensor to analog, should I use the 3.3v connection on the same side as the analog input, or use the AREF on the digital io side?


Thanks!

I think it's 5V tolerant but you won't get any useful readings from it at 5V.

You shouldn't need to worry about AREF. The AREF pin is usually connected to the same power supply that you are using to power the device so that the onboard A/D converter has the same frame of reference as the device that's generating the analog signals. If you have a Rev B board and you're powering the device from a Netduino 3.3V pin you shouldn't need to connect the AREF at all because the Netduino has an internal AREF that is on by default. If you have an earlier board then you should also connect the 3.3V line to the AREF.

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 30 March 2011 - 10:50 PM

Quick note: the digital pins are 5V tolerant--but you shouldn't feed more than 3.3V to the analog pins when using them as AnalogInputs.

#11 outlet

outlet

    New Member

  • Members
  • Pip
  • 5 posts

Posted 30 March 2011 - 11:38 PM

I think it's 5V tolerant but you won't get any useful readings from it at 5V.

You shouldn't need to worry about AREF. The AREF pin is usually connected to the same power supply that you are using to power the device so that the onboard A/D converter has the same frame of reference as the device that's generating the analog signals. If you have a Rev B board and you're powering the device from a Netduino 3.3V pin you shouldn't need to connect the AREF at all because the Netduino has an internal AREF that is on by default. If you have an earlier board then you should also connect the 3.3V line to the AREF.


Thanks for the explanation!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.