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

Analog Input Limits


  • Please log in to reply
2 replies to this topic

#1 woof_woof_bark_bark

woof_woof_bark_bark

    New Member

  • Members
  • Pip
  • 8 posts

Posted 02 September 2014 - 08:07 PM

Hello all,
   I've been playing with the analog input on my netduino, and I had been playing with it for quite a bit thinking that I had been using it wrong. Turns out... I was! When using a potentiometer to regulate the voltage into my analog input, I noticed that as I approached the upper end (higher voltages of my potentiometer) the value being printed from the .Read() of my analog input started to decline. I just learned today that that was due to using the 5 V pin on the board as my source and the highest value accurately registered through the .Read() was when the voltage was 3.3 V. I was curious if there was a way to allow for accurate measures of voltages higher than 3.3 volts via AnalogInputs (nothing necessarily too crazy... but how about the 5 volt pin?) I would appreciate any input on the subject.
 
Thanks for taking the time to read this.
Good luck and good thought,
woof_woof_bark_bark

 

 

 

PS. this is how I set up my code while using the 3.3 V pin as the source to my potentiometer providing me with an output that is between 0-1 (the voltage as a percent of 3.3 V). When I would use 5 V as the source and change AnalogReference_float to 5 as well; my output would be 0-1 (when at or below 3.3 V) and 1 - 0.6 (when voltage to the analog input pin was 3.3 V - 5 V) The biggest desire is to at least figure out  - if possible - how to change the percentage ie: I would love to make the output a voltage as a percent of X as opposed to being locked into 3.3V.
 
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
namespace AnalogTest 
{  
    public class Program 
    {        
        private const float AnalogReference_float = 3.30f;
        static AnalogInput pot = new AnalogInput(AnalogChannels.ANALOG_PIN_A0);
 
        public static void Main()
        {      
            while (true)
            {
 
                Debug.Print("Raw Value: " + pot.Read()*AnalogReference_float);
                Debug.Print("");    
            }     
        }  
    }
}



#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 03 September 2014 - 06:16 AM

The easiest way to measure 5 V on 3.3 V analog input is to use a voltage divider. For precise measurements I think you'd need to use an external specialized IC (ADC) that communicates via a digital interface such as I2C or SPI.

 

Notes:

  • Netduino cannot measure voltage higher than analog reference (Aref), which is limited to operating voltage, which is 3.3 V.
  • Netduino 2 analog inputs are not 5 V tolerant, the absolute maximum allowed input voltage is 4 V.


#3 woof_woof_bark_bark

woof_woof_bark_bark

    New Member

  • Members
  • Pip
  • 8 posts

Posted 03 September 2014 - 11:21 AM

I had a feeling that it wouldn't be possible. Thanks so much for the help!

Good luck and good thoughts,

woof_woof_bark_bark






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.