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.
Hey all,
I have more of a general question, based on something I read on Arduino's a long while back, and wanted to see if there was an issue with my thought process.
First, the background - I'm going to be using my N+ this weekend as a simple data-logger, recording resistance every second on an Analog pin. Since values between readings can potentially be rather small, I'd like to have a strong reference voltage. (i.e. if I read '1000' on the A1 pin, am I at 98% 5v, or is my 5v running at 4.8v and I'm getting continuity between the object I'm measuring?)
So if I connect my +5v straight to A1, and get a reading off of it, and then use that base as my offset?
For example -
I read A1, and it reads '1000'. I then read A2, and it also reads '1000', so 1000/1000 = 1, or 100% of my voltage is getting through. (Continuity). Or if A1 reads '1023', and A0 reads '1000', then I'm at 1000/1023 = .977 = 97.7%.
Or since the N+ is using the 5v itself, will A1 *always* report 1023 (max), and I don't need to worry about this?
I'm familiar with .NET programming - electronics, only basic.
--Mike.
Hi Coyttl,
What voltage are you looking to measure?
The Analog Digital Converter in the Netduino Plus is a 10 bit ADC. The internal reference is 3.3vdc and the design input to the analog pins is 3.3 vdc also (I don't recommend a applying more than 3.3 vdc). With 10 bit resolution you will get a reading from 0 to 1023 (3.3/1024= 0.0032 per unit).
Most like to take say 20 readings about 20 to 50 milliseconds apart them average then. Repeat this at what ever interval that you want. This reduces errors due to electrical noise etc.
If you want some code that may help you get started there are several examples for TMP36 temperature sensors written in C# and Visual Basic (just replace the TMP36 input with your voltage input.
If you need more help feel free to ask additional questions, the more information you can provide on what you want to do the easier it is for someone to provide the answers that you are looking for.
Hope this helps.
Chuck
Analog inputs already have voltage reference, the AREF pin. You can connect it to your strong reference, or use the internal 3.3V (on rev. B boards). The maximum voltage for analog inputs and AREF is 3.3V. Netduino microcontroller is powered by 3.3V, regulated from the 5V rail.
Hey guys -
Sorry about that. I fixed my post (changing all the 5v to 3.3v!)
So what @CW2's saying is that they're already tied to that - so if (for some reason) my 3.3 is actually 3.1, an application of 3.1v to A0 will give me a reading of 1023?
Unfortunately, there's not much more that I can add to what I'm doing - because there really ISN'T any more info! I'm checking resistance across two rails - a very simple application of connecting up the N+'s v3.3 to one rail, and reading the value off of the other rail. (This is temporary - like a few hours at most, so for my testing I don't plan on any isolation..) I just want to make sure that when/if the rails have full continuity, I'm able to detect that.
And I like the idea of taking multiple readings each time. I will definitely work that in. With the railroad, I have a strong feeling that some averaging will be needed.
Thanks!
-Mike.
so if (for some reason) my 3.3 is actually 3.1, an application of 3.1v to A0 will give me a reading of 1023?
Yes, the value of the analog input is scaled so the conversion extends from 0 = 0V to 1023 = ADVREF (resp. to be more precise the value of zero corresponds to any analog input in range <0, Aref/1024), the value of 1 represents any analog input in range <Aref/1024, 2*Aref/1024) etc., because of the ADC quantization levels). If you need very precise measurements, i.e. better than ~1% output tolerance of the Netduino 3.3V regulator (MC33269), you'd probably need to use a precision voltage reference or add a high impedance input circuitry.
Yes, the value of the analog input is scaled so the conversion extends from 0 = 0V to 1023 = ADVREF (resp. to be more precise the value of zero corresponds to any analog input in range <0, Aref/1024), the value of 1 represents any analog input in range <Aref/1024, 2*Aref/1024) etc., because of the ADC quantization levels). If you need very precise measurements, i.e. better than ~1% output tolerance of the Netduino 3.3V regulator (MC33269), you'd probably need to use a precision voltage reference or add a high impedance input circuitry.
Perfect, that's what I was interested in knowing.
Thanks!
Going to be running tests tomorrow. Hope they turn out somewhat enlightening!